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]

 



Sverre Rabbelier wrote:

> $ git pull --rebase
> usage: git merge-base [-a|--all] [--octopus] <commit> <commit>...
[...]
> [... many more snipped ...]
>
> You are not currently on a branch, so I cannot use any
> 'branch.<branchname>.merge' in your configuration file.
> Please specify which remote branch you want to use on the command
> line and try again (e.g. 'git pull <repository> <refspec>').
> See git-pull(1) for details.
>
>
> There are 127 helpful messages in total.

Does the following take care of it?

cc-ing Santi, author of the very nice v1.6.4.1~6^2 (pull: support
rebased upstream + fetch + pull --rebase, 2009-07-19).  Maybe we
should make merge-base more tolerant.

diff --git a/git-pull.sh b/git-pull.sh
index 8eb74d4..bbc369d 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -212,7 +212,7 @@ test true = "$rebase" && {
 	oldremoteref="$(git rev-parse -q --verify "$remoteref")" &&
 	for reflog in $(git rev-list -g $remoteref 2>/dev/null)
 	do
-		if test "$reflog" = "$(git merge-base $reflog $curr_branch)"
+		if test "$reflog" = "$(git show-branch --merge-base $reflog $curr_branch)"
 		then
 			oldremoteref="$reflog"
 			break
--
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]