summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYvan Roux <yvan.roux@linaro.org>2015-06-24 22:52:44 +0200
committerYvan Roux <yvan.roux@linaro.org>2015-06-25 15:42:40 +0200
commit600c9b07ae845daa90cdc475b7e94ccec08272d5 (patch)
treeb5fd91aaad8a68380959da13b9fe814686704d77
parentfc2d9bf046b3c4321c74c2b1896024b6558a28b2 (diff)
Naive attempt to fix badly formatted ChangeLog entries
Change-Id: I734df28b28addffa6a38e0e97dc7598abdaf6ceb
-rwxr-xr-xbackflip11
1 files changed, 11 insertions, 0 deletions
diff --git a/backflip b/backflip
index 625c8b3..aaa2c0e 100755
--- a/backflip
+++ b/backflip
@@ -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