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

Re: collapsing commits with rebase

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 8, 2009, 11:07 UTC
Message-ID
<alpine.DEB.1.00.0901081205120.30769@pacific.mpi-cbg.de>
In-Reply-To
<93c3eada0901071759u2496835dy134d92613bf4244b@mail.gmail.com>
Hi,
On Thu, 8 Jan 2009, Geoff Russell wrote:
Show 13 quoted lines
> On Thu, Jan 8, 2009 at 11:15 AM, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
>
> > Alternatively, something like this should work for you:
> >
> >        $ git checkout A
> >        $ git read-tree -u -m D
> >        $ git commit -m "My message"
> >        $ git cherry-pick E
> >        $ git cherry-pick F
> 
> Plan B is looking good, because I'd generally like the commit message to 
> be the concatenation of the messages for B,C and D.
Replace the commit call by this:
	$ for commit in B C D
	  do
		git cat-file commit $commit | sed '1,/^$/d'
		# possibly add an empty line between the commit messages,
		# git commit will strip away empty lines at the end.
	  done |
	  git commit -F -

Hth, Dscho

Previous: Geoff RussellNext: Geoff Russell
Message 4 of 12 in “collapsing commits with rebase”
  1. Geoff RussellJan 8, 2009
  2. Johannes SchindelinJan 8, 2009
  3. Geoff RussellJan 8, 2009
  4. Johannes SchindelinJan 8, 2009
  5. Geoff RussellJan 10, 2009
  6. Boyd Stephen Smith Jr.Jan 8, 2009
  7. Miklos VajnaJan 8, 2009
  8. Boyd Stephen Smith Jr.Jan 8, 2009
  9. Geoff RussellJan 8, 2009
  10. Sitaram ChamartyJan 8, 2009
  11. Boyd Stephen Smith Jr.Jan 8, 2009
  12. nadim khemirJan 10, 2009

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.