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

Re: git-rebase-walk

From
NWNico Williams <nico@cryptonector.com>
Date
Oct 1, 2026, 21:01 UTC
Message-ID
<ar7KDbV2ra7Rtzl6@ubby>
In-Reply-To
<ar69ZZ4r9ZxISIHz@debian>
On Thu, Oct 01, 2026 at 10:29:41PM +0200, Alejandro Colomar wrote:
Show 6 quoted lines
> Here's the implementation:
> 
> [...]
> 
> It seems to work fine, and the source file uses 52 lines (including
> blank lines).  The behavior seems intuitive, and not too verbose.
Yes, exactly.
Show 5 quoted lines
> Now, compared to your script, the source length is similar (most of the
> difference is printf calls).  I use more pipes, while you use shell
> features like arrays (I have a very hard time reading shell code that
> does heavy use of shell features).  Other than that, they look
> fundamentally similar (except for the paragraph below).  :)

Indeed. My script minus unnecessary vertical whitespace and printfs is very similar in size.

Show 5 quoted lines
> One thing I'm surprised, though, is that you take two parameters instead
> of just the target branch.  I very much prefer my script in this sense,
> which is like git-rebase(1), which rebases the active branch on top of
> the target commit.  It's up to the caller to make sure that the active
> branch is the right one.

Oh, I know... I... was being paternalistic there. It's completely unnecessary, I agree. I'll remove it.

Show 12 quoted lines
> > > I'll certainly try your script; thanks!
> > > 
> > > Out of curiosity, did you offer this script to git(1)?
> > 
> > No, though I think I've mentioned it here before.  I'd be happy to
> > submit a patch, but I'd first have to get employer approval for it
> > (which is not a problem -- it will only take time).
> 
> Please!  :)
> 
> Or I could send mine; I don't need to do any paperwork.
> Actually, due to the difference in parameters, I prefer to send mine.

You're there already, so go for it. You can credit Vitor Dukhovni and me for this idea (he wrote slow-rebase.sh, and he and I rewrote it together into bisect-rebase.sh when I just didn't have the patience to babysit a slow rebase of my PG work), though.. it's fairly obvious, so much so that there's also the three alternatives mentioned by @pabs3 in a comment on my gist any or all of which you could credit as well, and probably more if you look hard enough:

    https://github.com/CTSRD-CHERI/git-mergify-rebase
    https://github.com/mhagger/git-imerge/
    https://github.com/brooksdavis/mergify/

I agree with you: smaller and simpler is better, which is one reason I prefer bisect-rebase.sh over git-imerge. But I confess I've not looked a those three alternatives in much detail because, frankly, bisect-rebase.sh is so simple and easy to use, and since I [co-]wrote it, I know it well, so for me it's the best choice. Since it seems to be a best choice for someone other than me, it might actually be a good choice for others.

Nico
Previous: Alejandro ColomarNext: Nico Williams
Message 18 of 21 in “git-rebase-walk”
  1. Alejandro ColomarOct 1, 2026
  2. Patrick SteinhardtOct 1, 2026
  3. Alejandro ColomarOct 1, 2026
  4. Patrick SteinhardtOct 2, 2026
  5. Alejandro ColomarOct 2, 2026
  6. Nico WilliamsOct 3, 2026
  7. Phillip WoodOct 4, 2026
  8. Alejandro ColomarOct 5, 2026
  9. Alejandro ColomarOct 5, 2026
  10. Phillip WoodOct 6, 2026
  11. Nico WilliamsOct 6, 2026
  12. Alejandro ColomarOct 6, 2026
  13. Junio C HamanoOct 1, 2026
  14. Nico WilliamsOct 1, 2026
  15. Alejandro ColomarOct 1, 2026
  16. Nico WilliamsOct 1, 2026
  17. Alejandro ColomarOct 1, 2026
  18. Nico WilliamsOct 1, 2026
  19. Nico WilliamsOct 1, 2026
  20. Simon RichterOct 2, 2026
  21. Nico WilliamsOct 2, 2026

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.