scripts: replace/extend -- with --end-of-options in git commands - #22369
Closed
vszakats wants to merge 4 commits into
Closed
scripts: replace/extend -- with --end-of-options in git commands#22369vszakats wants to merge 4 commits into
-- with --end-of-options in git commands#22369vszakats wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates several Perl/scripts that invoke Git commands, replacing -- with --end-of-options to explicitly terminate option parsing and thereby require Git 2.24.0+.
Changes:
- Replaced
--with--end-of-optionsin variousgit ls-files,git status,git rev-list, andgit grepinvocations. - Standardized option-termination handling across test and maintenance scripts.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test1275.pl |
Uses --end-of-options for git ls-files pathspec handling. |
scripts/singleuse.pl |
Updates git grep invocation (currently introduces an argument-order/semantics problem). |
scripts/delta |
Updates git grep invocation (currently introduces a rev/path separator problem). |
scripts/checksrc.pl |
Updates git status and git rev-list invocations (rev-list change currently breaks path-limiting semantics). |
scripts/badwords |
Uses --end-of-options for git ls-files pathspec handling. |
.github/scripts/cleancmd.pl |
Uses --end-of-options for git ls-files pathspec handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
It makes these scripts require Git 2.24.0+ (2019-11-04). Refs: https://git-scm.com/docs/gitcli https://nesbitt.io/2026/07/21/end-of-options.html git/git@19e8789
vszakats
force-pushed
the
git-end-of-options
branch
from
July 22, 2026 10:41
f27338d to
64b829c
Compare
-- with --end-of-options-- with --end-of-options
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
scripts/delta:134
git greptreats extra arguments after the pattern as revisions unless--is used to start the pathspec list. Dropping the--here changes behavior if a ref namedinclude/curlexists (it would grep that revision instead of theinclude/curlpath). Keep the explicit--to preserve the original, unambiguous pathspec parsing.
my $apublic = cmd('git', 'grep', '--end-of-options', '^CURL_EXTERN', 'include/curl');
scripts/singleuse.pl:170
- This previously used
--after the pattern to force the following arguments to be treated as pathspecs (not revisions) bygit grep. With only--end-of-optionshere, a ref namedlib/projects/etc could be interpreted as a revision, changing what gets searched. Add back the--delimiter after$fto keep the original unambiguous behavior.
open(F, '-|', 'git', 'grep', '-Fwle', '--end-of-options', $f, 'lib', @unittests, 'projects');
-- with --end-of-options-- with --end-of-options in git commands
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.
It makes these scripts require Git 2.24.0+ (2019-11-04).
Refs:
https://git-scm.com/docs/gitcli
https://nesbitt.io/2026/07/21/end-of-options.html
git/git@19e8789