This commit is contained in:
Joey Hess 2018-03-21 02:25:53 -04:00
parent 87e1cace70
commit 0ae2662f71
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 45 additions and 0 deletions

View file

@ -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.

32
doc/todo/import_tree.mdwn Normal file
View file

@ -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]]