Mklog parses the diff content from prepare-commit-msg hook but fails
when git has been configured with some options (eg. mnemonicPrefix).
Forcing the default values for the prefixes and the algorithm would
set a distinct diff configuration supported by mklog and prevent most
failures.

contrib/ChangeLog:

        * prepare-commit-msg: Force default git prefixes and algorithm usage.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.pa...@embecosm.com>
---
 contrib/prepare-commit-msg | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/contrib/prepare-commit-msg b/contrib/prepare-commit-msg
index 1b878772dcc..fc4c4d80b16 100755
--- a/contrib/prepare-commit-msg
+++ b/contrib/prepare-commit-msg
@@ -78,4 +78,8 @@ else
     tee="cat"
 fi
 
-git $cmd | $tee | git gcc-mklog -c "$COMMIT_MSG_FILE"
+# Provides a baseline for everyone, we only need to deal with the default
+# values within mklog.
+default_values="--diff-algorithm=default --default-prefix"
+
+git $cmd $default_values | $tee | git gcc-mklog -c "$COMMIT_MSG_FILE"
-- 
2.47.2

Reply via email to