From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Subject: [PATCH v3 24/25] prune: strategies for linked checkouts Date: Tue, 18 Feb 2014 20:40:13 +0700 Message-ID: <1392730814-19656-25-git-send-email-pclouds@gmail.com> References: <1392730814-19656-1-git-send-email-pclouds@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Feb 18 14:43:46 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WFkxb-0002Ii-7v for gcvg-git-2@plane.gmane.org; Tue, 18 Feb 2014 14:43:43 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755787AbaBRNnA convert rfc822-to-quoted-printable (ORCPT ); Tue, 18 Feb 2014 08:43:00 -0500 Received: from mail-pb0-f54.google.com ([209.85.160.54]:51500 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755393AbaBRNmi (ORCPT ); Tue, 18 Feb 2014 08:42:38 -0500 Received: by mail-pb0-f54.google.com with SMTP id uo5so16792772pbc.13 for ; Tue, 18 Feb 2014 05:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=HwtAEuZpDMDrbg8F4bMHcxsD8xwivMtvcrv1k7F4if0=; b=DaVohXY//QZlMlm2KIpEFTL7JdBBHuKgkqbOc/QQKwsTh4LlbyRMLQkCUb/EDy0lax LhnUbUoKHbo02+X4bdTpp/JU/OlsTSCurNANpZYhfqQeQ2tvjncJAnOvCk1OEk2Vrz98 S27YECl0IWfyXG2D/JewTClMwhn9tNnZkqnVy7Cfi6yzrcLQ9Ub158kbflEtiuOq8qTs Mq0/YJ5Ae+uJun5edpxh3Qo0cS9Y+SNOXOfxXAZbu1HbLufo3EBYBPDLfPSIm9UTwJKe Aaod6mMEIlcysBjZDC/ZEHi7HJw925AZb/Lk3+h+ZCjCg/u5ZbQW2Qqnd2lEBy46rlmF B1zg== X-Received: by 10.66.249.202 with SMTP id yw10mr32368672pac.111.1392730957504; Tue, 18 Feb 2014 05:42:37 -0800 (PST) Received: from lanh ([115.73.228.211]) by mx.google.com with ESMTPSA id cz3sm56122947pbc.9.2014.02.18.05.42.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 05:42:36 -0800 (PST) Received: by lanh (sSMTP sendmail emulation); Tue, 18 Feb 2014 20:42:50 +0700 X-Mailer: git-send-email 1.8.5.2.240.g8478abd In-Reply-To: <1392730814-19656-1-git-send-email-pclouds@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: alias REPO=3D$GIT_COMMON_DIR/repos/ - linked checkouts are supposed to update mtime of $REPO/gitdir - linked checkouts are supposed to keep its location in $REPO/gitdir u= p to date - "git checkout --to" is supposed to create $REPO/locked if the new repo is on a different partition than the shared one. - "git checkout --to" is supposed to make hardlink named $REPO/link pointing to the .git file The pruning rules are: - if $REPO/locked exists, repos/ is not supposed to be pruned. - if $REPO/locked exists and $REPO/gitdir's mtimer is older than a really long limit, warn about old unused repo. - if $REPO/link exists and its link count is greated than 1, the repo is kept. - if $REPO/gitdir's mtime is older than a limit, and it points to nowhere, repos/ is to be pruned. Signed-off-by: Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy --- Documentation/git-prune.txt | 3 ++ Documentation/gitrepository-layout.txt | 19 +++++++++ builtin/checkout.c | 36 +++++++++++++++- builtin/prune.c | 75 ++++++++++++++++++++++++++= ++++++++ setup.c | 13 ++++++ 5 files changed, 145 insertions(+), 1 deletion(-) diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt index 058ac0d..7babf11 100644 --- a/Documentation/git-prune.txt +++ b/Documentation/git-prune.txt @@ -48,6 +48,9 @@ OPTIONS --expire