Bugzilla – Attachment 178112 Details for
Bug 39115
Tidy script should list the files we do not want to tidy
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39115: Restore ability to tidy files not in git index (yet)
Bug-39115-Restore-ability-to-tidy-files-not-in-git.patch (text/plain), 1.88 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-02-14 17:24:57 UTC
(
hide
)
Description:
Bug 39115: Restore ability to tidy files not in git index (yet)
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-02-14 17:24:57 UTC
Size:
1.88 KB
patch
obsolete
>From b9406516e1cced9bbff30d74a4457ae368b67736 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 13 Feb 2025 14:03:46 +0100 >Subject: [PATCH] Bug 39115: Restore ability to tidy files not in git index > (yet) > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > misc/devel/tidy.pl | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > >diff --git a/misc/devel/tidy.pl b/misc/devel/tidy.pl >index c2527a2cf22..d67751bd2b5 100755 >--- a/misc/devel/tidy.pl >+++ b/misc/devel/tidy.pl >@@ -42,6 +42,7 @@ my $exceptions = { > tt => [qw(Koha/ILL/Backend/ *doc-head-open.inc misc/cronjobs/rss)], > }; > >+my @original_files = @files; > if (@files) { > > # This is inefficient if the list of files is long but most of the time we will have only one >@@ -53,6 +54,20 @@ if (@files) { > chomp $output; > $output ? $file : (); > } @files; >+ >+ if ( scalar @files != scalar @original_files ) { >+ my @diff = array_minus( @original_files, @files ); >+ for my $file (@diff) { >+ my $cmd = sprintf q{git ls-files %s}, $file; >+ my $output = qx{$cmd}; >+ chomp $output; >+ unless ($output) { >+ l( sprintf "File '%s' not in the index, will be tidy anyway", $file ); >+ push @files, $file >+ ; # At the end of the index so the original order will be modified. This is not a feature and could be fixed later. >+ } >+ } >+ } > } else { > push @files, get_perl_files() if $perl_files; > push @files, get_js_files() if $js_files; >@@ -68,7 +83,7 @@ if (@files) { > if ( $no_write && !@files ) { > > # File should not be tidy, but we need to return the content or we risk data loss >- print read_file(@ARGV); >+ print read_file( $original_files[0] ); > exit; > } > >-- >2.48.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39115
:
177971
|
177972
|
177979
|
177980
|
177984
|
177985
|
178003
|
178017
|
178048
|
178049
|
178050
|
178051
|
178052
|
178053
|
178108
|
178109
|
178110
|
178111
| 178112 |
178113
|
178127