From 19137ae780d03b54b6dc0464a5818d047370b9f3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 Jun 2024 12:35:35 -0400 Subject: [PATCH] avoid unfiltered debugging from git-annex-shell 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 | 2 ++ Remote/Helper/Ssh.hs | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6c5864aa3f..6084853799 100644 --- 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 Mon, 03 Jun 2024 13:03:21 -0400 diff --git a/Remote/Helper/Ssh.hs b/Remote/Helper/Ssh.hs index d712706fd2..5c7d55c0fc 100644 --- a/Remote/Helper/Ssh.hs +++ b/Remote/Helper/Ssh.hs @@ -1,6 +1,6 @@ {- git-annex remote access with ssh and git-annex-shell - - - Copyright 2011-2022 Joey Hess + - Copyright 2011-2024 Joey Hess - - 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] -- 2.39.5