-
Notifications
You must be signed in to change notification settings - Fork 0
Development
cargo build # build both binaries (git-task, gtask)
cargo build --tests # compile tests without running (fast error check)
cargo test # unit tests + integration tests
cargo test --lib # unit tests only (fast, no subprocess/git overhead)
cargo test --test sync # one integration test file: basic | cross_repo | sync
cargo test diverged_edits_merge # a single test by substring match, across any file
cargo install --locked --path . # install git-task + gtask to ~/.cargo/bin
git task completions bash > ... # also: zsh, fish, powershell, elvishNo lint/format step is currently wired into the repo (no clippy/rustfmt config checked in).
If cargo build fails immediately after a dependency version bump with an "is not supported by
rustc" error, it's very likely a toolchain-lag issue rather than broken code: a couple of
dependencies (time, comfy-table) have needed a
cargo update -p <crate> --precise <version> downgrade in the past when the local rustc sat one
minor version behind current stable. Pin the dependency back and confirm before assuming the code
itself regressed.
CI on pull requests rejects a PR whose Cargo.toml version isn't strictly above the latest
release tag. Bump it, and rebuild once so Cargo.lock picks up the change, as part of any PR, even
a small one.
See Core Concepts for the event-sourcing model itself. The codebase layers roughly bottom-up:
-
domain/: pure data and logic, no I/O.Operationis the closed vocabulary of every mutation that can happen to a task;foldreplays an ordered operation list into aTask. -
store/: the only code that touches the git object database for task data. Handles create/append/load/resolve, and the merge reconciliationpulluses when a task has diverged. -
config/: per-repo config is event-sourced under the reservedrefs/tasks/configref, exactly like a task (see Configuration); user-level config stays plain TOML. -
automation/: the rules engine, matching conditions and executing actions as a new, attributed operation package. -
sync/: the machinery behind theauto-syncbuilt-in, a detached background push+pull triggered after a mutating command's rule cascade settles. -
cli/: one file per subcommand, each a thin argument struct plus arun()that wires the layers above together and prints, in text or JSON. -
web/: the process manager behindgit task web(install/spawn/stop/status of the companiongit-task-webserver). See Web Server Integration.
Integration tests (tests/basic.rs, tests/cross_repo.rs, tests/sync.rs,
tests/automation.rs, and others) drive the real, compiled git-task binary as a subprocess
against real temporary git repositories, not mocks. Each test gets its own GIT_TASK_CONFIG_DIR,
so the default parallel test execution is safe: no shared global state between tests. Auto-sync is
disabled by default in the test harness (GIT_TASK_DISABLE_AUTO_SYNC=1) so no test accidentally
spawns a real background sync worker; a handful of tests in automation.rs opt back in
specifically to exercise it.
git-task
Start here
Using tasks
Building on git-task
Contributing