<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jason Rhodes on Medium]]></title>
        <description><![CDATA[Stories by Jason Rhodes on Medium]]></description>
        <link>https://medium.com/@rhodesjason?source=rss-e9ca5ef412d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*rYifExRJ61xQRCv17IW3eg.png</url>
            <title>Stories by Jason Rhodes on Medium</title>
            <link>https://medium.com/@rhodesjason?source=rss-e9ca5ef412d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:01:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rhodesjason/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[git+ is a lifestyle]]></title>
            <link>https://medium.com/@rhodesjason/git-is-a-lifestyle-aa796b59392b?source=rss-e9ca5ef412d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa796b59392b</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Jason Rhodes]]></dc:creator>
            <pubDate>Fri, 09 Dec 2016 05:24:58 GMT</pubDate>
            <atom:updated>2016-12-09T14:31:39.520Z</atom:updated>
            <content:encoded><![CDATA[<h4>Control your team git process with custom commands and magic</h4><blockquote>Note: Originally published for <a href="https://medium.com/u/12579b0cb1b5">Mariko Kosaka</a>’s 2016 <a href="http://web.advent.today/">web.advent.today</a> calendar—make sure you check out all the <a href="http://web.advent.today/">other great articles</a> for the month.</blockquote><p>Here’s a familiar story, maybe: You grab another cup of coffee or tea and sit down to get started for the day. The feature you’ve been working on for two weeks finally made it through review and it’s time to merge. And then–</p><pre>$ git checkout master<br>$ git merge some-feature<br>$ git push<br> ! [rejected]        master -&gt; master (fetch first)<br>error: failed to push some refs to &#39;<a href="/service/mailto:git@github.com">git@github.com</a>:something/project.git&#39;<br>hint: Updates were rejected because the remote contains work that you do<br>hint: not have locally. This is usually caused by another repository pushing<br>hint: to the same ref. You may want to first integrate the remote changes<br>hint: (e.g., &#39;git pull ...&#39;) before pushing again.<br>hint: See the &#39;Note about fast-forwards&#39; in &#39;git push --help&#39; for details.</pre><p>“THANKS FOR THE HINTS, SHITHUB!” you yell, immediately ashamed of yourself. You recall <a href="http://ohshitgit.com/">ohshitgit.com</a> and <a href="http://git-undo.com/">Todd’s web advent article</a> you read last week and you wonder why there are so many websites about how to fix git mistakes and omg now you’re <em>so mad</em> at git you could almost leave a comment about it<em>. </em>“Why do I have to remember these lists of repetitive commands to type in a specific order all the time??” you whine, contrivedly. “Why can’t git just take care of this for me???”</p><p>It can! (Or else I totally wouldn’t have written this!)</p><p>At <a href="https://sparkpost.com/">SparkPost</a>, my team of about 20 engineers recently moved all of our code from mercurial into git. Several of us had used git for open-source projects for years and I’m a big fan, but not everyone was equally comfortable with it. And with a team our size, we had version control processes we were used to that were working for us.</p><p>Since a lot of that process was from a tool we’d used called hg-flow, we first reached for git-flow hoping it would make our git process easier. For reasons too boring to explain, it didn’t. We still wanted some process, but we couldn’t rely on everyone remembering “lists of repetitive commands to type in a specific order all the time”. So I made <a href="https://github.com/sparkpost/gitplus"><strong>git+</strong></a>.</p><p>To borrow from my friends in the React community, <strong>git+</strong> isn’t really a concrete thing so much as it’s a concept or idea or ✨ a lifestyle ✨. The thesis is uncontroversial: computers are much better than we are at doing lists of repetitive shit, so make them do it. And git makes it ridiculously easy to script up these lists and make them available as “custom commands”.</p><p>So now when we want to start a new hotfix branch for ticket “FAD-1234”, we do this:</p><pre>$ git start hotfix FAD-1234</pre><p>Notice how start isn’t a core git command. But for our team, it does this behind the scenes:</p><ol><li>Checkout master and pull (easy to forget!)</li><li>Create a branch using our hotfix/ticket naming convention</li></ol><p>If we’d used git start feature (instead of hotfix), it would have checked out develop and branched from there instead. Less things for us to remember, but more customized to our process than a generic flow library might be. And finishing a ticket is even better. git finish push does all this for us:</p><ol><li>Determine if the branch is a hotfix or not, let’s assume it is in this example</li><li>Checkout master and pull</li><li>Merge branch in using --no-ff to maintain branch history</li><li>Push to origin master</li><li>Checkout develop and pull</li><li>Merge branch in using --no-ff</li><li>Push to origin develop</li><li>Delete local hotfix branch</li><li>Delete remote hotfix branch</li></ol><p>Have fun remembering all that on your own, suckers!</p><p>At this point you might be wondering: <strong>how does it work? </strong>And what if you don’t care about “flow” or about a develop/master branch strategy? Is this relevant to you at all? Well, it <em>might</em> <em>be</em>!</p><p>Let’s walk through a couple examples of more generic <strong>git+</strong> customizations to demonstrate how it works. First, create a folder for your commands and add that folder to your $PATH.</p><pre>$ cd ~<br>$ mkdir git-commands<br>$ export PATH=$PATH:$HOME/git-commands</pre><p>That’ll be enough to get you started. (Note: to make this work permanently, the full path to that directory needs to be added to the $PATH permanently, usually by doing that export statement in your ~/.bash_profile or similar. (Another note: you could also fork and clone <a href="https://github.com/SparkPost/gitplus">sparkpost/gitplus</a> and use the commands folder there.))</p><p>Make a file called git-whoa inside your new git-commands directory, open it, and add this:</p><pre>#!/usr/bin/env bash</pre><pre>echo &#39;WHOA&#39;</pre><p>Save it, make it executable ( $ chmod +x ./git-commands/git-whoa ), type git whoa and gasp at the awesome unchecked power you’ve so quickly and easily acquired. 👑 I was really pretty shocked at how simple it was.</p><p>Another slightly more useful set of<strong> git+</strong> examples are git in, which shows a list of commits in the remote that you don’t have locally, and git out, which shows commits locally that are not yet in remote.</p><p>The git in command looks like this:</p><pre>#!/usr/bin/env sh</pre><pre># exit on error<br>set -e</pre><pre>BRANCH=$(git rev-parse — abbrev-ref HEAD)</pre><pre>git fetch origin<br>git log $BRANCH..origin/$BRANCH</pre><p>While git out just switches the order of the log around: git log $BRANCH..origin/$BRANCH.</p><p>Another more general use command we use is git open, which opens the current git repo on the assumed github.com repo page:</p><pre>#!/usr/bin/env sh</pre><pre># exit on error<br>set -e</pre><pre>open $(git config — get remote.origin.url | sed -e ‘s/git@/https:\/\//’ -e ‘s/github.com:/github.com\//’ -e ‘s/.git$//’)</pre><p>You can do anything you want with this idea. (✨ lifestyle ✨) If you want to see some interesting examples of git shortcuts, take a look at <a href="https://medium.com/u/a85f20c37193">Jessie Frazelle</a>’s tweet from a few months ago (and the responses):</p><h3>jessfraz on Twitter</h3><p>What&#39;s your most used custom git alias? Bonus points if you can fit it in 140 characters. (Short things like d for diff don&#39;t count)</p><p>Granted, these are all git <em>aliases</em>, which are a little different for boring reasons, but they’re good at showing how creative you can get. My favorite from that set was Jessie’s own example, which checks out a GitHub PR branch by PR number.</p><h3>jessfraz on Twitter</h3><p>gitconfig alias to checkout a PR to a new branch: pr = !&quot;pr() { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }; pr&quot; git pr 123</p><p>Making that a<strong> git+</strong> style command would be as simple as throwing the code in a file called git-pr:</p><pre>#!/usr/bin/env sh</pre><pre># exit on error<br>set -e</pre><pre>git fetch origin pull/$1/head:pr-$1<br>git checkout pr-$1</pre><p>Which has the added benefit of being easier to read than a one-liner alias, too.</p><p>I’ll finish up with a few tips for creating good git commands:</p><ol><li><strong>Don’t override real git commands.</strong> Mostly because it won’t work, so don’t bother trying. But even if it <em>did</em> work, it’d be all kinds of confusing and an all-around terrible idea.</li><li><strong>Always use set -e.</strong> If you’re using bash, this makes the script exit on error. That way you don’t have to worry about accidentally doing a git push when your earlier git pull didn’t succeed, etc.</li><li><strong>Document what the command does.</strong> You’ll forget, so you need to document the usage. You might not want to mess with creating a man page for your command (it’s possible but pretty complicated), but you should at least use comments in the file to document what the command does alongside the code itself.</li><li><strong>Be careful with doing anything besides git commands</strong>. It’s tempting to use this to do everything. One of my favorite things our version does is allow people to update the git+ commands by running git plus update from anywhere. It’s powerful and easy but don’t abuse the power by running deployment commands through git, etc.</li></ol><p>Again, if you want to check out more of the commands we use at <a href="https://medium.com/u/bc7a2f5f6ad9">SparkPost</a>, take a look at our <a href="https://github.com/sparkpost/gitplus">sparkpost/gitplus</a> repo. Feel free to fork it and create your own <strong>git+ </strong>lifestyle—just let me know if you do, so I can steal some of your best commands back.</p><p><a href="https://github.com/SparkPost/gitplus">SparkPost/gitplus</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa796b59392b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Green, Eventually]]></title>
            <link>https://medium.com/quickly-religious/green-eventually-6937d554a97a?source=rss-e9ca5ef412d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6937d554a97a</guid>
            <dc:creator><![CDATA[Jason Rhodes]]></dc:creator>
            <pubDate>Tue, 15 Oct 2013 03:37:29 GMT</pubDate>
            <atom:updated>2013-10-15T03:58:36.338Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VSvxd6qZrYPesuIB.jpeg" /><figcaption>Red lights/Flickr: horiavarlan</figcaption></figure><p>When I was in high school, someone—I can’t remember who—convinced me that the traffic lights in our town were attached to sensors that responded to quick pulses of light. It was how emergency vehicles overcame red lights when racing through the city, or at least that’s how I remember it being explained.</p><p>It wasn’t <em>all </em>of the traffic lights, either. Some were equipped with one of these amazing sensors and many were not, which made sense: light flash technology had to be pretty expensive! Our small town couldn’t be expected to install this kind of cutting-edge system at every intersection!</p><p>Once I’d sufficiently bought into the feasibility of the idea, I began repeatedly flashing my high beams at every red light I encountered. For a while, it worked. I’d flash the lights and wait a few seconds. Sometimes the light would turn green immediately. If not, I assumed I hadn’t flashed my lights the right number of times or that maybe I needed to adjust my flashing rate. I’d take a few more stabs at it and if the light turned green before a few seconds had passed, my power was confirmed. And if not, well, it was likely I’d found myself stopped at one of those unfortunate intersections where the sensor hadn’t been installed. It all added up perfectly.</p><p>At some point, I realized how that rationalization worked and I smiled at the brilliance of it. (I also stopped flashing my head lights at intersections.) It was a really long time before I drew the line from there to the prayer I’d participated in throughout my high school and college years. The connection is rather obvious now, and I smile a little less at the brilliance of it all.</p><blockquote>Tuesday night at the Bible study<br>We lift our hands and pray over your body<br>But nothing ever happens<br>—Sufjan Stevens, Casimir Pulaski Day</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6937d554a97a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/quickly-religious/green-eventually-6937d554a97a">Green, Eventually</a> was originally published in <a href="https://medium.com/quickly-religious">Quickly Religious</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[False Equity !== Objectivity]]></title>
            <link>https://medium.com/i-m-h-o/false-equity-objectivity-69e7cf668433?source=rss-e9ca5ef412d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/69e7cf668433</guid>
            <dc:creator><![CDATA[Jason Rhodes]]></dc:creator>
            <pubDate>Sat, 12 Oct 2013 13:53:02 GMT</pubDate>
            <atom:updated>2013-10-12T18:29:28.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*SmMXli6W1obG8EQq.jpeg" /><figcaption>PHOTO: Superbonnie (Reddit)</figcaption></figure><h4>It’s not always everybody’s fault</h4><p>Dave Rupert <a href="http://daverupert.com/2013/10/trolling-the-whitehouse/">trolled the U.S. Government</a> over this ridiculous “government shutdown” last week and the whole thing was pretty god damn funny, no matter what you think. But in Dave’s post-mortem write up, something more “serious” stuck out.</p><blockquote><strong>sudo rm -f republicans</strong>: While those type of comments are “for-the-lulz”, it’s an agitating sentiment. De-representing approximately ~50% of Americans is not even close to a solution. America is a melting pot and, like it or not, those are elected officials who represent real people.</blockquote><p>“<em>sudo rm -f</em>” is computer-speak for “delete all”, and while the idea of removing all Republicans from existence is probably a little over the top, it reminded me of a disturbing trend in our political conversations. It seems that many of us have become so concerned with being seen as bias-driven ideologues<em> </em>à<em> </em>la <em>Fox News</em> or <em>MSNBC</em> that we’re artificially forcing every issue to sound “balanced”. Blame is always shared! Every problem is a two-party problem! Every argument is equal and valuable!</p><p>Maybe most Congress members <em>are</em> completely terrible, I’m not sure. But let me be clear about how I feel about this particular issue—this demand, this “undo a law we already passed, that was upheld by the Supreme Court, and that even survived a presidential election, or else we will not pass a bill to fund the government” bullshit: <strong>it’s 100% the fault of Republicans in the House</strong>. And saying so doesn’t make me a liberal apologist or a Democratic Party shill or a socialist or a Muslim.</p><p>Many others have said the same thing in better ways. A couple of my favorites include <a href="http://www.theatlanticwire.com/entertainment/2013/10/jon-stewart-unpacks-metaphors-government-shutdown/70383/">Jon Stewart</a>:</p><blockquote>So let’s talk about what’s really happening at that store. Everybody chipped in and gave you money to go to the store to buy milk, bread and eggs. And then you decided on your own, ‘You know what? I don’t even like fucking eggs. Eggs are a communist menace turning our country Muslim, so I’m just going to buy milk and bread.’ And everybody else is like ‘We passed a law that said you’d buy milk, bread and eggs. And the Supreme Court upheld that shopping list.’ And that’s when you burned the fucking store down.<br>(<a href="http://www.thedailyshow.com/watch/wed-october-9-2013/shutstorm-2013%E2%80%94america-sits-on-its-balls%E2%80%94-colorful-analogies?xrs=share_copy">Video Source</a>)</blockquote><p>and <a href="http://elizabethwarren.com/blog/this-is-a-democracy">Elizabeth Warren</a>:</p><blockquote>In a democracy, hostage tactics are the last resort for those who can’t win their fights through elections, can’t win their fights in Congress, can’t win their fights for the Presidency, and can’t win their fights in Courts. For this right-wing minority, hostage-taking is all they have left — a last gasp of those who cannot cope with the realities of our democracy.</blockquote><p>It doesn’t make you smarter to pretend that the Democrats are “equally at fault” here because in this case <em>it isn’t true</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69e7cf668433" width="1" height="1" alt=""><hr><p><a href="https://medium.com/i-m-h-o/false-equity-objectivity-69e7cf668433">False Equity !== Objectivity</a> was originally published in <a href="https://medium.com/i-m-h-o">I. M. H. O.</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>