GeezerVison is showing github.com — refactor: save a git call when the author is on ignore_authors by shenxianpeng · Pull Request #694 · commit-check/commit-check
Conversation
Before: since #692, an author check that gets no message asks git whether a commit exists before it reads ignore_authors. An author on the list costs one git command more than in 2.20.4. Git commands run by commit-check --author-name (from GIT_TRACE) when the last commit is by dependabot[bot], who is on the list:
git rev-parse --git-dir
git rev-parse --verify HEAD
git log -n 1 '--pretty=format:%an' HEAD
⊘ skipped (not validated): author-name
CodSpeed reported two author benchmarks 18% slower on #692; both ran this extra lookup.
After: the same two commands as 2.20.4.
git rev-parse --git-dir
git log -n 1 '--pretty=format:%an' HEAD
⊘ skipped (not validated): author-name
How
AuthorValidator.validate reads ignore_authors first again and looks up whether a commit exists only when the list said no. In a repository with no commits it then asks the list a second time about the identity the first commit will carry, so what fix: check the first commit's author, name author.* in the CC017 advice #692 fixed stays fixed.
test_get_author_value_with_email_format mocks git but ran the commit lookup against the real repository. It now passes has_head=True, so nothing is looked up. Patching the lookup instead was slower than the git call by CodSpeed's count (callgrind, per run: 1.47M instructions on main, 1.92M with the extra patch, 1.26M with has_head=True).
- No change in results. Across the whole suite these two tests are the only ones whose git command count changes (1 to 0); coverage stays at 100%.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The author checks asked git whether a commit exists before they read
ignore_authors, so an author on the list cost one `git rev-parse` more
than in 2.20.4. Read the list first again, and look the commit up only
when the list said no; a repository with no commits then asks the list
a second time about the identity the first commit will carry.
One test of the fallback to the last commit's author ran that lookup
against the real repository. It now patches it like the other git calls.
coderabbitai
Bot
commented
Nov 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Nov 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (079bb74) to head (5305273).
Additional details and impacted files
@@ Coverage Diff @@
## main #694 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 2598 2600 +2
Branches 507 508 +1
=========================================
+ Hits 2598 2600 +2
☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codspeed
Bot
commented
Nov 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will improve performance by 27.34%
2 warnings
⚠️ 133 benchmarks are dominated by system calls
System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
Learn more about system calls
See affected benchmarks
⚠️ 4 benchmarks with a significant change ran on different hardware
Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.
Learn more about Macro Runners
See affected benchmarks
⚡ 4 improved benchmarks
✅ 681 untouched benchmarks
⏩ 131 skipped benchmarks1
Performance Changes
Tip Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/project-thread-pofwgp (5305273) with main (079bb74)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Patching has_commits in the fallback test built a mock that costs more
than the git call it replaced, by CodSpeed's count. The test now tells
_get_author_value that a commit exists, so nothing is looked up.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|