# What shall we do with the GECOS field again?

20 messages from 2005-09-19 to 2005-09-20. Participants: Petr Baudis, Kevin O'Riordan, A Large Angry SCM, Matthias Urlichs, Junio C Hamano, Nikolai Weibull, Linus Torvalds, Ryan Anderson.
Thread: https://gitlist.dev/t/1860

## Petr Baudis, 2005-09-19 13:48

Subject: What shall we do with the GECOS field again?
Message-ID: <20050919134838.GC2903@pasky.or.cz>
URL: https://gitlist.dev/e/20050919134838.GC2903%40pasky.or.cz

```
  Hello,

  after today's another confrontation with angry mob of real-world
Cogito users, I decided to revive the old discussion about what part of
the GECOS field should be used to prefill GIT_*_NAME. Linus stated in
<Pine.LNX.4.58.0504171636590.7211@ppc970.osdl.org> that he does not want
to cut based on ',', because it might throw away the first name of gecos
fields in the "Torvalds, Linus" name.

  Well, I have to say that from the GECOS fields I saw, none use that
format, but a lot of them used the realname,phone,something,phone,...
format. The other point is, that users usually do not expect their phone
number to end up in their name information in GIT commits, which results
in a very unpleasant surprise (doubly so due to the immutable GIT
nature). Yes, they should check after the first commit if they are happy
with everything, and yes, GECOS is world-readable and therefore they
shouldn't put information they don't want to be public to it. Still they
do and I think GIT shouldn't make them unpleasant surprises.

  So my proposal (patch will follow soon) is to cut everything after the
first , or ; from the GECOS field. These are the usual delimiters used
in the GECOS field, and hopefully this will prevent polluting the
realname fields of commit headers with crap and surprising the users.
In the (I think rather rare) situation of the "Baudis, Petr"-like GECOS
fields, this will just result in only the surname being in the realname
field, which seems to be much less harmful and comparably less evil to
me. 

  Opinions?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```

## Kevin O'Riordan, 2005-09-19 14:11

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050919141106.GA31983@compsoc.com>
URL: https://gitlist.dev/e/20050919141106.GA31983%40compsoc.com
In-Reply-To: <20050919134838.GC2903@pasky.or.cz>

```

Hi,

> [cutting] based on ',', ... might throw away the first name of gecos
> fields in the "Torvalds, Linus" name.
...
> ... a lot of them used the realname,phone,something,phone,... format.
...
> So my proposal ... is to cut everything after the first , or ; from
> the GECOS field.
...
> In the ... situation of the "Baudis, Petr"-like GECOS fields, this
> will just result in only the surname being in the realname field,
> which seems to be much less harmful and comparably less evil to me. 

In case this hasn't been suggested, how about cutting on "," but taking
the first and second fields instead of just the first, and then
discarding the second if it contains numbers (or is empty, or whatever) ?

-kor

```

## A Large Angry SCM, 2005-09-19 14:30

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <432ECB92.5000505@gmail.com>
URL: https://gitlist.dev/e/432ECB92.5000505%40gmail.com
In-Reply-To: <20050919134838.GC2903@pasky.or.cz>

```
Petr Baudis wrote:
>   Hello,
> 
>   after today's another confrontation with angry mob of real-world
> Cogito users, I decided to revive the old discussion about what part of
> the GECOS field should be used to prefill GIT_*_NAME. Linus stated in
> <Pine.LNX.4.58.0504171636590.7211@ppc970.osdl.org> that he does not want
> to cut based on ',', because it might throw away the first name of gecos
> fields in the "Torvalds, Linus" name.
> 
>   Well, I have to say that from the GECOS fields I saw, none use that
> format, but a lot of them used the realname,phone,something,phone,...
> format. The other point is, that users usually do not expect their phone
> number to end up in their name information in GIT commits, which results
> in a very unpleasant surprise (doubly so due to the immutable GIT
> nature). Yes, they should check after the first commit if they are happy
> with everything, and yes, GECOS is world-readable and therefore they
> shouldn't put information they don't want to be public to it. Still they
> do and I think GIT shouldn't make them unpleasant surprises.
> 
>   So my proposal (patch will follow soon) is to cut everything after the
> first , or ; from the GECOS field. These are the usual delimiters used
> in the GECOS field, and hopefully this will prevent polluting the
> realname fields of commit headers with crap and surprising the users.
> In the (I think rather rare) situation of the "Baudis, Petr"-like GECOS
> fields, this will just result in only the surname being in the realname
> field, which seems to be much less harmful and comparably less evil to
> me. 
> 
>   Opinions?
> 

Petr,

Your view of GECOS field contents (formatting) does not match my 
experience. Many organizations, both large and small, have standards and 
requirements for the contents and formatting of information in the GECOS 
field. Saying that the user's name is first and a particular punctuation 
character SHALL be the standard cut point and everyone not happy with 
the results should explicitly set the Git environment variables is the 
wrong approach.

A better approach is to not use the GECOS field contents at all and 
force everyone the set the Git environment variables, AND/OR to include 
the what Git thinks the user's name name might be in the commit message 
template they're editing (like the file list).

```

## Matthias Urlichs, 2005-09-19 14:34

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <pan.2005.09.19.14.34.50.221824@smurf.noris.de>
URL: https://gitlist.dev/e/pan.2005.09.19.14.34.50.221824%40smurf.noris.de
In-Reply-To: <20050919141106.GA31983@compsoc.com>

```
Hi, Kevin O'Riordan wrote:

> In case this hasn't been suggested, how about cutting on "," but taking
> the first and second fields instead of just the first, and then
> discarding the second if it contains numbers (or is empty, or whatever) ?

... or contains a room name or a street or ...  Bah.

*If* we want heuristics, then I'd check for the presence of more than one
semicolon or comma (semicolon to be checked first). Yes => use the part
before the semicolon or comma. No => use the whole field.

However, I'd argue that we don't want heuristics, we should cut at the
first delimiter, and anybody who wants to change their commit info gets to
set an envvar.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
I've got a patent pending on swallowing, oxidation, and chewing gum.

```

## Matthias Urlichs, 2005-09-19 14:47

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <pan.2005.09.19.14.47.51.811409@smurf.noris.de>
URL: https://gitlist.dev/e/pan.2005.09.19.14.47.51.811409%40smurf.noris.de
In-Reply-To: <432ECB92.5000505@gmail.com>

```
Hi, A Large Angry SCM wrote:

> Saying that the user's name is first and a particular punctuation 
> character SHALL be the standard cut point and everyone not happy with 
> the results should explicitly set the Git environment variables is the 
> wrong approach.

I disagree. Standard add-user tools use the gecos field in one of two ways:
- fullname
- fullname,and,some,other,cruft

Sure, many organizations bake their own, but I'd argue that the majority
doesn't.

> AND/OR to include 
> the what Git thinks the user's name name might be in the commit message
> template they're editing (like the file list).

I think that's a good idea, as long as people are told how to change it
(i.e., an envvar -- NOT by editing the file).

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
On those occasions when the angel managed to get his mind into the
twentieth century, it always gravitated to 1950.
        -- (Terry Pratchett & Neil Gaiman, Good Omens)

```

## Junio C Hamano, 2005-09-19 16:06

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <7vll1trqiq.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vll1trqiq.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050919134838.GC2903@pasky.or.cz>

```
Petr Baudis <pasky@suse.cz> writes:

>   Well, I have to say that from the GECOS fields I saw, none use that
> format, but a lot of them used the realname,phone,something,phone,...
> format.

>   Opinions?

If the real world GECOS were either only plain and
name,room,blah,... format as you say and assume I think a
heuristics like you suggested would be better than the
current heuristics of assuming everything is a name, but I
haven't seen what "angry mob" actually has so cannot judge.

What do popular MUAs do to come up with the real-name fields?
Don't they face the same problem, trying to using GECOS?

```

## Petr Baudis, 2005-09-19 16:16

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050919161636.GA18320@pasky.or.cz>
URL: https://gitlist.dev/e/20050919161636.GA18320%40pasky.or.cz
In-Reply-To: <7vll1trqiq.fsf@assigned-by-dhcp.cox.net>

```
Dear diary, on Mon, Sep 19, 2005 at 06:06:21PM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> told me that...
> Petr Baudis <pasky@suse.cz> writes:
> 
> >   Well, I have to say that from the GECOS fields I saw, none use that
> > format, but a lot of them used the realname,phone,something,phone,...
> > format.
> 
> >   Opinions?
> 
> If the real world GECOS were either only plain and
> name,room,blah,... format as you say and assume I think a
> heuristics like you suggested would be better than the
> current heuristics of assuming everything is a name, but I
> haven't seen what "angry mob" actually has so cannot judge.

It uses the name,room,blah,... format.

> What do popular MUAs do to come up with the real-name fields?
> Don't they face the same problem, trying to using GECOS?

mutt:

  { "gecos_mask",       DT_RX,   R_NONE, UL &GecosMask, UL "^[^,]*" },

A regular expression used by mutt to parse the GECOS field of a password
entry when expanding the alias.  By default the regular expression is
set to "^[^,]*" which will return the string up to the first ","
encountered.  If the GECOS field contains a string like "lastname,
firstname" then you should set the gecos_mask=".*".

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```

## A Large Angry SCM, 2005-09-19 16:16

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <432EE46F.9000806@gmail.com>
URL: https://gitlist.dev/e/432EE46F.9000806%40gmail.com
In-Reply-To: <pan.2005.09.19.14.47.51.811409@smurf.noris.de>

```
Matthias Urlichs wrote:
> Hi, A Large Angry SCM wrote:
> 
>>Saying that the user's name is first and a particular punctuation 
>>character SHALL be the standard cut point and everyone not happy with 
>>the results should explicitly set the Git environment variables is the 
>>wrong approach.
> 
> I disagree. Standard add-user tools use the gecos field in one of two ways:

s/two/many/

> - fullname
> - fullname,and,some,other,cruft
- title,name and other stuff
- department, name and other stuff
- other punctuation, etc.

> 
> Sure, many organizations bake their own, but I'd argue that the majority
> doesn't.

The point is we should not be telling them what and how to put stuff in 
the GECOS field.

>>AND/OR to include 
>>the what Git thinks the user's name name might be in the commit message
>>template they're editing (like the file list).
> 
> I think that's a good idea, as long as people are told how to change it
> (i.e., an envvar -- NOT by editing the file).

Yes.

```

## Nikolai Weibull, 2005-09-19 16:32

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050919163219.GA8862@puritan.pnetwork>
URL: https://gitlist.dev/e/20050919163219.GA8862%40puritan.pnetwork
In-Reply-To: <20050919134838.GC2903@pasky.or.cz>

```
Petr Baudis wrote:

>   So my proposal (patch will follow soon) is to cut everything after the
> first , or ; from the GECOS field. These are the usual delimiters used
> in the GECOS field, and hopefully this will prevent polluting the
> realname fields of commit headers with crap and surprising the users.
> In the (I think rather rare) situation of the "Baudis, Petr"-like GECOS
> fields, this will just result in only the surname being in the realname
> field, which seems to be much less harmful and comparably less evil to
> me. 

If we stop using GECOS, then can we please start using $EMAIL (or
perhaps use it regardless of whether we use GECOS or not)?  A lot of
applications seem to look for $EMAIL and I think that it's universal
enough for git to use it as well.  To me it seems that both
GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and
GIT_COMMITTER_EMAIL can use it, as I set $EMAIL as

EMAIL="Nikolai Weibull <something@something.something>"

Perhaps I should provide a patch instead of just putting out requests?,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

```

## Linus Torvalds, 2005-09-19 16:32

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <Pine.LNX.4.58.0509190924280.9106@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0509190924280.9106%40g5.osdl.org
In-Reply-To: <7vll1trqiq.fsf@assigned-by-dhcp.cox.net>

```


On Mon, 19 Sep 2005, Junio C Hamano wrote:
> 
> What do popular MUAs do to come up with the real-name fields?
> Don't they face the same problem, trying to using GECOS?

Since I have my pine installed in git, I could git grep it. It says

    /* full name is all chars up to first ',' (or whole gcos, if no ',') */
    /* replace any & with logname in upper case */

I don't know why the & rule, but there you have it..

The Perl User::pwent module seems to agree, btw (also about '&'):

   "Interpretation of the gecos field varies between systems, but
    traditionally holds 4 comma-separated fields containing the user's
    full name, office location, work phone number, and home phone number.  

    An & in the gecos field should be replaced by the user's properly
    capitalized login name."

I still worry about names of the type "Torvalds, Linus", but maybe that's 
just not an issue.

		Linus

```

## Petr Baudis, 2005-09-19 16:34

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050919163439.GB18320@pasky.or.cz>
URL: https://gitlist.dev/e/20050919163439.GB18320%40pasky.or.cz
In-Reply-To: <432EE46F.9000806@gmail.com>

```
Dear diary, on Mon, Sep 19, 2005 at 06:16:47PM CEST, I got a letter
where A Large Angry SCM <gitzilla@gmail.com> told me that...
> >Sure, many organizations bake their own, but I'd argue that the majority
> >doesn't.
> 
> The point is we should not be telling them what and how to put stuff in 
> the GECOS field.

The point is that our guess should be something which works for the most
people.

> >>AND/OR to include 
> >>the what Git thinks the user's name name might be in the commit message
> >>template they're editing (like the file list).
> >
> >I think that's a good idea, as long as people are told how to change it
> >(i.e., an envvar -- NOT by editing the file).
> 
> Yes.

I'll change cg-commit to always include the name/email fields in its
template. I think it's verbose enough as it is now, though, and I don't
want it to bloat it with more generic help text. I've expanded the
documentation of cg-commit on the GIT_ variables and that ought to be
enough. :-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone.  -- Alan Cox

```

## Junio C Hamano, 2005-09-19 16:49

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <7vd5n5q9xu.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd5n5q9xu.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.58.0509190924280.9106@g5.osdl.org>

```
Linus Torvalds <torvalds@osdl.org> writes:

> The Perl User::pwent module seems to agree, btw (also about '&'):
>
>    "Interpretation of the gecos field varies between systems, but
>     traditionally holds 4 comma-separated fields containing the user's
>     full name, office location, work phone number, and home phone number.  
>
>     An & in the gecos field should be replaced by the user's properly
>     capitalized login name."

I vaguelly recall seeing that & somewhere and wondering what
they do with mcdonalds ;-)

> I still worry about names of the type "Torvalds, Linus", but maybe that's 
> just not an issue.

Does not appear to be.  So I'd vote for us doing the "cut at
first comma, substitute & with toupper(login[0])+login[1..]".

```

## Linus Torvalds, 2005-09-19 16:59

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <Pine.LNX.4.58.0509190957090.9106@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0509190957090.9106%40g5.osdl.org
In-Reply-To: <7vd5n5q9xu.fsf@assigned-by-dhcp.cox.net>

```


On Mon, 19 Sep 2005, Junio C Hamano wrote:
> 
> I vaguelly recall seeing that & somewhere and wondering what
> they do with mcdonalds ;-)

Pine uppercases _all_ of the login field. So mcdonalds would be MCDONALDS. 
Which isn't much better than Mcdonalds, but might explain people out 
there with all-upcase last names.

		Linus

```

## Nikolai Weibull, 2005-09-19 21:21

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050919212113.GB8862@puritan.pnetwork>
URL: https://gitlist.dev/e/20050919212113.GB8862%40puritan.pnetwork
In-Reply-To: <20050919163219.GA8862@puritan.pnetwork>

```
Nikolai Weibull wrote:

> If we stop using GECOS, then can we please start using $EMAIL (or
> perhaps use it regardless of whether we use GECOS or not)?  A lot of
> applications seem to look for $EMAIL and I think that it's universal
> enough for git to use it as well.  To me it seems that both
> GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and
> GIT_COMMITTER_EMAIL can use it, as I set $EMAIL as
> 
> EMAIL="Nikolai Weibull <something@something.something>"
> 
> Perhaps I should provide a patch instead of just putting out requests?,

Perhaps something like the following patch will do?,
        nikolai

---
diff --git a/ident.c b/ident.c
--- a/ident.c
+++ b/ident.c
@@ -127,18 +127,22 @@ char *get_ident(const char *name, const 
 	char date[50];
 	int i;
 
-	if (!name)
-		name = real_name;
-	if (!email)
-		email = real_email;
+	if (!name && !email && getenv("EMAIL")) {
+		i = copy(buffer, sizeof(buffer), 0, getenv("EMAIL"));
+		i = add_raw(buffer, sizeof(buffer), i, " ");
+	} else {
+		if (!name)
+			name = real_name;
+		if (!email)
+			email = real_email;
+		i = copy(buffer, sizeof(buffer), 0, name);
+		i = add_raw(buffer, sizeof(buffer), i, " <");
+		i = copy(buffer, sizeof(buffer), i, email);
+		i = add_raw(buffer, sizeof(buffer), i, "> ");
+	}
 	strcpy(date, real_date);
 	if (date_str)
 		parse_date(date_str, date, sizeof(date));
-
-	i = copy(buffer, sizeof(buffer), 0, name);
-	i = add_raw(buffer, sizeof(buffer), i, " <");
-	i = copy(buffer, sizeof(buffer), i, email);
-	i = add_raw(buffer, sizeof(buffer), i, "> ");
 	i = copy(buffer, sizeof(buffer), i, date);
 	if (i >= sizeof(buffer))
 		die("Impossibly long personal identifier");

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

```

## Junio C Hamano, 2005-09-20 01:53

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <7v8xxsfqrw.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v8xxsfqrw.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050919163219.GA8862@puritan.pnetwork>

```
Nikolai Weibull <mailing-lists.git@rawuncut.elitemail.org> writes:

> If we stop using GECOS, then can we please start using $EMAIL (or
> perhaps use it regardless of whether we use GECOS or not)?  A lot of
> applications seem to look for $EMAIL and I think that it's universal
> enough for git to use it as well.  To me it seems that both
> GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and
> GIT_COMMITTER_EMAIL can use it,...

I am not convinced $EMAIL is used as widely as you claim above
(could you give a list of applications please?), but if it is
that sounds like a sensible idea.

```

## Ryan Anderson, 2005-09-20 04:02

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050920040236.GB6383@mythryan2.michonline.com>
URL: https://gitlist.dev/e/20050920040236.GB6383%40mythryan2.michonline.com
In-Reply-To: <Pine.LNX.4.58.0509190957090.9106@g5.osdl.org>

```
On Mon, Sep 19, 2005 at 09:59:42AM -0700, Linus Torvalds wrote:
> On Mon, 19 Sep 2005, Junio C Hamano wrote:
> > 
> > I vaguelly recall seeing that & somewhere and wondering what
> > they do with mcdonalds ;-)
> 
> Pine uppercases _all_ of the login field. So mcdonalds would be MCDONALDS. 
> Which isn't much better than Mcdonalds, but might explain people out 
> there with all-upcase last names.

I think that's more of an Asian response to the confusion westerners
have with "family name" vs "given name" and "first name" vs "last name".
The simple solution is to convert the "family" name to all upper case and
then whatever order is used is no longer ambiguous (assuming you know
the convention).

That, at least, is my conclusion from seeing Japanese business cards.

I could be totally wrong, of course.

-- 

Ryan Anderson
  sometimes Pug Majere

```

## Linus Torvalds, 2005-09-20 04:13

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <Pine.LNX.4.58.0509192110580.2553@g5.osdl.org>
URL: https://gitlist.dev/e/Pine.LNX.4.58.0509192110580.2553%40g5.osdl.org
In-Reply-To: <20050920040236.GB6383@mythryan2.michonline.com>

```


On Tue, 20 Sep 2005, Ryan Anderson wrote:

> On Mon, Sep 19, 2005 at 09:59:42AM -0700, Linus Torvalds wrote:
>
> > Pine uppercases _all_ of the login field. So mcdonalds would be MCDONALDS. 
> > Which isn't much better than Mcdonalds, but might explain people out 
> > there with all-upcase last names.
> 
> I think that's more of an Asian response to the confusion westerners
> have with "family name" vs "given name" and "first name" vs "last name".

I'd believe you, except I have this clear memory of it being pretty common
in France too.

I remember it vividly from the original extfs author: Remy CARD. And I 
don't think that one was the odd man out.

			Linus

```

## Junio C Hamano, 2005-09-20 06:30

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <7vzmq86ykl.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vzmq86ykl.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <7vd5n5q9xu.fsf@assigned-by-dhcp.cox.net>

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

> Does not appear to be.  So I'd vote for us doing the "cut at
> first comma, substitute & with toupper(login[0])+login[1..]".

I've done this in the proposed updates branch.

```

## Junio C Hamano, 2005-09-20 07:10

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <7v8xxs5i5x.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v8xxs5i5x.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050919212113.GB8862@puritan.pnetwork>

```
Nikolai Weibull <mailing-lists.git@rawuncut.elitemail.org> writes:

> Perhaps something like the following patch will do?,
>         nikolai

Thanks for the patch.  Some nits and requests.

(1) Proper commit log message here, with your Signed-off-by line.

> +	if (!name && !email && getenv("EMAIL")) {
> +		i = copy(buffer, sizeof(buffer), 0, getenv("EMAIL"));
> +		i = add_raw(buffer, sizeof(buffer), i, " ");

(2) Perhaps have `#define IDENT_ENVIRONMENT "EMAIL"' in cache.h
    and use it, like we do for other environment variables.

(3) Probably you need to validate what is in $EMAIL before
    trusting it, so that we can guard ourselves from EMAIL in a
    format that is suitable for other applications but not for
    us?  If you find that the value does not look good, just
    refuse it with an error message to set more specific
    GIT_{AUTHOR,COMMITTER}_* environment variables.

    Unlike GIT_* environment variables, EMAIL is a convention we
    did not invent ourselves.  We cannot expect it to always be
    formatted to our liking, and more importantly, we should not
    demand the user to set it to the way we like -- the other
    application the user originally set EMAIL for might not like
    what we want.

```

## Nikolai Weibull, 2005-09-20 10:31

Subject: Re: What shall we do with the GECOS field again?
Message-ID: <20050920103115.GA8979@puritan.pnetwork>
URL: https://gitlist.dev/e/20050920103115.GA8979%40puritan.pnetwork
In-Reply-To: <7v8xxsfqrw.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano wrote:

> Nikolai Weibull <mailing-lists.git@rawuncut.elitemail.org> writes:

> > If we stop using GECOS, then can we please start using $EMAIL (or
> > perhaps use it regardless of whether we use GECOS or not)?  A lot of
> > applications seem to look for $EMAIL and I think that it's universal
> > enough for git to use it as well.  To me it seems that both
> > GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and
> > GIT_COMMITTER_EMAIL can use it,...

> I am not convinced $EMAIL is used as widely as you claim above (could
> you give a list of applications please?), but if it is that sounds
> like a sensible idea.

I was sadly mistaken.  It doesn't seem to be so well-used after all.
Here's a list of applications that use it:

* mutt (the only one that really counts)
* darcs (which also uses DARCS_EMAIL)
* various debian utilities (who cares)
* Vim's changelog package (which I have written, so that doesn't count)

Quite a sad list, so I suppose that there's really no point in it...,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}

```
