On Mon, 6 Feb 2006, Junio C Hamano wrote:
It depends on what you expect, but it meets _my_ expectation:
$ GIT_AUTHOR_NAME='' git-commit-tree $(git-write-tree) </dev/null
Committing initial tree a2b59c3848164a2c9c3c75fbaadccaed9485da92
ef90563fa278735af367e7606ea7eb2559121ca7
$ git-cat-file commit ef90563fa278735af367e7606ea7eb2559121ca7
tree a2b59c3848164a2c9c3c75fbaadccaed9485da92
author [off-list ref] 1139281078 -0800
committer Junio C Hamano [off-list ref] 1139281078 -0800
That is, the user said GIT_AUTHOR_NAME is empty, so he gets a
commit with an empty author name.
Yes. That said, we should probably disallow that in git-commit-tree (and
let the user fix it up some way).
get_ident() in ident.c does this. getenv("GIT_AUTHOR_NAME") and
friends are passed to it, and git_default_* are takenfrom gecos.
It might match some peoples' expectation (but not mine) if we
did this instead.
No, don't use the default name.
An empty GIT_AUTHOR_NAME should _not_ mean that we use the default name
(which is usually the committer), because rather than meaning "default",
it most likely means "buggy import script".
I'd rather have an email import of mine say that it cannot commit, than
have it put "Linus Torvalds" in the author line (and some random email).
Linus