<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/20781">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/gitconfig: update pre-commit script<br><br>The previous pre-commit script generates an error when a commit doesn't<br>actually generate a patch file.  This happens in rare instances when the<br>only change in a patch is to update file permissions.<br><br>Update the pre-commit script to verify that there's actually a patch<br>before calling checkpatch.  Also print that we're running checkpatch<br>so that it doesn't look like odd failures come from lint-stable.<br><br>Fixes Bug #132 - Problem with `lint-stable` when changing mode of file<br><br>Change-Id: I142610b6fc984b2b14fd6c634bc4e7f2880ba987<br>Signed-off-by: Martin Roth <martinroth@google.com><br>---<br>M util/gitconfig/pre-commit<br>1 file changed, 7 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/20781/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit<br>index 70cd6ea..257f696 100755<br>--- a/util/gitconfig/pre-commit<br>+++ b/util/gitconfig/pre-commit<br>@@ -1,3 +1,9 @@<br> #!/bin/sh<br> %MAKE% lint-stable<br>-git diff --cached | util/lint/checkpatch.pl --no-signoff -q -<br>+<br>+PATCHDIFF=$(git diff --cached)<br>+if echo "$PATCHDIFF" | grep -q "@@"; then<br>+       echo<br>+ echo "Running checkpatch"<br>+  echo "$PATCHDIFF" | util/lint/checkpatch.pl --no-signoff -q -<br>+fi<br></pre><p>To view, visit <a href="https://review.coreboot.org/20781">change 20781</a>. To unsubscribe, 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/20781"/><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: I142610b6fc984b2b14fd6c634bc4e7f2880ba987 </div>
<div style="display:none"> Gerrit-Change-Number: 20781 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>