]> dgit.raspbian.org Git - git-annex.git/blob
b8fcb1f51f42b8f12c7733773d64d646b1db30cc
[git-annex.git] /
1 [[!comment format=mdwn
2  username="joey"
3  subject="""comment 1"""
4  date="2021-10-26T17:49:00Z"
5  content="""
6 Thank you for putting this patch together. It is especially helpful to get
7 patches from a windows user, since it's far from my comfort zone.
8
9 ---
10
11 My first concern was what happens if git-annex is interrupted after moving
12 the object into place but before freezeContent. Leaving an object file
13 with possibly unsafe permissions. Looks like `git-annex fsck` will
14 corrrect that, if it's run.
15
16 As you mentioned, when an unlocked file is added, and linkToAnnex
17 is called, it does move the object into the annex before freezeContent.
18 Although that may have been an oversight really. It could just as well
19 freeze before moving and so avoid leaving the file with the wrong
20 permissions when interrupted.
21
22 And there are other situations where being interrupted can have the same
23 result. Eg, in lockContentForRemoval, it calls thawContent, then an action
24 that may take long enough to be interrupted, and then freezeContent.
25 And it's hard to see any other way that could work; it can't
26 move the object out of the object directory before thawing it.
27
28 So, this seems ok, I suppose.
29
30 ---
31
32 In Annex.Ingest, `lockDown'` calls freezeContent on the file
33 when it's still in the work tree. So I think that would have the same
34 problem you're trying to prevent with this patch?
35
36 Command.Import also has a call to freezeContent that is not on the final
37 object file location.
38
39 A windows-specific feature like this risks getting broken, so maybe
40 it would be good to change freezeContent to avoid such problems. Eg, 
41 it could be changed to take a Key, and freeze the object file
42 for that Key. But at least the call in Annex.Ingest needs to happen
43 before there is a Key.
44
45 So perhaps there should be a freezeContent
46 and a separate freezeObject, which takes a Key. There could
47 then be a separate annex.freezeobject-command that gets run only
48 for freezeObject, not freezeContent.
49 """]]