git-annex-enableremotegit-annexhttp://git-annex.branchable.com/git-annex-enableremote/git-annexikiwiki2017-02-14T20:21:41ZRetrieving initremote parameters for new userhttp://git-annex.branchable.com/git-annex-enableremote/comment_2_78223f5c6ad120d5e0b98583543425db/Sundar Raman2017-02-14T00:04:50Z2017-02-14T00:04:50Z
<p>Is there a way to determine the parameters that an enableremote command must use, if one does not know it? The use case is as follows:
* Dev 1 performs an <code>initremote annexed-media directory=/path/to/media ...</code>
* Dev 1 syncs content
* Dev 2 comes along (or Dev 1 comes along months later with a different machine) and clones the repo, but needs to know the directory=/path... in order to 'enableremote'. Is there any way to glean this information from the source repo itself?</p>
<p>The steps would be:</p>
<pre><code>dev1$ git clone git@gitserver:myproject.git && cd myproject
dev1$ mkdir images && touch images/foo1.png
dev1$ git annex initremote annexation.dir directory=/mnt/media/myproject.annex/ encrypted=false
dev1$ git commit && git push && git annex sync --content
</code></pre>
<p><time></p>
<pre><code>dev2$ git clone git@gitserver:myproject.git && cd myproject
dev2$ git annex whereis
# shows something like ...
# whereis images/foo1.png (7 copies) ...
# 38e67e39-7dfb-45e8-90fc-8c5d01aae0b4 -- annexation.dir
dev2$ git annex enableremote annexation.dir directory=???
</code></pre>
<p>So how does the new developer know how to define the annexation.dir? Is there any way to extract from the repo itself? Or must this information be saved into the repo's documentation to avoid losing the reference?</p>
<p>Thanks!</p>
comment 2http://git-annex.branchable.com/git-annex-enableremote/comment_2_43876327581d6bcfb69c318c02d6389a/joey2017-02-14T18:56:21Z2017-02-14T18:16:52Z
<p>@Sundar, good question.</p>
<p><code>git annex enableremote</code> will always refuse to enable the remote if there's
a missing parameter, and prompt for the parameter. Finding the right value
is up to you. Most of the time, no additional parameters are needed, or
the parameters are fairly self-explanatory, eg login passwords for remote
services.</p>
<p>The difficulty with directory special remotes is that my /foo may not be
the same as your /foo, so it can't reuse the directory= that was provided
to initremote, and it's up to you to enter the right directory path.</p>
<p>I think this needs to come down to documentation in the repository. The
description of the remote (set by <code>git annex describe</code>
is a reasonable place to put that, unless you have somewhere better.</p>
comment 3http://git-annex.branchable.com/git-annex-enableremote/comment_3_4bc11d1df0ff6962b12f5b8a1bb6188e/Sundar Raman2017-02-14T20:21:41Z2017-02-14T20:21:41Z
Thanks much, did not think to use the 'describe' for that but that's very intuitive!