grep '+++' mydiff.patch|perl -pe 's/\+\+\+ //g'
:
git diff
, grep,
grep '+++' mydiff.patch
, "+++" (3 ).
- . , perl/regex .
grep '+++' mydiff.patch|perl -pe 's/\+\+\+ //g'
For patch files created using diff -Naur, the mydiff.patch file contains entries with the file name and date (indicates the space character of the tab)
To extract the file names for this, use
grep '+++' mydiff.patch|perl -pe 's/\+\+\+ (.*)\t.*/\1/g'
source
share