In our quest to find dumb replacements for ?wishlist: 'get' queue and schedule. (and a more complete git-annex-schedule), we have setup a cronjob that would start and stop the assistant during certain time windows, to ensure that it would not download during prime bandwidth time.
But that isn't exactly what we're looking for: we would like the assistant to continue doing its usual thing of adding and removing files, and even syncing the git branches. Just not get/move files around.
One way I thought of doing this was to disable a remote locally. git-annex-dead of course comes to mind, but that applies to all repositories, so it's not an option. If the remote was in git, i could just git remote rm origin
and git remote add origin
and be done with it, but this is the web remote, so it doesn't even show up in git remote -v
.
But this doesn't work with special remotes. Another solution is
simply to use the remote.name.annex-ignore
configuration documented
in the main git-annex manpage. For example, to disable the web
remote, you would use:
git config remote.web.annex-ignore true
The result would be:
joey@darkstar:~/tmp/a>git annex addurl --fast http://localhost
addurl localhost ok
(recording state in git...)
joey@darkstar:~/tmp/a>git config remote.web.annex-ignore true
joey@darkstar:~/tmp/a>git annex get localhost
get localhost (not available)
Try making some of these repositories available:
00000000-0000-0000-0000-000000000001 -- web
(Note that these git remotes have annex-ignore set: web)
failed
git-annex: get: 1 failed
joey@darkstar:~/tmp/a>git config remote.web.annex-ignore false
joey@darkstar:~/tmp/a>git annex get localhost
get localhost (from web...)
/home/joey/tmp/a/.g 100%[=====================>] 10 --.-KB/s in 0s
ok
The assistant (probably?) needs to be restarted for those changes to take effect. --anarcat and ?joeyh.
Indeed -- I think having
disableremote
(to complementinitremote
andenableremote
) would make sense. E.g. I failed to "disable" it via config. ```shell (git)lena:/tmp/ds000001[master] $> git config remote.datalad.annex-ignore true$> time SCHEMES="datalad-archives" PATH=~datalad/trash/speedyannex2:$PATH git annex fsck --from datalad --fast --debug sub-01/anat/sub-01_inplaneT2.nii.gz [2020-09-24 14:45:48.868954] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","show-ref","git-annex"] [2020-09-24 14:45:48.876348] process done ExitSuccess [2020-09-24 14:45:48.877109] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","show-ref","--hash","refs/heads/git-annex"] [2020-09-24 14:45:48.892383] process done ExitSuccess [2020-09-24 14:45:48.893294] read: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","log","refs/heads/git-annex..cdad4332bce8deff94e89ae35e6378ab1b87e4df","--pretty=%H","-n1"] [2020-09-24 14:45:48.899769] process done ExitSuccess [2020-09-24 14:45:48.901763] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","cat-file","--batch"] [2020-09-24 14:45:48.928262] chat: git ["--git-dir=.git","--work-tree=.","--literal-pathspecs","cat-file","--batch-check=%(objectname) %(objecttype) %(objectsize)"] git-annex: there is no available git remote named "datalad" SCHEMES="datalad-archives" PATH=~datalad/trash/speedyannex2:$PATH git annex 0.03s user 0.08s system 87% cpu 0.126 total
$> git annex version | head git-annex version: 8.20200309-g07fcace
```
This tip is mostly talking about the web special remote, which is unusual in that it's enabled by default. So there is nothing in
.git/config
about it.Any special remote that you set up with
initremote
orenableremote
does have a section in.git/config
same as a regular git remote would (just with git-annex specific configs in there). Sogit remote
can be used to list it, andgit remote rm
will disable it.As far as setting annex-ignore goes, it prevents git-annex from using that remote unless you explicitly ask it to. @yarikoptic's example above sets that for a remote and then explicitly fscks it.