path: root/config.c
diff options
authorWilliam Hubbs <>2019-02-04 18:48:50 (GMT)
committerJunio C Hamano <>2019-02-04 20:18:13 (GMT)
commit39ab4d0951ba64edcfae7809740715991b44fa6d (patch)
tree262e584b777c84928d7bb6ed6bf7360693eb8612 /config.c
parent16a465bc018d09e9d7bbbdc5f40a7fb99c21f8ef (diff)
config: allow giving separate author and committer idents
The,, and settings are analogous to the GIT_AUTHOR_* and GIT_COMMITTER_* environment variables, but for the git config system. This allows them to be set separately for each repository. Git supports setting different authorship and committer information with environment variables. However, environment variables are set in the shell, so if different authorship and committer information is needed for different repositories an external tool is required. This adds support to git config for,, and settings so this information can be set per repository. Also, it generalizes the fmt_ident function so it can handle author vs committer identification. Signed-off-by: William Hubbs <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'config.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/config.c b/config.c
index ff521eb..fd36db7 100644
--- a/config.c
+++ b/config.c
@@ -1445,7 +1445,9 @@ int git_default_config(const char *var, const char *value, void *cb)
if (starts_with(var, "core."))
return git_default_core_config(var, value, cb);
- if (starts_with(var, "user."))
+ if (starts_with(var, "user.") ||
+ starts_with(var, "author.") ||
+ starts_with(var, "committer."))
return git_ident_config(var, value, cb);
if (starts_with(var, "i18n."))