From 820c6485217eb168d417841de430edf9b438035e Mon Sep 17 00:00:00 2001 From: James Brechtel Date: Mon, 11 May 2026 22:14:17 -0400 Subject: [PATCH] Include hostname in auto-commit messages --- src/Converge.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Converge.hs b/src/Converge.hs index 59f9960..16aa454 100644 --- a/src/Converge.hs +++ b/src/Converge.hs @@ -41,7 +41,7 @@ import System.Exit (ExitCode (..)) import System.FSNotify import System.FilePath (isAbsolute, splitDirectories, ()) import System.IO (hPutStrLn, stderr) -import System.Process (readProcessWithExitCode, spawnProcess) +import System.Process (readProcess, readProcessWithExitCode, spawnProcess) -- | Configuration for a single repository to watch. data RepoConfig = RepoConfig @@ -268,7 +268,8 @@ gitCommitAll logger repoPath = do (_, _, stageErr) <- runGitIn repoPath ["add", "-A"] unless (T.null stageErr) $ logInfo logger ("git add stderr: " <> stageErr) - runGitIn repoPath ["commit", "-m", "converge: auto-commit"] + hostname <- init <$> readProcess "hostname" [] "" + runGitIn repoPath ["commit", "-m", "converge: auto-commit from " <> hostname] -- | Pull from the configured remote and branch. gitPull :: RepoConfig -> IO (ExitCode, Text, Text)