ghi edit #52

nijikokun opened this Issue May 2, 2012 · 6 comments


None yet
2 participants

Isn't it supposed to auto-detect the head branch? I have to specifically declare: -h user:branch for it to change to a pull request


stephencelis commented May 2, 2012

It detects HEAD if it's pushed and tracking.

$ git co -b topic-branch
$ ghi -v e 1 -H
fatal: HEAD can't be null
$ git push -u origin topic-branch
 * [new branch]      topic-branch -> topic-branch
Branch topic-branch set up to track remote branch topic-branch from origin.
$ ghi -v e 1 -H
===> POST /repos/user/repo/pulls {"head":"topic-branch","issue":"1","base":"master"}
$ ghi -v e 1 -Huser:
===> POST /repos/user/repo/pulls {"head":"user:topic-branch","issue":"1","base":"master"}

stephencelis commented May 2, 2012

Thoughts on improving the situation:

  1. Making the fatal error message more helpful? Something like "fatal: HEAD can't be null (Is your current branch being tracked upstream?)", perhaps.
  2. Defaulting head user to the authorized user.

What do you think?

I think the first one would be better, having a more verbose error message; why not make -H -h ?


stephencelis commented May 2, 2012

Because -h is typically help (in ghi and git). hub's command is an outlier.

a way around that would be to have a help command, but I digress;


stephencelis commented May 4, 2012

Did you try it? It works just fine with -h if you provide an issue number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment