<?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 Hasit Mistry on Medium]]></title>
        <description><![CDATA[Stories by Hasit Mistry on Medium]]></description>
        <link>https://medium.com/@hasitmistry?source=rss-aa7f056c5ac8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*XZcAPoj50GjIPFUvwdBS7g.png</url>
            <title>Stories by Hasit Mistry on Medium</title>
            <link>https://medium.com/@hasitmistry?source=rss-aa7f056c5ac8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 07:04:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hasitmistry/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[Tab Completion Script for Buffalo in Fish Shell]]></title>
            <link>https://medium.com/gobuffalo/tab-completion-script-for-buffalo-in-fish-shell-c8bad3705d32?source=rss-aa7f056c5ac8------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8bad3705d32</guid>
            <category><![CDATA[shellfish]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[buffalo]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[tab-completion]]></category>
            <dc:creator><![CDATA[Hasit Mistry]]></dc:creator>
            <pubDate>Mon, 17 Jul 2017 00:03:16 GMT</pubDate>
            <atom:updated>2017-07-24T01:45:33.956Z</atom:updated>
            <content:encoded><![CDATA[<p>I like writing support tools that ease development workflow. I also enjoy using tools that do the same for me. <a href="http://gobuffalo.io/docs/getting-started">Buffalo</a> is a rapid web development framework in Go that I have come to use and love recently for exactly the same reason — it makes it easy to setup and get started with a fully functional web project in a matter of minutes and comes with batteries included. As a way to make using <a href="https://github.com/gobuffalo/buffalo">buffalo</a> more enjoyable than it already is, I decided to write a tab completion script for it in <a href="http://fishshell.com/">fish</a>.</p><p>CLI completion is a very awesome feature. If you use any of the popular shells (bash, zsh, or fish) out there, chances are that you have encountered CLI tab completions before. fish has <a href="http://fishshell.com/docs/current/tutorial.html#tut_tab_completions">built-in support for tab completions</a> and exposes <a href="http://fishshell.com/docs/current/commands.html#complete">tools for writing completion scripts</a>.</p><p>Here is a GIF of what I’m talking about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7V8DF-uJ4hgg0Zv9BrBeeA.gif" /><figcaption>GIF showing buffalo.fish tab completion script in action.</figcaption></figure><p>And here is the buffalo.fish script that I wrote.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a94376550be86f2caef77d32b909afa6/href">https://medium.com/media/a94376550be86f2caef77d32b909afa6/href</a></iframe><p>To use it, put the file inside ~/.config/fish/completions folder for *nix style systems and you are ready to start tab completing buffalo commands/flags like a boss.</p><p>For the people looking to contribute, here are some known areas where I see tab completion support for buffalo can be improved.</p><ul><li>[DONE] Revise and improve use of -r, -x, and -f flags.</li></ul><p>Head over to the <a href="https://fishshell.com/docs/current/commands.html#complete">official documentation of </a><a href="https://fishshell.com/docs/current/commands.html#complete">complete tool</a> and take a look at <a href="https://stackoverflow.com/questions/20838284/how-can-i-provide-tab-completions-to-fish-shell-from-my-own-script">this discussion</a> and read through <a href="https://github.com/fish-shell/fish-shell/tree/master/share/completions">other completion scripts</a> that ship with fish.</p><ul><li>[DONE] Add completion for subcommands within subcommands.</li></ul><p>For example, take a look at buffalo db command.</p><pre>~ buffalo db -h                                                                                             <br>A tasty treat for all your database needs</pre><pre>Usage:<br>  buffalo db [flags]<br>  buffalo db [command]</pre><pre>Available Commands:<br>  create      Creates databases for you<br>  destroy     Allows to destroy generated code.<br>  drop        Drops databases for you<br>  generate<br>  migrate     Runs migrations against your database.<br>  schema      Tools for working with your database schema</pre><pre>Flags:<br>  -c, --config string   The configuration file you would like to use.<br>  -d, --debug           Use debug/verbose mode<br>  -e, --env string      The environment you want to run migrations against. Will use $GO_ENV if set. (default &quot;development&quot;)<br>  -h, --help            help for db<br>  -p, --path string     Path to the migrations folder (default &quot;./migrations&quot;)<br>  -v, --version         Show version information</pre><pre>Use &quot;buffalo db [command] --help&quot; for more information about a command.</pre><p>generate, and migrate are two subcommands in buffalo db that further accept from a list of subcommands.</p><pre>~ buffalo db generate -h<br>Usage:<br>  buffalo db generate [command]</pre><pre>Aliases:<br>  generate, g</pre><pre>Available Commands:<br>  config      Generates a database.yml file for your project.<br>  fizz        Generates Up/Down migrations for your database using fizz.<br>  model       Generates a model for your database<br>  sql         Generates Up/Down migrations for your database using SQL.</pre><pre>Flags:<br>  -h, --help   help for generate</pre><pre>Global Flags:<br>  -c, --config string   The configuration file you would like to use.<br>  -d, --debug           Use debug/verbose mode<br>  -e, --env string      The environment you want to run migrations against. Will use $GO_ENV if set. (default &quot;development&quot;)<br>  -p, --path string     Path to the migrations folder (default &quot;./migrations&quot;)</pre><pre>Use &quot;buffalo db generate [command] --help&quot; for more information about a command.</pre><pre>~ buffalo db migrate -h<br>Runs migrations against your database.</pre><pre>Usage:<br>  buffalo db migrate [flags]<br>  buffalo db migrate [command]</pre><pre>Aliases:<br>  migrate, m</pre><pre>Available Commands:<br>  down        Apply one or more of the &#39;down&#39; migrations.<br>  reset       The equivalent of running `migrate down` and then `migrate up`<br>  status      Displays the status of all migrations.<br>  up          Apply all of the &#39;up&#39; migrations.</pre><pre>Flags:<br>  -h, --help   help for migrate</pre><pre>Global Flags:<br>  -c, --config string   The configuration file you would like to use.<br>  -d, --debug           Use debug/verbose mode<br>  -e, --env string      The environment you want to run migrations against. Will use $GO_ENV if set. (default &quot;development&quot;)<br>  -p, --path string     Path to the migrations folder (default &quot;./migrations&quot;)</pre><pre>Use &quot;buffalo db migrate [command] --help&quot; for more information about a command.</pre><p>In its current form, buffalo.fish only completes until buffalo db generate or buffalo db migrate. This corresponds to TODO item on <a href="https://gist.github.com/hasit/7f80cfee0d2cc789b75f4aaea40f37e0#file-buffalo-fish-L21">line 21 in </a><a href="https://gist.github.com/hasit/7f80cfee0d2cc789b75f4aaea40f37e0#file-buffalo-fish-L21">buffalo.fish</a>.</p><ul><li>Add tab completion scripts for other shells such as bash, sh, and zsh.</li><li>Make tab completion more dynamic and robust as explained in <a href="https://stackoverflow.com/a/20879411/2128746">this answer</a>.</li></ul><p>This post is meant to be more along the lines of a showcase than a tutorial. If you are interested in knowing more about how to write tab completion scripts in fish, let me know here or on <a href="https://twitter.com/hasitmistry">Twitter</a> and I will try to write another post with step-by-step instructions. As always, questions, comments, and issues are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8bad3705d32" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gobuffalo/tab-completion-script-for-buffalo-in-fish-shell-c8bad3705d32">Tab Completion Script for Buffalo in Fish Shell</a> was originally published in <a href="https://medium.com/gobuffalo">Buffalo — Rapid Web Development in Go</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Better Git Commit Messages with Atom]]></title>
            <link>https://medium.com/free-code-camp/towards-better-git-commit-messages-using-atom-6dbda5e14984?source=rss-aa7f056c5ac8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6dbda5e14984</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Hasit Mistry]]></dc:creator>
            <pubDate>Sun, 20 Dec 2015 21:22:01 GMT</pubDate>
            <atom:updated>2016-06-10T18:32:40.742Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5El6ItJ_0MabNL0UXNvShw.jpeg" /></figure><p>Recently, I came across two enlightening posts about writing better Git commit messages. These posts give suggestions about how a well structured commit message should look like, and provide clear examples.</p><ul><li><a href="https://robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template">Better Commit Messages with a .gitmessage Template</a> by <a href="http://appallingfarrago.com/">Matthew Summer</a></li><li><a href="http://chris.beams.io/posts/git-commit/">How to Write a Git Commit Message</a> by <a href="http://chris.beams.io/">Chris Beams</a></li></ul><p>These two blog posts made me go back to my repositories and read my commit messages. And to be honest, I felt a little ashamed of my past then.</p><p>You may ask, “why are commit messages even important?” If you find yourself asking that question, you are like the one-week-younger version of me.</p><p>Just to give you an idea, Figure 1 shows some of the commit messages from my project <a href="https://github.com/hasit/licensethis/">licensethis</a>. I promise that the code is much better than the commit messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qlezTXx2CxPpbS4wa4XKqg.png" /><figcaption>Figure 1. <a href="https://github.com/hasit/licensethis/">licensethis</a> commit messages from earlier this year.</figcaption></figure><p>It’s unsurprising how little these commit messages actually tell me about my past work. That’s because I didn’t take writing them seriously.</p><p>In order to actually understand which changes each commit contributed, I had to go into each commit and read the changes line-by-line. This is tedious to say the least.</p><p>At the time of authoring these commit messages, I invariably blurted out whatever made sense to me at that moment, with no consideration of how I — or anyone else for that matter — would understand the text at a later stage.</p><p>First, let’s synthesize all the information we’ve absorbed from the above-mentioned blog posts. Then I’ll give working tips on how <a href="https://atom.io/">Atom</a> can be used as a tool for writing better commit messages for myself and others who are interested in doing the same.</p><p>Note that I am not going to write about <em>how</em> to write a good commit message. <a href="http://chris.beams.io/">Chris Beams</a>’s wonderful post on <a href="http://chris.beams.io/posts/git-commit/">How to Write a Git Commit Message</a> explains just that and more in seven rules.</p><p>Before we begin, let us look at this following text block to understand what is considered as a properly-structured, purposeful, and well-written commit message:</p><pre># Subject in (preferably) less than 50 characters<br>This is the subject of this commit message</pre><pre># Body in greater detail<br>This is the body of this commit message. The body is written after the subject line with one blank line in between. The blank line is used by various tools (such as &#39;git log&#39;, &#39;git show&#39;, etc.) to differentiate subject from body. Further paragraphs are also separated by blank lines.</pre><pre>Explain the problem being solved by this commit. More importantly, explain why these changes are being made, as opposed to how. The &#39;why&#39; part is your responsibility, the &#39;how&#39; part is code&#39;s responsibility.</pre><pre>- You can also use bullets like this.<br>- Or, like this.</pre><p>Some great examples of such commit messages can be found over at the <a href="https://github.com/torvalds/linux">Linux</a> and <a href="https://github.com/git/git">Git</a> repositories on <a href="https://github.com/">GitHub</a>.</p><p>Now, it is understandable that not every commit brings big changes to the repository. Some commits would be for fixing typos, and others for changing line order or indentation. In such cases, a subject line by itself should suffice.</p><p>Atom is a text editor that I use for everything! I use it to take notes in class, complete writing assignments in <a href="https://daringfireball.net/projects/markdown/">Markdown</a> (unless I absolutely require the super powers of MS Word), and for programming projects on a daily basis.</p><p>I keep tweaking Atom little-by-little every time I learn something new, it’s fun to watch my config files slowly grow in size.</p><p>So let us start by setting Atom as our default commit editor for git, and checking if the same has happened correctly using the following commands in your terminal:</p><pre>git config --global core.editor &quot;atom --wait&quot;</pre><pre>git config --get core.editor</pre><pre># Which should give you the output: atom --wait</pre><h4>Change the color of the subject line according to its length</h4><p>First, we will set up Atom so that it changes the color of the subject line to orange if the length exceeds 50 characters and to red if the length exceeds 65 characters. You can read more about git integrations for Atom at <a href="http://blog.atom.io/2014/03/13/git-integration.html">Git Integration</a>.</p><p>Open up your Atom’s styles.less file, which is under the “Atom” menu option:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*zkgNf5LtktODM49BOgVQ2g.jpeg" /></figure><p>Write the following lines of code into Atom’s styles.less file:</p><pre>atom-text-editor::shadow {<br> .git-commit.invalid.deprecated.line-too-long {<br>  color: <a href="http://twitter.com/text">@text</a>-color-warning;<br>  text-decoration: none;<br> }</pre><pre> .git-commit.invalid.illegal.line-too-long {<br>  color: <a href="http://twitter.com/text">@text</a>-color-selected;<br>  background: <a href="http://twitter.com/background">@background</a>-color-error;<br>  opacity: 0.9;<br> }<br>}</pre><p>Once you’ve made the changes and saved the file, Atom will behave as shown in Figure 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LrrcnjYYKGNePP0T-79uCQ.gif" /><figcaption>Figure 2. Commit message subject line behaviour in Atom.</figcaption></figure><h4>Write a snippet for commit message structure</h4><p>Second, we will write a short snippet for commit messages. This snippet will provide placeholders for subject line and body that can be navigated using TAB key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*U8y5zf56tzuPQx0kTn3L2Q.jpeg" /></figure><p>Write the following lines of code into Atom’s snippets.cson:</p><pre>&#39;.text.git-commit&#39;:<br>  &#39;commit-message&#39;:<br>    &#39;prefix&#39;: &#39;comm&#39;<br>    &#39;body&#39;: &quot;&quot;&quot;<br>      ${1:Subject &lt; 50 chars}</pre><pre>      ${2:Body in detail}<br>    &quot;&quot;&quot;</pre><p>After you make the changes and save the snippets file, the next time you open your commit message, you just need to type <strong>comm</strong> and press TAB to expand your snippet.</p><p>Once the snippet has been expanded, you can press TAB again to jump the cursor from ‘subject line’ to ‘body’. Figure 3 shows this snippet in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSJ0TgQUPX2ukRwgZi9RBQ.gif" /><figcaption>Figure 3. ‘comm’ snippet in action.</figcaption></figure><p>These little code snippets have sure improved my git commit workflow, and I’m confident they can improve yours.</p><p>If you have any other committing-related snippets that you use in Atom, please be sure to post them. I’d love to have a look and maybe incorporate them into my workflow.</p><p>Also — for those curious — here’s a list of themes and packages I’ve used in the above figures:</p><ul><li>UI Theme — <a href="https://atom.io/themes/nucleus-dark-ui">Nucleus Dark</a></li><li>Syntax Theme — <a href="https://atom.io/themes/atom-dark-fusion-syntax">Atom Dark Fusion</a></li><li>Git editing support for Atom — <a href="https://atom.io/packages/language-git">language-git</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6dbda5e14984" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/towards-better-git-commit-messages-using-atom-6dbda5e14984">Get Better Git Commit Messages with Atom</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>