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 v4 24/27] prune: strategies for linked checkouts Date: Sat, 1 Mar 2014 19:13:00 +0700 Message-ID: <1393675983-3232-25-git-send-email-pclouds@gmail.com> References: <1392730814-19656-1-git-send-email-pclouds@gmail.com> <1393675983-3232-1-git-send-email-pclouds@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Junio C Hamano , =?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 Sat Mar 01 13:23:28 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 1WJiwx-0002kU-Gg for gcvg-git-2@plane.gmane.org; Sat, 01 Mar 2014 13:23:27 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753036AbaCAMXV convert rfc822-to-quoted-printable (ORCPT ); Sat, 1 Mar 2014 07:23:21 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:46036 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752995AbaCAMXT (ORCPT ); Sat, 1 Mar 2014 07:23:19 -0500 Received: by mail-pd0-f173.google.com with SMTP id z10so1860609pdj.18 for ; Sat, 01 Mar 2014 04:23:18 -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=j45D4om3PhW/btWEGAsr76KsvHeRt8Uob7v12hfm0sc=; b=rCKoMbhhq5u25PKIlyAod/786JHY205g4noF802ZorkqvT1jtHV3t5HZmT2cau9nWk tWdhrdJwRvmbvOvixIsOpqGGeHBx90poqqgBoerNS/GcKJRUEsYiF9rTOeeldDnSXgEP XQX/FhRAoJ/Id735JqaX5s0xVzA9TriSfE/Ui/w0+rq7A6Up8IcQbbYBmekLoM09eUnk txziDYGI4MZ+dq3ybHwziTsfO8OkSJFQhP/Qv4CmeWathRnXqfMSFv236hfsMxjvdoZd 1w8OU6Yid1Xa55Ujp3euDWT0utZ8vrX0DNYGR4ahEMfg89ThCPhtzszE3BB4wOnCjk85 IBpA== X-Received: by 10.67.5.7 with SMTP id ci7mr9147235pad.99.1393676598817; Sat, 01 Mar 2014 04:23:18 -0800 (PST) Received: from lanh ([115.73.238.45]) by mx.google.com with ESMTPSA id bz4sm15934231pbb.12.2014.03.01.04.23.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 04:23:18 -0800 (PST) Received: by lanh (sSMTP sendmail emulation); Sat, 01 Mar 2014 19:23:43 +0700 X-Mailer: git-send-email 1.9.0.40.gaa8c3ea In-Reply-To: <1393675983-3232-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 R=3D$GIT_COMMON_DIR/repos/) - linked checkouts are supposed to keep its location in $R/gitdir up to date. The use case is auto fixup after a manual checkout move. - linked checkouts are supposed to update mtime of $R/gitdir. If $R/gitdir's mtime is older than a limit, and it points to nowhere, repos/ is to be pruned. - "git checkout --to" is supposed to create $R/locked if the new repo is on a different partition than the shared one. The main use case is when the checkout is on a portable device and may not be available at prune time. If $R/locked exists, repos/ is not supposed to be pruned. If $R/locked exists and $R/gitdir's mtime is older than a really long limit, warn about old unused repo. - "git checkout --to" is supposed to make a hard link named $R/link pointing to the .git file on supported file systems to help detect the user manually deleting the checkout. If $R/link exists and its link count is greated than 1, the repo is kept. 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 | 74 ++++++++++++++++++++++++++= ++++++++ compat/mingw.h | 1 + git-compat-util.h | 4 ++ setup.c | 13 ++++++ 7 files changed, 149 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