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

squashing patches (was: Re: [RFC] git-sequencer.txt)

From
Stephan Beyer <s-beyer@gmx.net>
Date
Jun 9, 2008, 11:45 UTC
Message-ID
<20080609114550.GA8079@leksak.fem-net>
In-Reply-To
<20080607220101.GM31040@leksak.fem-net>
Wow,

I didn't expect *that much* feedback :-) I think I begin slowly to comment some things, and/or tell you some things that are still open. Then, maybe, someone of you swoops in :)

> TODO FILE FORMAT
> ----------------

First to say, I tried to be (backwards-)compatible to the rebase--interactive TODO file format in "master". It became incompatible to the one in "next" in one point only (-> merge). But if I understood "next" right, this is not bad, since Joerg Sommers rebase-i patchset is still open for discussion (i.e. mark).

Well, now I come to the subject's topic.
I've noticed that one thing is *obviously* missing:
There's a slight asymmetry between
> file [<options>] <file>::
and
> pick [<options>] <commit>::
> edit <commit>::
> squash [<options>] <commit>::

"edit" is kept for backwards compatibility. It's a short form for and internally `expanded' to "pick --edit". As --edit is a general option, there is also "file --edit". So there's no functional asymmetry in this case.

If you want to pick several commits and squash them together, there is "squash". BUT there is no equivalent for "file" currently. The only way to squash several patches together is with an external tool like your favourite text editor, which is not fun but error-prone. And there is no way to squash a commit (in the repo) and a patch (as file) together (in exactly this order). The only thing is that you could run sequencer twice and squash in the second move.

So I wonder if file --squash is useful, too, or even --squash as an general option. The latter means that you could squash merge commits into other commits, too.

We've also discussed the non-atomic approach of doing something like
	pick ( a b c d )	# or another syntax for that
for picking multiple commits into one.
In my current point of view, this does not seem right, as it:
 - is not atomic ;), and...
 - Well, the approach could be used for "file ( a b c d )", too,
   but it doesn't help for squashing commits AND patches.
Comments? Opinions? Ideas?
A first try to prod,
  Stephan.
-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
Previous: Stephan BeyerNext: Johannes Schindelin
Message 2 of 41 in “[RFC] git-sequencer.txt”
  1. Stephan BeyerJun 7, 2008
  2. squashing patches (was: Re: [RFC] git-sequencer.txt)Stephan Beyer, Jun 9, 2008
  3. Johannes SchindelinJun 9, 2008
  4. Paolo BonziniJun 9, 2008
  5. Paolo BonziniJun 9, 2008
  6. Stephan BeyerJun 9, 2008
  7. Paolo BonziniJun 9, 2008
  8. Add git-squash tool and testsStephan Beyer, Jun 9, 2008
  9. Johannes SchindelinJun 9, 2008
  10. Paolo BonziniJun 9, 2008
  11. Johannes SchindelinJun 9, 2008
  12. Stephan BeyerJun 9, 2008
  13. Johannes SchindelinJun 10, 2008
  14. Stephan BeyerJun 9, 2008
  15. Junio C HamanoJun 9, 2008
  16. Stephan BeyerJun 9, 2008
  17. Jeff KingJun 9, 2008
  18. Stephan BeyerJun 9, 2008
  19. Jeff KingJun 10, 2008
  20. Junio C HamanoJun 9, 2008
  21. Stephan BeyerJun 10, 2008
  22. Jakub NarebskiJun 9, 2008
  23. Stephan BeyerJun 10, 2008
  24. Christian CouderJun 10, 2008
  25. Stephan BeyerJun 10, 2008
  26. Christian CouderJun 11, 2008
  27. Daniel BarkalowJun 11, 2008
  28. Jakub NarebskiJun 10, 2008
  29. [RFCv2/FYI] git-sequencer.txtStephan Beyer, Jun 12, 2008
  30. Paolo BonziniJun 12, 2008
  31. Stephan BeyerJun 12, 2008
  32. git-commit: Change --reuse-message to --reuse-commit.Stephan Beyer, Jun 12, 2008
  33. Paolo BonziniJun 12, 2008
  34. Junio C HamanoJun 12, 2008
  35. Stephan BeyerJun 12, 2008
  36. Paolo BonziniJun 13, 2008
  37. Stephan BeyerJun 13, 2008
  38. Paolo BonziniJun 13, 2008
  39. Olivier MarinJun 13, 2008
  40. Jakub NarebskiJun 12, 2008
  41. Stephan BeyerJun 12, 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.