Repository navigation
feat: status, sync and open across repositories - #14
Conversation
|
Verdict: approve Checked every acceptance criterion of #5 against a real fleet built under a throwaway HOME (clean, dirty-by-untracked-file-alone, no-upstream, ahead, behind, ahead-and-behind, a cloned empty repository with an unborn HEAD, and a detached HEAD). Every one of the eight states rendered as its own distinct line in both the table and
Spot-checked three of the mutation claims by reverting the guarding logic in a detached copy of the source tree: breaking the unborn-HEAD detection fails
Nit: Nit: |
A cloned empty repository carries an upstream but no branch.ab line, and so does a branch with no upstream at all, so a missing comparison is its own state rather than up to date. Probed against git before the parser was written. Refs #5
Results are handed back on the run's own goroutine, so a failure never interleaves another repository's line into nonsense. Refs #5
status renders an unborn HEAD and a missing upstream as states of their own, never as an empty column that reads as up to date. sync fetches only, reports each failure and exits non zero when any failed. open resolves the remote's web URL, or prints it with --print. Refs #5
Review nits: the walk returned bare errors unlike internal/scan, and the forge URL shapes were only covered through the remote package, not from the command itself. Refs #5
94b2c45 to
346c6cd
Compare
What
internal/statusparsesgit status --porcelain=v2 --branchinto a repository state.internal/gitsyncruns fetches in a bounded pool and hands results back serially.internal/gitgainsFetchand a porcelain status read.internal/remotegainsWebURL.cmd/gitcdgainsstatuswith--jsonand--strict,sync, andopenwith--print.Why
# branch.upstreamline but no# branch.abline, and sodoes a branch with no upstream at all. Both were probed against real git before the parser was
written, because treating a missing comparison as "up to date" is exactly the silent
misreport this command exists to prevent. Each renders as its own state.
--strictcounts staged, unstaged and untracked. A forgotten new file is the thing a strictgate must not wave through.
syncfetches only. It never pulls, rebases or merges. Results are delivered on the run's owngoroutine, so one repository's failure never interleaves into another's line.
https://{host}/{owner}/{repo}shape. Azure DevOpskeeps its own
_gitpath.Verification
task checkexit 0.with no upstream and one with an unborn HEAD:
status --strictexits 1 on the untracked file alone.syncagainst a deliberately broken remote reports each failure, continues, prints3 of 4 repositories failed, exits 1, and writes nothing to stdout.open --printresolves the web URL and exits 0.Risk
cmd/gitcd/discover.goholds a walk overrootthat overlapsinternal/scan, which feat: list and cd with fuzzy matching #3introduces. feat: status, sync and open across repositories #5 was deliberately told to build the minimum it needed rather than wait, so the
duplication is known, is noted in
AGENTS.md, and is to be reconciled once both land. It isnot meant to survive.
syncruns plaingit fetchrather than naming a remote, which is right while a gitcd clonecarries one remote and wrong the moment one carries two.
statustable shifts columns rather than truncating when a name is long, so a narrowterminal wraps instead of hiding information.
--jsoncarries every field, including whethera sync comparison exists at all, so a consumer can tell the three cases apart.
Closes #5
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.