Implement pipe-delimited output and integration test suite#22
Open
rsanheim wants to merge 7 commits into
Open
Conversation
Update Rust implementation to conform to SPEC.md v0.2.2 three-column pipe-delimited output format: `repo | branch | message`. Rust changes: - Add FormattedResult struct and update OutputFormatter trait - Replace bracket-wrapped format_repo_name with format_column using `...` truncation - Add branch resolution via rev-parse in worker threads - Parse branch line from `git status --porcelain -b` with ahead/behind support - Handle detached HEAD as `HEAD (detached)` - Add --no-optional-locks as global git option for status - Collect-then-print in run_parallel for aligned column widths - Exit code 9 when no repositories found Integration test suite (Ruby/RSpec): - 26 specs covering full Section 7.2.3 test matrix - Real git repos in tmpdirs for each test - Tests for pipe-delimited format, column alignment, ordering, truncation
* Make RepoBuilder#git public, remove duplicated git_in from specs * Extract with_tracking_repo helper for upstream/clone boilerplate * Add FormattedResult::message_only constructor for fetch/pull/status
When an external subcommand matches a git alias (e.g. `st` -> `status`), route it to the optimized handler instead of falling through to passthrough.
Replace collect-then-print with streaming: as each result arrives, print all contiguous results from the front of the queue immediately. Use a fixed branch column width (14 chars) so output can stream without waiting for all results to compute column widths.
Fixed branch column at 14 chars and added streaming output via head-of-line blocking as RECOMMENDED behavior.
14 chars truncated "HEAD (detached)" (15 chars). Bump to 16 so detached HEAD displays without truncation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
repo | branch | messagest->status) to optimized commandsBefore:
After:
Rust changes
FormattedResultstruct replaces plainStringreturn fromOutputFormatterformat_column()with...truncation replaces bracket-wrappedformat_repo_name()git rev-parse --abbrev-ref HEADgit status --porcelain -bfor branch, ahead/behind counts--no-optional-locksadded as global git option for statusgit config --get alias.<cmd>and route to optimized handlers when alias maps to status/pull/fetchGitCommandgainsglobal_argsfor options that must precede-CIntegration test suite
spec/status_spec.rb-- 21 tests covering the full Section 7.2.3 matrix (clean, modified, added, deleted, renamed, untracked, MM, AM, detached HEAD, ahead, behind, diverged, mixed)spec/output_format_spec.rb-- 5 tests for pipe format, column alignment, alphabetical ordering, truncation, exit code 9spec/passthrough_spec.rb-- 1 test for passthrough outputspec/support/--git_all_runner.rb,repo_builder.rb,output_parser.rbscript/test -t specruns the integration suiteTest plan
cargo test)script/test -t spec)script/test)