<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Elsa Gonsiorowski</title>
        <description>My Personal Website</description>
        <link>http://gonsie.com/</link>
        <atom:link href="http://gonsie.com/blorg/feeds/coding.xml" rel="self" type="application/rss+xml"/>
        <pubDate>Tue, 19 May 2026 17:45:38 +0000</pubDate>
        <lastBuildDate>Tue, 19 May 2026 17:45:38 +0000</lastBuildDate>
        <generator>Jekyll v3.10.0</generator>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
            <item>
                <title>Verify git sign-off with TravisCI</title>
                <author>gonsie@me.com (Elsa Gonsiorowski)</author>
                <description>&lt;p&gt;I don’t know how to explain my role as a contributor to the &lt;a href=&quot;https://github.com/hpc/mpifileutils&quot;&gt;mpiFileUtils&lt;/a&gt; project.
I joined because these tools are so incredibly useful and just plain cool!
I also wanted to represent HPC users and contribute documentation to get more people using them.
While I haven’t touched the “core” code, I have &lt;a href=&quot;https://github.com/hpc/mpifileutils/pull/208&quot;&gt;converted the build system to CMake&lt;/a&gt;, created distinct &lt;a href=&quot;https://mpifileutils.readthedocs.io/&quot;&gt;user&lt;/a&gt; and &lt;a href=&quot;https://github.com/hpc/mpifileutils/wiki&quot;&gt;developer&lt;/a&gt; documentation, and begun acting as &lt;a href=&quot;https://en.wikipedia.org/wiki/Scrum_(software_development)&quot;&gt;scrum master&lt;/a&gt; for the team’s development process.&lt;/p&gt;

&lt;p&gt;One thing I noticed recently is that our documented &lt;a href=&quot;https://github.com/hpc/mpifileutils/blob/master/.github/CONTRIBUTING.md&quot;&gt;contributing requirements&lt;/a&gt; did not match what we were doing in practice. 
Namely, our team had agreed to use ‘signed-off’ commits as part of our project (inspired by &lt;a href=&quot;https://www.open-mpi.org/faq/?category=contributing#contribute-code&quot;&gt;OpenMPI&lt;/a&gt;).
But, since we hadn’t automated the check for it, the sign-off wasn’t always happening.&lt;/p&gt;

&lt;p&gt;So, today I set about remedying the situation.&lt;/p&gt;

&lt;h2 id=&quot;verifying-a-git-sign-off&quot;&gt;Verifying a git sign-off&lt;/h2&gt;

&lt;p&gt;We use a less strict form of git signatures, simply a “Signed-off-by” line in the commit message (rather than a full-blown gpg key signature).
This can/should be automatically added to a commit message with the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git commit -s&lt;/code&gt; flag.
The check to see if the latest commit has the sign-off is simple:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git show &lt;span class=&quot;nt&quot;&gt;--summary&lt;/span&gt; HEAD | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-q&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Signed-off-by:&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;integration-with-travisci&quot;&gt;Integration with TravisCI&lt;/h2&gt;

&lt;p&gt;We already run some automated tests with &lt;a href=&quot;https://travis-CI.org&quot;&gt;TravisCI&lt;/a&gt;.
Travis offers a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;before_script&lt;/code&gt; step which triggers before the build of our project.
This is the perfect place for the git-show + grep one liner!
Everything seemed to work… until I actually created the pull request for this change.
Strange.&lt;/p&gt;

&lt;p&gt;Turns out, TravisCI not only checks that a branch passes the tests, but it also checks that a branch &lt;em&gt;merged with master&lt;/em&gt; passes the tests.
Travis was doing a merge, thus changing the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HEAD&lt;/code&gt;, before running the verify line.
So, the verify should only trigger for testing the branch.
Luckily, Travis provides an environment variable set to if the tests are running on a PR or not.&lt;/p&gt;

&lt;p&gt;Thus, the one-liner becomes:&lt;/p&gt;

&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;s1&quot;&gt;&apos;if [ &quot;$TRAVIS_PULL_REQUEST&quot; = &quot;false&quot; ]; then git show --summary HEAD | grep -q &quot;Signed-off-by:&quot;; fi&apos;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With this small change it is now easy and automatic for our team to hold ourselves to the standards we’ve set.&lt;/p&gt;

&lt;h2 id=&quot;caveats&quot;&gt;Caveats&lt;/h2&gt;

&lt;p&gt;The mpifileutils team has agreed that we won’t enforce a sign-off on every commit, just the final commit of a pull request. 
Therefore, this check only looks at &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HEAD&lt;/code&gt;, the last commit that was made.&lt;/p&gt;
</description>
                <pubDate>Mon, 15 Apr 2019 00:00:00 +0000</pubDate>
                <link>http://gonsie.com/blorg/travisci-verify-signoff.html</link>
                <guid isPermaLink="true">http://gonsie.com/blorg/travisci-verify-signoff.html</guid>
                
                <category>coding</category>
                
                
            </item>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    </channel>
</rss>
