git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: `pull --rebase --autostash` fails when fast forward in dirty repo

From
Junio C Hamano <gitster@pobox.com>
Date
May 23, 2017, 22:40 UTC
Message-ID
<xmqqa863jiyf.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170523131231.zqjkymypbilv6tyf@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 16 quoted lines
> ...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.
Previous: Jeff KingNext: Jeff King
Message 3 of 8 in “`pull --rebase --autostash` fails when fast forward in dirty repo”
  1. Tyler BrazierMay 21, 2017
  2. Jeff KingMay 23, 2017
  3. Junio C HamanoMay 23, 2017
  4. Jeff KingMay 25, 2017
  5. Jeff KingMay 25, 2017
  6. Junio C HamanoMay 25, 2017
  7. Tyler BrazierMay 26, 2017
  8. Junio C HamanoMay 26, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.