diff options
author | Joey Hess <joey@kitenet.net> | 2011-12-11 14:51:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-12-11 15:05:53 -0400 |
commit | 8680c415dedcc1fdbbcc0b9cdd7e37e860b22130 (patch) | |
tree | 073641a052f833cda6222a19b1cf1c91c41ee94d /doc | |
parent | 59971c923029a6f10c47a526e7878130637c139e (diff) |
slow, stupid, and safe index updating
Always merge the git-annex branch into .git/annex/index before making a
commit from the index.
This ensures that, when the branch has been changed in any way
(by a push being received, or changes pulled directly into it, or
even by the user checking it out, and committing a change), the index
reflects those changes.
This is much too slow; it needs to be optimised to only update the
index when the branch has really changed, not every time.
Also, there is an unhandled race, when a change is made to the branch
right after the index gets updated. I left it in for now because it's
unlikely and I didn't want to complicate things with additional locking
yet.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/bugs/git-annex_branch_corruption.mdwn | 3 | ||||
-rw-r--r-- | doc/internals.mdwn | 14 |
2 files changed, 6 insertions, 11 deletions
diff --git a/doc/bugs/git-annex_branch_corruption.mdwn b/doc/bugs/git-annex_branch_corruption.mdwn index 63633fb08..5249e63d8 100644 --- a/doc/bugs/git-annex_branch_corruption.mdwn +++ b/doc/bugs/git-annex_branch_corruption.mdwn @@ -39,6 +39,9 @@ corresponds to its index, and if the branch is at a different ref, merge it into the index. I am still considering how to do that atomically; what if a push comes in while git-annex is updating its index? +> Now git-annex always updates the index with the git-annex branch, which +> is a slow, but safe way to avoid this problem. [[done]] --[[Joey]] + --- ## Workaround diff --git a/doc/internals.mdwn b/doc/internals.mdwn index d84b3c489..68cc7c3cd 100644 --- a/doc/internals.mdwn +++ b/doc/internals.mdwn @@ -22,17 +22,9 @@ deleting or changing the file contents. This branch is managed by git-annex, with the contents listed below. The file `.git/annex/index` is a separate git index file it uses -to accumulate changes for the git-annex. Also, `.git/annex/journal/` is used -to record changes before they are added to git. - -Note that for speed reasons, git-annex assumes only it will modify this -branch. If you go in and make changes directly, it will probably revert -your changes in its next commit to the branch. - -The best way to make changes to the git-annex branch is instead -to create a branch of it, with a name like "my/git-annex", and then -use "git annex merge" to automerge your branch into the main git-annex -branch. +to accumulate changes for the git-annex branch. +Also, `.git/annex/journal/` is used to record changes before they +are added to git. ### `uuid.log` |