summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-02-25 23:16:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-28 23:03:46 (GMT)
commitfd5a58477c62ddb6ec16cf7b5b2da7597f0fa398 (patch)
treea51b098ad598800dd438e521ee1a8b7eb832a220 /cache.h
parent5ef264dbdbc48b44ad5fc37e7542f3dc70e3e8c5 (diff)
downloadgit-fd5a58477c62ddb6ec16cf7b5b2da7597f0fa398.zip
git-fd5a58477c62ddb6ec16cf7b5b2da7597f0fa398.tar.gz
git-fd5a58477c62ddb6ec16cf7b5b2da7597f0fa398.tar.bz2
ident: add the ability to provide a "fallback identity"
In 3bc2111fc2e9 (stash: tolerate missing user identity, 2018-11-18), `git stash` learned to provide a fallback identity for the case that no proper name/email was given (and `git stash` does not really care about a correct identity anyway, but it does want to create a commit object). In preparation for the same functionality in the upcoming built-in version of `git stash`, let's offer the same functionality as an API function. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> [tg: add docs; make it a bug to call the function before other functions in the ident API] Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 7b6b89f..611e554 100644
--- a/cache.h
+++ b/cache.h
@@ -1491,6 +1491,11 @@ extern const char *git_sequence_editor(void);
extern const char *git_pager(int stdout_is_tty);
extern int is_terminal_dumb(void);
extern int git_ident_config(const char *, const char *, void *);
+/*
+ * Prepare an ident to fall back on if the user didn't configure it.
+ * Must be called before any other function from the ident API.
+ */
+void prepare_fallback_ident(const char *name, const char *email);
extern void reset_ident_date(void);
struct ident_split {