# auto commit merge using the default merge message

10 messages from 2009-04-23 to 2009-04-24. Participants: Caleb Cushing, Alex Riesen, Michael J Gruber, Junio C Hamano, Brian Gernhardt, Jeff King.
Thread: https://gitlist.dev/t/19019

## Caleb Cushing, 2009-04-23 07:46

Subject: auto commit merge using the default merge message
Message-ID: <81bfc67a0904230046j48ed06b7s5693406332ee52dc@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0904230046j48ed06b7s5693406332ee52dc%40mail.gmail.com

```
so I do the same merge all the time... sorta, I'm not sure rerere
would actually work because the file is different each time... I just
have to delete it each time. and I want to automate the process.
checkout merge rm commmit, problem is commit brings and editor up, I
want to commit with the 'auto inserted merge message' that is
generated, without seeing the editor, how do I do this?

-- 
Caleb Cushing

http://xenoterracide.blogspot.com

```

## Alex Riesen, 2009-04-23 07:57

Subject: Re: auto commit merge using the default merge message
Message-ID: <81b0412b0904230057k1653d039vfc3962e6affda584@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0904230057k1653d039vfc3962e6affda584%40mail.gmail.com
In-Reply-To: <81bfc67a0904230046j48ed06b7s5693406332ee52dc@mail.gmail.com>

```
2009/4/23 Caleb Cushing <xenoterracide@gmail.com>:
> so I do the same merge all the time... sorta, I'm not sure rerere
> would actually work because the file is different each time... I just
> have to delete it each time. and I want to automate the process.
> checkout merge rm commmit, problem is commit brings and editor up, I
> want to commit with the 'auto inserted merge message' that is
> generated, without seeing the editor, how do I do this?

See git commit -C <commit-with-fitting-description>,
git commit -F <message-file> and git commit -m "message text".

```

## Michael J Gruber, 2009-04-23 08:25

Subject: Re: auto commit merge using the default merge message
Message-ID: <49F025E7.7090404@drmicha.warpmail.net>
URL: https://gitlist.dev/e/49F025E7.7090404%40drmicha.warpmail.net
In-Reply-To: <81b0412b0904230057k1653d039vfc3962e6affda584@mail.gmail.com>

```
Alex Riesen venit, vidit, dixit 23.04.2009 09:57:
> 2009/4/23 Caleb Cushing <xenoterracide@gmail.com>:
>> so I do the same merge all the time... sorta, I'm not sure rerere
>> would actually work because the file is different each time... I just
>> have to delete it each time. and I want to automate the process.
>> checkout merge rm commmit, problem is commit brings and editor up, I
>> want to commit with the 'auto inserted merge message' that is
>> generated, without seeing the editor, how do I do this?
> 
> See git commit -C <commit-with-fitting-description>,
> git commit -F <message-file> and git commit -m "message text".

I think he wants the auto generated message which may be different for
each merge. Maybe something like

GIT_EDITOR=/bin/true git commit

will do the trick.

Michael

```

## Junio C Hamano, 2009-04-23 08:32

Subject: Re: auto commit merge using the default merge message
Message-ID: <7vocunwz1n.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vocunwz1n.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <49F025E7.7090404@drmicha.warpmail.net>

```
Michael J Gruber <git@drmicha.warpmail.net> writes:

> I think he wants the auto generated message which may be different for
> each merge. Maybe something like
>
> GIT_EDITOR=/bin/true git commit
>
> will do the trick.

Use "GIT_EDITOR=:" instead.  It also is *true* just like /bin/true, but
git knows a simple magic about this and avoids an extra fork+exec.

A similar trick exists for GIT_PAGER=cat (not "/bin/cat"), by the way.

```

## Michael J Gruber, 2009-04-23 09:07

Subject: Re: auto commit merge using the default merge message
Message-ID: <49F02FC0.1010007@drmicha.warpmail.net>
URL: https://gitlist.dev/e/49F02FC0.1010007%40drmicha.warpmail.net
In-Reply-To: <7vocunwz1n.fsf@gitster.siamese.dyndns.org>

```
Junio C Hamano venit, vidit, dixit 23.04.2009 10:32:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> I think he wants the auto generated message which may be different
>> for each merge. Maybe something like
>> 
>> GIT_EDITOR=/bin/true git commit
>> 
>> will do the trick.
> 
> Use "GIT_EDITOR=:" instead.  It also is *true* just like /bin/true,
> but git knows a simple magic about this and avoids an extra
> fork+exec.

Good to know!

> A similar trick exists for GIT_PAGER=cat (not "/bin/cat"), by the
> way.
> 

So, GIT_PAGER=cat differs from GIT_PAGER=/bin/cat even when `which
cat`==/bin/cat?

Michael

```

## Brian Gernhardt, 2009-04-23 16:19

Subject: Re: auto commit merge using the default merge message
Message-ID: <CA5A92BB-29E5-40C0-BA9A-ED076676D8BF@silverinsanity.com>
URL: https://gitlist.dev/e/CA5A92BB-29E5-40C0-BA9A-ED076676D8BF%40silverinsanity.com
In-Reply-To: <49F02FC0.1010007@drmicha.warpmail.net>

```

On Apr 23, 2009, at 5:07 AM, Michael J Gruber wrote:

> Junio C Hamano venit, vidit, dixit 23.04.2009 10:32:
>> Use "GIT_EDITOR=:" instead.  It also is *true* just like /bin/true,
>> but git knows a simple magic about this and avoids an extra
>> fork+exec.
>
> Good to know!
>
>> A similar trick exists for GIT_PAGER=cat (not "/bin/cat"), by the
>> way.
>>
>
> So, GIT_PAGER=cat differs from GIT_PAGER=/bin/cat even when `which
> cat`==/bin/cat?

Yes, if $GIT_PAGER == "cat", then git won't launch a pager at all.  If  
$GIT_PAGER == "/bin/cat", then git will launch /bin/cat and pipe all  
of it's output through it.  The result is (assuming a functional /bin/ 
cat) identical, but "cat" avoids the extra memory usage of "/bin/cat".

~~ Brian

```

## Caleb Cushing, 2009-04-24 01:31

Subject: Re: auto commit merge using the default merge message
Message-ID: <81bfc67a0904231831y31bfb057pa5eaa86d0e153824@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0904231831y31bfb057pa5eaa86d0e153824%40mail.gmail.com
In-Reply-To: <7vocunwz1n.fsf@gitster.siamese.dyndns.org>

```
On Thu, Apr 23, 2009 at 4:32 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Use "GIT_EDITOR=:" instead.  It also is *true* just like /bin/true, but
> git knows a simple magic about this and avoids an extra fork+exec.
>

So I could put

GIT_EDITOR=:

at the top of my shell script, and then whenever I need to do a
commit, just git commit and it'll work (assuming the commit has a
default message).

-- 
Caleb Cushing

http://xenoterracide.blogspot.com

```

## Jeff King, 2009-04-24 14:06

Subject: Re: auto commit merge using the default merge message
Message-ID: <20090424140606.GB10761@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090424140606.GB10761%40coredump.intra.peff.net
In-Reply-To: <81bfc67a0904231831y31bfb057pa5eaa86d0e153824@mail.gmail.com>

```
On Thu, Apr 23, 2009 at 09:31:10PM -0400, Caleb Cushing wrote:

> On Thu, Apr 23, 2009 at 4:32 AM, Junio C Hamano <gitster@pobox.com> wrote:
> > Use "GIT_EDITOR=:" instead.  It also is *true* just like /bin/true, but
> > git knows a simple magic about this and avoids an extra fork+exec.
> >
> 
> So I could put
> 
> GIT_EDITOR=:
> 
> at the top of my shell script, and then whenever I need to do a
> commit, just git commit and it'll work (assuming the commit has a
> default message).

You need to also

  export GIT_EDITOR

for "git commit" to see it.

-Peff

```

## Caleb Cushing, 2009-04-24 17:50

Subject: Re: auto commit merge using the default merge message
Message-ID: <81bfc67a0904241050t26a0ed62vbf17e471ddc10672@mail.gmail.com>
URL: https://gitlist.dev/e/81bfc67a0904241050t26a0ed62vbf17e471ddc10672%40mail.gmail.com
In-Reply-To: <20090424140606.GB10761@coredump.intra.peff.net>

```
On Fri, Apr 24, 2009 at 10:06 AM, Jeff King <peff@peff.net> wrote:
> export GIT_EDITOR
>

maybe I'm being silly, but won't that then affect my interactive shells?

-- 
Caleb Cushing

http://xenoterracide.blogspot.com

```

## Jeff King, 2009-04-24 17:55

Subject: Re: auto commit merge using the default merge message
Message-ID: <20090424175511.GA11360@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090424175511.GA11360%40coredump.intra.peff.net
In-Reply-To: <81bfc67a0904241050t26a0ed62vbf17e471ddc10672@mail.gmail.com>

```
On Fri, Apr 24, 2009 at 01:50:57PM -0400, Caleb Cushing wrote:

> On Fri, Apr 24, 2009 at 10:06 AM, Jeff King <peff@peff.net> wrote:
> > export GIT_EDITOR
> >
> maybe I'm being silly, but won't that then affect my interactive shells?

No, because you're putting it in your shell script, not in your .profile
(right?). The "export" command just tells the shell "pass this variable
in the environment to any child processes you spawn". Without it, the
variable is local to that shell.

-Peff

```
