diff --git a/CHANGELOG b/CHANGELOG index 24efe49550..624d23dfd6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +git-annex (10.20250321) UNRELEASED; urgency=medium + + * updatecluster, updateproxy: When a remote that has no annex-uuid is + configured as annex-cluster-node, warn and avoid writing bad data to + the git-annex branch. + + -- Joey Hess Fri, 21 Mar 2025 12:27:11 -0400 + git-annex (10.20250320) upstream; urgency=medium * Added the compute special remote. diff --git a/Command/UpdateCluster.hs b/Command/UpdateCluster.hs index 003ab48ed6..be271d64fc 100644 --- a/Command/UpdateCluster.hs +++ b/Command/UpdateCluster.hs @@ -38,7 +38,7 @@ start = startingCustomOutput (ActionItemOther Nothing) $ do Nothing -> return Nothing Just [] -> return Nothing Just clusternames -> - ifM (Command.UpdateProxy.checkCanProxy r "Cannot use this special remote as a cluster node.") + ifM (Command.UpdateProxy.checkCanProxy r "Cannot use this remote as a cluster node.") ( return $ Just $ M.fromList $ zip clusternames (repeat (S.singleton r)) , return Nothing diff --git a/Command/UpdateProxy.hs b/Command/UpdateProxy.hs index 88a8ecaf77..006e618b60 100644 --- a/Command/UpdateProxy.hs +++ b/Command/UpdateProxy.hs @@ -59,24 +59,32 @@ start = startingCustomOutput (ActionItemOther Nothing) $ do isproxy r | remoteAnnexProxy (R.gitconfig r) || not (null (remoteAnnexClusterNode (R.gitconfig r))) = - checkCanProxy r "Cannot proxy to this special remote." + checkCanProxy r "Cannot proxy to this remote." | otherwise = pure False checkCanProxy :: Remote -> String -> Annex Bool -checkCanProxy r cannotmessage = - ifM (R.isExportSupported r) - ( if annexObjects (R.config r) - then pure True - else do - warnannexobjects - pure False - , pure True - ) +checkCanProxy r cannotmessage + | R.uuid r == NoUUID = do + warning $ UnquotedString $ unwords + [ R.name r + , "is a git remote without a known annex-uuid." + , cannotmessage + ] + pure False + | otherwise = + ifM (R.isExportSupported r) + ( if annexObjects (R.config r) + then pure True + else do + warnannexobjects + pure False + , pure True + ) where warnannexobjects = warning $ UnquotedString $ unwords [ R.name r - , "is configured with exporttree=yes, but without" - , "annexobjects=yes." + , "is a special remote configured with exporttree=yes," + , "but without annexobjects=yes." , cannotmessage , "Suggest you run: git-annex enableremote" , R.name r