From 182eefd3d4eaf69b609258fd8ce113a3b3d47af6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 13 Feb 2025 16:04:07 +0100 Subject: [PATCH] Bug 39115: Finally use ':(exclude)' and grep This was not working: % git ls-files Koha/Schema.pm --exclude='Koha/Schema/Result' --exclude='Koha/Schema.pm' Koha/Schema.pm The efficiency of the script is getting worse and it will need to be rewritten. The xt/tt_tidy.t will take longer. But at least it should work correctly now Signed-off-by: Nick Clemens --- misc/devel/tidy.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl index d67751bd2b5..1445cc30288 100755 --- a/misc/devel/tidy.pl +++ b/misc/devel/tidy.pl @@ -49,7 +49,7 @@ if (@files) { @files = map { my $file = $_; my $filetype = get_filetype($file); - my $cmd = sprintf q{git ls-files %s %s}, $file, build_git_exclude($filetype); + my $cmd = sprintf q{git ls-files %s | grep %s}, build_git_exclude($filetype), $file; my $output = qx{$cmd}; chomp $output; $output ? $file : (); @@ -139,7 +139,7 @@ sub tidy { sub build_git_exclude { my ($filetype) = @_; - return join( " ", map( "--exclude='$_'", @{ $exceptions->{$filetype} } ) ); + return join( " ", map( "':(exclude)$_'", @{ $exceptions->{$filetype} } ) ); } sub get_perl_files { -- 2.39.5