On 6/11/20 9:45 AM, Martin Liška wrote:
On 6/10/20 2:15 PM, Jonathan Wakely wrote:
And this is another little patch that just avoids running 'git diff'
twice, by using tee(1) to write to $GCC_GIT_DIFF_FILE as a side effect
of generating the diff to pipe to mklog.py.

Thanks, please install the improvement.

Martin

I've pushed the patch as I'm going to replace my GCC_GIT_DIFF_FILE environment
variable with a more feasible 'git config gcc-config.diff-file'.

Pushed to master as well.
Martin
>From 2dd6d9d4029d99c5ad54a21677506bd25e3f7540 Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Thu, 11 Jun 2020 10:02:26 +0200
Subject: [PATCH] prepare-commit-hook: Use gcc-config.diff-file.

contrib/ChangeLog:

	* prepare-commit-msg: Replace ENV variable with a git config
	value.
---
 contrib/prepare-commit-msg | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/prepare-commit-msg b/contrib/prepare-commit-msg
index 57bb91747f6..d4971e65092 100755
--- a/contrib/prepare-commit-msg
+++ b/contrib/prepare-commit-msg
@@ -58,8 +58,9 @@ else
 fi
 
 # Save diff to a file if requested.
-if ! [ -z "$GCC_GIT_DIFF_FILE" ]; then
-    tee="tee $GCC_GIT_DIFF_FILE"
+DIFF_FILE = $(git config gcc-config.diff-file)
+if ! [ -z "$DIFF_FILE" ]; then
+    tee="tee $DIFF_FILE"
 else
     tee="cat"
 fi
-- 
2.26.2

Reply via email to