From 0ae2662f71e6696397ee40b1ea8e98f1a0737750 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 21 Mar 2018 02:25:53 -0400 Subject: [PATCH] ideas --- doc/todo/adb_special_remote.mdwn | 13 +++++++++++++ doc/todo/import_tree.mdwn | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 doc/todo/adb_special_remote.mdwn create mode 100644 doc/todo/import_tree.mdwn diff --git a/doc/todo/adb_special_remote.mdwn b/doc/todo/adb_special_remote.mdwn new file mode 100644 index 0000000000..0411e5847c --- /dev/null +++ b/doc/todo/adb_special_remote.mdwn @@ -0,0 +1,13 @@ +Make a special remote using adb to send file to an android device. + +While there is an android port, a special remote will suffice for many use +cases, and may work better overall. + +It should support exporttree=yes, since most use cases involve exporting a +tree of files and consuming them on the android device. + +Use adb push, adb pull, and use adb shell for checkpresent and remove. + +Ought to implement [[import tree]] at the same time, so that changes made +to files on the android device can be imported back into the git +repository. diff --git a/doc/todo/import_tree.mdwn b/doc/todo/import_tree.mdwn new file mode 100644 index 0000000000..ee8cc8081b --- /dev/null +++ b/doc/todo/import_tree.mdwn @@ -0,0 +1,32 @@ +When `git annex export treeish` is used to export to a remote, and the +remote allows files to somehow be edited on it, then there ought to be a +way to import the changes back from the remote into the git repository. + +The command could be `git annex import treeish` or something like that. + +It would ask the special remote to list changed/new files, and deleted +files. Download the changed/new files and inject into the annex. +Generate a new treeish, with parent the treeish that was exported, +that has the modifications in it. + +Updating the working copy is then done by merging the import treeish. +This way, conflicts will be detected and handled as normal by git. + +The remote interface needs one new method, to list the changed/new and +deleted files. It will be up to remotes to implement that if they can +support importing. + +One way for a remote to do it, assuming it has mtimes, is to export +files to the remote with their mtime set to the date of the treeish +being exported (when the treeish is a commit, which has dates, and not +a raw tree). Then the remote can simply enumerate all files, +with their mtimes, and look for files that have mtimes +newer than the last exported treeish's date, as well as noticing +deleted and newly added/renamed files. + +A similar approach is for the remote to preserve object file timestamps, +but keep a list somewhere (eg a file on the remote) of the timestamps of +each exported file, and then it can later look for files with newer +timestamps. + +See also, [[adb_special_remote]]