Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2019-02-04 21:48:50 +0300
committerJunio C Hamano <gitster@pobox.com>2019-02-04 23:18:13 +0300
commit39ab4d0951ba64edcfae7809740715991b44fa6d (patch)
tree262e584b777c84928d7bb6ed6bf7360693eb8612 /cache.h
parent16a465bc018d09e9d7bbbdc5f40a7fb99c21f8ef (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 'cache.h')
-rw-r--r--cache.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index 49713cc5a5..bb78eb9a3a 100644
--- a/cache.h
+++ b/cache.h
@@ -1479,10 +1479,19 @@ int date_overflows(timestamp_t date);
#define IDENT_STRICT 1
#define IDENT_NO_DATE 2
#define IDENT_NO_NAME 4
+
+enum want_ident {
+ WANT_BLANK_IDENT,
+ WANT_AUTHOR_IDENT,
+ WANT_COMMITTER_IDENT
+};
+
extern const char *git_author_info(int);
extern const char *git_committer_info(int);
-extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int);
-extern const char *fmt_name(const char *name, const char *email);
+extern const char *fmt_ident(const char *name, const char *email,
+ enum want_ident whose_ident,
+ const char *date_str, int);
+extern const char *fmt_name(enum want_ident);
extern const char *ident_default_name(void);
extern const char *ident_default_email(void);
extern const char *git_editor(void);