Say I have:
$> git remote
Alpha
Beta
Gamma
Delta
It is easy to sync with all repos via:
$> git annex sync
Or specific repos via:
$> git annex sync Alpha Beta
However, it is currently awkward to exclude specific repos. Is it possible to 'invert' or 'negate' specific remotes, so that the following are equivalent?
$> git annex sync \! Gamma
$> git annex sync Alpha Beta Delta
This problem comes up surprisingly often due to:
- An external host being temporarily down (which causes sync to hang for a while),
- Repos being available, but the machine is under heavy IO load or memory pressure,
- Repos on external drives that are swapped out and mounted to a specific location (e.g., /mnt/),
- Wanting to roll out repo-wide changes in stages, or keeping 1-2 repos untouched for whatever reason, or
- Some repos being too large for a machine (e.g., repacking fails due to low memory), but which can still act like a dumb file-store.
The problem gets worse when you have a lot of remotes or a lot of repos to manage (I have both). My impression is that this feature would require a syntax addition for git-annex-sync only. I like '!' because it behaves the same in GNU find and sh.
I think you could just use this:
It's not very ergonomic to type out so much each for each sync, but I suppose it technically accomplishes the idea.
Still -- wouldn't making '!x' alias to '-c remote.x.annex-sync=false' have minimal impact and provide a bit more symmetry with the matching-options?
I'm not familiar with Haskell, but could probably fumble my way through this one. Would you accept a patch?
git-annex sync does support remote groups, so that might also help with this use case without needing additional syntax?