From: Nguyễn Thái Ngọc Duy Date: Sat, 30 Aug 2014 08:33:55 GMT Subject: [PATCH 25/32] prune: strategies for linked checkouts Message-ID: <1409387642-24492-26-git-send-email-pclouds@gmail.com> In-Reply-To: <1409387642-24492-1-git-send-email-pclouds@gmail.com> (alias R=$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ễn Thái Ngọc Duy --- Documentation/git-prune.txt | 3 + Documentation/gitrepository-layout.txt | 19 ++++++ builtin/checkout.c | 14 +++++ builtin/prune.c | 95 ++++++++++++++++++++++++++++++ setup.c | 13 ++++ t/t2026-prune-linked-checkouts.sh (new +x) | 84 ++++++++++++++++++++++++++ 6 files changed, 228 insertions(+) create mode 100755 t/t2026-prune-linked-checkouts.sh 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