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

Re: How to change merge message ("weenie commits")

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 26, 2007, 12:54 UTC
Message-ID
<epctjl$vrv$1@sea.gmane.org>
In-Reply-To
<20070125161609.GA7453@diana.vm.bytemark.co.uk>
Karl Hasselström wrote:
Show 9 quoted lines
> On 2007-01-25 09:56:33 -0600, Bill Lear wrote:
> 
>> Do others run into this and perhaps have a good solution?
> 
> I make lots of small commits, then periodically rewrite history with
> StGIT to get the nice-looking set of commits I wish I had made in the
> first place. I don't think I do anything that couldn't be done with
> just git, but StGIT is made precisely for this kind of work, and is
> quite good at it.

If you want to use only core git, "git cherry-pick" (with or without --no-commit option), "git commit --amend" and "git merge --squash" (and probably "git rebase --onto") are your friends. You can also do "git format-patch", edit/reorder patches and then "git am --3way" or "git apply".

But StGIT is made for this work. I use it to reorder commits, to amend commit deeper in the history, to split and join commits (although it is more work, at least with version I use). If you have branch which is currently not managed by StGIT, "stg init" and then use "stg uncommit". I frequently use "stg uncommit" and "stg pop"/"stg push" to add commit in the middle of branch.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Karl HasselströmNext: Junio C Hamano
Message 6 of 8 in “How to change merge message ("weenie commits")”
  1. Bill LearJan 25, 2007
  2. Santi BéjarJan 25, 2007
  3. J. Bruce FieldsJan 25, 2007
  4. Seth FalconJan 25, 2007
  5. Karl HasselströmJan 25, 2007
  6. Jakub NarebskiJan 26, 2007
  7. Junio C HamanoJan 25, 2007
  8. Robin RosenbergJan 26, 2007

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.