Is it possible to automate hunk selection for git add interactive patch mode?
When git add -p is run user can select which hunk to add to the stage, also the user can edit hunks for stage. Sometimes the amount of hunks are large, but they can be accepted/rejected based on some simple rule (e.g. I want to filter out all calls to debug function in staging). Is there a way to automate this process, apart of writing expect script spawning git add -p? Writing the expect script is too error prone.