From 8c836623b7241f3305d5fc24d30c24b3aa4de77a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 22 Feb 2019 16:18:09 -0400 Subject: [PATCH] design work --- .../importing_trees_from_special_remotes.mdwn | 25 +++++++++++++++++++ doc/todo/import_tree.mdwn | 2 ++ 2 files changed, 27 insertions(+) diff --git a/doc/design/importing_trees_from_special_remotes.mdwn b/doc/design/importing_trees_from_special_remotes.mdwn index 8a4e0d9371..b275bdcb25 100644 --- a/doc/design/importing_trees_from_special_remotes.mdwn +++ b/doc/design/importing_trees_from_special_remotes.mdwn @@ -16,6 +16,31 @@ that has the modifications in it. Updating the local working copy is then done by merging the import treeish. This way, conflicts will be detected and handled as normal by git. +## command line interface + +`git annex import --from remote` would import files from the remote to the +top of the working tree. Sometimes users will want to import into a +subdirectory, so there should be a way to do that. + +`git annex export` has its own way to specify a subdirectory to export, +eg "master:subdir" (which is one way of referring to a git tree in git). +So it seems it would make sense to make importing use a similar syntax. +When importing, "master:subdir" would mean to import into a tree at subdir, +and merge it into master. So any branch ref not containing a colon, eg +"master" naturally means import not in a subdir, and merge it into the +branch. + +Note that while export can have a particular commit or tree sha specified, +it does not makes sense to import *to* a particular sha. + +Also, there should be a way to configure it so `git annex sync --content` +first imports from a remote and then exports to it. Currently `git annex +export` has `--tracking` to configure the latter. It seems to only make +sense to import and export the same tracking branch. So, should `git annex +export --tracking` set the same thing, or perhaps it would be better to +move the tracking branch configuration out of `git annex export` and into +an interface that explicitly configures both import and export? + ## content identifiers The remote is responsible for collecting a list of diff --git a/doc/todo/import_tree.mdwn b/doc/todo/import_tree.mdwn index d53f0e214a..eaae6914a7 100644 --- a/doc/todo/import_tree.mdwn +++ b/doc/todo/import_tree.mdwn @@ -3,6 +3,8 @@ 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 --from remote` +There also ought to be a way to make `git annex sync` automatically import. + See [[design/importing_trees_from_special_remotes]] for current design for this.