What happens
On a tree with no upstream drift, hand-edit a tracked file and run plain trackcn status (v0.8.0):
$ echo "// edit" >> path/to/tracked-file.md
$ trackcn status
owner/repo/tree/main/... -> ...
No upstream changes.
$ echo $?
0Exit 0, "No upstream changes.", the modified file is never mentioned.
trackcn status --json on the same tree does catch it: exit 1, "drifted": true, and the file listed in locallyModified.
Why this looks intentional in the code…
The detection is fully implemented — cmdStatus computes localDrift per source and sets drifted. The plain/JSON split is explicit in the exit line:
if (json ? (stale || drifted || failed) : (stale || conflicted || failed)) process.exit(1);and there is a test pinning the quiet behavior:
it('status lists the source but stays quiet about local-only modifications', ...
expect(code).toBe(0);
expect(stdout).toContain('No upstream changes.');
expect(stdout).not.toContain('modified locally');…but the docs promise the opposite
SPEC.md, unqualified:
trackcn statusExit codes:
1— upstream has changes, local files have drifted, or an upstream check failed Detects:- Locally modified files (disk hash != stored hash)
README, "CI gate" section:
trackcn statusexits 1 if any source is stale or any tracked file has drifted:- run: npx trackcn status
Anyone following that CI recipe has a gate that silently passes hand-edited vendored files — which is how we got bitten: we edited a tracked file, ran status, saw exit 0 / "No upstream changes.", and concluded detection was broken entirely.
Resolution — happy to PR either way
Two consistent outcomes:
- Code bends to docs: plain
statusprints locally-modified files and includesdriftedin its exit code (flip the one test). Makes the README CI recipe true as written. - Docs bend to code: SPEC.md and the README CI-gate section both qualify that local-drift detection and its exit-1 live behind
--json.
Tell me which direction matches your intent and I'll send the PR.
Activity
0No activity yet.