From: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
To: "Santi Béjar" <santi@agolina.net>
Cc: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>,
git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] rebase: be cleverer with rebased upstream branches
Date: Tue, 15 Feb 2011 20:37:47 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.00.1102151940140.7843@debian> (raw)
In-Reply-To: <AANLkTi=1WkZXBtQu71mELTBc6F7XrfBi+NWNWy-AxS79@mail.gmail.com>
On Tue, 15 Feb 2011, Santi B?jar wrote:
> On Mon, Feb 14, 2011 at 1:51 PM, Martin von Zweigbergk
> <martin.von.zweigbergk@gmail.com> wrote:
> > 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
> > simulates one step of "reflog walking" by keeping track of the
> > position of the remote-tracking branch before and after the fetch
> > operation. This does not rely on reflogs. 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 (as in '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
> > as a kind of '$upstream@{1}'.
>
> I don't agree with point b). In line 190:
>
> remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
>
> It returns the local tracking branch for repo=origin and branch=master
> and uses its reflog.
Yes, but the local tracking branch is not updated when the
two-argument version of 'git pull' is used [1].
> The end result is the same, there is one case where you need the old
> value of the tracking branch, so it should be done in git-pull.
True, case a) is still there. I was just trying to explain why I
didn't just move the code from git-pull.sh to git-rebase.sh, but maybe
it confused more than it clarified...
> But I wonder if it is possible to write a function shared by
> git-pull.sh and git-rebase.sh that computes the branch forking points,
> the number of arguments could detect if it has the old-remote-hash or
> not.
Makes sense. I will have a look at it.
> I think the delay could be much shorter if the computation was not in
> shell, but in C. Or maybe change the algorithm. So I don't think a
> configuration item is the answer here.
It would definitely be nice if we can make it fast enough so we don't
have to make it configurable.
[1] http://thread.gmane.org/gmane.comp.version-control.git/165758
next prev parent reply other threads:[~2011-02-16 1:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-14 13:51 [PATCH] rebase: be cleverer with rebased upstream branches Martin von Zweigbergk
2011-02-15 11:28 ` Santi Béjar
2011-02-16 1:37 ` Martin von Zweigbergk [this message]
2011-02-16 9:26 ` Santi Béjar
2011-02-15 20:30 ` Junio C Hamano
2011-02-16 3:03 ` Martin von Zweigbergk
2011-02-16 12:10 ` Santi Béjar
2011-02-16 13:22 ` Santi Béjar
2011-02-16 19:07 ` Junio C Hamano
2011-02-16 21:16 ` Santi Béjar
2011-02-16 16:45 ` Martin von Zweigbergk
2011-02-17 10:24 ` Santi Béjar
2011-03-12 21:15 ` Martin von Zweigbergk
2011-03-12 23:51 ` Santi Béjar
2011-03-13 1:32 ` Martin von Zweigbergk
2011-03-13 3:14 ` Martin von Zweigbergk
2011-03-13 22:57 ` Junio C Hamano
2011-03-13 23:42 ` Santi Béjar
2011-03-13 23:09 ` Santi Béjar
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=alpine.DEB.2.00.1102151940140.7843@debian \
--to=martin.von.zweigbergk@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=santi@agolina.net \
/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