<p>Alex Thiessen has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/23096">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/gitconfig: Use `make` in git hooks<br><br>As the code was moved from the Makefile.inc to a separate file in commit<br>9ab8ae6a (util/gitconfig: Make gitconfig a bash script), `$(MAKE)` was<br>replaced by `remake`, introducing dependency on this tool which is<br>basically a `make` with debugging capabilities. Many developers don't<br>have `remake` installed, leading to pre-commit hooks being not executed<br>properly. Apparently this was an unintentional change.<br><br>Furthermore, special treatment of `make` tool via the `%MAKE%`<br>substitution performed during hooks' deployment doesn't seem justified.<br>It was introduced in commit f3947152 (gitconfig: Use the right make<br>executable in git hooks) and back then, `make` was called via `exec`.<br>This is not the case anymore since commit b18f522b (lint/gitconfig:<br>Enable checkpatch.pl checking of commits) and I think it's obsolete now.<br><br>Replace `sed` and `chmod +x` with `install` for brevity.<br><br>Change-Id: Ia78e06567b904b342dc9b7778569201fe02e6897<br>Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com><br>---<br>M util/gitconfig/gitconfig.sh<br>M util/gitconfig/pre-commit<br>2 files changed, 3 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/23096/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/gitconfig/gitconfig.sh b/util/gitconfig/gitconfig.sh</span><br><span>index 5f91a69..e6da0ee 100755</span><br><span>--- a/util/gitconfig/gitconfig.sh</span><br><span>+++ b/util/gitconfig/gitconfig.sh</span><br><span>@@ -7,8 +7,7 @@</span><br><span> for hook in commit-msg pre-commit ; do</span><br><span>    if [ util/gitconfig/$hook -nt .git/hooks/$hook ] || \</span><br><span>                [ ! -x .git/hooks/$hook ]; then</span><br><span style="color: hsl(0, 100%, 40%);">-         sed -e "s,%MAKE%,remake,g" util/gitconfig/$hook > .git/hooks/$hook</span><br><span style="color: hsl(0, 100%, 40%);">-         chmod +x .git/hooks/$hook</span><br><span style="color: hsl(120, 100%, 40%);">+             install "util/gitconfig/${hook}" ".git/hooks"</span><br><span>    fi</span><br><span> done</span><br><span> # Now set up the hooks for 3rdparty/</span><br><span>@@ -16,9 +15,7 @@</span><br><span>       if [ -d $hooks ]; then</span><br><span>               if [ util/gitconfig/commit-msg -nt $hooks/commit-msg ] || \</span><br><span>                  [ ! -x $hooks/commit-msg ]; then</span><br><span style="color: hsl(0, 100%, 40%);">-                        sed -e "s,%MAKE%,remake,g" \</span><br><span style="color: hsl(0, 100%, 40%);">-                          util/gitconfig/commit-msg > $hooks/commit-msg</span><br><span style="color: hsl(0, 100%, 40%);">-                        chmod +x $hooks/commit-msg</span><br><span style="color: hsl(120, 100%, 40%);">+                    install "util/gitconfig/commit-msg" "${hooks}"</span><br><span>           fi</span><br><span>   fi</span><br><span> done</span><br><span>diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit</span><br><span>index 1c04bc3..2c1a2aa 100755</span><br><span>--- a/util/gitconfig/pre-commit</span><br><span>+++ b/util/gitconfig/pre-commit</span><br><span>@@ -1,5 +1,5 @@</span><br><span> #!/bin/sh</span><br><span style="color: hsl(0, 100%, 40%);">-%MAKE% lint-stable</span><br><span style="color: hsl(120, 100%, 40%);">+make lint-stable</span><br><span> </span><br><span> PATCHDIFF=$(git diff --cached)</span><br><span> if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/23096">change 23096</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/23096"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia78e06567b904b342dc9b7778569201fe02e6897 </div>
<div style="display:none"> Gerrit-Change-Number: 23096 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alex Thiessen <alex.thiessen.de+coreboot@gmail.com> </div>