Re: BUG: git pull --rebase on detatched head prints a lot of usage warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 3, 2010 at 8:05 PM, Sverre Rabbelier <srabbelier@xxxxxxxxx> wrote:
> Heya,
>
> On Fri, Dec 3, 2010 at 20:00, Jonathan Nieder <jrnieder@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]