Re: auto commit merge using the default merge message

7 messages, 5 authors, 2016-06-15 · open the first message on its own page

Re: auto commit merge using the default merge message

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:46:38

Michael J Gruber [off-list ref] 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.

Re: auto commit merge using the default merge message

From: Michael J Gruber <hidden>
Date: 2016-06-15 22:46:38

Junio C Hamano venit, vidit, dixit 23.04.2009 10:32:
Michael J Gruber [off-list ref] writes:
quoted
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

Re: auto commit merge using the default merge message

From: Brian Gernhardt <hidden>
Date: 2016-06-15 22:46:39

On Apr 23, 2009, at 5:07 AM, Michael J Gruber wrote:
Junio C Hamano venit, vidit, dixit 23.04.2009 10:32:
quoted
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!
quoted
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

Re: auto commit merge using the default merge message

From: Caleb Cushing <hidden>
Date: 2016-06-15 22:46:39

On Thu, Apr 23, 2009 at 4:32 AM, Junio C Hamano [off-list ref] 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

Re: auto commit merge using the default merge message

From: Jeff King <hidden>
Date: 2016-06-15 22:46:39

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 [off-list ref] wrote:
quoted
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

Re: auto commit merge using the default merge message

From: Caleb Cushing <hidden>
Date: 2016-06-15 22:46:39

On Fri, Apr 24, 2009 at 10:06 AM, Jeff King [off-list ref] wrote:
export GIT_EDITOR
maybe I'm being silly, but won't that then affect my interactive shells?

-- 
Caleb Cushing

http://xenoterracide.blogspot.com

Re: auto commit merge using the default merge message

From: Jeff King <hidden>
Date: 2016-06-15 22:46:39

On Fri, Apr 24, 2009 at 01:50:57PM -0400, Caleb Cushing wrote:
On Fri, Apr 24, 2009 at 10:06 AM, Jeff King [off-list ref] wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help