[PATCH 2/2] git-gc: skip stashes when expiring reflogs
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jun 11, 2008, 21:29 UTC
- Message-ID
- <5vuJsx6Kidj7e8EABk_d63dLAYuWF-S880RrJKu83cJo_ejU3VN-VA@cipher.nrlssc.navy.mil>
- In-Reply-To
- <OLvkESB0JjBNs9kF8Q2M5UFNBJqq4FjbgGeQVyWstGwcXqCOq16_oomM0y-utOBbV7BnndyrICE@cipher.nrlssc.navy.mil>
The stash makes use of git's reflog mechanism, but it is not a reflog in the traditional sense. Each entry is a state that the user explicitly requested git to remember. The stash is generally short-lived, but the user probably expects that a stash will continue to exist until it is explicitly deleted. So we should not expire stash entries.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> --- builtin-gc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-gc.c b/builtin-gc.c index f5625bb..5cb74ec 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -30,7 +30,7 @@ static char *prune_expire = "2.weeks.ago"; #define MAX_ADD 10 static const char *argv_pack_refs[] = {"pack-refs", "--all", "--prune", NULL}; -static const char *argv_reflog[] = {"reflog", "expire", "--all", NULL}; +static const char *argv_reflog[] = {"reflog", "expire", "--all", "--exclude=refs/stash", NULL}; static const char *argv_repack[MAX_ADD] = {"repack", "-d", "-l", NULL}; static const char *argv_prune[] = {"prune", "--expire", NULL, NULL}; static const char *argv_rerere[] = {"rerere", "gc", NULL};
-- 1.5.5.3