<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Matt Robinson &#187; Tips and Tricks</title>
	<atom:link href="http://www.mattrobinson.net/category/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattrobinson.net</link>
	<description>Nerding Out Since the Distant Future</description>
	<lastBuildDate>Sun, 22 Jan 2012 14:56:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Rank Your Git Contributors Lines of Code (then be careful what you do with the data)</title>
		<link>http://www.mattrobinson.net/2012/01/17/rank-your-git-contributors-lines-of-code-then-be-careful-what-you-do-with-the-data/</link>
		<comments>http://www.mattrobinson.net/2012/01/17/rank-your-git-contributors-lines-of-code-then-be-careful-what-you-do-with-the-data/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 06:41:18 +0000</pubDate>
		<dc:creator>mattr</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[metrics LOC]]></category>

		<guid isPermaLink="false">http://www.mattrobinson.net/?p=135</guid>
		<description><![CDATA[Lately at work there&#8217;s been a bit of an obsession with metrics &#8211; I&#8217;m not sure it&#8217;s healthy. Code metrics can be interesting, but in the wrong hands or used the wrong way, they are misleading and harmful. It&#8217;s still to be seen what the outcome will be in this case. I&#8217;m more than little [...]]]></description>
			<content:encoded><![CDATA[<p>Lately at work there&#8217;s been a bit of an obsession with metrics &#8211; I&#8217;m not sure it&#8217;s healthy.  Code metrics can be interesting, but in the wrong hands or used the wrong way, they are misleading and harmful.  It&#8217;s still to be seen what the outcome will be in this case.  I&#8217;m more than little worried.</p>
<p>That said, even I like to get some numbers on code, especially unfamiliar code, to help me figure out a few things.   For example, I&#8217;ve been using <a href="http://cloc.sourceforge.net/">CLOC (Count Lines of Code)</a> for years to find out quickly how big a project is and what languages are used in what proportion.</p>
<p>The first metric that&#8217;s started to be tracked at work is lines of code added and deleted per release, per author.  I&#8217;ve occasionally glanced at these kinds of numbers in the past too, and even wrote a little script (<a href="https://github.com/mmrobins/git-rank">git-rank</a>) to get the same kind of info when I was on a code deletion spree.  I&#8217;ve found these numbers to be useful for getting a general idea of who is most knowledgeable about a project or some files within the project. </p>
<p>However, the numbers can easily be misleading.  For example, if someone is committing a lot of style reformats, vendoring code from other projects, or autogenerating documentation, their numbers will be very high but they may know very little about the codebase.  For example, for a release to a Rails project I&#8217;ve worked on the metrics gathered showed that I had added 248,475 lines and deleted 458,020 lines. That&#8217;s obviously suspicious, although it does make me look very active.  These are the kinds of numbers that you should dig a little to figure out what&#8217;s happening, which is why I wrote my little git-rank script makes it easy to break those line totals down by file, and then exclude files for the next count.</p>
<p><code>$ git rank v1.1.1..v1.1.9 --all-authors-breakdown --author "Matt Robinson"<br />
Matt Robinson         603061<br />
                      1 vendor/gems/json_pure-1.5.1/tests/fixtures/fail14.json<br />
                      1 vendor/gems/json_pure-1.5.1/tests/fixtures/fail12.json<br />
                      1 vendor/rails/railties/test/vendor/gems/dummy-gem-a-0.4.0/lib/dummy-gem-a.rb<br />
                      ........<br />
                      21418 vendor/gems/haml-3.0.13/lib/haml/precompiler.rbc<br />
                      24953 vendor/gems/haml-3.0.13/test/sass/engine_test.rbc<br />
                      30038 vendor/gems/haml-3.0.13/test/haml/engine_test.rbc<br />
Matt Robinson         603061</code></p>
<p>It&#8217;s pretty obvious that most of what I did was update vendored gems.  If you&#8217;re trying to figure out who did the most work between the releases I specified, you probably want to ignore the vendor directory when count lines of code.</p>
<p><code>% git rank v1.1.1..v1.1.9 --exclude-file vendor<br />
Josh Cooper           4<br />
Nigel Kersten         8<br />
Andreas Zuber         11<br />
Michael Stahnke       11<br />
Jacob Helwig          15<br />
nfagerlund            37<br />
Daniel Pittman        283<br />
Max Martin            418<br />
Nick Lewis            543<br />
Randall Hansen        901<br />
Pieter van de Bruggen 1018<br />
Matt Robinson         1661</code></p>
<p>Now we&#8217;re starting to get a more realistic picture.  From here we could dig deeper by listing all the files again for all the authors, and then maybe start excluding lines based on a regex if there were automated changes, and then maybe look at additions vs deletions in the count (I&#8217;m summing them together for these numbers).</p>
<p>However, I hope people *never* think they can get the whole picture, or even most of the picture, of a code base and who is contributing the most from something as arbitrary as lines of code counts.  I feel like that&#8217;s almost too obvious to say, but I&#8217;ve heard horror stories of managers who tie reviews to metrics like this.  I hope I never personally experience such a thing.</p>
<p>P.S. If anyone tries using the &#8216;git-rank&#8217; project I mentioned above, please keep in mind it&#8217;s a hacky little sick project that is probably got some bugs and you should take the numbers is spits out with a grain of salt.  <a href="http://en.wikipedia.org/wiki/Grain_of_salt">What a weird phrase that is</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattrobinson.net/2012/01/17/rank-your-git-contributors-lines-of-code-then-be-careful-what-you-do-with-the-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version Control Your Configuration / Dot Files</title>
		<link>http://www.mattrobinson.net/2011/04/06/version-control-your-configuration-dot-files/</link>
		<comments>http://www.mattrobinson.net/2011/04/06/version-control-your-configuration-dot-files/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 05:19:56 +0000</pubDate>
		<dc:creator>mattr</dc:creator>
				<category><![CDATA[Recommended Stuff]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[git version control dotfiles configuration]]></category>

		<guid isPermaLink="false">http://www.mattrobinson.net/?p=91</guid>
		<description><![CDATA[I&#8217;ve been meaning to write this post forever, but once I started doing what I suggest here it seemed so obvious that I have trouble remembering what life was like before I did it. Once you&#8217;ve been working in a terminal for long enough, you realize how much more productive you can be with your [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to write this post forever, but once I started doing what I suggest here it seemed so obvious that I have trouble remembering what life was like before I did it.  Once you&#8217;ve been working in a terminal for long enough, you realize how much more productive you can be with your aliases, scripts, prompts, plugins and other configurations setup the way you like.  This becomes especially apparent when you either work on someone else&#8217;s machine, or something happens and you have to rebuild yours and you realize just how slow you are in comparison.</p>
<p>How do you avoid this slowdown and prevent loss of all those great hacks and configurations you&#8217;ve built up?  Version control all the files that enable your productive environment.  Here&#8217;s my repo for all those files.  </p>
<p><a href="https://github.com/mmrobins/config-files">https://github.com/mmrobins/config-files</a></p>
<p>I&#8217;ve got bash, zsh, vim, screen, tmux, irb, tmux, irssi, ruby scripts, puppet scripts and more in this git repository.  I spend a lot time working remotely via ssh or on virtual machines on my development box, so it&#8217;s important not only that I have these files available, but I also have a fast way to get all these files in place quickly.  I also want changes that I make to these files to be easy to commit back to my repository.  To accomplish this, I make all these files symlinks to the files in my repository so that if I edit ~/.bashrc with my great new alias that saves all sorts of typing, it&#8217;s actually editing the .bashrc in my git respository.  Then I have a little perl script that when run puts all these symlinks in place for my automatically and backup up any files I&#8217;m moving out of the way to create the links, just in case.</p>
<p><a href="https://github.com/mmrobins/config-files/blob/master/create_symlinks">https://github.com/mmrobins/config-files/blob/master/create_symlinks</a></p>
<p>Now whenever I end up in a new environment on the terminal, I can get all my productivity in place with a few simple commands from the home directory.<br />
<code><br />
git clone git://github.com/mmrobins/config-files.git<br />
./config-files/create_symlinks<br />
source .bashrc<br />
</code></p>
<p>Now vim has my plugins and configuration, bash has my prompt, if GNU Screen or tmux are available they&#8217;re how I like them, my aliases work, etc.  There&#8217;s always going to be tweaks necessary for this to work cross platform and on different machines with different privileges, but since committing those changes back to the git repo is so easy, it become a natural part of my workflow to have these incremental improvements to my work environment available everywhere I work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattrobinson.net/2011/04/06/version-control-your-configuration-dot-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Put Your rc, Config Files and More Under Source Control</title>
		<link>http://www.mattrobinson.net/2009/06/21/put-your-rc-config-files-and-more-under-source-control/</link>
		<comments>http://www.mattrobinson.net/2009/06/21/put-your-rc-config-files-and-more-under-source-control/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 02:08:07 +0000</pubDate>
		<dc:creator>mattr</dc:creator>
				<category><![CDATA[Recommended Stuff]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.mattrobinson.net/?p=33</guid>
		<description><![CDATA[I&#8217;ve been working on more and more computers lately, and I was getting tired of my favorite bash and editor shortcuts not being available between the different machines. I finally took some good advice I heard a while back and put my config files under source control, and it&#8217;s been one of the best tips [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on more and more computers lately, and I was getting tired of my favorite bash and editor shortcuts not being available between the different machines.  I finally took some good advice I heard a while back and put my config files under source control, and it&#8217;s been one of the best tips I&#8217;ve followed in some time.</p>
<p>The way I&#8217;ve done it is to use <a href="http://www.github.com/mmrobins">GitHub</a> to store my config files, so anyone else is free to take a look if they want to see how I&#8217;ve got vim, bash, screen, readline, ruby&#8217;s irb or other things configured.  However, the biggest benefit is that I can quickly get a new machine customized with all my favorite settings just by doing a checkout (clone in git) into my home directory on the new machine.  From there I&#8217;ve got a little script I run called &#8216;create_symlinks&#8217; that backs up the old config files before overwriting them with symlinks that point to the files in my checkout.  That way, whenever I update my repository, the files are automatically current.</p>
<p>This has been immensely helpful in taking the tricks I learn at work and easily incorporating them at home or on any remote server I have to do work.  If I add something new and cool to my vimrc at work, I just have to remember to commit it and push the changes to GitHub before I head home, and then I can continue working from home without having to remember whatever command I just automated.</p>
<p>I&#8217;ve even heard of people who go so far as to put their whole home directories under version control as a way of not only moving files around, but as a way of doing backups.  That seems overkill to me, but it&#8217;s worth thinking about what sorts of files we move around a lot might be easily moved and backed up using a source control system like git or SVN.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mattrobinson.net/2009/06/21/put-your-rc-config-files-and-more-under-source-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

