From 4aec56d12ba66a321ce8a6db2ab60f81be5ccfc5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 27 Dec 2006 01:47:57 -0800 Subject: git-reflog: gc.* configuration and documentation. Signed-off-by: Junio C Hamano --- builtin-reflog.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'builtin-reflog.c') diff --git a/builtin-reflog.c b/builtin-reflog.c index de31967b99..d3f2f50d2b 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -5,6 +5,9 @@ #include "dir.h" #include "tree-walk.h" +static unsigned long default_reflog_expire; +static unsigned long default_reflog_expire_unreachable; + struct expire_reflog_cb { FILE *newlog; const char *ref; @@ -150,6 +153,17 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused, return status; } +static int reflog_expire_config(const char *var, const char *value) +{ + if (!strcmp(var, "gc.reflogexpire")) + default_reflog_expire = approxidate(value); + else if (!strcmp(var, "gc.reflogexpireunreachable")) + default_reflog_expire_unreachable = approxidate(value); + else + return git_default_config(var, value); + return 0; +} + static const char reflog_expire_usage[] = "git-reflog expire [--dry-run] [--expire=