git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: "Santi Béjar" <santi@agolina.net>
Cc: git@vger.kernel.org, trast@student.ethz.ch, newren@gmail.com
Subject: Re: [RFC] rebase: be cleverer with rebased upstream branches
Date: Sat, 13 Nov 2010 21:46:03 -0500	[thread overview]
Message-ID: <AANLkTikvpXpFH81q6f-xp5zKCNGFpYoVO7D9-Cy2M_J7@mail.gmail.com> (raw)
In-Reply-To: <AANLkTincij4wR4=RhbA0oCwe66OhVry0AkS6GCALVWmz@mail.gmail.com>

On Sat, Nov 13, 2010 at 6:30 PM, Santi Béjar <santi@agolina.net> wrote:
> On Fri, Nov 12, 2010 at 9:11 PM, Martin von Zweigbergk
> <martin.von.zweigbergk@gmail.com> wrote:
>> Since c85c792 (pull --rebase: be cleverer with rebased upstream
>> branches, 2008-01-26), 'git pull --rebase' has used the reflog to try to
>> rebase from the old upstream onto the new upstream.
>>
>> However, if, instead of 'git pull --rebase', the user were to do 'git
>> fetch' followed by 'git rebase @{upstream}', the reflog would not be
>> walked. This patch teaches "git rebase" the same reflog-walking tricks
>> that 'git pull --rebase' already knows.
>>
>> Apart from making 'git rebase' better aligned with 'git pull --rebase',
>> this may also be useful on its own for rebasing one branch against
>> another local branch that has been rebased. Currently, you would have to
>> do that using 'git rebase --onto' or by configuring it on the branch.
>>
>> It might seem like most of the related code in git-pull.sh can be
>> removed once git-rebase.sh supports reflog walking. Unfortunately, not
>> much of it can be removed, though. The reason is that git-pull.sh does
>> one step of 'reflog' walking even when the reflog is not used. There are
>> at least two cases where the reflog is not used: a) when it is disabled,
>> b) when the remote branch was specified on the command line (let's say
>> 'git pull --rebase origin master'). In both of these cases, git-pull.sh
>> remembers the position of the reference before the fetch and uses that
>> in place of '$ref@{1}'.
>
> In the code I don't see when b) is different to call it without
> command line branches. And if it is different I suppose it is a bug.

The difference is somewhere in the code for 'git fetch'. I'm trying to
refer to the same thing as I did in
http://thread.gmane.org/gmane.comp.version-control.git/160004/focus=160939.

> The code must stay in git-pull.sh because there it has more
> information (commit before and after fetch) than in git-rebase,
> essentially when reflogs are disabled.

Yes, I think that's what I meant by reason 'a)', but maybe I could have
explained it in a better way.

      reply	other threads:[~2010-11-14  2:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-12 20:11 [RFC] rebase: be cleverer with rebased upstream branches Martin von Zweigbergk
2010-11-13 23:30 ` Santi Béjar
2010-11-14  2:46   ` Martin von Zweigbergk [this message]

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=AANLkTikvpXpFH81q6f-xp5zKCNGFpYoVO7D9-Cy2M_J7@mail.gmail.com \
    --to=martin.von.zweigbergk@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    --cc=santi@agolina.net \
    --cc=trast@student.ethz.ch \
    /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).