From 566842f62bdf1f16c2e94fb431445d2e6c0f3f0b Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 4 Apr 2007 10:46:14 -0400 Subject: Fix lost-found to show commits only referenced by reflogs Prior to 1.5.0 the git-lost-found utility was useful to locate commits that were not referenced by any ref. These were often amends, or resets, or tips of branches that had been deleted. Being able to locate a 'lost' commit and recover it by creating a new branch was a useful feature in those days. Unfortunately 1.5.0 added the reflogs to the reachability analysis performed by git-fsck, which means that most commits users would consider to be lost are still reachable through a reflog. So most (or all!) commits are reachable, and nothing gets output from git-lost-found. Now git-fsck can be told to ignore reflogs during its reachability analysis, making git-lost-found useful again to locate commits that are no longer referenced by a ref itself, but may still be referenced by a reflog. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- git-lost-found.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-lost-found.sh') diff --git a/git-lost-found.sh b/git-lost-found.sh index 9360804711..58570dff13 100755 --- a/git-lost-found.sh +++ b/git-lost-found.sh @@ -12,7 +12,7 @@ fi laf="$GIT_DIR/lost-found" rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit -git fsck --full | +git fsck --full --no-reflogs | while read dangling type sha1 do case "$dangling" in -- cgit v1.2.3