mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
config: add --expiry-date
Add --expiry-date as a data-type for config files when 'git config --get' is used. This will return any relative or fixed dates from config files as timestamps. This is useful for scripts (e.g. gc.reflogexpire) that work with timestamps so that '2.weeks' can be converted to a format acceptable by those scripts/functions. Following the convention of git_config_pathname(), move the helper function required for this feature from builtin/reflog.c to builtin/config.c where other similar functions exist (e.g. for --bool or --path), and match the order of parameters with other functions (i.e. output pointer as first parameter). Signed-off-by: Haaris Mehmood <hsed@unimetic.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
89ea799ffc
commit
5f9674243d
1
config.h
1
config.h
@@ -58,6 +58,7 @@ extern int git_config_bool_or_int(const char *, const char *, int *);
|
||||
extern int git_config_bool(const char *, const char *);
|
||||
extern int git_config_string(const char **, const char *, const char *);
|
||||
extern int git_config_pathname(const char **, const char *, const char *);
|
||||
extern int git_config_expiry_date(timestamp_t *, const char *, const char *);
|
||||
extern int git_config_set_in_file_gently(const char *, const char *, const char *);
|
||||
extern void git_config_set_in_file(const char *, const char *, const char *);
|
||||
extern int git_config_set_gently(const char *, const char *);
|
||||
|
||||
Reference in New Issue
Block a user