diff --git a/.github/scripts/cleancmd.pl b/.github/scripts/cleancmd.pl index d6ddeb7274..722015b08f 100755 --- a/.github/scripts/cleancmd.pl +++ b/.github/scripts/cleancmd.pl @@ -122,7 +122,7 @@ sub process { } my @filemasks = @ARGV; -open(my $git_ls_files, '-|', 'git', 'ls-files', '--', @filemasks) or die "Failed running git ls-files: $!"; +open(my $git_ls_files, '-|', 'git', 'ls-files', '--end-of-options', @filemasks) or die "Failed running git ls-files: $!"; while(my $f = <$git_ls_files>) { chomp $f; process($f); diff --git a/scripts/badwords b/scripts/badwords index a6cc6cd0a2..53c93f4031 100755 --- a/scripts/badwords +++ b/scripts/badwords @@ -318,7 +318,7 @@ sub file { } my @filemasks = @ARGV; -open(my $git_ls_files, '-|', 'git', 'ls-files', '--', ":!:$file", @filemasks) or die "Failed running git ls-files: $!"; +open(my $git_ls_files, '-|', 'git', 'ls-files', '--end-of-options', ":!:$file", @filemasks) or die "Failed running git ls-files: $!"; my @files; while(my $each = <$git_ls_files>) { chomp $each; diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index b1062308a4..ea71ee7ecb 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -1236,12 +1236,12 @@ sub scanfile { @copyright = sort {$$b{year} cmp $$a{year}} @copyright; # if the file is modified, assume commit year this year - if(qx(git status -s -- "$file") =~ /^ [MARCU]/) { + if(qx(git status -s --end-of-options "$file") =~ /^ [MARCU]/) { $commityear = (localtime(time))[5] + 1900; } else { # min-parents=1 to ignore wrong initial commit in truncated repos - my $grl = qx(git rev-list --max-count=1 --min-parents=1 --timestamp HEAD -- "$file"); + my $grl = qx(git rev-list --max-count=1 --min-parents=1 --timestamp --end-of-options HEAD -- "$file"); if($grl) { chomp $grl; $commityear = (localtime((split(/ /, $grl))[0]))[5] + 1900; diff --git a/scripts/delta b/scripts/delta index 7a1793dbb3..d5b174044f 100755 --- a/scripts/delta +++ b/scripts/delta @@ -131,8 +131,8 @@ my $total = $now - Time::Piece->strptime('19980320', '%Y%m%d')->epoch; my $totalhttpget = $now - Time::Piece->strptime('19961111', '%Y%m%d')->epoch; # Number of public functions in libcurl -my $apublic = cmd('git', 'grep', '^CURL_EXTERN', '--', 'include/curl'); -my $bpublic = cmd('git', 'grep', '^CURL_EXTERN', $start, '--', 'include/curl'); +my $apublic = cmd('git', 'grep', '--end-of-options', '^CURL_EXTERN', '--', 'include/curl'); +my $bpublic = cmd('git', 'grep', '--end-of-options', '^CURL_EXTERN', $start, '--', 'include/curl'); my $public = $apublic - $bpublic; # diffstat diff --git a/scripts/singleuse.pl b/scripts/singleuse.pl index fc6cc7f111..6332a9bfec 100755 --- a/scripts/singleuse.pl +++ b/scripts/singleuse.pl @@ -167,7 +167,7 @@ my %api = ( sub doublecheck { my ($f, $used) = @_; - open(F, '-|', 'git', 'grep', '-Fwle', $f, '--', 'lib', @unittests, 'projects'); + open(F, '-|', 'git', 'grep', '-Fwl', '--end-of-options', $f, '--', 'lib', @unittests, 'projects'); my @also; while() { my $e = $_; diff --git a/tests/test1275.pl b/tests/test1275.pl index 3b33bb3cf0..d46fd62489 100755 --- a/tests/test1275.pl +++ b/tests/test1275.pl @@ -29,7 +29,7 @@ use warnings; my $root = $ARGV[0] || ".."; my @m; -if(open(O, '-|', 'git', 'ls-files', '--', $root)) { +if(open(O, '-|', 'git', 'ls-files', '--end-of-options', $root)) { push @m, ; close(O); }