# Possible feature request for merge and pull

10 messages from 2010-07-28 to 2010-07-29. Participants: Bradley Wagner, Ævar Arnfjörð Bjarmason, Avery Pennarun, Jeff King, Jonathan Nieder.
Thread: https://gitlist.dev/t/24545

## Bradley Wagner, 2010-07-28 01:24

Subject: Possible feature request for merge and pull
Message-ID: <AANLkTim6JAPrSVaSaGZ72xtfFnUUcYeWT8vpL3rYuwki@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTim6JAPrSVaSaGZ72xtfFnUUcYeWT8vpL3rYuwki%40mail.gmail.com

```
I would love to be able to use the -m flag and --log together with git
merge and pull to be able to create a custom commit message but also
include one-line summaries of each of the commits being merged/pulled.

```

## Ævar Arnfjörð Bjarmason, 2010-07-28 07:34

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTinRvq71GS5WVdWs9zP5QSJ=TjCWBgTfRGn2Qub0@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinRvq71GS5WVdWs9zP5QSJ%3DTjCWBgTfRGn2Qub0%40mail.gmail.com
In-Reply-To: <AANLkTim6JAPrSVaSaGZ72xtfFnUUcYeWT8vpL3rYuwki@mail.gmail.com>

```
On Wed, Jul 28, 2010 at 01:24, Bradley Wagner
<bradley.wagner@hannonhill.com> wrote:
> I would love to be able to use the -m flag and --log together with git
> merge and pull to be able to create a custom commit message but also
> include one-line summaries of each of the commits being merged/pulled.

This sort of thing has vaguely come up before, and it was mentioned
that you can just use a small script that calls git-filter-branch or
git-rebase -i.

It's easy to rewrite the commits you just pulled, having some feature
that e.g. adds a custom message to the beginning of each of them would
just impose an artificial limitation and overlap with existing (and
more powerful) functionality.

```

## Avery Pennarun, 2010-07-28 20:49

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTikA2jWu76aPUNG+B7Nwc9eDzoU93VcGvUFWR0Ri@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikA2jWu76aPUNG%2BB7Nwc9eDzoU93VcGvUFWR0Ri%40mail.gmail.com
In-Reply-To: <AANLkTinRvq71GS5WVdWs9zP5QSJ=TjCWBgTfRGn2Qub0@mail.gmail.com>

```
On Wed, Jul 28, 2010 at 3:34 AM, Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> On Wed, Jul 28, 2010 at 01:24, Bradley Wagner
> <bradley.wagner@hannonhill.com> wrote:
>> I would love to be able to use the -m flag and --log together with git
>> merge and pull to be able to create a custom commit message but also
>> include one-line summaries of each of the commits being merged/pulled.
>
> This sort of thing has vaguely come up before, and it was mentioned
> that you can just use a small script that calls git-filter-branch or
> git-rebase -i.
>
> It's easy to rewrite the commits you just pulled, having some feature
> that e.g. adds a custom message to the beginning of each of them would
> just impose an artificial limitation and overlap with existing (and
> more powerful) functionality.

If I understand correctly, the request is not to rewrite the pulled
commits, but just to produce a nice message in the newly-created merge
commit.

It sounds like --log and -m are currently incompatible, in that -m
overrides --log, and that's not the desired behaviour.  Bradley: this
is probably a relatively easy fix to make, in case you're looking to
get into some git hacking. :)

Have fun,

Avery

```

## Bradley Wagner, 2010-07-28 20:55

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTimXe1SYiVONTnN_4e1ieAKNHgKwJ7fBOYjL-CUE@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimXe1SYiVONTnN_4e1ieAKNHgKwJ7fBOYjL-CUE%40mail.gmail.com
In-Reply-To: <AANLkTikA2jWu76aPUNG+B7Nwc9eDzoU93VcGvUFWR0Ri@mail.gmail.com>

```
Avery,

On Wed, Jul 28, 2010 at 4:49 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> On Wed, Jul 28, 2010 at 3:34 AM, Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> On Wed, Jul 28, 2010 at 01:24, Bradley Wagner
>> <bradley.wagner@hannonhill.com> wrote:
>>> I would love to be able to use the -m flag and --log together with git
>>> merge and pull to be able to create a custom commit message but also
>>> include one-line summaries of each of the commits being merged/pulled.
>>
>> This sort of thing has vaguely come up before, and it was mentioned
>> that you can just use a small script that calls git-filter-branch or
>> git-rebase -i.
>>
>> It's easy to rewrite the commits you just pulled, having some feature
>> that e.g. adds a custom message to the beginning of each of them would
>> just impose an artificial limitation and overlap with existing (and
>> more powerful) functionality.
>
> If I understand correctly, the request is not to rewrite the pulled
> commits, but just to produce a nice message in the newly-created merge
> commit.

Yes, that's correct.

> It sounds like --log and -m are currently incompatible, in that -m
> overrides --log, and that's not the desired behaviour.

Correct, I can't remember which overrides which but basically it's as
if you just used one of them. Also, git pull doesn't appear to take a
-m flag at all.

> Bradley: this
> is probably a relatively easy fix to make, in case you're looking to
> get into some git hacking. :)

Nice, I may check that out.

>
> Have fun,
>
> Avery
>



-- 
Hannon Hill - Put Us to the Test
bradley.wagner@hannonhill.com | http://www.hannonhill.com

```

## Jeff King, 2010-07-29 01:03

Subject: Re: Possible feature request for merge and pull
Message-ID: <20100729010341.GA25732@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20100729010341.GA25732%40coredump.intra.peff.net
In-Reply-To: <AANLkTikA2jWu76aPUNG+B7Nwc9eDzoU93VcGvUFWR0Ri@mail.gmail.com>

```
On Wed, Jul 28, 2010 at 04:49:11PM -0400, Avery Pennarun wrote:

> It sounds like --log and -m are currently incompatible, in that -m
> overrides --log, and that's not the desired behaviour.  Bradley: this
> is probably a relatively easy fix to make, in case you're looking to
> get into some git hacking. :)

Really? I get:

  $ mkdir repo && cd repo && git init &&
    echo content >file && git add file && git commit -m one &&
    echo content >>file && git commit -a -m two &&
    git checkout -b other HEAD^ &&
    echo content >file2 && git add file2 && git commit -m three &&
    git merge --log -m "custom message" master &&
    git show

  commit fa21035ea5f5437e8664a5d249e7ab88ee3f0e75
  Merge: d12be4a 4dc5cba
  Author: Jeff King <peff@peff.net>
  Date:   Wed Jul 28 20:50:39 2010 -0400

      custom message

      * master:
        two

which seems to be what was asked for. So is the problem just that
git-pull does not take "-m"?

-Peff

```

## Bradley Wagner, 2010-07-29 01:21

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTikP+5GxyWbXNcKeOtQoOEGAT9v313jAum+q-1LV@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikP%2B5GxyWbXNcKeOtQoOEGAT9v313jAum%2Bq-1LV%40mail.gmail.com
In-Reply-To: <20100729010341.GA25732@coredump.intra.peff.net>

```
On Wed, Jul 28, 2010 at 9:03 PM, Jeff King <peff@peff.net> wrote:
> On Wed, Jul 28, 2010 at 04:49:11PM -0400, Avery Pennarun wrote:
>
>> It sounds like --log and -m are currently incompatible, in that -m
>> overrides --log, and that's not the desired behaviour.  Bradley: this
>> is probably a relatively easy fix to make, in case you're looking to
>> get into some git hacking. :)
>
> Really? I get:
>
>  $ mkdir repo && cd repo && git init &&
>    echo content >file && git add file && git commit -m one &&
>    echo content >>file && git commit -a -m two &&
>    git checkout -b other HEAD^ &&
>    echo content >file2 && git add file2 && git commit -m three &&
>    git merge --log -m "custom message" master &&
>    git show
>
>  commit fa21035ea5f5437e8664a5d249e7ab88ee3f0e75
>  Merge: d12be4a 4dc5cba
>  Author: Jeff King <peff@peff.net>
>  Date:   Wed Jul 28 20:50:39 2010 -0400
>
>      custom message
>
>      * master:
>        two
>
> which seems to be what was asked for. So is the problem just that
> git-pull does not take "-m"?
>
> -Peff
>

--log is supposed to include one-log summaries of each of the merged
commits, right? It's not doing that for me when when I do 'git merge
--log -m "message" <branch>'. Instead, it's only using the message I
specified with -m.

One difference is that I'm merging topic branch into master but that
shouldn't make any difference.

Your right that the other part of the request is to add -m to pull.

```

## Jonathan Nieder, 2010-07-29 01:27

Subject: Re: Possible feature request for merge and pull
Message-ID: <20100729012723.GH29156@dert.cs.uchicago.edu>
URL: https://gitlist.dev/e/20100729012723.GH29156%40dert.cs.uchicago.edu
In-Reply-To: <AANLkTikP+5GxyWbXNcKeOtQoOEGAT9v313jAum+q-1LV@mail.gmail.com>

```
Bradley Wagner wrote:
> On Wed, Jul 28, 2010 at 9:03 PM, Jeff King <peff@peff.net> wrote:

>> Really? I get:
[...]
> --log is supposed to include one-log summaries of each of the merged
> commits, right? It's not doing that for me

Just a wild guess, but are you using a version of git before
1.7.1.1?

If you upgrade, you'll be able to use -m with --log for
"git merge", at least (v1.7.1.1~23^2: merge: --log appends
shortlog to message if specified, 2010-05-11).

Thanks, Tay!
Jonathan

```

## Bradley Wagner, 2010-07-29 01:30

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTinPcH-urWJJ_UELA5Kj=m3zKKLB8yGuvj6b03jw@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinPcH-urWJJ_UELA5Kj%3Dm3zKKLB8yGuvj6b03jw%40mail.gmail.com
In-Reply-To: <20100729012723.GH29156@dert.cs.uchicago.edu>

```
On Wed, Jul 28, 2010 at 9:27 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Bradley Wagner wrote:
>> On Wed, Jul 28, 2010 at 9:03 PM, Jeff King <peff@peff.net> wrote:
>
>>> Really? I get:
> [...]
>> --log is supposed to include one-log summaries of each of the merged
>> commits, right? It's not doing that for me
>
> Just a wild guess, but are you using a version of git before
> 1.7.1.1?

Certainly am: git version 1.7.0

> If you upgrade, you'll be able to use -m with --log for
> "git merge", at least (v1.7.1.1~23^2: merge: --log appends
> shortlog to message if specified, 2010-05-11).

Thanks, I'll do that.

> Thanks, Tay!
> Jonathan

```

## Bradley Wagner, 2010-07-29 04:20

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTimt7Q++tAjNc7iZSUTdtaYphg9=Dtmaco3HUJSc@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimt7Q%2B%2BtAjNc7iZSUTdtaYphg9%3DDtmaco3HUJSc%40mail.gmail.com
In-Reply-To: <AANLkTinPcH-urWJJ_UELA5Kj=m3zKKLB8yGuvj6b03jw@mail.gmail.com>

```
On Wed, Jul 28, 2010 at 9:30 PM, Bradley Wagner
<bradley.wagner@hannonhill.com> wrote:
> On Wed, Jul 28, 2010 at 9:27 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Bradley Wagner wrote:
>>> On Wed, Jul 28, 2010 at 9:03 PM, Jeff King <peff@peff.net> wrote:
>>
>>>> Really? I get:
>> [...]
>>> --log is supposed to include one-log summaries of each of the merged
>>> commits, right? It's not doing that for me
>>
>> Just a wild guess, but are you using a version of git before
>> 1.7.1.1?
>
> Certainly am: git version 1.7.0
>
>> If you upgrade, you'll be able to use -m with --log for
>> "git merge", at least (v1.7.1.1~23^2: merge: --log appends
>> shortlog to message if specified, 2010-05-11).
>
> Thanks, I'll do that.

New version works great with merge. Thanks guys! Now I'm wondering if
we could bring -m flag to pull.

```

## Avery Pennarun, 2010-07-29 04:22

Subject: Re: Possible feature request for merge and pull
Message-ID: <AANLkTikYS97TKOcNoS42rczJJ6bUztQF1LbCa4qGk0xK@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikYS97TKOcNoS42rczJJ6bUztQF1LbCa4qGk0xK%40mail.gmail.com
In-Reply-To: <AANLkTimt7Q++tAjNc7iZSUTdtaYphg9=Dtmaco3HUJSc@mail.gmail.com>

```
On Thu, Jul 29, 2010 at 12:20 AM, Bradley Wagner
<bradley.wagner@hannonhill.com> wrote:
> New version works great with merge. Thanks guys! Now I'm wondering if
> we could bring -m flag to pull.

I'm sure this is also an easy patch if you're in the mood to contribute it :)

Perhaps there are reasons this was left out originally, but I'm
guessing it was just that nobody expressed any need for it.

Have fun,

Avery

```
