Bug 39114 - Auto-rebase script does not deal correctly with deleted files
Summary: Auto-rebase script does not deal correctly with deleted files
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Baptiste Wojtkowski (bwoj)
URL:
Keywords:
Depends on: 38664
Blocks:
  Show dependency treegraph
 
Reported: 2025-02-12 19:10 UTC by Jonathan Druart
Modified: 2025-02-13 16:15 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39114: The auto-rebase script - Fix files removal (1.89 KB, patch)
2025-02-12 19:13 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39114: The auto-rebase script - Fix files removal (1.96 KB, patch)
2025-02-13 09:12 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 39114: The auto-rebase script - Fix files removal (3.28 KB, patch)
2025-02-13 09:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39114: The auto-rebase script - Fix files removal (3.21 KB, patch)
2025-02-13 11:20 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39114: The auto-rebase script - Fix files removal (3.31 KB, patch)
2025-02-13 14:15 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39114: The auto-rebase script - Fix files removal (3.37 KB, patch)
2025-02-13 16:04 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-02-12 19:10:18 UTC
It's using `$git->rm($file)` but this does not work.
Comment 1 Jonathan Druart 2025-02-12 19:13:39 UTC
Created attachment 177970 [details] [review]
Bug 39114: The auto-rebase script - Fix files removal

It's using `$git->rm($file)` but this does not work.

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl
Comment 2 Matt Blenkinsop 2025-02-13 09:12:56 UTC
Created attachment 177986 [details] [review]
Bug 39114: The auto-rebase script - Fix files removal

It's using `$git->rm($file)` but this does not work.

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 3 Jonathan Druart 2025-02-13 09:37:27 UTC
Created attachment 177988 [details] [review]
Bug 39114: The auto-rebase script - Fix files removal

Wrong handling of the return of the try-catch, $git->rm has an output
("rm /file/path").

This patch retrieves the status from the `git diff-tree` output

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 4 Katrin Fischer 2025-02-13 10:22:19 UTC
Thanks Matt!
Comment 5 Jonathan Druart 2025-02-13 11:20:46 UTC
Created attachment 177989 [details] [review]
Bug 39114: The auto-rebase script - Fix files removal

Wrong handling of the return of the try-catch, $git->rm has an output
("rm /file/path").

This patch retrieves the status from the `git diff-tree` output

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl
Comment 6 Nick Clemens (kidclamp) 2025-02-13 14:15:28 UTC
Created attachment 178012 [details] [review]
Bug 39114: The auto-rebase script - Fix files removal

Wrong handling of the return of the try-catch, $git->rm has an output
("rm /file/path").

This patch retrieves the status from the `git diff-tree` output

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl

WNC amended patch, tidied, ironically

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens (kidclamp) 2025-02-13 14:16:01 UTC
Not sure why Matt's sign off got lost, but feel free to move to PQA and add it back
Comment 8 Jonathan Druart 2025-02-13 14:19:26 UTC
(In reply to Nick Clemens (kidclamp) from comment #7)
> Not sure why Matt's sign off got lost, but feel free to move to PQA and add
> it back

He tested a previous version of the patch.
Comment 9 Baptiste Wojtkowski (bwoj) 2025-02-13 16:04:58 UTC
Created attachment 178035 [details] [review]
Bug 39114: The auto-rebase script - Fix files removal

Wrong handling of the return of the try-catch, $git->rm has an output
("rm /file/path").

This patch retrieves the status from the `git diff-tree` output

Test plan:
git checkout HEAD~100 (so you are before 38664)
git rm mainpage.pl
edit C4/Auth.pm and make some changes
git commit -a --no-verify -m"Bug 12345: test"
then rebase your branch
Retrieve the auto_rebase.pl version from this patch and run it
perl auto_rebase.pl

The resulted commit should not contain mainpage.pl

WNC amended patch, tidied, ironically

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 10 Katrin Fischer 2025-02-13 16:15:26 UTC
Pushed for 25.05!

Well done everyone, thank you!