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 v5 25/28] prune: strategies for linked checkouts Date: Sat, 8 Mar 2014 09:48:17 +0700 Message-ID: <1394246900-31535-26-git-send-email-pclouds@gmail.com> References: <1393675983-3232-1-git-send-email-pclouds@gmail.com> <1394246900-31535-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 08 03:50:34 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 1WM7LN-0006Fm-IV for gcvg-git-2@plane.gmane.org; Sat, 08 Mar 2014 03:50:34 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753658AbaCHCu1 convert rfc822-to-quoted-printable (ORCPT ); Fri, 7 Mar 2014 21:50:27 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34851 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753637AbaCHCuZ (ORCPT ); Fri, 7 Mar 2014 21:50:25 -0500 Received: by mail-pa0-f51.google.com with SMTP id kq14so4933653pab.24 for ; Fri, 07 Mar 2014 18:50:25 -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=Wz9GeYHPNnI+YYAZ3E1dxChVc2h+VLAaNOB6YYy+EV8=; b=w2xY07U5PXMQOX8R4ZFa94B40R4sOoznUKkpwM0pbmDd4N2uf9rr3ro6Hips+t17Nj LkP0cPAgQRUqTceR8fsxFir7qCNjCWC9AKZf9j5F0AJtap9NrtcKQdCP6KkuXiU3DIUl iTNIhR2GUEm1rI2+ogJJkTcLtCJy7s/zrJbjW6SAdATibAShmSwQ5GbLMTjamcNd576s LDCr4RH+0pFFYUruxOmG4mgasBfE7G5IoA60IEbXvhXo48DOArvMr13ktHHWI5g1ZiH8 1RYCccVzPxXJgihpRMcHbc1Mw7B8CahK3q5aU12cLQYnqHzm7Isy7qlrR/AUUI7EKEZU cMgw== X-Received: by 10.67.5.39 with SMTP id cj7mr25635185pad.7.1394247025106; Fri, 07 Mar 2014 18:50:25 -0800 (PST) Received: from lanh ([115.73.205.153]) by mx.google.com with ESMTPSA id ns7sm42326355pbc.32.2014.03.07.18.50.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Mar 2014 18:50:24 -0800 (PST) Received: by lanh (sSMTP sendmail emulation); Sat, 08 Mar 2014 09:50:58 +0700 X-Mailer: git-send-email 1.9.0.40.gaa8c3ea In-Reply-To: <1394246900-31535-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. - 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 | 14 +++++++ builtin/prune.c | 74 ++++++++++++++++++++++++++= ++++++++ setup.c | 13 ++++++ 5 files changed, 123 insertions(+) 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