[PATCH] Make default expiration period of reflog used for stash infinite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This makes the default expiration period for the reflog that implements
stash infinite.

The original behaviour to autoexpire old stashes can be restored by using
the gc.refs/stash.{reflogexpire,reflogexpireunreachable} configration
variables introduced by the previous commit.

Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 > [Stalled/Needs more work]
 >
 > * jc/reflog-expire (Sun Jun 15 23:48:46 2008 -0700) 1 commit
 >  - Per-ref reflog expiry configuration
 >
 > Perhaps a good foundation for optionally unexpirable stash.  As 1.6.0 will
 > be a good time to make backward incompatible changes, we might make expiry
 > period of stash 'never' in new repositories.  Needs a concensus.

 builtin-reflog.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/builtin-reflog.c b/builtin-reflog.c
index 0711728..125d455 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -441,6 +441,17 @@ static void set_reflog_expiry_param(struct cmd_reflog_expire_cb *cb, int slot, c
 		}
 	}
 
+	/*
+	 * If unconfigured, make stash never expire
+	 */
+	if (!strcmp(ref, "refs/stash")) {
+		if (!(slot & EXPIRE_TOTAL))
+			cb->expire_total = 0;
+		if (!(slot & EXPIRE_UNREACH))
+			cb->expire_unreachable = 0;
+		return;
+	}
+
 	/* Nothing matched -- use the default value */
 	if (!(slot & EXPIRE_TOTAL))
 		cb->expire_total = default_reflog_expire;
-- 
1.5.6.1.102.g8e69d

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux