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 v6 27/32] prune: strategies for linked checkouts Date: Wed, 9 Jul 2014 14:33:12 +0700 Message-ID: <1404891197-18067-28-git-send-email-pclouds@gmail.com> References: <1404891197-18067-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 Wed Jul 09 09:35:58 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 1X4mQ2-0004PY-9h for gcvg-git-2@plane.gmane.org; Wed, 09 Jul 2014 09:35:58 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755086AbaGIHfy convert rfc822-to-quoted-printable (ORCPT ); Wed, 9 Jul 2014 03:35:54 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:49178 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbaGIHfx (ORCPT ); Wed, 9 Jul 2014 03:35:53 -0400 Received: by mail-pa0-f50.google.com with SMTP id bj1so8779340pad.37 for ; Wed, 09 Jul 2014 00:35:52 -0700 (PDT) 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=n3luwqo48DQbyWF1rZXBwtgzWzMCCqtJI4NdMH44V9c=; b=0C9+8dSdtlaKYCP5V69xBGoAI7ZriaVYqhSk6EFir/EG8odWZK54g/d8fHHEfZ/KY6 B0QrNJLht6FOjqV9dHk/77CJHkbCSyS/ELIJW40Sz+g1z1JKPNHA00BhODXbPjnF/6LD Il3FEYphVu01/qmkvahY55Ij8LwDXSwKDcL1a3Vyb9wsn0YrPF8baGNE/WoDrztOOemI cXXxRxDYAfd57AWxXaUpVhcwtGC70tF/BBoZKTQUtZxHEStqoP99rCV1WZY1DilE+uNd fi/vRiwaGzEpCz3v4MzWxa1auytrRUjETOH57O/21LomflgiMEtZYVC6MvLO+hhTOaOO BnRQ== X-Received: by 10.70.48.205 with SMTP id o13mr9792820pdn.25.1404891352886; Wed, 09 Jul 2014 00:35:52 -0700 (PDT) Received: from lanh ([115.73.209.165]) by mx.google.com with ESMTPSA id co3sm57908850pbb.89.2014.07.09.00.35.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jul 2014 00:35:52 -0700 (PDT) Received: by lanh (sSMTP sendmail emulation); Wed, 09 Jul 2014 14:35:49 +0700 X-Mailer: git-send-email 1.9.1.346.ga2b5940 In-Reply-To: <1404891197-18067-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 7a493c8..50e39ec 100644 --- a/Documentation/git-prune.txt +++ b/Documentation/git-prune.txt @@ -48,6 +48,9 @@ OPTIONS --expire