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 v2 17/21] prune: strategies for split repositories Date: Sat, 14 Dec 2013 17:55:03 +0700 Message-ID: <1387018507-21999-18-git-send-email-pclouds@gmail.com> References: <1386771333-32574-1-git-send-email-pclouds@gmail.com> <1387018507-21999-1-git-send-email-pclouds@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jonathan Niedier , 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 Dec 14 11:53:03 2013 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 1VrmqD-0001Lo-Po for gcvg-git-2@plane.gmane.org; Sat, 14 Dec 2013 11:53:02 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753609Ab3LNKw6 convert rfc822-to-quoted-printable (ORCPT ); Sat, 14 Dec 2013 05:52:58 -0500 Received: from mail-pd0-f174.google.com ([209.85.192.174]:35961 "EHLO mail-pd0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753598Ab3LNKw4 (ORCPT ); Sat, 14 Dec 2013 05:52:56 -0500 Received: by mail-pd0-f174.google.com with SMTP id y13so3499153pdi.33 for ; Sat, 14 Dec 2013 02:52:56 -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=S63UQKQ5OWq7Kqn5tf1dirwLJYvAADAc6CmXbPXW6EY=; b=qnG1RjIkVy8U9b23URD5sTv5wWLwjbkFPESIqIuPl3ZCVe+8xdibvZzIlGaDpUDhxL XAG+Ryg8AjQhYXJKic6ewPpk+z8H/67iB5v3yJnvO4BuXQNNw6qqxNef+kLuA68YWIlQ w8kPyi64nojdSD661YEawSO8UU6QyM/A6gCQpzpmGLJbNwsjcbZZj7iHPqMN/M54rKlK GKUxyjTy7fm8URe/aMom0jSRhVPFcuwRoL1GDi82wKaAEXl13Fj4tO5gM480ODaycygw S8EDBKaaZ4GAbNhLCYk22wrHjL2Nl60YGCNnReT43qD//2jTexosTRvCgUyQ3qHXS/im yY9Q== X-Received: by 10.68.211.1 with SMTP id my1mr8837809pbc.55.1387018376477; Sat, 14 Dec 2013 02:52:56 -0800 (PST) Received: from lanh ([115.73.245.131]) by mx.google.com with ESMTPSA id bh6sm15324980pad.20.2013.12.14.02.52.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Dec 2013 02:52:55 -0800 (PST) Received: by lanh (sSMTP sendmail emulation); Sat, 14 Dec 2013 17:57:49 +0700 X-Mailer: git-send-email 1.8.5.1.77.g42c48fa In-Reply-To: <1387018507-21999-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_SUPER_DIR/repos/ - split repos are supposed to update mtime of $REPO/gitdir - split repos are supposed to keep its location in $REPO/gitdir up 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 1, repos/ is to be pruned. - if $REPO/gitdir's mtime is older than a limit, and it points to nowhere, repos/ is to be pruned. Warn about it some time before the prune time. Signed-off-by: Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy --- Documentation/git-prune.txt | 4 +++ Documentation/gitrepository-layout.txt | 19 ++++++++++ builtin/checkout.c | 36 ++++++++++++++++++- builtin/prune.c | 65 ++++++++++++++++++++++++++= ++++++++ setup.c | 13 +++++++ 5 files changed, 136 insertions(+), 1 deletion(-) diff --git a/Documentation/git-prune.txt b/Documentation/git-prune.txt index bf82410..55a9341 100644 --- a/Documentation/git-prune.txt +++ b/Documentation/git-prune.txt @@ -46,6 +46,10 @@ OPTIONS --expire