Commit Graph

25 Commits

Author SHA1 Message Date
jbrechtel e0f986a5ee Formats repo 2026-05-13 22:15:55 -04:00
jbrechtel 63e034fd01 Commit and push uncommitted changes on startup
- watchRepo: call syncRepo at startup to commit any pre-existing
  uncommitted changes before entering the file watcher
- Add gitPush function for git push <remote> <branch>
- Add push step to syncRepo after successful pull (with failure
  notification via notifyUser)
- Export syncRepo and gitPush for testing
- Test: startup sync commits and pushes uncommitted changes
2026-05-13 22:10:30 -04:00
jbrechtel eb847c03f6 Notify on all git operation failures, not just merge conflicts
Generalize notifyConflict into notifyUser that accepts an arbitrary
title and body.  Call notify-send for commit failures and pull
failures in addition to the existing merge-conflict notification.
"Nothing to commit" is intentionally excluded — it is an expected
no-op, not a failure.
2026-05-13 22:05:26 -04:00
jbrechtel bcf43d5d83 updating documentation 2026-05-13 22:01:43 -04:00
jbrechtel ee8a4cb449 Add AGENTS.md — project guide for AI coding agents 2026-05-13 21:50:28 -04:00
jbrechtel 4bc23b5d7c Use --rebase instead of --no-edit in gitPull
git pull --no-edit fails with exit 128 on divergent branches because
fast-forward is impossible.  Using --rebase handles divergent histories
by rebasing local commits on top of fetched remote commits, producing
a linear history without merge commits.

- src/Converge.hs: Change gitPull from --no-edit to --rebase
- test/GitPullSpec.hs: Update rebase test to expect success and
  verify linear history (3 commits, no merge parents)
- test/*.hs: Clean up unused imports
2026-05-13 21:48:49 -04:00
jbrechtel 65bf75cdf2 Adds specs 2026-05-13 21:39:02 -04:00
jbrechtel 34c8232427 Avoids running commands during external git operations 2026-05-13 21:00:09 -04:00
jbrechtel a151cf26c4 Force checkout to workspace root with path: ., use ./hs for build
Build / build (push) Failing after 8s
2026-05-11 22:50:47 -04:00
jbrechtel 9521dee9c1 Run hpack before build, fix cache key, add container debug
Build / build (push) Failing after 6s
2026-05-11 22:46:57 -04:00
jbrechtel 8efdedc451 Use GITHUB_WORKSPACE for mount paths, add host-level debug
Build / build (push) Failing after 9s
2026-05-11 22:42:50 -04:00
jbrechtel 96a3c4e672 Fix checkout path: use explicit path: repo in Gitea workflow
Build / build (push) Failing after 10s
2026-05-11 22:37:41 -04:00
jbrechtel 9d7a09c85b Add debug step to diagnose Gitea build failure
Build / build (push) Failing after 12s
2026-05-11 22:30:23 -04:00
jbrechtel 3b785018ca Fix Gitea build: use ./hs wrapper, cache .stack-root, run upx on host
Build / build (push) Failing after 7s
2026-05-11 22:18:21 -04:00
jbrechtel 820c648521 Include hostname in auto-commit messages
Build / build (push) Failing after 7s
2026-05-11 22:14:17 -04:00
jbrechtel 68a518337d Adds systemd service example 2026-05-11 22:10:20 -04:00
jbrechtel 403ab6bd17 Fix Gitea Actions workflow: use docker run instead of container to avoid missing node
Build / build (push) Failing after 1m34s
2026-05-11 21:56:56 -04:00
jbrechtel 60c2a9a5f8 Adds gitea build and upx compression
Build / build (push) Failing after 20s
2026-05-11 21:37:55 -04:00
jbrechtel 266dd117c6 feat: add thread-safe logger and filter .git fs events
- Introduce Logger newtype (MVar-backed) to serialize stderr output
  across concurrent repo watchers, preventing interleaved log lines
- Thread Logger through runConverge → watchRepo → syncRepo → gitCommitAll
- Switch watchDir → watchTree with isGitPath filter to ignore events
  inside .git directories, reducing noise and potential feedback loops
- Extract logEvent as a standalone function
2026-05-11 20:53:23 -04:00
jbrechtel bd8e815134 Add detailed logging and fix event coalescing
- Add timestamped logging for events, commits, pulls, and conflicts
- Use MVar-based event coalescing so rapid changes trigger only one
  sync per debounce window (fixes missed changes from overlapping syncs)
- Handle 'nothing to commit' gracefully instead of treating it as error
- Log changed file list (git status --porcelain) during sync
- Log commit hash on success, pull output on success
- Remove unused imports
2026-05-11 10:25:22 -04:00
jbrechtel 97e129a855 Use XDG config directory as default config path
- Look for config at $XDG_CONFIG_HOME/converge/config.yaml by default
- --config still overrides to an explicit path
- Falls back to single-repo --repo mode if no config file found
- New defaultConfigPath and configFileExists helpers in Converge module
2026-05-11 10:11:34 -04:00
jbrechtel d6e15864f4 Remove accidentally committed fsnotify source; add to .gitignore 2026-05-11 10:05:06 -04:00
jbrechtel 77c6de303f Fix compilation errors
- Remove nonexistent confDebounce field from WatchConfig (fsnotify 0.4.4.0)
- Remove unused Generic deriving and GHC.Generics import
- Replace .!= with fromMaybe (not re-exported by Data.Yaml)
- Add missing Data.Text import in Main.hs
- Use git -C flag in runGitIn to run in the correct repo directory
- Clean up unused imports
2026-05-11 10:04:44 -04:00
jbrechtel eb77e7c0e6 Support multiple repositories per execution
- Add RepoConfig type for per-repo path/remote/branch
- Options now holds [RepoConfig] instead of single repo
- YAML config file support (--config) for multi-repo setup
- --repo still works for quick single-repo usage
- Concurrent watchers via async (one thread per repo)
- --debounce flag overrides config file value
2026-05-11 09:48:26 -04:00
jbrechtel bf3329e5ce Initial commit: converge - auto-sync git repo watcher 2026-05-11 09:40:25 -04:00