Skip to content

scripts: replace/extend -- with --end-of-options in git commands - #22369

Closed
vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:git-end-of-options
Closed

scripts: replace/extend -- with --end-of-options in git commands#22369
vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:git-end-of-options

Conversation

@vszakats

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings July 22, 2026 10:25
@github-actions github-actions Bot added tests CI Continuous Integration script labels Jul 22, 2026
@vszakats vszakats removed tests CI Continuous Integration labels Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-options in various git ls-files, git status, git rev-list, and git grep invocations.
  • 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.

Comment thread scripts/singleuse.pl Outdated
Comment thread scripts/delta Outdated
Comment thread scripts/checksrc.pl Outdated
Copilot AI review requested due to automatic review settings July 22, 2026 10:41
@vszakats
vszakats force-pushed the git-end-of-options branch from f27338d to 64b829c Compare July 22, 2026 10:41
@vszakats vszakats changed the title scripts: replace -- with --end-of-options scripts: replace/extend -- with --end-of-options Jul 22, 2026
@github-actions github-actions Bot added tests CI Continuous Integration labels Jul 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 grep treats extra arguments after the pattern as revisions unless -- is used to start the pathspec list. Dropping the -- here changes behavior if a ref named include/curl exists (it would grep that revision instead of the include/curl path). 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) by git grep. With only --end-of-options here, a ref named lib/projects/etc could be interpreted as a revision, changing what gets searched. Add back the -- delimiter after $f to keep the original unambiguous behavior.
    open(F, '-|', 'git', 'grep', '-Fwle', '--end-of-options', $f, 'lib', @unittests, 'projects');

Copilot AI review requested due to automatic review settings July 22, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 22, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@vszakats vszakats changed the title scripts: replace/extend -- with --end-of-options scripts: replace/extend -- with --end-of-options in git commands Jul 22, 2026
@vszakats vszakats closed this in 41b4a91 Jul 22, 2026
@vszakats
vszakats deleted the git-end-of-options branch July 22, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration script tests

Development

Successfully merging this pull request may close these issues.

2 participants