77c6de303fd0b346a40d7d1c8492d59e17be43f9
- 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
Converge
Auto-sync one or more git repositories by watching for file changes, automatically committing them, and pulling from a remote.
Converge notifies the user via libnotify / notify-send whenever a merge conflict occurs during automatic pulling.
Usage
Single repository
# Watch the current directory (defaults)
./scripts/run
# Watch a specific repo
./scripts/run -- --repo /path/to/repo --branch master --debounce 10000
Multiple repositories (config file)
# Create a config file
cp converge.example.yaml converge.yaml
# Edit to list your repos
vim converge.yaml
# Run with config
./scripts/run -- --config converge.yaml
Options
| Option | Default | Description |
|---|---|---|
-c, --config FILE |
— | Path to YAML config file listing repositories |
-r, --repo PATH |
. (cwd) |
Path to a single git repository |
-d, --debounce MS |
5000 |
Debounce window in milliseconds (overrides config) |
--remote NAME |
origin |
Remote name (single-repo mode) |
-b, --branch NAME |
main |
Branch to pull (single-repo mode) |
Config file format
repos:
- path: /absolute/or/relative/path
remote: origin # optional, defaults to "origin"
branch: main # optional, defaults to "main"
- path: /another/repo
debounce_ms: 5000 # optional, defaults to 5000
Development
All development tools run inside Docker via the hs wrapper script.
# Build (format + compile)
./scripts/build
# Run tests
./scripts/test
# Run the tool
./scripts/run
# Install to ~/.local/bin
./scripts/install
Design
- Language: Haskell (GHC 9.10.3 via lts-24.38)
- File watching: fsnotify
- Concurrency: one watcher thread per repository via
async - Notifications: shell out to
notify-send(libnotify) - Configuration: YAML config file for multi-repo, CLI flags for single-repo
- Daemonization: TBD (likely systemd service)
Description
Languages
Haskell
79%
Go
13.8%
Shell
7.2%