Fix async post-commit stats for commit aliases#1378
Open
peckfly wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Added a follow-up fix commit: What changed:
Validation run locally:
Note: |
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.
Problem
In async/wrapper-daemon mode, commits made through a Git alias could successfully create the commit and authorship note, but the foreground wrapper did not recognize the invocation as a
commit. For example, withalias.ci=commit, runninggit ci -m "..."skipped the inline post-commit stats path, so users would not see the sameyou ... aistats output they get fromgit commit -m "...".Root Cause
The daemon-side path already resolves Git aliases when processing trace events, but the foreground wrapper classified commands using the raw parsed command. That means
git ci -m ...was still seen as commandciwhen deciding whether to run post-commit stats, so this check never matchedcommit.Fix
alias.ci=commitand verifiesgit ci -m ...shows post-commit AI stats.This is a general alias handling fix, not a special case for
ci; aliases and alias chains that resolve tocommitare classified as commit invocations.Tests
cargo fmt --checkgit diff --checkcargo test --test async_mode async_mode_post_commit -- --nocaptureGIT_AI_TEST_GIT_MODE=wrapper-daemon cargo test --test integration git_alias_resolution -- --nocapturetask buildtask lint