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

Re: Merging commits together into a super-commit

From
Alex Riesen <raa.lkml@gmail.com>
Date
May 11, 2007, 11:54 UTC
Message-ID
<81b0412b0705110454w5b18c267x17e82453e736f0b8@mail.gmail.com>
In-Reply-To
<20070510215515.3084.qmail@science.horizon.com>
On 10 May 2007 17:55:15 -0400, linux@horizon.com <linux@horizon.com> wrote:
Show 12 quoted lines
> Er... why is everyone making this so complex?
>
> git checkout trunk      # Switch to "trunk"
> git checkout branch .   # Overwrite with "branch", but stay on "trunk"
> git commit
>
> Now branch is the same tree object as "branch", but without the history.
>
> Of course, you could be even nastier and di a direct
>
> git-commit-tree branch^{tree} -p HEAD < commit_message
>

And it is not enough. Authorship information is lost. And you have to be damn sure the "branch" starts directly at HEAD, otherwise everything HEAD..branch is lost. It is complex if you want it right.

Previous: linux@horizon.comNext: Eugine Kosenko
Message 2 of 4 in “Re: Merging commits together into a super-commit”
  1. linux@horizon.comMay 10, 2007
  2. Alex RiesenMay 11, 2007
  3. Merging commits together into a super-commitEugine Kosenko, May 11, 2007
  4. Jan HudecMay 12, 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.