Wednesday, January 29, 2014

git log -p splitting

At work we have two related code bases.  Recently one of them received a lot of loving, and the other needed the same treatment to work better with new Perl and modules. The one ha gotten several hundred patches, and browsing that many and cherrypicking them got tiresome.  It was better for me to split the whole log into separate patches and review and apply one by one and then moving the "done" patches to a different directory.


Here, the small hack to split "git log -p" into one patch pr. file:

#!/bin/bash

awk 'BEGIN { FN=0; }
     /^commit / { FN++; }
     { print $0 >> FN }' $1


No comments: