diff options
author | Joey Hess <joey@kitenet.net> | 2012-12-25 16:18:59 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-12-25 16:19:03 -0400 |
commit | 7e3f9f7f49e3c75c0539a69e9f323f37eec3acbc (patch) | |
tree | 16f3ca84ec40a695ce42856383acba21fb514350 /doc | |
parent | d50bda6b9401448626a94cac67ba8336b8aa4736 (diff) |
update
Diffstat (limited to 'doc')
-rw-r--r-- | doc/design/assistant/blog/day_156_and_157__direct_mode_assistant.mdwn | 32 | ||||
-rw-r--r-- | doc/design/assistant/desymlink.mdwn | 4 | ||||
-rw-r--r-- | doc/direct_mode.mdwn | 5 |
3 files changed, 19 insertions, 22 deletions
diff --git a/doc/design/assistant/blog/day_156_and_157__direct_mode_assistant.mdwn b/doc/design/assistant/blog/day_156_and_157__direct_mode_assistant.mdwn index 76df1f510..f49d2914f 100644 --- a/doc/design/assistant/blog/day_156_and_157__direct_mode_assistant.mdwn +++ b/doc/design/assistant/blog/day_156_and_157__direct_mode_assistant.mdwn @@ -6,14 +6,16 @@ I don't know if it'll be easy or hard. Let's find out.. * First, got direct mode adding of new files working. This was not hard, all the pieces I needed were there. For now, it uses the same method as in - indirect mode to make sure nothing can modify the file while it's being added. + indirect mode to make sure nothing can modify the file while it's being + added. * An unexpected problem is that in its startup scan, the assistant runs `git add --update` to detect and stage any deletions that happened while it was not running. But in direct mode that also stages the full file contents, so can't be used. Had to switch to using git plumbing to only - stage deleted files. Happily this also led to fixing a bug, where deletions - were not always committed at startup. + stage deleted files. Happily this also led to fixing a bug; deletions + were not always committed at startup when using the old method; with the + new method it can tell when there are deletions and trigger a commit. * Next, got it to commit when direct mode files are modified. The Watcher thread gets a inotify event when this happens, so that was easy. (Although @@ -30,20 +32,14 @@ I don't know if it'll be easy or hard. Let's find out.. * Another unexpected problem: When an assistant receives new files from one of its remotes, in direct mode it still sets up symlinks to the content. This was because the Merger thread didn't use the `sync` command's direct - mode aware merge code. + mode aware merge code.. so fixed that. - One other interesting thing about file transfers in - direct mode is that they can sometimes happen before the git branch is - pushed and merged. When that happens the object is stored in indirect mode. - Happily the direct mode aware merger detects such objects and converts them - to direct mode. +* Finally there was some direct mode bookeeping the assistant has + to get right. For example, when a file is modified, the old object has + to be looked up, and be marked as not locally present any longer. That + lookup relies on the already running `git cat-file --batch`, so it's + not as fast as it could be, if I kept a local cache of the mapping + between files and objects. But it seems fast enough for now. -* Noticed that when the assistant adds a new object for a modified direct - mode file, it neglects to update the mapping for old object, so it - incorrectly still maps that object to the file. That bad data could lead to - unknown buggy behavior. - - This is complicated by a mapping only being maintained from objects to - files, but not a reverse mapping. To get from files to objects currently - requires querying git for the symlink target, which is relatively slow. - +At this point the assistant seems to work in direct mode on Linux! +Needs more testing.. diff --git a/doc/design/assistant/desymlink.mdwn b/doc/design/assistant/desymlink.mdwn index 45229f3f3..db0e06c4b 100644 --- a/doc/design/assistant/desymlink.mdwn +++ b/doc/design/assistant/desymlink.mdwn @@ -87,9 +87,6 @@ is converted to a real file when it becomes present. * Deal with files changing as they're being transferred from a direct mode repository to another git repository. The remote repo currently will accept the bad data and update the location log to say it has the key. -* When the assistant adds a modified direct mode file, it leaves behind - an associated files mapping to the file for the old key as well. That - needs to be deleted (sync deletes it in the similar situation). * kqueue does not deliver an event when an existing file is modified; need a different way to detect file modifications (possibly an OSX specific interface?) @@ -114,3 +111,4 @@ is converted to a real file when it becomes present. of `.git/annex/objects/` or hard-linking if the same key is present elsewhere in the tree. **done** * handle merge conflicts on direct mode files **done** +* support direct mode in the assistant (many little fixes) diff --git a/doc/direct_mode.mdwn b/doc/direct_mode.mdwn index df5d64fa2..2acf52fd5 100644 --- a/doc/direct_mode.mdwn +++ b/doc/direct_mode.mdwn @@ -33,7 +33,10 @@ any time). To do so: ## use a direct mode repository -The main command that's used in direct mode repositories is +Perhaps the best way to use a direct mode repository is with the git-annex +assistant. + +Otherwise, the main command that's used in direct mode repositories is `git annex sync`. This automatically adds new files, commits all changed files to git, pushes them out, pulls down any changes, etc. |