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

Re: [PATCH] rebase -i: avoid checking out $branch when possible

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 20, 2012, 16:45 UTC
Message-ID
<4F9192AE.5050304@kdbg.org>
In-Reply-To
<fee3225e29915e1b61e29a5d2fe37db20fa4b596.1334933837.git.trast@student.ethz.ch>
Am 20.04.2012 17:05, schrieb Thomas Rast:
Show 14 quoted lines
> The command
> 
>   git rebase [-i] [--onto $onto] $base $branch
> 
> is defined to be equivalent to
> 
>   git checkout $branch && git rebase [-i] [--onto $onto] $base
> 
> However, we do not have to actually perform the checkout.  The rebase
> starts building on top of $base (or $onto, if given).  The tree
> _state_ (not diff) of $branch is irrelevant.  Actually performing the
> checkout has some downsides: $branch may potentially be way out of
> touch with HEAD, and thus e.g. trigger a full rebuild in a timestamp-
> based build system, even if $base..$branch only edits the README.

Thanks, this is very much appreciated. I like it (because it would prevent lots of unneeded rebuilds in my use-cases).

>  cp "$todo" "$todo".backup
>  git_sequence_editor "$todo" ||
> -	die_abort "Could not execute editor"
> +	die_abort_with_checkout "Could not execute editor"
I don't think that we want to checkout here, even if the docs say we do.
-- Hannes
Previous: Junio C Hamano
Message 9 of 9 in “rebase -i: avoid checking out $branch when possible”
  1. rebase -i: avoid checking out $branch when possibleThomas Rast, Apr 20, 2012
  2. Junio C HamanoApr 20, 2012
  3. Thomas RastApr 20, 2012
  4. Junio C HamanoApr 20, 2012
  5. Shezan BaigMay 15, 2012
  6. Junio C HamanoMay 15, 2012
  7. Thomas RastMay 18, 2012
  8. Junio C HamanoMay 18, 2012
  9. Johannes SixtApr 20, 2012

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.