From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Simpkins Subject: [PATCH] prune: honor --expire=never Date: Fri, 26 Feb 2010 13:59:16 -0800 Message-ID: <20100226215916.GF5116@facebook.com> Reply-To: Adam Simpkins Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: , X-From: git-owner@vger.kernel.org Sat Feb 27 00:42:46 2010 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nl9pS-0005al-24 for gcvg-git-2@lo.gmane.org; Sat, 27 Feb 2010 00:42:42 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966588Ab0BZXmg (ORCPT ); Fri, 26 Feb 2010 18:42:36 -0500 Received: from mailout-snc1.facebook.com ([69.63.179.25]:44171 "EHLO mailout-snc1.facebook.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966562Ab0BZXmf (ORCPT ); Fri, 26 Feb 2010 18:42:35 -0500 X-Greylist: delayed 5798 seconds by postgrey-1.27 at vger.kernel.org; Fri, 26 Feb 2010 18:42:34 EST Received: from mail.thefacebook.com ([192.168.18.104]) by pp01.snc1.tfbnw.net (8.14.3/8.14.3) with ESMTP id o1QLx3wh009308 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Fri, 26 Feb 2010 13:59:03 -0800 Received: from simpkins (192.168.18.252) by mail.TheFacebook.com (192.168.18.104) with Microsoft SMTP Server (TLS) id 8.2.213.0; Fri, 26 Feb 2010 13:59:17 -0800 Received: from simpkins by simpkins with local (Exim 4.69) (envelope-from ) id 1Nl8DM-0005ul-UJ; Fri, 26 Feb 2010 13:59:16 -0800 Mail-Followup-To: git@vger.kernel.org, gitster@pobox.com Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-02-26_06:2010-02-06,2010-02-26,2010-02-25 signatures=0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Previously, prune treated an expiration time of 0 to mean that no expire argument was supplied, and everything should be pruned. As a result, "prune --expire=never" would prune all unreachable objects, regardless of their timestamps. prune can be called with --expire=never automatically by gc, when the gc.pruneExpire configuration is set to "never". Signed-off-by: Adam Simpkins --- builtin-prune.c | 7 +++++-- t/t5304-prune.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/builtin-prune.c b/builtin-prune.c index 4675f60..ce43271 100644 --- a/builtin-prune.c +++ b/builtin-prune.c @@ -7,6 +7,8 @@ #include "parse-options.h" #include "dir.h" +#define ALWAYS_EXPIRE ((unsigned int)-1) + static const char * const prune_usage[] = { "git prune [-n] [-v] [--expire