diff options
author | William Hubbs <williamh@gentoo.org> | 2019-02-04 12:48:50 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-04 12:18:13 -0800 |
commit | 39ab4d0951ba64edcfae7809740715991b44fa6d (patch) | |
tree | 262e584b777c84928d7bb6ed6bf7360693eb8612 /builtin | |
parent | Third batch after 2.20 (diff) | |
download | tgif-39ab4d0951ba64edcfae7809740715991b44fa6d.tar.xz |
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')
-rw-r--r-- | builtin/am.c | 1 | ||||
-rw-r--r-- | builtin/commit.c | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/builtin/am.c b/builtin/am.c index 95370313b6..3727d4d267 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1594,6 +1594,7 @@ static void do_commit(const struct am_state *state) } author = fmt_ident(state->author_name, state->author_email, + WANT_AUTHOR_IDENT, state->ignore_date ? NULL : state->author_date, IDENT_STRICT); 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); |