add git config debugging

(and process cwd debugging)

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2023-05-15 15:35:29 -04:00
parent ee23c540ea
commit 0da0e2efcc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 46 additions and 9 deletions

View file

@ -189,11 +189,13 @@ withCreateProcess p action = bracket (createProcess p) cleanupProcess
debugProcess :: CreateProcess -> ProcessHandle -> IO ()
debugProcess p h = do
pid <- getPid h
debug "Utility.Process" $ unwords
debug "Utility.Process" $ unwords $
[ describePid pid
, action ++ ":"
, showCmd p
]
] ++ case cwd p of
Nothing -> []
Just c -> ["in", show c]
where
action
| piped (std_in p) && piped (std_out p) = "chat"