Ever since patchfolders were created for different branches and different board families it has become more and more a nightmare to maintain these folders and keep them clean.
Instead of taking the approach to clear one or more of these folders by myself, last but not least due to lack of necessary skills, I was thinking maybe I can provide some tools that make such tasks a little easier for somebody else.
Last but not least was (and still is) this a perfect opportunity to pratice with my quite new Python skills.
https://github.com/EvilOlaf/refactorpatches
What this script basically does is break down all patches in a certain folder and check which files are targeted by each individual diff (if you choose to split them up) and sort the output by the target file.
This way it should be an easy thing to merge patches that affect the same file and therefore it is no longer necessary to take care about the order to apply them.
Requirements from apt: patchutils, python3
Requirements from Pypi: none but just make sure the prettytable.py is in the same folder as main refactor.py.
I have tested this with random patch folders for kernel patches and for what it is expected to do at the current state it seems to just work as it should.
There is still a ton of room for improvements.
Let me know what do you think or if it is useful at all. Even if it is not I had fun coding and using Python