diff options
author | William Hubbs <williamh@gentoo.org> | 2019-02-04 21:48:50 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-04 23:18:13 +0300 |
commit | 39ab4d0951ba64edcfae7809740715991b44fa6d (patch) | |
tree | 262e584b777c84928d7bb6ed6bf7360693eb8612 /builtin/commit.c | |
parent | 16a465bc018d09e9d7bbbdc5f40a7fb99c21f8ef (diff) |
config: allow giving separate author and committer idents
The author.email, author.name, committer.email and committer.name
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 author.email, author.name,
committer.email and committer.name 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 <williamh@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 004b816635..f96b90daeb 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -607,7 +607,8 @@ static void determine_author_info(struct strbuf *author_ident) set_ident_var(&date, strbuf_detach(&date_buf, NULL)); } - strbuf_addstr(author_ident, fmt_ident(name, email, date, IDENT_STRICT)); + strbuf_addstr(author_ident, fmt_ident(name, email, WANT_AUTHOR_IDENT, date, + IDENT_STRICT)); assert_split_ident(&author, author_ident); export_one("GIT_AUTHOR_NAME", author.name_begin, author.name_end, 0); export_one("GIT_AUTHOR_EMAIL", author.mail_begin, author.mail_end, 0); |