]> git.ipfire.org Git - thirdparty/git.git/commit - config.c
config: add --expiry-date
authorHaaris Mehmood <hsed@unimetic.com>
Sat, 18 Nov 2017 02:27:27 +0000 (02:27 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 18 Nov 2017 03:31:29 +0000 (12:31 +0900)
commit5f9674243d0341519e5031681c941b0e1ad7a9e3
tree26e797cc693541bcd3eaaa83c610894bb2982ae5
parent89ea799ffcc5c8a0547d3c9075eb979256ee95b8
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>
Documentation/git-config.txt
builtin/config.c
builtin/reflog.c
config.c
config.h
t/helper/test-date.c
t/t1300-repo-config.sh