]> dgit.raspbian.org Git - git-annex.git/commitdiff
avoid unfiltered debugging from git-annex-shell
authorJoey Hess <joeyh@joeyh.name>
Thu, 27 Jun 2024 16:35:35 +0000 (12:35 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 27 Jun 2024 16:37:25 +0000 (12:37 -0400)
When --debugfilter or annex.debugfilter is set, avoid propigating debug
output from git-annex-shell, since it cannot be filtered.

It would be possible to pass --debugfilter on to git-annex-shell,
but it only started accepting that option in 2022. So it would break
interop with older versions.

CHANGELOG
Remote/Helper/Ssh.hs

index 6c5864aa3f976255fb40baec68fbc048494a7b63..6084853799671574dd021005d657516f7e9f591a 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -6,6 +6,8 @@ git-annex (10.20240532) UNRELEASED; urgency=medium
   * Tab completion of options like --from now includes special remotes.
   * Fix Windows build with Win32 2.13.4+
     Thanks, Oleg Tolmatcev
+  * When --debugfilter or annex.debugfilter is set, avoid propigating
+    debug output from git-annex-shell, since it cannot be filtered.
 
  -- Joey Hess <id@joeyh.name>  Mon, 03 Jun 2024 13:03:21 -0400
 
index d712706fd20a4f2cc719b23fdbacb8edbeeae2a6..5c7d55c0fcbf0920dd673dcb2964afb349d70a88 100644 (file)
@@ -1,6 +1,6 @@
 {- git-annex remote access with ssh and git-annex-shell
  -
- - Copyright 2011-2022 Joey Hess <id@joeyh.name>
+ - Copyright 2011-2024 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU AGPL version 3 or higher.
  -}
@@ -21,6 +21,7 @@ import Remote.Helper.Messages
 import Utility.Metered
 import Utility.Rsync
 import Utility.SshHost
+import Utility.Debug
 import Types.Remote
 import Types.Transfer
 import Config
@@ -61,9 +62,10 @@ git_annex_shell cs r command params fields
        shellcmd = "git-annex-shell"
        getshellopts = do
                debugenabled <- Annex.getRead Annex.debugenabled
-               let params' = if debugenabled
-                       then Param "--debug" : params
-                       else params
+               debugselector <- Annex.getRead Annex.debugselector
+               let params' = case (debugenabled, debugselector) of
+                       (True, NoDebugSelector) -> Param "--debug" : params
+                       _ -> params
                return (Param command : File (fromRawFilePath dir) : params')
        uuidcheck NoUUID = []
        uuidcheck u@(UUID _) = ["--uuid", fromUUID u]