From: Nguyễn Thái Ngọc Duy Date: Sat, 01 Mar 2014 12:13:00 GMT Subject: [PATCH v4 24/27] prune: strategies for linked checkouts Message-ID: <1393675983-3232-25-git-send-email-pclouds@gmail.com> In-Reply-To: <1393675983-3232-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. - "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ễn Thái Ngọc 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