Can't figure out some sense from the git-commit-tree man page
Hi,
The git-commit-tree man page reads:
A commit encapsulates:
· all parent object ids
· author name, email and date
· committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)
The "If not provided" part doesn't make sense. If you're not setting the author and committer in your config or environment, how are you supposed to provide it ?
Naively, I tried sending a "git-cat-file commit" looking text to stdin, but it just ended up in the changelog, which was actually no surprise.
Mike
Quoted 15 lines · Mike Hommey
Hi,
The git-commit-tree man page reads:
A commit encapsulates:· all parent object ids
· author name, email and date
· committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)
Quoted 3 lines
The "If not provided" part doesn't make sense. If you're not setting the author and committer in your config or environment, how are you supposed to provide it ?
Makes sense to me. I interpreted it as:
If not provided (by one of the ways I'm about to mention), the default is ... This default can be overridden by ...
I can understand how it might be read differently, though. Assuming my reading is correct, might something along these lines be clearer:
To find author and committer info, "git-commit-tree" first looks at these environment variables:
...
If they are not set, it tries the keys user.name and user.email from the .git/config file. Finally, it falls back to using your name, hostname, and domain.
Even clearer, though this might be a bit extreme, would be to not mention .git/config and say it reads the global or repository-specific keys using git-config.
Signature · 4 lines
"I like talking to Rabbit. He talks about sensible things. He doesn't use long, difficult words, like Owl. He uses short, easy words, like 'What about lunch?' and 'Help yourself, Pooh.' I suppose, really, I ought to go and see Rabbit." A. A. Milne, 'The House at Pooh Corner'
Hi,
Quoted 7 lines · Mike Hommey
? committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)The "If not provided" part doesn't make sense.
It does, if you know how to specify the committer info. Which the man page specifies how to provide:
This can be overridden by either .git/config file, or using the following environment variables.
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
EMAIL
Hth,
Dscho
Quoted 18 lines · Johannes Schindelin
Hi,
Quoted 7 lines · Mike Hommey
? committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)The "If not provided" part doesn't make sense.
It does, if you know how to specify the committer info. Which the man page specifies how to provide:
This can be overridden by either
.git/configfile, or using the following environment variables.
Quoted 7 lines
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
This is exactly where the man page doesn't make sense to me. It tells you that if you don't provide committer name, etc. it uses your name, hostname, etc., and you can override this with .git/config or the environment variable you listed.
So where were you supposed to provide these informations in the first place ?
Mike
Hi,
Quoted 26 lines · Mike Hommey
Quoted 17 lines · Johannes Schindelin
Quoted 7 lines · Mike Hommey
? committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)The "If not provided" part doesn't make sense.
It does, if you know how to specify the committer info. Which the man page specifies how to provide:
This can be overridden by either
.git/configfile, or using the following environment variables.Quoted 7 lines
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
Quoted 7 lines
This is exactly where the man page doesn't make sense to me. It tells you that if you don't provide committer name, etc. it uses your name, hostname, etc., and you can override this with .git/config or the environment variable you listed.
So where were you supposed to provide these informations in the first place ?
In /etc/passwd. Like on every Unix system. (Oh yeah, there is NIS and other things, but in effect it is the same system.)
Ciao,
Dscho
[Cc: Mike Hommey <[email protected]>, [email protected]]
Quoted 26 lines · Mike Hommey
Quoted 17 lines · Johannes Schindelin
Quoted 7 lines · Mike Hommey
? committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)The "If not provided" part doesn't make sense.
It does, if you know how to specify the committer info. Which the man page specifies how to provide:
This can be overridden by either
.git/configfile, or using the following environment variables.Quoted 7 lines
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
Quoted 7 lines
This is exactly where the man page doesn't make sense to me. It tells you that if you don't provide committer name, etc. it uses your name, hostname, etc., and you can override this with .git/config or the environment variable you listed.
So where were you supposed to provide these informations in the first place ?
Where you are supposed to provide this information? In .git/config (per repository) or in ~/.gitconfig (per user), in the form:
[user]
name = Mike Hommey
email = [email protected]
"If not provided" means that git gets your user name from system, from the GECOS files in /etc/passwd, and composes your email address from your user id (account name), and from the hostname of your machine (or "(localhost)"). This is last resort fallback, so you better provide user and email yourself.
Signature · 3 lines
Jakub Narebski Warsaw, Poland ShadeHawk on #git
Quoted 10 lines · Johannes Schindelin
Hi,
Quoted 6 lines · Mike Hommey
? committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)
Quoted 5 lines
Quoted 1 line
The "If not provided" part doesn't make sense.
It does, if you know how to specify the committer info.
Which the man page specifies how to provide:
At least on a first reading all of the following appears to fall under the "if not provided" case. I know what you mean, but the language here is misleading. One simple fix would be just to delete the words "If not provided", or maybe replace them by "By default, ...".
--b.
Quoted 11 lines
This can be overridden by either
.git/configfile, or using the following environment variables.
GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
Quoted 13 lines · J. Bruce Fields
Quoted 12 lines · Johannes Schindelin
Hi,
Quoted 7 lines · Mike Hommey
? committer name and email and the commit time.
If not provided, "git-commit-tree" uses your name, hostname and domain to provide author and committer info. This can be overridden by either .git/config file, or using the following environment variables. (...)The "If not provided" part doesn't make sense.
Quoted 8 lines
Quoted 3 lines
It does, if you know how to specify the committer info.
Which the man page specifies how to provide:
At least on a first reading all of the following appears to fall under the "if not provided" case. I know what you mean, but the language here is misleading. One simple fix would be just to delete the words "If not provided", or maybe replace them by "By default, ...".
I think it would be better to put the fact that "If not provided..." *after* telling that you can provide author, committer, etc. by setting environment or editing the conf.
Mike
Quoted 3 lines · Mike Hommey
I think it would be better to put the fact that "If not provided..." *after* telling that you can provide author, committer, etc. by setting environment or editing the conf.
Yup, probably. Patch?
--b.
PATCH 1/1 Clarify commit-tree documentation
As per http://marc.info/?l=git&m=118737219702802&w=2 , clarify git-commit-tree documentation.
--- Documentation/git-commit-tree.txt | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)
Documentation/git-commit-tree.txt +6 -9
@@ -51,9 +51,9 @@ A commit encapsulates: - author name, email and date - committer name and email and the commit time. -If not provided, "git-commit-tree" uses your name, hostname and domain to -provide author and committer info. This can be overridden by -either `.git/config` file, or using the following environment variables. +While parent object ids are provided on the command line, author and +commiter information is taken from the following environment variables, +if set: GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
@@ -65,12 +65,9 @@ either `.git/config` file, or using the following environment variables. (nb "<", ">" and "\n"s are stripped) -In `.git/config` file, the following items are used for GIT_AUTHOR_NAME and -GIT_AUTHOR_EMAIL: - - [user] - name = "Your Name" - email = "[email protected]" +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 fully qualified hostname. A commit comment is read from stdin. If a changelog entry is not provided via "<" redirection, "git-commit-tree" will just wait
Signature · 1 line
1.5.3.rc4
Re: [PATCH] Clarify commit-tree documentation
Sounds good. Thanks.