prune: strategies for linked checkouts
commit404a45f10331f0ec4c8b348a83dd7b8413c40cf6
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 13 Jul 2014 04:51:02 +0000 (13 11:51 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Jul 2014 18:05:42 +0000 (17 11:05 -0700)
treeaa3e9e36a5064da71cf4fe796dbc7dd194bb9d6d
parentf879c05a2e9c070d068e74d54ae94f0fb31aa87a
prune: strategies for linked checkouts

(alias R=$GIT_COMMON_DIR/repos/<id>)

 - 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/<id> is to be pruned.

 - If $R/locked exists, repos/<id> 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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-prune.txt
Documentation/gitrepository-layout.txt
builtin/checkout.c
builtin/prune.c
setup.c
t/t2026-prune-linked-checkouts.sh [new file with mode: 0755]