You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue captures the improvements required to make gh pr subcommands more amenable to scripting. Most of these bullet points are trivial; some are more involved. Came out of research for #940
create:
Clear error if not connected to a tty but either --title xor --fill is missing
All output except final URL should go to STDERR when when not connected to tty
list:
output should be machine friendly when not connected to tty Output should include
the data that is lost when color is removed.
don't print header when not connected to tty
merge:
if not tty, merge should run non-interactively.
all output should go to STDERR
review:
when not connected to tty and there are enough flags, run non-interactively; clear error
otherwise
all output except final review/comment URL should go to STDERR
view:
Output raw text and print metadata linewise when not connected to tty
Assume --fill was passed if STDIN fails isTerminal check
Assume --fill was passed if STDOUT fails isTerminal check
I'm wondering whether a safer default behavior would be to, if in non-interactive mode (and thus unable to prompt for information), to fail with an error that explains that either explicit --title or --fill flag is required? That would force scripts that use pr create to read more clearly re: what their intention is.
In general, the way I see mutation commands such as pr create or repo create is that the API operation that they will result in should be either put behind a prompt confirmation (in interactive mode) or behind an explicit flag (non-interactive mode), but should never be allowed to happen without both.
I'm wondering whether a safer default behavior would be to, if in non-interactive mode (and thus unable to prompt for information), to fail with an error that explains that either explicit --title or --fill flag is required? That would force scripts that use pr create to read more clearly re: what their intention is.
I'm fine with this and mirrors what I did for issue create.
Activity
[-]pr improvements[/-][+]pr scriptability improvements[/+]mislav commentedon Jul 1, 2020
I'm wondering whether a safer default behavior would be to, if in non-interactive mode (and thus unable to prompt for information), to fail with an error that explains that either explicit
--titleor--fillflag is required? That would force scripts that usepr createto read more clearly re: what their intention is.In general, the way I see mutation commands such as
pr createorrepo createis that the API operation that they will result in should be either put behind a prompt confirmation (in interactive mode) or behind an explicit flag (non-interactive mode), but should never be allowed to happen without both.vilmibm commentedon Jul 9, 2020
I'm fine with this and mirrors what I did for
issue create.