git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Jeff King <peff@peff.net>
Cc: Michael J Gruber <git@drmicha.warpmail.net>,
	Pete Wyckoff <pw@padd.com>,
	git@vger.kernel.org
Subject: Re: tracking branch for a rebase
Date: Fri, 4 Sep 2009 20:59:49 +0200	[thread overview]
Message-ID: <20090904185949.GA21583@atjola.homenet> (raw)
In-Reply-To: <20090904181846.GC19093@coredump.intra.peff.net>

On 2009.09.04 14:18:46 -0400, Jeff King wrote:
> On Fri, Sep 04, 2009 at 04:31:57PM +0200, Michael J Gruber wrote:
> 
> > Making [rebase against upstream] the default for rebase without
> > arguments may meet some objections (oh no, I didn't mean to rebase),
> > but I guess it's worth trying.
> 
> FWIW, that has been a patch I have been meaning to do for a while. I
> don't see it as any more error-prone than "git pull" without arguments.
> In either case, you can always recover with a reset from the reflog.

Note that with:
	branch.foo.remote = origin
	branch.foo.merge = refs/heads/foo

"git pull --rebase" is not the same as:
"git fetch origin && git rebase origin/foo", but:

git fetch origin && git rebase --onto origin/foo $reflog_merge_base

Where $reflog_merge_base is the first merge base is found between the
current branch head, and the reflog entries for origin/foo.


Same deal for "git pull --rebase origin bla", which is not:
"git fetch origin bla && git rebase FETCH_HEAD", but:

git fetch origin && git rebase --onto FETCH_HEAD $reflog_merge_base

Where again $reflog_merge_base is found by looking at the reflog for
origin/foo.

It does that to try to automatically handle cases where upstream has
been rebased. I'm not completely sure whether I like or hate that.
Especially the "git pull --rebase <remote> <refspec>" case seems very
weird to me. And if "rebase" is to pickup the same default as "pull", I
guess it should also show the same behaviour, but just skips the "fetch"
part?

> The biggest question is whether it should respect branch.*.merge, or
> just branch.*.rebase (I never use the latter simply because I never use
> "git pull", but I think it is probably reasonable to restrict it to
> cases where you said you are interested in rebasing in general).

Hm, you'll probably want "git merge" to pickup the default as well then,
right? And that should only do so if branch.*.rebase is not set. So
effectively, you still have to use the right command, but can skip the
argument. Having to deal a lot with git-svn, I also regulary use its
"git svn rebase --local", which means "just rebase, don't fetch".

Now, basically "git svn rebase" is pretty much git-svn's "pull". Maybe
its idea could be taken, so we get "git pull --local" to just skip the
fetch part, but keep "git rebase" and "git merge" 'dumb', requiring
explicit arguments.

(In the past, I once argued for deprecating "pull", and having
merge/rebase doing the fetch as well, with a --local argument that stops
them from doing so. That was probably mostly due to the fact that I ran
into too many people that simply didn't understood that "git pull" is
not "svn up". I still kind of like the idea, but seeing just how often I
use rebase/merge with already fetched stuff, I can see how having to use
a --local flag with them all the time would be quite a PITA, but now,
having the --local flag for "pull" seems to make sense to me.)

Björn

  reply	other threads:[~2009-09-04 19:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 13:54 tracking branch for a rebase Pete Wyckoff
2009-09-04 14:31 ` Michael J Gruber
2009-09-04 18:18   ` Jeff King
2009-09-04 18:59     ` Björn Steinbrink [this message]
2009-09-05  6:12       ` Jeff King
2009-09-05 14:01         ` Björn Steinbrink
2009-09-05 14:28           ` Jeff King
2009-09-07  5:05             ` Junio C Hamano
2009-09-07  8:14               ` Michael J Gruber
2009-09-07  8:25                 ` Junio C Hamano
2009-09-07  8:44                   ` Jeff King
2009-09-07  9:06                     ` Michael J Gruber
2009-09-07  8:43               ` Jeff King
2009-09-07  9:29                 ` Johannes Schindelin
2009-09-07  9:53                   ` Michael J Gruber
2009-09-08 23:17                     ` Julian Phillips
2009-09-09 10:45                   ` Jeff King
2009-09-10  6:42                     ` Junio C Hamano
2009-09-10  7:47                       ` Johannes Schindelin
2009-09-10  9:36                         ` [PATCH] Introduce <branch>@{tracked} as shortcut to the tracked branch Johannes Schindelin
2009-09-10  9:44                           ` Michael J Gruber
2009-09-10 10:14                             ` Johannes Schindelin
2009-09-10 10:18                             ` Johan Herland
2009-09-10 10:59                               ` Michael J Gruber
2009-09-10 12:29                                 ` Johan Herland
2009-09-10 13:35                                   ` Johannes Schindelin
2009-09-10 14:17                                     ` Michael J Gruber
2009-09-10 11:11                               ` Jeff King
2009-09-10 18:29                                 ` Junio C Hamano
2009-10-02 14:54                                   ` Björn Steinbrink
2009-09-10 14:16                           ` Jeff King
2009-09-10 14:26                             ` Jeff King
2009-09-10 15:24                               ` Johannes Schindelin
2009-09-10 15:25                                 ` [PATCH v2] Introduce <branch>@{upstream} " Johannes Schindelin
2009-09-10 15:55                                   ` Jeff King
2009-09-10 16:18                                     ` Johannes Schindelin
2009-09-10 15:22                             ` [PATCH] Introduce <branch>@{tracked} " Johannes Schindelin
2009-09-11  4:54                         ` tracking branch for a rebase Junio C Hamano
2009-09-05 17:59           ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090904185949.GA21583@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=pw@padd.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).