# Re: Merging commits together into a super-commit

4 messages from 2007-05-10 to 2007-05-12. Participants: linux@horizon.com, Alex Riesen, Eugine Kosenko, Jan Hudec.
Thread: https://gitlist.dev/t/8073

## linux@horizon.com, 2007-05-10 21:55

Subject: Re: Merging commits together into a super-commit
Message-ID: <20070510215515.3084.qmail@science.horizon.com>
URL: https://gitlist.dev/e/20070510215515.3084.qmail%40science.horizon.com

```
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, 2007-05-11 11:54

Subject: Re: Merging commits together into a super-commit
Message-ID: <81b0412b0705110454w5b18c267x17e82453e736f0b8@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0705110454w5b18c267x17e82453e736f0b8%40mail.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:
> 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, 2007-05-11 12:41

Subject: Merging commits together into a super-commit
Message-ID: <9909dee80705110541m13c4035tc8338e179d6bec9b@mail.gmail.com>
URL: https://gitlist.dev/e/9909dee80705110541m13c4035tc8338e179d6bec9b%40mail.gmail.com
In-Reply-To: <9909dee80705110537j7e6d1426p7723c110c0a2c667@mail.gmail.com>

```
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, 2007-05-12 13:02

Subject: Re: Merging commits together into a super-commit
Message-ID: <20070512130210.GA32764@efreet.light.src>
URL: https://gitlist.dev/e/20070512130210.GA32764%40efreet.light.src
In-Reply-To: <9909dee80705110541m13c4035tc8338e179d6bec9b@mail.gmail.com>

```
On Fri, May 11, 2007 at 15:41:45 +0300, Eugine Kosenko wrote:
> 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>

```
