# Re: git-commit: allow From: line to be entered in commit message

14 messages from 2006-01-12 to 2006-01-13. Participants: Joel Becker, Alex Riesen, Junio C Hamano, sean, Johannes Schindelin.
Thread: https://gitlist.dev/t/3061

## Joel Becker, 2006-01-12 19:00

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <20060112190031.GH14196@ca-server1.us.oracle.com>
URL: https://gitlist.dev/e/20060112190031.GH14196%40ca-server1.us.oracle.com
In-Reply-To: <20060112093700.1d3d25db.seanlkml@sympatico.ca>

```
On Thu, Jan 12, 2006 at 09:37:00AM -0500, sean wrote:
> Use the author name and email information given as the 
> first line of the commit message in the form of:
> 
> From: name <email>
> 
> as the author's name and email address in the resulting
> commit object.  This makes committing foreign patches
> a little less cumbersome to handle for some workflows.

	If we do this, can we have it populated up front?  That is, when
the edit opens, the current idea of author is in the comments as "From:"
so I can see what the author would be if I changed nothing.  This would
catch surprises where I'd forgotten to set AUTHOR_*, etc.

Joel
 

-- 

Life's Little Instruction Book #182

	"Be romantic."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

```

## Alex Riesen, 2006-01-12 20:16

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <20060112201646.GA3179@steel.home>
URL: https://gitlist.dev/e/20060112201646.GA3179%40steel.home
In-Reply-To: <20060112093700.1d3d25db.seanlkml@sympatico.ca>

```
sean, Thu, Jan 12, 2006 15:37:00 +0100:
> 
> Mostly just for comment to see if there is any support
> for this feature....
> 
> Sean
> 
> ---
> Use the author name and email information given as the 
> first line of the commit message in the form of:
> 
> From: name <email>
> 

Isn't this what git-am expect (as a part of mbox) and handle?

```

## Junio C Hamano, 2006-01-12 20:22

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <7vhd89mc0y.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vhd89mc0y.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060112190031.GH14196@ca-server1.us.oracle.com>

```
Joel Becker <Joel.Becker@oracle.com> writes:

> On Thu, Jan 12, 2006 at 09:37:00AM -0500, sean wrote:
>> Use the author name and email information given as the 
>> first line of the commit message in the form of:
>> 
>> From: name <email>
>> 
> 	If we do this, can we have it populated up front?  That is, when
> the edit opens, the current idea of author is in the comments as "From:"
> so I can see what the author would be if I changed nothing.  This would
> catch surprises where I'd forgotten to set AUTHOR_*, etc.

Committing somebody else's changes by hand ought to be a rare
event.  Otherwise that is an indication that there needs to be a
"git am/applymbox" equivalent for the mythical transport medium
(other than e-mail) that feeds you somebody else's changes to
you and have you commit.  If something is a regular event in a
workflow, we would want to be able to automate things, and
having the user type in whom the changes have come from is not
the way to do it.

Most of the time when I use "git commit", I'll be committing my
own changes; I do not want to see "From: me" every time I
commit.

"Populate upfront, only if it is different from yourself" is
perhaps acceptable, but that is probably hard to arrange.  There
is no reliable way to know what is "yourself", and that was why
we have GIT_AUTHOR_* environment variables to override things to
begin with.

```

## sean, 2006-01-13 02:46

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <BAYC1-PASMTP1298D73139F4BE57D59B97AE260@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP1298D73139F4BE57D59B97AE260%40CEZ.ICE
In-Reply-To: <20060112201646.GA3179@steel.home>

```
On Thu, 12 Jan 2006 21:16:46 +0100
Alex Riesen <raa.lkml@gmail.com> wrote:

> > Use the author name and email information given as the 
> > first line of the commit message in the form of:
> > 
> > From: name <email>
> > 
> Isn't this what git-am expect (as a part of mbox) and handle?
> 

Hi Alex,

Yes it is, but not everyone is processing patches in mbox format.   If 
this facility is good enough for the mbox users, it seems like it would
be good enough for non-mbox users.   In fact, it would seem more
consistent to tell someone that a From: line will be handled properly
whether they use git-am or git-commit. 

Sean

```

## sean, 2006-01-13 03:58

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <BAYC1-PASMTP1281924C5151CEB4DECC7CAE260@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP1281924C5151CEB4DECC7CAE260%40CEZ.ICE
In-Reply-To: <7vek3chj8j.fsf@assigned-by-dhcp.cox.net>

```
On Thu, 12 Jan 2006 19:58:20 -0800
Junio C Hamano <junkio@cox.net> wrote:

> sean <seanlkml@sympatico.ca> writes:
> 
> > ...   In fact, it would seem more
> > consistent to tell someone that a From: line will be handled properly
> > whether they use git-am or git-commit. 
> 
> Yuck.
> 
> Somebody using am/applymbox is not writing that "From: " line
> himself.  The person who writes that "From: " line writes that
> into his MUA when sending a patch --- that is "editing an
> email", so there is a consistency between that activity and use
> of word "From: ".
> 
> The editor for commit message does not have anything to do with
> e-mail.  What you are talking about is not consistency, but
> confusion.
> 

I don't imagine that the person "editing" the commit message is
doing so in this case either, rather copy-n-pasting.  If you're
really dead-set against this method, you should at least consider
adding it as a command line option, because having to set this
via environment variables is a much bigger Yuck.

Sean

```

## Junio C Hamano, 2006-01-13 03:58

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <7vek3chj8j.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vek3chj8j.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <BAYC1-PASMTP1298D73139F4BE57D59B97AE260@CEZ.ICE>

```
sean <seanlkml@sympatico.ca> writes:

> ...   In fact, it would seem more
> consistent to tell someone that a From: line will be handled properly
> whether they use git-am or git-commit. 

Yuck.

Somebody using am/applymbox is not writing that "From: " line
himself.  The person who writes that "From: " line writes that
into his MUA when sending a patch --- that is "editing an
email", so there is a consistency between that activity and use
of word "From: ".

The editor for commit message does not have anything to do with
e-mail.  What you are talking about is not consistency, but
confusion.

```

## Joel Becker, 2006-01-13 06:58

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <20060113065855.GJ14196@ca-server1.us.oracle.com>
URL: https://gitlist.dev/e/20060113065855.GJ14196%40ca-server1.us.oracle.com
In-Reply-To: <7vhd89mc0y.fsf@assigned-by-dhcp.cox.net>

```
On Thu, Jan 12, 2006 at 12:22:53PM -0800, Junio C Hamano wrote:
> Committing somebody else's changes by hand ought to be a rare
> event.  Otherwise that is an indication that there needs to be a
>...
> Most of the time when I use "git commit", I'll be committing my
> own changes; I do not want to see "From: me" every time I
> commit.

	Well, I'm wary of putting
GIT_AUTHOR_EMAIL=joel.becker@oracle.com as a permanent part of my
environment, for fear of overriding some other authors at some point.
On the other hand, if I don't put it in the environment, I get a bogus
author line (jlbec@thisbox.oracle.com).  So I end up having to
hand-write the AUTHOR_EMAIL lines on each commit line; not a solution
I'm happy with.
	This way, I'd have a chance to edit it and be sure :-)

Joel
 

-- 

Life's Little Instruction Book #274

	"Leave everything a little better than you found it."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

```

## Junio C Hamano, 2006-01-13 07:06

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <7vpsmwbo9s.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vpsmwbo9s.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060113065855.GJ14196@ca-server1.us.oracle.com>

```
Joel Becker <Joel.Becker@oracle.com> writes:

> Well, I'm wary of putting
> GIT_AUTHOR_EMAIL=joel.becker@oracle.com as a permanent part of my
> environment, for fear of overriding some other authors at some point.

The weakest default comes from .git/config so you could have
this in your .git/config:

	[user]
        	name = Joel Becker 
                email = Joel.Becker@oracle.com

and you can have GIT_AUTHOR_* override it as necessary.

```

## Joel Becker, 2006-01-13 19:12

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <20060113191231.GM14196@ca-server1.us.oracle.com>
URL: https://gitlist.dev/e/20060113191231.GM14196%40ca-server1.us.oracle.com
In-Reply-To: <7vpsmwbo9s.fsf@assigned-by-dhcp.cox.net>

```
On Thu, Jan 12, 2006 at 11:06:07PM -0800, Junio C Hamano wrote:
> Joel Becker <Joel.Becker@oracle.com> writes:
> 
> > Well, I'm wary of putting
> > GIT_AUTHOR_EMAIL=joel.becker@oracle.com as a permanent part of my
> > environment, for fear of overriding some other authors at some point.
> 
> The weakest default comes from .git/config so you could have
> this in your .git/config:
> 
> 	[user]
>         	name = Joel Becker 
>                 email = Joel.Becker@oracle.com

	This configuration is something I have the opportunity to forget
every time I call git-clone.  So I still need to leave it in the
environment permanently.
	Am I correct in assuming that "From:" lines will override the
environment when using git-applymbox?  If so, I guess leaving
GIT_AUTHOR_* in my environment permanently will be ok.

Joel

-- 

"War doesn't determine who's right; war determines who's left."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

```

## Junio C Hamano, 2006-01-13 19:39

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <7vhd877w9m.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vhd877w9m.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060113191231.GM14196@ca-server1.us.oracle.com>

```
Joel Becker <Joel.Becker@oracle.com> writes:

> 	Am I correct in assuming that "From:" lines will override the
> environment when using git-applymbox?  If so, I guess leaving
> GIT_AUTHOR_* in my environment permanently will be ok.

That's what I do.  Although I use git-am not git-applymbox, both
of them are designed to work that way.

```

## Joel Becker, 2006-01-13 20:01

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <20060113200124.GO14196@ca-server1.us.oracle.com>
URL: https://gitlist.dev/e/20060113200124.GO14196%40ca-server1.us.oracle.com
In-Reply-To: <7vhd877w9m.fsf@assigned-by-dhcp.cox.net>

```
On Fri, Jan 13, 2006 at 11:39:17AM -0800, Junio C Hamano wrote:
> That's what I do.  Although I use git-am not git-applymbox, both
> of them are designed to work that way.

	While I can see that git-am and git-applymbox have different
options for the same basic task, I can't quite see why one would be
preferred to the other.  What does git-am do that git-applymbox does
not?

Joel

-- 

"I'm so tired of being tired,
 Sure as night will follow day.
 Most things I worry about
 Never happen anyway."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

```

## Junio C Hamano, 2006-01-13 20:33

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <7virsn50lv.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7virsn50lv.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060113200124.GO14196@ca-server1.us.oracle.com>

```
Joel Becker <Joel.Becker@oracle.com> writes:

> On Fri, Jan 13, 2006 at 11:39:17AM -0800, Junio C Hamano wrote:
>> That's what I do.  Although I use git-am not git-applymbox, both
>> of them are designed to work that way.
>
> 	While I can see that git-am and git-applymbox have different
> options for the same basic task, I can't quite see why one would be
> preferred to the other.  What does git-am do that git-applymbox does
> not?

Sorry about the confusion.  This is turning into a FAQ and it is
all _my_ fault [*1*].

Some historical background.

 - "applymbox" was there first.  It was renamed from a tool
   'dotest' Linus had used since BK days, with somewhat
   unextensible command line syntax.

 - "am" was invented later, to majorly redo what applymbox does
   with extensible command line syntax.  It is supposed to do
   everything applymbox does, but the only thing it does not
   support is to be command-line compatible.

The primary reason why I kept applymbox maintained is because
many "How to hack kernel with git" documents floating around
talk about applymbox, and it still is used by Linus to apply
patches with his trained fingers.  Worse yet, it could be that
applymbox is used as a building block in larger private scripts
used by kernel developers, and its removal would force them to
update their scripts to use "am" instead.  I do not want to see
the kernel people spending their time on adjusting their private
tools for git changes unnecessarily; their time is better spent
on improving the kernel.

So in short, I tend to recommend "am" to new people, but
"applymbox" is still usable.


[Footnote]

*1* I do not mind keeping applymbox maintained, but at the same
time I know I would feel it stupid to carry two tools that do
almost the same thing if it were somebody else's project, and
every time this issue comes up I feel the urge to say "in 3
months, git-applymbox will be removed, please get used to
git-am", which so far I ended up resisting.

```

## Junio C Hamano, 2006-01-13 20:46

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <7vvewn3lgg.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vvewn3lgg.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7virsn50lv.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <junkio@cox.net> writes:

> Joel Becker <Joel.Becker@oracle.com> writes:
>
>> On Fri, Jan 13, 2006 at 11:39:17AM -0800, Junio C Hamano wrote:
>>> That's what I do.  Although I use git-am not git-applymbox, both
>>> of them are designed to work that way.
>>
>> 	While I can see that git-am and git-applymbox have different
>> options for the same basic task, I can't quite see why one would be
>> preferred to the other.  What does git-am do that git-applymbox does
>> not?

The behaviour upon seeing unapplicable patch is somewhat
different.  In Linus workflow, he reviews (and modifies if
necessary) all patches inside mbox and runs "applymbox"; upon
failure, he blows what remains in .dotest away, trims mbox to
get rid of what has already been applied and re-runs it from
scratch.  The failure recovery method "applymbox" had (this
happened before my time IIRC) is to edit .dotest/patch to make
it applicable and re-run it.  OTOH, "am" tries to do better by
allowing you to hand tweak the working tree to match what would
have resulted if the patch applied cleanly and say "--resolved".

Another difference is that "am" can be told to handle binary
file changes and apply such as long as the patch is intra
repository (i.e. both pre and post image blob are available in
the repository).  This is used as a backend to do "git rebase".

```

## Johannes Schindelin, 2006-01-13 21:47

Subject: Re: git-commit: allow From: line to be entered in commit message
Message-ID: <Pine.LNX.4.63.0601132247080.32562@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0601132247080.32562%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20060113191231.GM14196@ca-server1.us.oracle.com>

```
Hi,

On Fri, 13 Jan 2006, Joel Becker wrote:

> On Thu, Jan 12, 2006 at 11:06:07PM -0800, Junio C Hamano wrote:
> > Joel Becker <Joel.Becker@oracle.com> writes:
> > 
> > > Well, I'm wary of putting
> > > GIT_AUTHOR_EMAIL=joel.becker@oracle.com as a permanent part of my
> > > environment, for fear of overriding some other authors at some point.
> > 
> > The weakest default comes from .git/config so you could have
> > this in your .git/config:
> > 
> > 	[user]
> >         	name = Joel Becker 
> >                 email = Joel.Becker@oracle.com
> 
> 	This configuration is something I have the opportunity to forget
> every time I call git-clone.  So I still need to leave it in the
> environment permanently.

Of course, you could put it in your templates and never forget.

Ciao,
Dscho

```
