ident: add user.useConfigOnly boolean for when ident shouldn't be guessed
commit4d5c2956969a6690db2bbb2f3ff40459c09d7646
authorDan Aloni <alonid@gmail.com>
Sat, 6 Feb 2016 06:23:36 +0000 (6 08:23 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Feb 2016 19:06:28 +0000 (8 11:06 -0800)
tree947e1240cdd91641779bd739abd626954c11f4fa
parent59f929596b611d88270ac0fd3ea132b32d66d460
ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

It used to be that:

   git config --global user.email "(none)"

was a viable way for people to force themselves to set user.email in
each repository.  This was helpful for people with more than one
email address, targeting different email addresses for different
clones, as it barred git from creating a commit unless the user.email
config was set in the per-repo config to the correct email address.

A recent change, 19ce497c (ident: keep a flag for bogus
default_email, 2015-12-10), however, declared that an explicitly
configured user.email is not bogus, no matter what its value is, so
this hack no longer works.

Provide the same functionality by adding a new configuration
variable user.useConfigOnly; when this variable is set, the
user must explicitly set user.email configuration.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Dan Aloni <alonid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
ident.c
t/t7517-per-repo-email.sh [new file with mode: 0755]