forked from GitoxideLabs/gitoxide
-
Notifications
You must be signed in to change notification settings - Fork 0
Add branch-info test #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Reviewer's GuideIntegrate a new Sequence Diagram for branch-info Commit ListingsequenceDiagram
actor User
participant CLI_Main as "branch-info:main()"
participant Args_Instance as "Args.run()"
participant BranchInfoHelpers as "branch-info:helpers"
participant GixLib as "gix Library"
User->>CLI_Main: execute `branch-info`
CLI_Main->>Args_Instance: Args::parse() then run()
activate Args_Instance
Args_Instance->>GixLib: gix::discover()
GixLib-->>Args_Instance: repo
Args_Instance->>GixLib: Resolve 'to_id' (e.g., head_id(), rev_parse_single())
GixLib-->>Args_Instance: to_id
Args_Instance->>BranchInfoHelpers: detect_base(repo, head_id) / gix.rev_parse_single() (for 'from_id')
activate BranchInfoHelpers
BranchInfoHelpers-->>Args_Instance: from_id
deactivate BranchInfoHelpers
Args_Instance->>BranchInfoHelpers: list_commits(repo, from_id, to_id)
activate BranchInfoHelpers
BranchInfoHelpers->>GixLib: repo.rev_walk([to_id]).with_boundary([from_id]).all()
GixLib-->>BranchInfoHelpers: commit_infos
loop For each commit_info
BranchInfoHelpers->>GixLib: commit_info.object()
GixLib-->>BranchInfoHelpers: commit
BranchInfoHelpers->>GixLib: commit.message().summary()
GixLib-->>BranchInfoHelpers: summary
BranchInfoHelpers->>CLI_Main: Output commit_id and summary
end
deactivate BranchInfoHelpers
deactivate Args_Instance
CLI_Main-->>User: Displays list of commits
Sequence Diagram for branch-info Diff DisplaysequenceDiagram
actor User
participant CLI_Main as "branch-info:main()"
participant Args_Instance as "Args.run()"
participant BranchInfoHelpers as "branch-info:helpers"
participant GixLib as "gix Library"
User->>CLI_Main: execute `branch-info --show-diff`
CLI_Main->>Args_Instance: Args::parse() then run()
activate Args_Instance
Args_Instance->>GixLib: gix::discover()
GixLib-->>Args_Instance: repo
Args_Instance->>GixLib: Resolve 'to_id' (e.g., head_id(), rev_parse_single())
GixLib-->>Args_Instance: to_id
Args_Instance->>BranchInfoHelpers: detect_base(repo, head_id) / gix.rev_parse_single() (for 'from_id')
activate BranchInfoHelpers
BranchInfoHelpers-->>Args_Instance: from_id
deactivate BranchInfoHelpers
Args_Instance->>BranchInfoHelpers: show_patch(repo, from_id, to_id)
activate BranchInfoHelpers
BranchInfoHelpers->>GixLib: find_commit(from_id)
GixLib-->>BranchInfoHelpers: lhs_commit
BranchInfoHelpers->>GixLib: find_commit(to_id)
GixLib-->>BranchInfoHelpers: rhs_commit
BranchInfoHelpers->>GixLib: lhs_commit.tree()
GixLib-->>BranchInfoHelpers: lhs_tree
BranchInfoHelpers->>GixLib: rhs_commit.tree()
GixLib-->>BranchInfoHelpers: rhs_tree
BranchInfoHelpers->>GixLib: repo.diff_tree_to_tree(lhs_tree, rhs_tree)
GixLib-->>BranchInfoHelpers: changes
loop For each change
BranchInfoHelpers->>BranchInfoHelpers: print_patch(cache, change)
activate BranchInfoHelpers
BranchInfoHelpers->>GixLib: change.diff(cache)
GixLib-->>BranchInfoHelpers: platform_diff
BranchInfoHelpers->>GixLib: (further gix calls for diff content)
GixLib-->>BranchInfoHelpers: diff_lines
BranchInfoHelpers->>CLI_Main: Output diff_lines
deactivate BranchInfoHelpers
end
deactivate BranchInfoHelpers
deactivate Args_Instance
CLI_Main-->>User: Displays full diff
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
tests/journey/branch-info.sh
for end-to-end coveragetests/journey.sh
harnessTesting
cargo check-short
cargo test-short
https://chatgpt.com/codex/tasks/task_e_684a09c8b3788320be95f67cc89f442c
Summary by Sourcery
Add a new branch-info CLI tool to the workspace with associated build configuration and end-to-end tests, and clean up the old test harness.
New Features:
Build:
Tests:
Chores: