remove warning about git gc for annex.alwayscommit=false
authorJoey Hess <joeyh@joeyh.name>
Wed, 15 Apr 2020 18:25:33 +0000 (14:25 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 15 Apr 2020 18:25:33 +0000 (14:25 -0400)
commit503abb6d54758d36f22585f7db468bbe993c4073
tree8f2dc1ff8c2fbba5d7c32831355e37383e02d7d9
parentddadc0c1aa316fab289b86efaecb81975ad92acb
remove warning about git gc for annex.alwayscommit=false

I doubt that warning has ever been right, but I'm sure it is not right
now.

For there to be a risk of git gc deleting objects that are in the annex
index, journal files would have to be staged into it, and deleted, but
the index not committed to the git-annex branch. And AFAICS, there is no
code path where that actually happens. I considered adding one recently,
but didn't.

The way it actually works is, as long as the user has annex.alwayscommit=false
the data lives in the journal, where it's safe from git gc. Then when
git-annex is run w/o that config, the journal is staged into the index,
which is immediately committed to the branch. There's no window where
git gc could delete the objects, because git gc only deletes objects
after some time (2 weeks by default).

Now, if git-annex gets suspended at just the wrong time, or interrupted,
then yes, it's possible. But doesn't matter whether that config was ever
set or not. And many uses of git-annex also recover from that situation
by committing to the git-annex branch.
doc/git-annex.mdwn