As always: some projects need a first (working) implementation and then over time you can improve them.
During lunch I was talking with a colleague about this tool. Then the idea to just use those actually changed files from the current implementation (means: the current branch in Git) shall be used as input. Et voila: consider it done!
Also added some fine-tuning to the call-parameter of the script itself, so it can be run as well with some custom string beside “todoM” (which is my marker).
Cleaning an implementation of properly tagged lines takes now a second – not minutes (like before!
Enjoy and have fun 🙂
Code can be found as always at https://github.com/marcelpetrick/cleanMyCode/blob/master/remove_todoM.sh
some better package-manager than via that set-up.exe: apt-cyg!
make shell-scripts runnable under Win (7):
add to the first line after “#!/bin/bash”
(set -o igncr) 2>/dev/null && set -o igncr;
else you get the error message that “\r” is not a command … ha
how to use proxy for firewalled use:
Maybe more will be added. All just small, but fixing tricky
I like to decorate the code with some debugging-messages, explicit variables, etc. while developing a feature or fixing a bug. Problem is that other team-members will not like that (or the amount ;)).
So, I commit the current state with Git and then remove all lines marked with the comment “// todoM”. Since this some non-creative work, why not automate it?
Code for the bash-script now on github: https://github.com/marcelpetrick/cleanMyCode 🙂
Further improvements like massive parallelization planned!
The fourth version relies now on some exported bash-function, so that GNU parallel can be used to speed up the process by parallelizing the search&replace inside the file- (-list given by find).
This helps, just I/O is now the bottleneck. CPU-speed not.
But I’ve always wanted to experiment with “parallel” and see how to use this. I should improve the “contactSheet”-script as well. Or the cat-cam-script .. endless opportunities ..