diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-12-06 09:23:37 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-12-06 09:23:37 -0800 |
commit | 6cddb7362ca3c7312b57a4f172bca5c953a45b6c (patch) | |
tree | 62b363b31ccae02533ee81eea365cb975ab39cce /config.c | |
parent | 0186e9ebedfb18ad02fe20af18cc35526760fbad (diff) | |
parent | 5f9674243d0341519e5031681c941b0e1ad7a9e3 (diff) | |
download | git-6cddb7362ca3c7312b57a4f172bca5c953a45b6c.tar.gz |
Merge branch 'hm/config-parse-expiry-date'
"git config --expiry-date gc.reflogexpire" can read "2.weeks" from
the configuration and report it as a timestamp, just like "--int"
would read "1k" and report 1024, to help consumption by scripts.
* hm/config-parse-expiry-date:
config: add --expiry-date
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -990,6 +990,16 @@ int git_config_pathname(const char **dest, const char *var, const char *value) return 0; } +int git_config_expiry_date(timestamp_t *timestamp, const char *var, const char *value) +{ + if (!value) + return config_error_nonbool(var); + if (parse_expiry_date(value, timestamp)) + return error(_("'%s' for '%s' is not a valid timestamp"), + value, var); + return 0; +} + static int git_default_core_config(const char *var, const char *value) { /* This needs a better name */ |