summaryrefslogtreecommitdiff
path: root/doc/bugs/windows_port_-_repo_can__39__t_pull_newly_added_files_/comment_4_29e72997b88f91f84639587b4cede34c._comment
blob: c785ff77b79c7499357fb725dc63218bfa35c4cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[[!comment format=mdwn
 username="https://www.google.com/accounts/o8/id?id=AItOawmhfodZquCI_EEl-f3h7HkROTszlsQL6yA"
 nickname="Joe"
 subject="comment 4"
 date="2013-06-16T17:27:18Z"
 content="""
I have a workaround that requires a small patch. I'm not sure why it's not creating the mapping, but I noticed that git annex fsck has a verifyDirectMapping which will create the mapping if it doesn't exist. 

git annex fsck will throw an error on fixLinks and won't proceed to verifyDirectMapping if the map file doesn't exist. So, I needed a way to call verifyDirectMapping directly. My hack is to add an argument to git annex fsck to call verifyDirectMapping. 

My workflow is this:

**repo1**:
[[!format  sh \"\"\"
echo a > new.txt
git annex add .
git commit -m \"add a\"
git copy --to origin
git annex sync
\"\"\"]]

**repo2**:
[[!format  sh \"\"\"
git annex sync
git annex pull origin synced/master
git annex fsck --verifyDirectMapping
git annex get .
\"\"\"]]

The new file comes down cleanly.

I'm sure there's a better way to do this to fix the core issue, but here's how I patched Fsck.hs as a minimal workaround

[[!format  diff \"\"\"

diff --git a/Command/Fsck.hs b/Command/Fsck.hs
old mode 100644
new mode 100755
index 9af6a4a..97aabb8
--- a/Command/Fsck.hs
+++ b/Command/Fsck.hs
@@ -59,12 +60,16 @@ incrementalScheduleOption :: Option
 incrementalScheduleOption = Option.field [] \"incremental-schedule\" paramTime
 	\"schedule incremental fscking\"
 
+verifyDirectMappingOption :: Option
+verifyDirectMappingOption = Option.flag [] \"verifyDirectMapping\" \"verifies direct mappings are consistent\"
+
 options :: [Option]
 options = 
 	[ fromOption
 	, startIncrementalOption
 	, moreIncrementalOption
 	, incrementalScheduleOption
+	, verifyDirectMappingOption
 	]
 
 seek :: [CommandSeek]
@@ -107,18 +112,23 @@ withIncremental = withValue $ do
 start :: Maybe Remote -> Incremental -> FilePath -> (Key, Backend) -> CommandStart
 start from inc file (key, backend) = do
 	numcopies <- numCopies file
-	case from of
-		Nothing -> go $ perform key file backend numcopies
-		Just r -> go $ performRemote key file backend numcopies r
+	verify <- Annex.getFlag (Option.name verifyDirectMappingOption)
+	if verify
+		then go $ verifyDirectMapping key file
+		else
+			case from of
+				Nothing -> go $ perform key file backend numcopies
+				Just r -> go $ performRemote key file backend numcopies r


\"\"\"]]
"""]]