From: Joey Hess Date: Tue, 28 Apr 2020 17:31:26 +0000 (-0400) Subject: support required groupwanted X-Git-Tag: archive/raspbian/10.20250416-2+rpi1~1^2~118^2~714 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=57b89c635f5fad229b86c4d98b55731c6f08b472;p=git-annex.git support required groupwanted 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. --- diff --git a/CHANGELOG b/CHANGELOG index 9b9029768f..7413ed9644 100644 --- 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 Mon, 30 Mar 2020 15:58:34 -0400 diff --git a/Logs/PreferredContent.hs b/Logs/PreferredContent.hs index 05d7b58083..1235713e38 100644 --- a/Logs/PreferredContent.hs +++ b/Logs/PreferredContent.hs @@ -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) diff --git a/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing.mdwn b/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing.mdwn index 70aee565f1..e8d2a33789 100644 --- a/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing.mdwn +++ b/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing.mdwn @@ -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 index 0000000000..24e09e6a18 --- /dev/null +++ b/doc/bugs/drop_file_denied_with_required__61__groupwanted_and_groupwanted__61__nothing/comment_1_ff2986a884988cdf3782db59325d2a9f._comment @@ -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. +"""]]