From: Jonathan Nieder <jrnieder@gmail.com>
To: Sverre Rabbelier <srabbelier@gmail.com>
Cc: "Git List" <git@vger.kernel.org>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Santi Béjar" <santi@agolina.net>
Subject: Re: BUG: git pull --rebase on detatched head prints a lot of usage warnings
Date: Fri, 3 Dec 2010 13:00:50 -0600 [thread overview]
Message-ID: <20101203190050.GB14049@burratino> (raw)
In-Reply-To: <AANLkTimyCG6zVhc4znWPWwipd0bn-YT2FrOT=T0AgHNW@mail.gmail.com>
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
next prev parent reply other threads:[~2010-12-03 19:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 18:38 BUG: git pull --rebase on detatched head prints a lot of usage warnings Sverre Rabbelier
2010-12-03 19:00 ` Jonathan Nieder [this message]
2010-12-03 19:05 ` Sverre Rabbelier
2010-12-03 20:23 ` Santi Béjar
2010-12-03 20:45 ` Sverre Rabbelier
2010-12-03 21:06 ` Junio C Hamano
2010-12-03 22:16 ` Santi Béjar
2010-12-03 22:31 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101203190050.GB14049@burratino \
--to=jrnieder@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=santi@agolina.net \
--cc=srabbelier@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).