From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Tyler Brazier <tylerbrazier@gmail.com>, git@vger.kernel.org
Subject: Re: `pull --rebase --autostash` fails when fast forward in dirty repo
Date: Wed, 24 May 2017 07:40:08 +0900 [thread overview]
Message-ID: <xmqqa863jiyf.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170523131231.zqjkymypbilv6tyf@sigill.intra.peff.net> (Jeff King's message of "Tue, 23 May 2017 09:12:31 -0400")
Jeff King <peff@peff.net> writes:
> ...we can probably restrict it to when autostash is in use, like:
>
> /*
> * If this is a fast-forward, we can skip calling rebase and
> * just do the merge ourselves. But we don't know about
> * autostash, so use the real rebase command when it's in effect.
> */
> if (!autostash && is_descendant_of(merge_head, list)) {
> opt_ff = "--ff-only";
> return run_merge();
> }
>
> AFAICT from the commit introducing this code (33b842a1e9), and the
> surrounding discussion:
>
> http://public-inbox.org/git/OF95D98CB6.47969C1C-ONC1257FE1.0058D980-C1257FE1.0059986D@dakosy.de/T/#u
Sounds like a sensible solution.
> But I notice on the run_merge() code path that we do still invoke
> git-merge.
... wouldn't that what we want even when the merge happens to be a
fast-forward one? I am not sure what you meant by this, but...
> And rebase has been getting faster as it is moved to C code
> itself. So is this optimization even worth doing anymore?
...that might be something worth thinking about---my gut feeling
tells me something but we should go by a measurement, not by gut
feeling of a random somebody.
Thanks.
next prev parent reply other threads:[~2017-05-23 22:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-21 5:17 `pull --rebase --autostash` fails when fast forward in dirty repo Tyler Brazier
2017-05-23 13:12 ` Jeff King
2017-05-23 22:40 ` Junio C Hamano [this message]
2017-05-25 18:04 ` Jeff King
2017-05-25 18:22 ` Jeff King
2017-05-25 23:33 ` Junio C Hamano
2017-05-26 4:38 ` Tyler Brazier
2017-05-26 5:58 ` 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=xmqqa863jiyf.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=tylerbrazier@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.
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).