From: Santi Béjar Date: Fri, 03 Dec 2010 20:23:54 GMT Subject: Re: BUG: git pull --rebase on detatched head prints a lot of usage warnings Message-ID: In-Reply-To: On Fri, Dec 3, 2010 at 8:05 PM, Sverre Rabbelier wrote: > Heya, > > On Fri, Dec 3, 2010 at 20:00, Jonathan Nieder 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