summaryrefslogtreecommitdiff
path: root/merge-file.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2011-10-06 17:17:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-06 18:16:16 (GMT)
commitd855e4d35de214e651a62909de96d54915273665 (patch)
treead1340b623e49fa1efa0cd9eda33dc9d9938540b /merge-file.c
parent8a55caa8a3d9169ba14861b8917e739a50a322fa (diff)
downloadgit-d855e4d35de214e651a62909de96d54915273665.zip
git-d855e4d35de214e651a62909de96d54915273665.tar.gz
git-d855e4d35de214e651a62909de96d54915273665.tar.bz2
ident: do not retrieve default ident when unnecessary
Avoid a getpwuid() call (which contacts the network if the password database is not local), read of /etc/mailname, gethostname() call, and reverse DNS lookup if the user has already chosen a name and email through configuration, the environment, or the command line. This should slightly speed up commands like "git commit". More importantly, it improves error reporting when computation of the default ident string does not go smoothly. For example, after detecting a problem (e.g., "warning: cannot open /etc/mailname: Permission denied") in retrieving the default committer identity: touch /etc/mailname; # as root chmod -r /etc/mailname; # as root git commit -m 'test commit' you can squelch the warning while waiting for your sysadmin to fix the permissions problem. echo '[user] email = me@example.com' >>~/.gitconfig Inspired-by: Johannes Sixt <j6t@kdgb.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-file.c')
0 files changed, 0 insertions, 0 deletions