summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar https://www.google.com/accounts/o8/id?id=AItOawmicVKRM8vJX4wPuAwlLEoS2cjmFXQkjkE <Thomas@web>2013-12-08 15:23:36 +0000
committerGravatar admin <admin@branchable.com>2013-12-08 15:23:36 +0000
commitf918f73ea96ed4d28d5520aec98efab69e0f166f (patch)
treeced2dca1550e2613726a8cfe39d98919c39fcd4c
parent3497fddf7dbfee2170fcdbfd52377559f39c3bc2 (diff)
Added a comment: pseudocode
-rw-r--r--doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment35
1 files changed, 35 insertions, 0 deletions
diff --git a/doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment b/doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment
new file mode 100644
index 000000000..d96ac6987
--- /dev/null
+++ b/doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment
@@ -0,0 +1,35 @@
+[[!comment format=mdwn
+ username="https://www.google.com/accounts/o8/id?id=AItOawmicVKRM8vJX4wPuAwlLEoS2cjmFXQkjkE"
+ nickname="Thomas"
+ subject="pseudocode"
+ date="2013-12-08T15:23:36Z"
+ content="""
+The implementation should really be nothing more than the following to be run from a regular git annex repository with a configures special plain directory remote:
+
+ foreach(path : allAnnexedFiles) {
+ if(remote.exists(path) && remote.filesize(path) === expectedFilesize) goto finally;
+
+ if(fileAvailableLocally(path)) {
+ copyFileToRemote(path);
+ goto finally;
+ }
+
+ if(shouldCopyFromElsewhere && canCopyFileFromSomeOtherRemote(path)) {
+ copyFileFromSomeOtherRemoteToRemote(path);
+ }
+
+ finally:
+ logThatFileExistsOnRemote(path);
+ }
+
+ foreach(remotePath : filesInRemoteDir) {
+ if(fileIsAnnexed(remotePath) || fileIsIgnored(remotePath) continue;
+
+ delete(remotePath);
+ }
+
+The above pseude code assumes
+- that the no other process is working on the remote at the same time.
+- that the remote is not trusted.
+- that nobody expects changes done at the remote to propagate to other clones.
+"""]]