<?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>gnapse.com &#187; git</title>
	<atom:link href="http://gnapse.com/blog/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://gnapse.com/blog</link>
	<description>whatever comes to my mind</description>
	<lastBuildDate>Wed, 28 Jul 2010 18:50:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>gitignore++</title>
		<link>http://gnapse.com/blog/2009/12/18/gitignore/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=gitignore</link>
		<comments>http://gnapse.com/blog/2009/12/18/gitignore/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 21:31:14 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=108</guid>
		<description><![CDATA[I always wondered why Rails developers on the Mac keep adding those .DS_Store files into the .gitignore file of their project repo. It just doesn&#8217;t feel right. When I cloned some of these repos in ubuntu I always wondered what the held that file has to do with me.  I also felt bad every time [...]]]></description>
			<content:encoded><![CDATA[<p>I always wondered why Rails developers on the Mac keep adding those <code>.DS_Store</code> files into the <code>.gitignore</code> file of their project repo. It just doesn&#8217;t feel right. When I cloned some of these repos in ubuntu I always wondered what the held that file has to do with me.  I also felt bad every time I added my <code>nbproject</code> folders and <code>*.kpf</code> files to my <code>.gitignore</code> list back in the days when I used Netbeans and Komodo to program in Rails. People interested in my projects need not be seeing this when they clone my code.<span id="more-108"></span></p>
<p>It turns out that <a title="Git Version Control System" href="http://git-scm.com/" target="_blank">git</a> offers three mechanisms to specify which files to ignore. Most people know about the <code>.gitignore</code> files inside the working tree. But if you take a look at the <a href="http://www.kernel.org/pub/software/scm/git-core/docs/gitignore.html" target="_blank">gitignore documentation</a> you&#8217;ll find out that there&#8217;s a second file to specify ignore patterns that are specific to a given user&#8217;s work-flow, but that shouldn&#8217;t be cluttering the .gitignore files inside the repo, which are normally also versioned by git and thus shared by all the developers working in the project. Patterns like these should go in the <code>$GIT_DIR/info/exclude</code> file, where <code>$GIT_DIR</code> usually refers to the <code>.git/</code> directory inside your working tree.</p>
<p>Nobody cares what&#8217;s your favorite editor and you shouldn&#8217;t be cluttering the ignore files versioned inside the repo with the patterns of the files generated by your working environment. That way your buddies on a Mac won&#8217;t laugh at you when they notice you are stuck with Netbeans because you&#8217;re on Linux, or that you are geeky enough to use Emacs or Vim instead of the sexy TextMate.</p>
<p>But wait. We still have to repeat all those pesky private ignore patterns in every different project, when we should be able to tell git globally about the garbage we normally want to ignore. <a title="Don't Repeat Yourself" href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY</a> anybody?</p>
<p>You&#8217;re right. That sounds very stupid. We are programmers after all. We&#8217;re supposed to be clever and lazy. So is the guy who invented all this git thing. It turns out that you can specify a global <code>.gitignore</code> file via <code>git-config</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git-config <span style="color: #660033;">--global</span> core.excludesfile <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>ernesto<span style="color: #000000; font-weight: bold;">/</span>.gitignore</pre></div></div>

<p>The file doesn&#8217;t have to be named <code>.gitignore</code> and it doesn&#8217;t have to be in your home directory. The <code>core.excludesfile</code> configuration directive is there precisely so that you can put this global ignore file anywhere you want. Also, beware of using <code>~/</code> to specify that the file is in your home directory. The documentation says that it works and expands it to the value of the <code>$HOME</code> environment variable, but it doesn&#8217;t work in my Mac.</p>
<p>So now you can go and edit that file and put the things that bother you privately. Mine for instance is something like this.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.DS_Store
.svn
<span style="color: #000000; font-weight: bold;">*</span>~
<span style="color: #000000; font-weight: bold;">*</span>.<span style="color: #7a0874; font-weight: bold;">&#91;</span>oa<span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">*</span>.kpf
nbproject
Thumbs.db</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2009/12/18/gitignore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AMP: One VCS to rule them all</title>
		<link>http://gnapse.com/blog/2009/11/30/amp-one-vcs-to-rule-them-all/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=amp-one-vcs-to-rule-them-all</link>
		<comments>http://gnapse.com/blog/2009/11/30/amp-one-vcs-to-rule-them-all/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 18:59:56 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bazaar]]></category>
		<category><![CDATA[distributed vcs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[vcs]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=95</guid>
		<description><![CDATA[If you are a programmer and you already know something about git, mercurial, bazaar or some other modern distributed version control system, you should give AMP a try. And no, it is not a VCS in the most strict sense of the concept, but a meta-tool for VCS ease of use. Currently it works as [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a programmer and you already know something about <a href="http://git-scm.com/" target="_blank">git</a>, <a href="http://mercurial.selenic.com/" target="_blank">mercurial</a>, <a href="http://bazaar-vcs.org/" target="_blank">bazaar</a> or some other modern distributed version control system, you should give <a href="http://amp.carboni.ca/" target="_blank">AMP</a> a try. And no, it is not a <abbr title="Version Control System">VCS</abbr> in the most strict sense of the concept, but a meta-tool for VCS ease of use.</p>
<p>Currently it works as a Ruby interface to Mercurial, but they are aiming high. According to their own definition, &#8220;[their] goal is to produce a piece of software that lets you forget that you&#8217;re working on git project one moment and a Mercurial project the next.&#8221; A sort of meta-interface for most modern distributed VCS&#8217;s out there, so that you can use them all with the same set of commands, or maybe even interact between different VCS&#8217;s. Although I haven&#8217;t had the time yet to truly play with it, It appears to be highly customizable.</p>
<p>BTW, they also mention svn and cvs as VCS&#8217;s they want to support, but I can&#8217;t see why to drain out resources into these dinosaurs. I still don&#8217;t get why people still use centralized-only VCS&#8217;s if they have the choice of distributed version control. But anyway, I wish them good luck with the project overall, and I will sure keep an eye on it for a while.</p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2009/11/30/amp-one-vcs-to-rule-them-all/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs: my first achievements, frustrations and impressions</title>
		<link>http://gnapse.com/blog/2009/07/17/emacs-my-first-achievements-frustrations-and-impressions/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=emacs-my-first-achievements-frustrations-and-impressions</link>
		<comments>http://gnapse.com/blog/2009/07/17/emacs-my-first-achievements-frustrations-and-impressions/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 16:44:23 +0000</pubDate>
		<dc:creator>ernesto</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web programming]]></category>
		<category><![CDATA[auto-complete]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://gnapse.com/blog/?p=50</guid>
		<description><![CDATA[Wow, this was fast! I never thought writing again about Emacs just a day after my first post about it. So far (the short version) I am doing better than I thought for just about a couple of days being serious about this. There are a few things that still bother me a lot though, [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, this was fast! I never thought writing again about Emacs just a day after my first post about it.</p>
<p>So far (the short version) I am doing better than I thought for just about a couple of days being serious about this. There are a few things that still bother me a lot though, aside from the fact that I am not proficient using it yet, of course.</p>
<p><span id="more-50"></span></p>
<h3>My [mostly borrowed] customizations</h3>
<p>I&#8217;ve heavily customized Emacs to suit my needs better than it could do with its awkward defaults. Emacs key shortcuts (or is it key bindings?) are soooo unpleasant, unintuitive, lengthy and annoying that I refuse to use them at all. Happily one of Emacs&#8217; most powerful strengths, its ability to be customized, comes to the rescue. Actually this feature is what makes <a href="http://bettercoding.wordpress.com/2009/07/13/emacs-still-relevant/" target="_blank">Emacs still relevant after 30+ years</a>.</p>
<div id="attachment_52" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-52" title="customized-emacs" src="http://gnapse.com/blog/wp-content/uploads/2009/07/customized-emacs-300x225.png" alt="My Emacs after being customized" width="300" height="225" /><p class="wp-caption-text">My Emacs after being customized</p></div>
<p>Without going too much into details, I based my Emacs customizations mostly on <a href="http://github.com/rmm5t/dotfiles/tree" target="_blank">Ryan McGeary&#8217;s</a>, mostly because his setup is aimed at Ruby on Rails development and Git, which is what I want Emacs for in the first place. Overall, it&#8217;s <a title="Ruby mode for Emacs" href="http://rubyforge.org/projects/ri-emacs/" target="_blank">ri-emacs</a>, <a title="Rails support for Emacs" href="http://rinari.rubyforge.org/" target="_blank">rinari</a>, <a title="rhtml/erb mode for Emacs" href="http://github.com/eschulte/rhtml/tree" target="_blank">rhtml-mode</a>, <a title="Git support for Emacs" href="http://zagadka.vm.bytemark.co.uk/magit/" target="_blank">magit</a>, <a title="A snippets/templates system for Emacs" href="http://code.google.com/p/yasnippet/" target="_blank">yasnippets</a>, and several other non-language-specific customizations (<a title="Interactively Do Things" href="http://www.emacswiki.org/emacs/InteractivelyDoThings" target="_blank">ido</a>, <a title="Recently opened files" href="http://www.emacswiki.org/emacs/RecentFiles" target="_blank">recentf</a>, etc.)</p>
<p>On top of this setup, and after pruning stuff that I don&#8217;t need, at least for the moment (like erlang, markdown, haml, svn, carbon-emacs, etc.) I added support for some other stuff, namely <a title="RSpec support for Emacs" href="http://github.com/pezra/rspec-mode/tree">rspec</a>,  <a href="http://www.emacswiki.org/emacs/CuaMode" target="_blank">cua-mode</a> (see <a title="IBM's guidelines for user interface standards across platforms" href="http://en.wikipedia.org/wiki/IBM_Common_User_Access" target="_blank">Common User Access</a>), and other minor goodies from other sources.</p>
<p>Aside from McGeary&#8217;s setup as a base, I have to give credit to snippets of code I borrowed from elsewhere to further customize my environment. I should particularly mention <a href="http://devcraft.wordpress.com/2008/07/19/using-emacs-for-rails-development-the-perfect-setup/" target="_blank">Devcraft&#8217;s advises to customize Emacs for Rails development</a>, Dahoiv&#8217;s<a href="http://dahoiv.net/.emacs" target="_blank"> .emacs</a> file, the <a href="http://www.emacsblog.org/" target="_blank">Emacs blog</a> (where Ryan McGeary also writes) and the <a href="http://emacs-fu.blogspot.com/" target="_blank">emacs-flu blog</a>.</p>
<h3>Pros and Cons</h3>
<p><strong>On the good side</strong>, I have played for a while with the ruby on rails mode and it is good. The yasnippet extensions take a lot of credit on this, but overall it tastes very good on its own. I have yet to deal enough with the magit extension to fully evaluate my environment. I cannot afford buying a Mac+TextMate for Ruby development, and Emacs can hopefully come to the rescue for my productivity and joy while coding.</p>
<p>Also, having been able to get rid of most of the many painful key bindings in such a short time was amazing. I wonder why Emacs does not update its defaults to comply with the <a title="Common User Access" href="http://en.wikipedia.org/wiki/IBM_Common_User_Access" target="_blank">CUA standards</a>. The cua-mode is not enough.</p>
<p><strong>On the bad side</strong> (taking aside my own inexperience and lack of abilities) not everything is doing fine. Many of my key-bindings customizations break on &#8220;weird&#8221; modes, like C-w for closing the current buffer, which is not working when the current buffer is in <a title="Emacs mode to navigate and manipulate the file system" href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html" target="_blank">dired mode</a>.</p>
<p>Also, I feel disappointed with the embedded shell (<code>M-x eshell</code>). I actually expected a bash session inside an Emacs window, but aliases and tab-completion are not working as they should, which makes me suspect it is not bash but an Emacs shell program (surprise!!!). As it is right now, I prefer to <code>Alt-Tab</code> to my terminal emulator with a real bash session in it. Something similar happens with the Rails console (available via <code>C-c ; c</code>), which I really didn&#8217;t test a lot after I realized that pressing the up and down arrow keys didn&#8217;t navigate through my history of previous commands <img src='http://gnapse.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> .</p>
<h3>So, what is it then?</h3>
<p>In spite of all this, I still believe I can give Emacs a chance. Most shortcomings I&#8217;ve faced are not directly related to its function as a coding environment, but to tasks around coding, like going to the console to type rails-related commands, manipulating the file system, etc. I was doing these stuff outside my previous code editors anyway so I guess this can stay as is for some time.</p>
<p>Hopefully I&#8217;ll be able to fix some of this issues over time and always use more and more features of this wonderful editor. I could even live without using git from within it, but I have yet to test that. Meanwhile, I&#8217;ll take some time to get better at coding with what is currently working for me. It seems to me that <strong>Emacs will stay for a while on my desktop</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gnapse.com/blog/2009/07/17/emacs-my-first-achievements-frustrations-and-impressions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
