# How to use git-fmt-merge-msg?

4 messages from 2009-02-05 to 2009-02-05. Participants: Robert Haines, Santi Béjar.
Thread: https://gitlist.dev/t/17587

## Robert Haines, 2009-02-05 12:31

Subject: How to use git-fmt-merge-msg?
Message-ID: <84B3CCAA-A044-4517-B2C8-14D5DD754FD2@manchester.ac.uk>
URL: https://gitlist.dev/e/84B3CCAA-A044-4517-B2C8-14D5DD754FD2%40manchester.ac.uk

```
Hi all,

I would like to use git-fmt-merge-msg to produce automatic summaries  
of what commits are being merged when I merge one branch into the  
other - like I see all the time in git.git, etc. The problem I am  
having is that I can only seem to get it to work with remote branches  
via .git/FETCH_HEAD - basically I don't know what else I can feed it  
to do what I want.

Say I have a local repo with no remotes so no .git/FETCH_HEAD. Can I  
use git-fmt-merge-msg to produce such a summary when I'm just merging  
local branches? I've tried feeding just about everything I can find  
in .git/ into it but with no luck. Is there anything generated during  
the merge that can be used as input if I do a merge --no-commit? A  
list of merged commits or something?

I'm sure I've missed something simple here... Alternatively, am I just  
barking up the wrong tree?

Thanks,
Rob

-- 
Robert Haines

Research Associate, RealityGrid          Tel. : +44 (0)161 275 6067
Research Computing Services              Fax. : +44 (0)161 275 0637
University of Manchester                 Email: rhaines@manchester.ac.uk
Oxford Road                              Web  : www.realitygrid.org
Manchester, M13 9PL                           : www.rcs.manchester.ac.uk

```

## Santi Béjar, 2009-02-05 12:59

Subject: Re: How to use git-fmt-merge-msg?
Message-ID: <adf1fd3d0902050459s4fcb914ai2b9c8c04e9f72b02@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d0902050459s4fcb914ai2b9c8c04e9f72b02%40mail.gmail.com
In-Reply-To: <84B3CCAA-A044-4517-B2C8-14D5DD754FD2@manchester.ac.uk>

```
2009/2/5 Robert Haines <rhaines@manchester.ac.uk>:
> Hi all,
>
> I would like to use git-fmt-merge-msg to produce automatic summaries of what
> commits are being merged when I merge one branch into the other - like I see
> all the time in git.git, etc. The problem I am having is that I can only
> seem to get it to work with remote branches via .git/FETCH_HEAD - basically
> I don't know what else I can feed it to do what I want.
>
> Say I have a local repo with no remotes so no .git/FETCH_HEAD. Can I use
> git-fmt-merge-msg to produce such a summary when I'm just merging local
> branches? I've tried feeding just about everything I can find in .git/ into
> it but with no luck. Is there anything generated during the merge that can
> be used as input if I do a merge --no-commit? A list of merged commits or
> something?
>
> I'm sure I've missed something simple here...

Sure :-)

Manpage of git merge:
       --log
           In addition to branch names, populate the log message with one-line
           descriptions from the actual commits that are being merged.

Manpage of git config:
       merge.log
           Whether to include summaries of merged commits in newly created
           merge commit messages. False by default.

HTH,
Santi

```

## Robert Haines, 2009-02-05 13:25

Subject: Re: How to use git-fmt-merge-msg?
Message-ID: <B22C0229-47F4-48EC-9C68-63696C7BB3F2@manchester.ac.uk>
URL: https://gitlist.dev/e/B22C0229-47F4-48EC-9C68-63696C7BB3F2%40manchester.ac.uk
In-Reply-To: <adf1fd3d0902050459s4fcb914ai2b9c8c04e9f72b02@mail.gmail.com>

```

On 5 Feb 2009, at 12:59, Santi Béjar wrote:

> 2009/2/5 Robert Haines <rhaines@manchester.ac.uk>:
>> Hi all,
>>
>> I would like to use git-fmt-merge-msg to produce automatic  
>> summaries of what
>> commits are being merged when I merge one branch into the other -  
>> like I see
>> all the time in git.git, etc. The problem I am having is that I can  
>> only
>> seem to get it to work with remote branches via .git/FETCH_HEAD -  
>> basically
>> I don't know what else I can feed it to do what I want.
>>
>> Say I have a local repo with no remotes so no .git/FETCH_HEAD. Can  
>> I use
>> git-fmt-merge-msg to produce such a summary when I'm just merging  
>> local
>> branches? I've tried feeding just about everything I can find  
>> in .git/ into
>> it but with no luck. Is there anything generated during the merge  
>> that can
>> be used as input if I do a merge --no-commit? A list of merged  
>> commits or
>> something?
>>
>> I'm sure I've missed something simple here...
>
> Sure :-)
>
> Manpage of git merge:
>       --log
>           In addition to branch names, populate the log message with  
> one-line
>           descriptions from the actual commits that are being merged.
>
> Manpage of git config:
>       merge.log
>           Whether to include summaries of merged commits in newly  
> created
>           merge commit messages. False by default.

Aaaahhhh.... Time for me to upgrade. The version of git I am using  
(1.5.3.8) doesn't have merge --log. No wonder I couldn't find it!

Thanks for the pointer and sorry for the noise...

Cheers,
Rob

```

## Santi Béjar, 2009-02-05 13:35

Subject: Re: How to use git-fmt-merge-msg?
Message-ID: <adf1fd3d0902050535y631035b6lfc09e0982aefdfd7@mail.gmail.com>
URL: https://gitlist.dev/e/adf1fd3d0902050535y631035b6lfc09e0982aefdfd7%40mail.gmail.com
In-Reply-To: <B22C0229-47F4-48EC-9C68-63696C7BB3F2@manchester.ac.uk>

```
2009/2/5 Robert Haines <rhaines@manchester.ac.uk>:
>
> On 5 Feb 2009, at 12:59, Santi Béjar wrote:
>

[...]

>>
>> Manpage of git merge:
>>      --log
>>          In addition to branch names, populate the log message with
>> one-line
>>          descriptions from the actual commits that are being merged.
>>
>> Manpage of git config:
>>      merge.log
>>          Whether to include summaries of merged commits in newly created
>>          merge commit messages. False by default.
>
> Aaaahhhh.... Time for me to upgrade. The version of git I am using (1.5.3.8)
> doesn't have merge --log. No wonder I couldn't find it!

In that version you can use --summary and merge.summary, but they are
now deprecated.

HTH,
Santi

```
