summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-09-05 16:08:49 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-09-05 16:08:49 -0400
commitcc930a7439b448b89552fed843a549a5c4dbc074 (patch)
tree1243695925d8374b8740ef0e5717398f10432dfe
parent21fe1ffb95947a480b1eaba127287fee96e552f7 (diff)
Assistant, repair: Filter out git fsck lines about duplicate file entries in tree objects.
-rw-r--r--CHANGELOG2
-rw-r--r--Git/Fsck.hs2
-rw-r--r--doc/forum/how_to_disaster_recovery/comment_5_9b9403a80c5b0a1a441dfb94feece37d._comment20
3 files changed, 24 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 8d9abccf8..7139aaf59 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,8 @@ git-annex (6.20160809) UNRELEASED; urgency=medium
* Make --json and --quiet suppress automatic init messages, and any
other messages that might be output before a command starts.
Fixes a reversion introduced in version 5.20150727.
+ * Assistant, repair: Filter out git fsck lines about duplicate file
+ entries in tree objects.
-- Joey Hess <id@joeyh.name> Mon, 05 Sep 2016 11:51:49 -0400
diff --git a/Git/Fsck.hs b/Git/Fsck.hs
index f3e6db9f9..f85023dc1 100644
--- a/Git/Fsck.hs
+++ b/Git/Fsck.hs
@@ -104,6 +104,8 @@ findShas :: Bool -> String -> [Sha]
findShas supportsNoDangling = catMaybes . map extractSha . concat . map words . filter wanted . lines
where
wanted l
+ -- Skip lines like "error in tree <sha>: duplicateEntries: contains duplicate file entries"
+ | "duplicateEntries" `isPrefixOf` l = False
| supportsNoDangling = True
| otherwise = not ("dangling " `isPrefixOf` l)
diff --git a/doc/forum/how_to_disaster_recovery/comment_5_9b9403a80c5b0a1a441dfb94feece37d._comment b/doc/forum/how_to_disaster_recovery/comment_5_9b9403a80c5b0a1a441dfb94feece37d._comment
new file mode 100644
index 000000000..52f1d1e45
--- /dev/null
+++ b/doc/forum/how_to_disaster_recovery/comment_5_9b9403a80c5b0a1a441dfb94feece37d._comment
@@ -0,0 +1,20 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 5"""
+ date="2016-09-05T20:02:39Z"
+ content="""
+Very interesting git fsck output!
+
+It seems like your git repository has somehow gotten a tree object in it
+which contains two files with the same name.
+
+While git's data structures allow this, it's pretty nonsensical, and it's
+not something that would normally ever happen. It would be interesting to
+take a look and see what commits use those tree objects, and where those
+strange trees came from.
+
+git-annex in turn is seeing that tree object's sha in the fsck output and
+assumes fsck means that the data for that object is broken or missing.
+So, I suppose what I'll do is make it skip over lines containing
+`duplicateEntries`, and then it won't try to repair this repository.
+"""]]