threads / discuss / 8073

Re: Merging commits together into a super-commit

Subject: Re: Merging commits together into a super-commit

## tl;dr

4 messages between May 10, 2007 and May 12, 2007.

replies: 3people: 4as markdown or json

linux@horizon.com· May 10, 2007, 21:55 UTC · lore
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
But that's not really necessary.

Starting from the branch, using the high-level commands is a bit awkward, but it's easy enough to:

git-update-ref HEAD trunk git-commit

Alex Riesen· May 11, 2007, 11:54 UTC · re: linux@horizon.com · lore
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.

Eugine Kosenko· May 11, 2007, 12:41 UTC · lore

Merging commits together into a super-commit

2007/5/11, Alex Riesen <raa.lkml@gmail.com>:
> And it is not enough. Authorship information is lost.

If one dare to make such super-commit, he would be the author of the whole couple of changes.

> 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.
I used to make git-rebase to add extra commits after this.
Jan Hudec· May 12, 2007, 13:02 UTC · re: Eugine Kosenko · lore
On Fri, May 11, 2007 at 15:41:45 +0300, Eugine Kosenko wrote:
Show 5 quoted lines
> 2007/5/11, Alex Riesen <raa.lkml@gmail.com>:
> >And it is not enough. Authorship information is lost.
> 
> If one dare to make such super-commit, he would be the author of the
> whole couple of changes.

No, he would not. He would be committer, but the change would still be based on the work of the original authors and therefore would have to be attributed to them (and especially they would still remain copyright holders).

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

← back to recent threads