aosp-merger: Improve merge commit message

* 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
This commit is contained in:
Chirayu Desai
2022-01-10 04:07:45 +05:30
parent 134fd8ad0a
commit e83beff143
2 changed files with 20 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
#!/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