3 subject="""comment 2"""
4 date="2020-04-15T16:30:43Z"
6 Tried to implement that approach, but it has a problem: Once the journal
7 gets staged into the index, the journal is no longer dirty. So, when
8 git-annex is later run with annex.alwayscommit=true, it won't know it needs
9 to commit the index to the branch. It would only do so after some other
10 subsequent change is made. So `git annex merge` would not commit the staged
11 changes as it does now.
13 Solving that would need some other indication that the index has staged
14 changes in it, eg a flag file or some comparison of index file timestamp
15 with the git-annex branch ref timestamp. But whatever it is would need to
16 be checked for when annex.alwayscommit=true. So git-annex would become
17 slower in the common case to support annex.alwayscommit=false.
19 The slowdown would be much less than the win of the optimisation that
20 caused this, but still I am not much of a fan of slowing things back down
23 (The only way around that, maybe, would be to leave a file in the journal
24 after staging it, so git-annex treats the journal as dirty without needing
25 to check anything else, and so knows it needs to commit the annex index
26 later. But then the journal would be treated as dirty every time git-annex
27 starts up, and so would be staged into the index. Which would make running
28 with annex.alwayscommit=false slower. Maybe the file could have a special
29 name that git-annex knows it does not need to stage? This feels like a lot
30 of complexity being added.)
32 So, I'm now leaning more toward disabling the optimisation when
33 annex.alwayscommit=false. The journal won't be staged to the index
34 then, and git-annex will have to check for journalled changes as long
35 as it's running with that configuration. No worse than it was before.