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

Re: optimized checkout+rebase?

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 13, 2008, 07:20 UTC
Message-ID
<47D8D5B8.70809@viscovery.net>
In-Reply-To
<20080312191041.GF3198@ins.uni-bonn.de>
Ralf Wildenhues schrieb:
Show 14 quoted lines
> this is a common work pattern:
> 
>   git checkout master
>   git pull
>   for branch in $my_topic_branches; do
>     git checkout $branch
>     git rebase master
>     # occasional fixups here...
>   done
> 
> Now, it looks to me that one of the first operations of rebase just
> undoes part of the work that the checkout of the branch did.  Well,
> "undoes" is the wrong word, what I mean is that it looks like work
> may be saved by combining the two checkout and the rewinding step.
Well, what you could do is:
   for branch in $my_topic_branches; do
     git rebase master $branch
     # occasional fixups here...
   done

But it seems that even then rebase first does the checkout $branch, and then the checkout master right after that. At least the first checkout should be unnecessary because all the revision range computations and patch formating should be possible to do without the checkout. (The second checkout is indispensable, of course.)

This has annoyed me, too, but not so much that I started looking at a fix, though...

-- Hannes
Previous: Ralf WildenhuesNext: Ralf Wildenhues
Message 2 of 10 in “optimized checkout+rebase?”
  1. Ralf WildenhuesMar 12, 2008
  2. Johannes SixtMar 13, 2008
  3. Ralf WildenhuesMar 15, 2008
  4. rebase [--onto O] A B: omit needless checkoutJunio C Hamano, Mar 15, 2008
  5. Ralf WildenhuesMar 15, 2008
  6. Junio C HamanoMar 16, 2008
  7. Johannes SixtMar 19, 2008
  8. Junio C HamanoMar 19, 2008
  9. Johannes SixtMar 20, 2008
  10. Junio C HamanoMar 20, 2008

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.