Skip to content

Commit c9ccf9d

Browse files
committed
Merge branch 'bc/author-committer-doc'
Clarify documentation on committer/author identities. * bc/author-committer-doc: doc: provide guidance on user.name format docs: expand on possible and recommended user config options doc: move author and committer information to git-commit(1)
2 parents 0d0fa20 + 69e104d commit c9ccf9d

File tree

4 files changed

+69
-27
lines changed

4 files changed

+69
-27
lines changed

Documentation/config/user.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ committer.email::
1313
Also, all of these can be overridden by the `GIT_AUTHOR_NAME`,
1414
`GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`,
1515
`GIT_COMMITTER_EMAIL` and `EMAIL` environment variables.
16-
See linkgit:git-commit-tree[1] for more information.
16+
+
17+
Note that the `name` forms of these variables conventionally refer to
18+
some form of a personal name. See linkgit:git-commit[1] and the
19+
environment variables section of linkgit:git[1] for more information on
20+
these settings and the `credential.username` option if you're looking
21+
for authentication credentials instead.
1722

1823
user.useConfigOnly::
1924
Instruct Git to avoid trying to guess defaults for `user.email`

Documentation/git-commit-tree.txt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ OPTIONS
6969
Do not GPG-sign commit, to countermand a `--gpg-sign` option
7070
given earlier on the command line.
7171

72-
7372
Commit Information
7473
------------------
7574

@@ -79,26 +78,6 @@ A commit encapsulates:
7978
- author name, email and date
8079
- committer name and email and the commit time.
8180

82-
While parent object ids are provided on the command line, author and
83-
committer information is taken from the following environment variables,
84-
if set:
85-
86-
GIT_AUTHOR_NAME
87-
GIT_AUTHOR_EMAIL
88-
GIT_AUTHOR_DATE
89-
GIT_COMMITTER_NAME
90-
GIT_COMMITTER_EMAIL
91-
GIT_COMMITTER_DATE
92-
93-
(nb "<", ">" and "\n"s are stripped)
94-
95-
In case (some of) these environment variables are not set, the information
96-
is taken from the configuration items user.name and user.email, or, if not
97-
present, the environment variable EMAIL, or, if that is not set,
98-
system user name and the hostname used for outgoing mail (taken
99-
from `/etc/mailname` and falling back to the fully qualified hostname when
100-
that file does not exist).
101-
10281
A commit comment is read from stdin. If a changelog
10382
entry is not provided via "<" redirection, 'git commit-tree' will just wait
10483
for one to be entered and terminated with ^D.
@@ -117,6 +96,7 @@ FILES
11796
SEE ALSO
11897
--------
11998
linkgit:git-write-tree[1]
99+
linkgit:git-commit[1]
120100

121101
GIT
122102
---

Documentation/git-commit.txt

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,6 @@ changes to tracked files.
367367
+
368368
For more details, see the 'pathspec' entry in linkgit:gitglossary[7].
369369

370-
:git-commit: 1
371-
include::date-formats.txt[]
372-
373370
EXAMPLES
374371
--------
375372
When recording your own work, the contents of modified files in
@@ -463,6 +460,43 @@ alter the order the changes are committed, because the merge
463460
should be recorded as a single commit. In fact, the command
464461
refuses to run when given pathnames (but see `-i` option).
465462

463+
COMMIT INFORMATION
464+
------------------
465+
466+
Author and committer information is taken from the following environment
467+
variables, if set:
468+
469+
GIT_AUTHOR_NAME
470+
GIT_AUTHOR_EMAIL
471+
GIT_AUTHOR_DATE
472+
GIT_COMMITTER_NAME
473+
GIT_COMMITTER_EMAIL
474+
GIT_COMMITTER_DATE
475+
476+
(nb "<", ">" and "\n"s are stripped)
477+
478+
The author and committer names are by convention some form of a personal name
479+
(that is, the name by which other humans refer to you), although Git does not
480+
enforce or require any particular form. Arbitrary Unicode may be used, subject
481+
to the constraints listed above. This name has no effect on authentication; for
482+
that, see the `credential.username` variable in linkgit:git-config[1].
483+
484+
In case (some of) these environment variables are not set, the information
485+
is taken from the configuration items `user.name` and `user.email`, or, if not
486+
present, the environment variable EMAIL, or, if that is not set,
487+
system user name and the hostname used for outgoing mail (taken
488+
from `/etc/mailname` and falling back to the fully qualified hostname when
489+
that file does not exist).
490+
491+
The `author.name` and `committer.name` and their corresponding email options
492+
override `user.name` and `user.email` if set and are overridden themselves by
493+
the environment variables.
494+
495+
The typical usage is to set just the `user.name` and `user.email` variables;
496+
the other options are provided for more complex use cases.
497+
498+
:git-commit: 1
499+
include::date-formats.txt[]
466500

467501
DISCUSSION
468502
----------

Documentation/git.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,36 @@ double-quotes and respecting backslash escapes. E.g., the value
482482
Git Commits
483483
~~~~~~~~~~~
484484
`GIT_AUTHOR_NAME`::
485+
The human-readable name used in the author identity when creating commit or
486+
tag objects, or when writing reflogs. Overrides the `user.name` and
487+
`author.name` configuration settings.
488+
485489
`GIT_AUTHOR_EMAIL`::
490+
The email address used in the author identity when creating commit or
491+
tag objects, or when writing reflogs. Overrides the `user.email` and
492+
`author.email` configuration settings.
493+
486494
`GIT_AUTHOR_DATE`::
495+
The date used for the author identity when creating commit or tag objects, or
496+
when writing reflogs. See linkgit:git-commit[1] for valid formats.
497+
487498
`GIT_COMMITTER_NAME`::
499+
The human-readable name used in the committer identity when creating commit or
500+
tag objects, or when writing reflogs. Overrides the `user.name` and
501+
`committer.name` configuration settings.
502+
488503
`GIT_COMMITTER_EMAIL`::
504+
The email address used in the author identity when creating commit or
505+
tag objects, or when writing reflogs. Overrides the `user.email` and
506+
`committer.email` configuration settings.
507+
489508
`GIT_COMMITTER_DATE`::
490-
'EMAIL'::
491-
see linkgit:git-commit-tree[1]
509+
The date used for the committer identity when creating commit or tag objects, or
510+
when writing reflogs. See linkgit:git-commit[1] for valid formats.
511+
512+
`EMAIL`::
513+
The email address used in the author and committer identities if no other
514+
relevant environment variable or configuration setting has been set.
492515

493516
Git Diffs
494517
~~~~~~~~~

0 commit comments

Comments
 (0)