git-extras
git-extras copied to clipboard
Make `pull-request` command work like GitHub interface
The one thing I really like about the GitHub UI here is that when there's only one commit, it'll automatically pull out the title and contents from it. When there's more than one, it defaults to the title-cased string of the branch name.
I think this is a good idea, but only if it occurs when a title is not supplied.
Only issue is that it isn't possible to check if a title is already supplied due to the order in which the info for the PR is supplied because we would never know if the title (1st parameter) was not supplied or if the base (fourth parameter) was not supplied.
The only solution I can think of is making the title the last ($4
) parameter; however, that would change the API and would be unnatural, IMO.
I'll leave this open if anyone else has a solution.
The way the hub
command addresses this is with command flags instead of arguments, e.g. -b
denotes the base branch for the PR, -h
denotes the head. Combined with opening the PR title and message in my editor and understanding a convenient (if arcane) shorthand for remote:branch
, I typically use hub pull-request
(aliased as gpr
) to open PRs from the CLI instead. Adding similar functionality to extras
would be desirable.