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

Re: Graphical tool to merge and reorder commits

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 19, 2025, 11:05 UTC
Message-ID
<aKRaiaym7KsJ2Ojg@pks.im>
In-Reply-To
<260a97ce-2ab0-4920-9cea-078369c42f74@petrovitsch.priv.at>
On Tue, Aug 19, 2025 at 11:51:42AM +0200, Bernd Petrovitsch wrote:
Show 28 quoted lines
> On 19.08.25 10:35, R. Diez wrote:
> [...]
> > I guess some "git history squash" command would be useful too.
> > 
> > This is what frequently happens to me:
> > - I commit some code changes because the current project builds and tests fine.
> > - I start the "compile all projects" process, which takes about 1 hour.
> > - In the meantime, I commit other unrelated changes.
> > - After an hour, I realise that a silly mistake in the first commit makes compilation fail for some project.
> >    I fix that and I trigger a "compile all projects" again, which takes 1 hour again.
> > - In the meantime, I commit yet another unrelated change.
> > - After yet another hour, the build process notifies me that I made yet another little mistake, and yet another project fails now.
> > 
> > The commit history looks like this:
> > 
> > - A - B - fixA1 - C - fixA2 - D - E
> > 
> > I only do a "git push" when the 1-hour compilation process succeeds. Before the "git push", I want to reorganise that into:
> > 
> > - A+fixA1+fixA2 - B - C - D - E
> > 
> > I know I can work with branches, but branches make everything more complicated. A linear history is easier, especially when you are working alone. Besides, it is not often that I make such silly mistakes. ;-)
> 
> - `git rebase -i HEAD~11` (or so;-)
> - move fixA1 and fixA2 under A and change "pick" to "fixup" for fixA1 and fixA2
> - save and exit the editor
> 
> And done.

It's not really that this isn't doable. It's just not all that obvious for people who aren't experts, and it's not a straight-forward thing to do. I think the Git project could certainly use better tooling to make common workflows obvious and easy.

Anyway, the patch series is out now and can be found at [1].
Patrick
[1]: https://lore.kernel.org/git/20250819-b4-pks-history-builtin-v1-0-9b77c32688fe@pks.im/T/#t
Previous: Bernd PetrovitschNext: R. Diez
Message 7 of 11 in “Graphical tool to merge and reorder commits”
  1. R. DiezAug 17, 2025
  2. Konstantin KhomoutovAug 18, 2025
  3. Junio C HamanoAug 18, 2025
  4. Patrick SteinhardtAug 19, 2025
  5. R. DiezAug 19, 2025
  6. Bernd PetrovitschAug 19, 2025
  7. Patrick SteinhardtAug 19, 2025
  8. R. DiezAug 19, 2025
  9. Ben KnobleAug 19, 2025
  10. Junio C HamanoAug 19, 2025
  11. Johannes SixtAug 19, 2025

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.