git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] doc/git-fsck: change the way for getting heads' SHA1s

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Dec 21, 2008, 16:30 UTC
Message-ID
<200812211730.22466.markus.heidelberg@web.de>

The straightforward way with using 'cat .git/refs/heads/*' doesn't work with packed refs as well as branches of the form topic/topic1. So let's use git-for-each-ref for getting the heads' SHA1s in this example.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
 Documentation/git-fsck.txt |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-fsck.txt b/Documentation/git-fsck.txt
index d5a7647..287c4fc 100644
--- a/Documentation/git-fsck.txt
+++ b/Documentation/git-fsck.txt
@@ -79,7 +79,8 @@ that aren't readable from any of the specified head nodes.
 
 So for example
 
-	git fsck --unreachable HEAD $(cat .git/refs/heads/*)
+	git fsck --unreachable HEAD \
+		$(git for-each-ref --format="%(objectname)" refs/heads)
 
 will do quite a _lot_ of verification on the tree. There are a few
 extra validity tests to be added (make sure that tree objects are
-- 
1.6.1.rc3.54.g7bef0
Message 1 of 1 in “doc/git-fsck: change the way for getting heads' SHA1s”
  1. doc/git-fsck: change the way for getting heads' SHA1sMarkus Heidelberg, Dec 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.