tools/verifygitlog.py: Fix --pretty filter to inspect each arg.#19274
Open
finnmglas wants to merge 1 commit into
Open
tools/verifygitlog.py: Fix --pretty filter to inspect each arg.#19274finnmglas wants to merge 1 commit into
finnmglas wants to merge 1 commit into
Conversation
The list comprehension checked "--pretty" not in args (the entire argument list) instead of "--pretty" not in arg (the current element), so the filter could not actually strip a user-supplied --pretty argument from the call to git log. Signed-off-by: Finn Glas <finn@finnmglas.com>
|
Code size report: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19274 +/- ##
=======================================
Coverage 98.47% 98.47%
=======================================
Files 176 176
Lines 22845 22845
=======================================
Hits 22497 22497
Misses 348 348 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
Small fix:
The list comprehension in
git_log()was meant to strip a user-supplied--prettyargument before appending the scripts own--pretty=format:, but the test checked the wrong variable:The check "--pretty" not in args looks for an exact "--pretty" element in the entire arg list rather than testing the current arg for --pretty as a substring, so the filter never strips anything.
Testing
Tested locally:
the user-supplied --pretty before the script appends its own.
Generative AI
I did not use generative AI tools when creating this PR.
(This fix is very minor so didn't need it. Generally use it tho.)