* Merge and commit separately, to get newline between commit content and Change-Id * Install prepare-commit-msg git hook, for nicer conflict messages https://gist.github.com/mikeNG/e55ef8e7a1e5cd596a950386503054fd/ Change-Id: I97370b352ccf4f146b4b6ea89af75e032fb13730
15 lines
438 B
Bash
15 lines
438 B
Bash
#!/bin/sh
|
|
|
|
case "$2,$3" in
|
|
merge,)
|
|
if grep -q "# It looks like you may be committing a merge." "$1"; then
|
|
sed -i -e '/# ------------------------ >8 ------------------------/,+3d' "$1"
|
|
/usr/bin/perl -i.bak -ne 's/^#// if /^# Conflicts/ .. /^#\R/; print' "$1"
|
|
sed -i '/ It looks like you may be committing a merge./i # ------------------------ >8 ------------------------' "$1"
|
|
fi
|
|
;;
|
|
|
|
*)
|
|
;;
|
|
esac
|