projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
656e363
)
contrib: Avoid redundant 'git diff' in prepare-commit-msg hook
author
Jonathan Wakely
<jwakely@redhat.com>
Thu, 11 Jun 2020 07:57:58 +0000
(09:57 +0200)
committer
Martin Liska
<mliska@suse.cz>
Thu, 11 Jun 2020 07:57:58 +0000
(09:57 +0200)
contrib/ChangeLog:
* prepare-commit-msg: Use 'tee' to save the diff to a file
instead of running 'git diff' twice.
contrib/prepare-commit-msg
patch
|
blob
|
history
diff --git
a/contrib/prepare-commit-msg
b/contrib/prepare-commit-msg
index 24f0783aae24e59b7954dac3693ae598a3180db7..57bb91747f68f96d9dcc597ef7ec6c710c985ce4 100755
(executable)
--- a/
contrib/prepare-commit-msg
+++ b/
contrib/prepare-commit-msg
@@
-59,7
+59,9
@@
fi
# Save diff to a file if requested.
if ! [ -z "$GCC_GIT_DIFF_FILE" ]; then
- git $cmd > "$GCC_GIT_DIFF_FILE";
+ tee="tee $GCC_GIT_DIFF_FILE"
+else
+ tee="cat"
fi
-git $cmd | git gcc-mklog -c "$COMMIT_MSG_FILE"
+git $cmd |
$tee |
git gcc-mklog -c "$COMMIT_MSG_FILE"