# Groups of commits

6 messages from 2010-04-28 to 2010-04-28. Participants: John Tapsell, Jeff King, Michael Poole, Tay Ray Chuan, Alex Riesen, Avery Pennarun.
Thread: https://gitlist.dev/t/23625

## John Tapsell, 2010-04-28 01:59

Subject: Groups of commits
Message-ID: <j2u43d8ce651004271859t8f306261n330004142a42b6df@mail.gmail.com>
URL: https://gitlist.dev/e/j2u43d8ce651004271859t8f306261n330004142a42b6df%40mail.gmail.com

```
Hi all,

  In my work place, we have a lot of strict rules to get something
committed.  The code has to pass against a large test suite, it has to
be tested on different hardware, and so on.

  The problem is that it forces everyone to have one single large
commit for a week's work.  All the intermediate stages get squashed
and that history forever lost.

  It would be nice to have a commit in the repository, treated as a
single commit for all purposes, but then be able to split it into
multiple commits if necessary.

  Any ideas?

John

```

## Jeff King, 2010-04-28 02:14

Subject: Re: Groups of commits
Message-ID: <20100428021431.GD16107@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20100428021431.GD16107%40coredump.intra.peff.net
In-Reply-To: <j2u43d8ce651004271859t8f306261n330004142a42b6df@mail.gmail.com>

```
On Wed, Apr 28, 2010 at 10:59:44AM +0900, John Tapsell wrote:

>   In my work place, we have a lot of strict rules to get something
> committed.  The code has to pass against a large test suite, it has to
> be tested on different hardware, and so on.
> 
>   The problem is that it forces everyone to have one single large
> commit for a week's work.  All the intermediate stages get squashed
> and that history forever lost.

Redefine "committed" to be "merged to the mainline branch" (or
"committed to the mainline branch" if you need to keep the nomenclature
to please pointy-haired people). Have everybody work on their own branch
each week (or better yet, a branch per topic).

When they would make their single big commit, instead "git merge
--no-ff" from the topic branch into mainline. Do your tests on the
result. If it fails, kick back an error (or whatever you do now). If it
works, then add that merge commit to mainline.

If you want to see the "big commits", follow "log --first-parent" of the
mainline branch. These commits will all pass the test suite. If you want
to see the whole history, then use regular history browsing. Commits on
side-branches do not necessarily pass the test suite.

>   It would be nice to have a commit in the repository, treated as a
> single commit for all purposes, but then be able to split it into
> multiple commits if necessary.

My suggestion above is not exactly what you asked for. It treats the
history as multiple commits most of the time, but using --first-parent
you can ask for just the big commits.

-Peff

```

## Michael Poole, 2010-04-28 02:15

Subject: Re: Groups of commits
Message-ID: <87sk6ge312.fsf@troilus.org>
URL: https://gitlist.dev/e/87sk6ge312.fsf%40troilus.org
In-Reply-To: <j2u43d8ce651004271859t8f306261n330004142a42b6df@mail.gmail.com>

```
John Tapsell writes:

> Hi all,
>
>   In my work place, we have a lot of strict rules to get something
> committed.  The code has to pass against a large test suite, it has to
> be tested on different hardware, and so on.
>
>   The problem is that it forces everyone to have one single large
> commit for a week's work.  All the intermediate stages get squashed
> and that history forever lost.
>
>   It would be nice to have a commit in the repository, treated as a
> single commit for all purposes, but then be able to split it into
> multiple commits if necessary.
>
>   Any ideas?

Isn't that what topic branches are for?  When development is done on a
short-lived branch (hopefully one with a descriptive name), the only
commit that needs to go through that process is the merge onto the
integration branch.

Michael Poole

```

## Tay Ray Chuan, 2010-04-28 05:25

Subject: Re: Groups of commits
Message-ID: <r2jbe6fef0d1004272225rd61ef84axe86ba45a0b352a8@mail.gmail.com>
URL: https://gitlist.dev/e/r2jbe6fef0d1004272225rd61ef84axe86ba45a0b352a8%40mail.gmail.com
In-Reply-To: <87sk6ge312.fsf@troilus.org>

```
On Wed, Apr 28, 2010 at 10:15 AM, Michael Poole <mdpoole@troilus.org> wrote:
> John Tapsell writes:
>
>> Hi all,
>>
>>   In my work place, we have a lot of strict rules to get something
>> committed.  The code has to pass against a large test suite, it has to
>> be tested on different hardware, and so on.
>>
>>   The problem is that it forces everyone to have one single large
>> commit for a week's work.  All the intermediate stages get squashed
>> and that history forever lost.
>>
>>   It would be nice to have a commit in the repository, treated as a
>> single commit for all purposes, but then be able to split it into
>> multiple commits if necessary.
>>
>>   Any ideas?
>
> Isn't that what topic branches are for?  When development is done on a
> short-lived branch (hopefully one with a descriptive name), the only
> commit that needs to go through that process is the merge onto the
> integration branch.

Just to add to the "merge in topic branches" idea - if you find that
the commits are trivially fast-forwardable, you can still add a short
note/cover letter with

  git merge --no-ff -m "Added in foo's work" <branch/commit>

-- 
Cheers,
Ray Chuan

```

## Alex Riesen, 2010-04-28 08:05

Subject: Re: Groups of commits
Message-ID: <y2t81b0412b1004280105p46962bdeq163bc4fb92cb0fdb@mail.gmail.com>
URL: https://gitlist.dev/e/y2t81b0412b1004280105p46962bdeq163bc4fb92cb0fdb%40mail.gmail.com
In-Reply-To: <r2jbe6fef0d1004272225rd61ef84axe86ba45a0b352a8@mail.gmail.com>

```
On Wed, Apr 28, 2010 at 07:25, Tay Ray Chuan <rctay89@gmail.com> wrote:
> Just to add to the "merge in topic branches" idea - if you find that
> the commits are trivially fast-forwardable, you can still add a short
> note/cover letter with
>
>  git merge --no-ff -m "Added in foo's work" <branch/commit>
>

Except that is not a "short note" anymore, but a full-fledged merge
commit. You forced it with "--no-ff".

```

## Avery Pennarun, 2010-04-28 12:46

Subject: Re: Groups of commits
Message-ID: <i2k32541b131004280546j5fc4e160oa1618fe14d83a291@mail.gmail.com>
URL: https://gitlist.dev/e/i2k32541b131004280546j5fc4e160oa1618fe14d83a291%40mail.gmail.com
In-Reply-To: <y2t81b0412b1004280105p46962bdeq163bc4fb92cb0fdb@mail.gmail.com>

```
On Wed, Apr 28, 2010 at 4:05 AM, Alex Riesen <raa.lkml@gmail.com> wrote:
> On Wed, Apr 28, 2010 at 07:25, Tay Ray Chuan <rctay89@gmail.com> wrote:
>> Just to add to the "merge in topic branches" idea - if you find that
>> the commits are trivially fast-forwardable, you can still add a short
>> note/cover letter with
>>
>>  git merge --no-ff -m "Added in foo's work" <branch/commit>
>
> Except that is not a "short note" anymore, but a full-fledged merge
> commit. You forced it with "--no-ff".

I think it's safe to say that a commit *is* just a "short note" about
a tree, who made it, the reason (message), and who its parents were.

Have fun,

Avery

```
