<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>
<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">
<div></div>
<p dir="auto">Just an idea, if you agree I'll create an MR.</p>
<p dir="auto">We can easily check that Author's email matches with the email in Signed-off-by in every runner - it just takes 0.1s. It makes us independent of server side git hooks, which may work or not (out of our control, see <a href="https://gitlab.com/gnutls/gnutls/merge_requests/858" data-original="!858" data-link="false" data-link-reference="false" data-project="179611" data-merge-request="21774279" data-reference-type="merge_request" data-container="body" data-placement="bottom" title="Fix typo when checking for ed25519 support" class="gfm gfm-merge_request has-tooltip">!858</a>).</p>
<p dir="auto">If it doesn't match, the complete pipeline would stop/error immediately and we wouldn't have to wait hours for a notification email.</p>
<p dir="auto">I suggest this little script:</p>
<pre class="code highlight js-syntax-highlight plaintext" lang="plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#/usr/bin/env sh</span>
<span id="LC2" class="line" lang="plaintext"></span>
<span id="LC3" class="line" lang="plaintext"># create list of commits of the current branch</span>
<span id="LC4" class="line" lang="plaintext">commits=$(git rev-list --no-merges master..)</span>
<span id="LC5" class="line" lang="plaintext"></span>
<span id="LC6" class="line" lang="plaintext"># check if author's email matches email in 'Signed-off-by'</span>
<span id="LC7" class="line" lang="plaintext">for hash in $commits; do</span>
<span id="LC8" class="line" lang="plaintext"> author=$(git log --format='%ae' ${hash}^\!)</span>
<span id="LC9" class="line" lang="plaintext"> signed=$(git log --format='%b' ${hash}^\! | grep -i "Signed-off-by:")</span>
<span id="LC10" class="line" lang="plaintext"> if test $? -ne 0; then</span>
<span id="LC11" class="line" lang="plaintext"> echo "Missing Signed-off-by"</span>
<span id="LC12" class="line" lang="plaintext"> exit 1</span>
<span id="LC13" class="line" lang="plaintext"> fi</span>
<span id="LC14" class="line" lang="plaintext"> if ! echo $signed | grep -q "Signed-off-by:.*<${author}>"; then</span>
<span id="LC15" class="line" lang="plaintext"> echo "Author '${author}' doesn't match"</span>
<span id="LC16" class="line" lang="plaintext"> exit 1</span>
<span id="LC17" class="line" lang="plaintext"> fi</span>
<span id="LC18" class="line" lang="plaintext">done</span></code></pre>
<p dir="auto">If you agree, please let me know where to put it.</p>
</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777777;">
—
<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/issues/668">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/sent_notifications/38cfcb4900e80852467cabad4fc99add/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/issues/668"}}</script>
</p>
</div>
</body>
</html>