From 7b8ee33affd968d3a8f5f6224268702d1900f0a1 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 26 May 2020 09:08:31 +0200 Subject: [PATCH] prepare-commit-msg: Save diff if requested by user. contrib/ChangeLog: * prepare-commit-msg: Save diff to a file if the GCC_GIT_DIFF_FILE variable is set. --- contrib/prepare-commit-msg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contrib/prepare-commit-msg b/contrib/prepare-commit-msg index 820dacc7e42..fd59bfbcf88 100755 --- a/contrib/prepare-commit-msg +++ b/contrib/prepare-commit-msg @@ -54,4 +54,9 @@ else exit 0 fi +# Save diff to a file if requested. +if ! [ -z "$GCC_GIT_DIFF_FILE" ]; then + git $cmd > "$GCC_GIT_DIFF_FILE"; +fi + git $cmd | git gcc-mklog -c "$COMMIT_MSG_FILE" -- 2.30.2