Re: BUG: git pull --rebase on detatched head prints a lot of usage warnings
- From
- Santi Béjar <santi@agolina.net>
- Date
- Dec 3, 2010, 20:23 UTC
- Message-ID
- <AANLkTikwdqQpmyxZu-kp7UHjYnKuVxs8urxM=9c=66H0@mail.gmail.com>
- In-Reply-To
- <AANLkTin-9pb7cxsAvDqWj3So47_zq5co9TZRWux9ezxz@mail.gmail.com>
On Fri, Dec 3, 2010 at 8:05 PM, Sverre Rabbelier <srabbelier@gmail.com> wrote:
Show 6 quoted lines
> Heya, > > On Fri, Dec 3, 2010 at 20:00, Jonathan Nieder <jrnieder@gmail.com> wrote: >> Does the following take care of it? > > Yes.
I also think it fixes, but I wonder if it's the best fix. One thing is that show-branch is an ancillary command, and not a plumbing command (but there is already a call to show-branch, but it should probably be change to merge-base now that it handles three commit as arguments).
The problem is that many parts of git-pull.sh/git-parse-remote.sh assume that you are not in a detached HEAD. Can you confirm that the following patch fixes it?
diff --git i/git-parse-remote.sh w/git-parse-remote.sh index 5f47b18..6d0a5de 100644 --- i/git-parse-remote.sh +++ w/git-parse-remote.sh @@ -68,7 +68,7 @@ get_remote_merge_branch () { test -z "$origin" && origin=$default curr_branch=$(git symbolic-ref -q HEAD) [ "$origin" = "$default" ] && - echo $(git for-each-ref --format='%(upstream)' $curr_branch) + echo $(git for-each-ref --format='%(upstream)' HEAD) ;; *) repo=$1 I'm wondering if most of $curr_branch should be changed to HEAD, I'll check it. HTH, Santi