diff options
author | Yvan Roux <yvan.roux@linaro.org> | 2015-06-24 22:52:44 +0200 |
---|---|---|
committer | Yvan Roux <yvan.roux@linaro.org> | 2015-06-25 15:42:40 +0200 |
commit | 600c9b07ae845daa90cdc475b7e94ccec08272d5 (patch) | |
tree | b5fd91aaad8a68380959da13b9fe814686704d77 | |
parent | fc2d9bf046b3c4321c74c2b1896024b6558a28b2 (diff) |
Naive attempt to fix badly formatted ChangeLog entries
Change-Id: I734df28b28addffa6a38e0e97dc7598abdaf6ceb
-rwxr-xr-x | backflip | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -96,6 +96,17 @@ forge_entry() { | grep ^+ \ | sed -e '1d' -e 's:^+::' \ | awk '$1 ~ /^2.*$/ {print "\t"$0} $1 !~ /^2.*$/ {print $0}' > $FRAGFILE + + # Try to fix ChangeLog format frequent issue when the same contributor + # commits 2 patches in a row. Git diff messes up with the context and the + # regular first 2 lines of the entry (DATE NAME MAIL\n\n) ended at the + # bottom of the patch. + if ! head -n 1 $FRAGFILE | grep "<.*@.*>" \ + && tail -n 2 $FRAGFILE | grep "<.*@.*>" > /dev/null; then + tail -n 2 $FRAGFILE > ${FRAGFILE}.tmp + head -n -2 $FRAGFILE >> ${FRAGFILE}.tmp + mv ${FRAGFILE}.tmp $FRAGFILE + fi print_info "${bold}Forged ChangeLog entry:${NC}" cat $FRAGFILE if $INTERACTIVE; then |