forum/Multiple group groupwanted settings helpgit-annexhttp://git-annex.branchable.com/forum/Multiple_group_groupwanted_settings_help/git-annexikiwiki2018-06-13T17:18:49Zcomment 1http://git-annex.branchable.com/forum/Multiple_group_groupwanted_settings_help/comment_1_e78d0aa6b23225c509b9e97549fe915b/joey2018-06-12T16:45:22Z2018-06-12T16:17:30Z
<p>groupwanted expressions are only used when there is only one that the
repository could use. The repository can be in two groups and if only one
of the groups has a groupwanted expression, it will be used, but if both
do, neither expression will be used.</p>
<p>This limitation to exactly one expression also holds for standard
preferred content expressions (which is documented).
git-annex does not try to combine together two expressions with OR.
Why not? Well, consider the standard preferred content expressions for the
client and transfer groups. The one for transfer looks at whether client
repositories have the content:
<code>not (inallgroup=client and copies=client:2) ...</code></p>
<p>If a repository is both a transfer repository and a client at the same
time, that would make it want to have content as long as not all clients
contain the content -- so once all other clients get the content, the
repository would want to drop its copy. But then, it would see that
not all client repositories now have the content (since it doesn't!) and
want to get it. And potentially round and round..</p>
<p>git-annex actually detects and prevents this kind of drop/get cycle
(probably), but the right behavior of combining those two groupwanted
expressions is at best undefined. So it's better to have the user write
down an expression with what they really want to happen than try to OR
expressions.</p>
<p>I've updated the docs for groupwanted to note that it's only used when one
of a repos's groups has it.</p>
comment 2http://git-annex.branchable.com/forum/Multiple_group_groupwanted_settings_help/comment_2_b3d95d5c03c7b985d39a4d5a45ba3dec/ghen12018-06-13T17:18:49Z2018-06-13T17:18:49Z
<p>Thank you for clarifying. I've worked out a setup that seems to do what I want. The rules are a little messier, but not too bad:</p>
<pre><code>group a1 = a 1 a1store
group a2 = a 2 a2store
group b1 = b 1 b1store
group b2 = b 2 b2store
wanted a1 = groupwanted
wanted a2 = groupwanted
wanted b1 = groupwanted
wanted b2 = groupwanted
groupwanted a1store = not copies=1:1 and not copies=a:1
groupwanted a2store = not copies=2:1 and not copies=a:1
groupwanted b1store = not copies=1:1 and not copies=b:1
groupwanted b2store = not copies=2:1 and not copies=b:1
numcopies default = 2
config annex.synccontent = true
</code></pre>