support required groupwanted
authorJoey Hess <joeyh@joeyh.name>
Tue, 28 Apr 2020 17:31:26 +0000 (13:31 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 28 Apr 2020 17:31:26 +0000 (13:31 -0400)
When the required content is set to "groupwanted", use whatever expression
has been set in groupwanted as the required content of the repo, similar to
how setting required content to "standard" already worked.

CHANGELOG
Logs/PreferredContent.hs
doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing.mdwn
doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing/comment_1_ff2986a884988cdf3782db59325d2a9f._comment [new file with mode: 0644]

index 9b9029768f4620c4ccf0207f05a3e7d7453a98e3..7413ed9644768f627f6bc5c5e8ae9ee3423e80b5 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -37,6 +37,10 @@ git-annex (8.20200331) UNRELEASED; urgency=medium
   * addurl: When run with --fast on an url that 
     annex.security.allowed-ip-addresses prevents accessing, display
     a more useful message.
+  * When the required content is set to "groupwanted", use whatever
+    expression has been set in groupwanted as the required content of the
+    repo, similar to how setting required content to "standard" already
+    worked.
 
  -- Joey Hess <id@joeyh.name>  Mon, 30 Mar 2020 15:58:34 -0400
 
index 05d7b58083d4e1ebda500b2167be2e6d4cefb7e2..1235713e38772eff8fc39a9aa11c66cadc4919f4 100644 (file)
@@ -92,8 +92,9 @@ preferredRequiredMapsLoad' mktokens = do
                in simpleMap
                        . parseLogOldWithUUID (\u -> mk u . decodeBS <$> A.takeByteString)
                        <$> Annex.Branch.get l
-       pc <- genmap preferredContentLog =<< groupPreferredContentMapRaw
-       rc <- genmap requiredContentLog M.empty
+       gm <- groupPreferredContentMapRaw
+       pc <- genmap preferredContentLog gm
+       rc <- genmap requiredContentLog gm
        -- Required content is implicitly also preferred content, so combine.
        let pc' = M.unionWith combiner pc rc
        return (pc', rc)
index 70aee565f195466a079990b00030198e13dd8b1b..e8d2a33789465544a0de82ffc58937b526302d76 100644 (file)
@@ -131,3 +131,5 @@ ok
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
 I had, some time ago I synced my phone with it. I stopped because of the painful crippled file system there, and the annex was so large that the phone was slow. But I always wanted to restart annexing, to archive and partially checkout my libraries, and maybe do the phone sync right (probably via a special remote)! It seems to be THE tool as soon as a repo is split over multiple disks.
+
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing/comment_1_ff2986a884988cdf3782db59325d2a9f._comment b/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing/comment_1_ff2986a884988cdf3782db59325d2a9f._comment
new file mode 100644 (file)
index 0000000..24e09e6
--- /dev/null
@@ -0,0 +1,24 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2020-04-28T17:06:39Z"
+ content="""
+This comes down to this part of preferredRequiredMapsLoad:
+
+       pc <- genmap preferredContentLog =<< groupPreferredContentMapRaw
+       rc <- genmap requiredContentLog M.empty
+
+So for required content, it does not use the group preferred content map.
+
+Should it also use the groupwanted values for required content in this case?
+It kind of makes sense, but I do wonder if someone might have a group that they
+want to use one expression for its preferred content (groupwanted)
+and a different expression for its required content ("grouprequired").
+
+OTOH, I suppose that allowing for the former case now does not prevent
+later adding support for the latter. 
+
+(Also, setting required to "standard" already works, so that's a precident.)
+
+Confirmed that passing the map does fix the behavior, so I'm doing that.
+"""]]