ident: keep separate "explicit" flags for author and committer
commitd6991ceedc6a6fbcc2184f8328eb1b4c88b55267
authorJeff King <peff@peff.net>
Thu, 15 Nov 2012 00:34:13 +0000 (14 16:34 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Nov 2012 01:47:24 +0000 (15 17:47 -0800)
treebdf8bdcc36cf08cc1b3b3550deea078aa83d381b
parent452802309c422ce71f1c038357ee0775af5fb3eb
ident: keep separate "explicit" flags for author and committer

We keep track of whether the user ident was given to us
explicitly, or if we guessed at it from system parameters
like username and hostname. However, we kept only a single
variable. This covers the common cases (because the author
and committer will usually come from the same explicit
source), but can miss two cases:

  1. GIT_COMMITTER_* is set explicitly, but we fallback for
     GIT_AUTHOR. We claim the ident is explicit, even though
     the author is not.

  2. GIT_AUTHOR_* is set and we ask for author ident, but
     not committer ident. We will claim the ident is
     implicit, even though it is explicit.

This patch uses two variables instead of one, updates both
when we set the "fallback" values, and updates them
individually when we read from the environment.

Rather than keep user_ident_sufficiently_given as a
compatibility wrapper, we update the only two callers to
check the committer_ident, which matches their intent and
what was happening already.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
cache.h
ident.c