git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-commit-tree(1): correct description of defaults
@ 2013-01-10 12:29 Peter Eisentraut
  2013-01-10 18:33 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Eisentraut @ 2013-01-10 12:29 UTC (permalink / raw)
  To: git, gitster

The old phrasing indicated that the EMAIL environment variable takes
precedence over the user.email configuration setting, but it is the
other way around.

Signed-off-by: Peter Eisentraut <peter@eisentraut.org>
---
 Documentation/git-commit-tree.txt |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index 6d5a04c..a221169 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -72,13 +72,13 @@ if set:
 	GIT_COMMITTER_NAME
 	GIT_COMMITTER_EMAIL
 	GIT_COMMITTER_DATE
-	EMAIL
 
 (nb "<", ">" and "\n"s are stripped)
 
 In case (some of) these environment variables are not set, the information
 is taken from the configuration items user.name and user.email, or, if not
-present, system user name and the hostname used for outgoing mail (taken
+present, the environment variable EMAIL, or, if that is not set,
+system user name and the hostname used for outgoing mail (taken
 from `/etc/mailname` and falling back to the fully qualified hostname when
 that file does not exist).
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] git-commit-tree(1): correct description of defaults
  2013-01-10 12:29 [PATCH] git-commit-tree(1): correct description of defaults Peter Eisentraut
@ 2013-01-10 18:33 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2013-01-10 18:33 UTC (permalink / raw)
  To: Peter Eisentraut; +Cc: git

Peter Eisentraut <peter@eisentraut.org> writes:

> The old phrasing indicated that the EMAIL environment variable takes
> precedence over the user.email configuration setting, but it is the
> other way around.
>
> Signed-off-by: Peter Eisentraut <peter@eisentraut.org>
> ---

It could be argued that the observed behaviour is a bug, by the way.

If we followed the normal "command line options trump environment
variables that in turn trump config variables that in turn trump
whatever the default values we compute using cues from the system"
precedence order, EMAIL ought to come between the more specific
GIT_{AUTHOR,COMMITTER}_EMAIL environment variables and the
user.email configuration variable.

But reading the value of EMAIL can also be seen as part of the
"using cues from the system" (it often is set in equivalents of
"$HOME/.profile" by equivalents of "adduser") step, and the original
motivation to add user.email indeed was to allow users to override
EMAIL (or the name we grab from the system) without having to set
the GIT_COMMITTER_EMAIL environment variable.

So the current behaviour is correct, and the patch is a good
(belated ;-) update to the documentation.

Will apply.  Thanks.

>  Documentation/git-commit-tree.txt |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
> index 6d5a04c..a221169 100644
> --- a/Documentation/git-commit-tree.txt
> +++ b/Documentation/git-commit-tree.txt
> @@ -72,13 +72,13 @@ if set:
>  	GIT_COMMITTER_NAME
>  	GIT_COMMITTER_EMAIL
>  	GIT_COMMITTER_DATE
> -	EMAIL
>  
>  (nb "<", ">" and "\n"s are stripped)
>  
>  In case (some of) these environment variables are not set, the information
>  is taken from the configuration items user.name and user.email, or, if not
> -present, system user name and the hostname used for outgoing mail (taken
> +present, the environment variable EMAIL, or, if that is not set,
> +system user name and the hostname used for outgoing mail (taken
>  from `/etc/mailname` and falling back to the fully qualified hostname when
>  that file does not exist).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-10 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10 12:29 [PATCH] git-commit-tree(1): correct description of defaults Peter Eisentraut
2013-01-10 18:33 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).