べすとえふぉーと

プログラミング等のノート 

gitのログから変更したファイルを抽出してcsvに出力

git log  $starthash...$endhash --name-only \ 
| grep -e "src"   -e "config" \ 
| grep -v "exclude_string_1" \ 
| grep -v "exclude_string_2" \ 
| sort \ 
| uniq \ 
| xargs find > ../pathlist.txt 2>/dev/null ; cat ../pathlist.txt \ 
| awk -F "/" '{ print $NF }' > ../filenames.txt \ 
 && paste -d , ../pathlist.txt ../filenames.txt > ../filenameandpath.csv \ 
 && rm ../pathlist.txt ../filenames.txt  

$starthash から$endhashまでを抽出
grep -e のオプションでディレクトリ指定
exclude_string_1、exclude_string_2で除外したい文字を指定
filenameandpath.csvが出力されるcsv