<?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>Abizern.org &#187; git</title>
	<atom:link href="http://abizern.org/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://abizern.org</link>
	<description>The personal and developer blog of a Mac developer in London.</description>
	<lastBuildDate>Sun, 09 Oct 2011 19:06:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Just Enough GPG for git</title>
		<link>http://abizern.org/2011/01/17/just-enough-gpg-for-git/</link>
		<comments>http://abizern.org/2011/01/17/just-enough-gpg-for-git/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 15:52:38 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[365git]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[gpg2]]></category>
		<category><![CDATA[gpgtools]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[minimal]]></category>
		<category><![CDATA[signed]]></category>
		<category><![CDATA[tags]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=440</guid>
		<description><![CDATA[It came about that I wanted to do some work with git and signed tags. It&#8217;s been a while since I had looked at this, I&#8217;ve got some old entries up on keyservers that date back to 1999, and never on a Mac. It turns out that it is quite simple to set up a [...]]]></description>
			<content:encoded><![CDATA[<p>It came about that I wanted to do some work with git and signed tags. It&#8217;s been a while since I had looked at this, I&#8217;ve got some old entries up on keyservers that date back to 1999, and never on a Mac.</p>
<p>It turns out that it is quite simple to set up a minimal <a href="http://en.wikipedia.org/wiki/Pretty_Good_Privacy">GPG</a> environment – one that lets you work on the command line without having to set it up for Mail.app. This is about all I need it for.</p>
<p>The <a href="http://www.gpgtools.org/index.html">GPGTools project</a> has recently resurrected the <a href="http://macgpg.sourceforge.net/">MacGPG project</a> to provide email encryption and tools to the Mac. It is still in development, and I didn&#8217;t want to mess about with my Mail installation so rather than install the complete set of tools, I chose to install <a href="http://www.gpgtools.org/macgpg2.html">MacGPG2</a> and <a href="http://www.gpgtools.org/keychain.html">GPGKeychain Access</a></p>
<p><a href="http://www.gpgtools.org/macgpg2.html">MacGPG2</a> is the <a href="http://en.wikipedia.org/wiki/Pretty_Good_Privacy#OpenPGP">OpenPGP</a> implementation for the Mac. This installs gpg2 into /usr/local/bin and gpg is symlinked to gpg2. I only mention this because although the commands can all be issued as gpg, you get to the documentation by using man gpg2, not man gpg. Installation is through an installer package.</p>
<p><a href="http://www.gpgtools.org/keychain.html">GPGKeychain Access</a> does not integrate with the Mac Keychain as the name might suggest, but provides a window to look at and manage the keys that you have on your system. These are usually under ~/.gnupg/ Run the installer, and create your keys. It&#8217;s quite simple and there is a video on the project page. However, there are a couple of things that you should keep in mind. If you forget your passphrase you can&#8217;t use your private key anymore. And if you&#8217;ve published the key, you won&#8217;t be able to revoke it and it will just sit around on keyservers. So, set an expiry date on your keys in case you do lose the private key or passphrase. As the expiry date comes up just extend it again.</p>
<p>There is no key-server configured. There seems to be a ticket for this to be implemented in some future milestone. Until then, create a file called gpg.conf under ~/.gnupg and put this line in it:</p>
<pre>keyserver hkp://pgp.mit.edu</pre>
<p>And that is just enough so that when you use the menu items that send and get keys from keyservers they will work. As far as I know, these servers talk to each other, so writing to one makes the key visible on the others.</p>
<p>Synchronisation of keys is an issue. If you are adventurous you could add more entries to the gpg.conf file to use a central location for the keyrings, somewhere like Dropbox or iDisk, so that all your machines can use the same files. But, it&#8217;s just as easy to export the keys as text and use those files to keep different machines in sync. Partcularly if you will be using gpg rarely.</p>
<p>This has been a companion piece to the non-Mac centric <a href="http://365git.tumblr.com/">365Git</a> post about <a href="http://365git.tumblr.com/post/2796779828/signing-a-git-tag">signed tags</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2011/01/17/just-enough-gpg-for-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DVCS at LiDG</title>
		<link>http://abizern.org/2010/10/08/dvcs-at-lidg/</link>
		<comments>http://abizern.org/2010/10/08/dvcs-at-lidg/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 13:19:12 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[dvcs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[keynote]]></category>
		<category><![CDATA[lidg]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=413</guid>
		<description><![CDATA[I gave a short presentation to the London iPhone Developer Group at the Apple store in London this week. 20 minutes is far too short to cover such a large subject but I did what I could. I have been given another opportunity to present in the future and I&#8217;m going to skip the boring [...]]]></description>
			<content:encoded><![CDATA[<p>I gave a short presentation to the London iPhone Developer Group at the Apple store in London this week.</p>
<p>20 minutes is far too short to cover such a large subject but I did what I could. I have been given another opportunity to present in the future and I&#8217;m going to skip the boring beginner bits and just cover 3 or 4 advanced Git techniques which should be more fun.</p>
<p>For what it&#8217;s worth, here are the slides. Probably not much help unless you were there (I prefer more talk and less slides) and I apologise for being weak and using bullet points.</p>
<p><a title="Keynote Download" href="http://goo.gl/vCCP">Download the Keynote presentation</a> (540 kb)</p>
<p><a title="PDF Download" href="http://goo.gl/JPJR">Download the PDF slides</a> (220 kb)</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/10/08/dvcs-at-lidg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Presentation at NSCoder Night</title>
		<link>http://abizern.org/2010/09/26/git-presentation-at-nscoder-night/</link>
		<comments>http://abizern.org/2010/09/26/git-presentation-at-nscoder-night/#comments</comments>
		<pubDate>Sun, 26 Sep 2010 14:04:44 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[NSCoder Night]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[keynote]]></category>
		<category><![CDATA[nscodernight]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[slides]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=394</guid>
		<description><![CDATA[At September&#8217;s NSCoder Night Alex Blewitt (@alblue on Twitter) gave a short presentation on the Git distributed version control system. Here are the slides as both a Keynote presentation and a PDF document. Download the Keynote presentation (1.1 Mb) Download the Slides as a PDF file (1.7 Mb)]]></description>
			<content:encoded><![CDATA[<p>At September&#8217;s NSCoder Night Alex Blewitt (<a href="http://www.twitter.com/alblue">@alblue on Twitter</a>) gave a short presentation on the Git distributed version control system. Here are the slides as both a Keynote presentation and a PDF document.</p>
<p><a title="Keynote download" href="http://goo.gl/LNx6">Download the Keynote presentation</a> (1.1 Mb)</p>
<p><a title="PDF Download" href="http://goo.gl/jNso">Download the Slides as a PDF file</a> (1.7 Mb)</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/09/26/git-presentation-at-nscoder-night/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>September NSCoder Night</title>
		<link>http://abizern.org/2010/09/20/september-nscoder-night/</link>
		<comments>http://abizern.org/2010/09/20/september-nscoder-night/#comments</comments>
		<pubDate>Mon, 20 Sep 2010 11:58:57 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[NSCoder Night]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[nscodernight]]></category>
		<category><![CDATA[social]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=387</guid>
		<description><![CDATA[Another month has gone by and it&#8217;s that time again. Tomorrow is the Third Tuesday of September which means NSCoder night. And this week Alex Blewitt (@alblue) will be talking about DVCS and Git. Yes, that&#8217;s right; someone else is going to be talking about Git. So come along for the usual collection (array or [...]]]></description>
			<content:encoded><![CDATA[<p>Another month has gone by and it&#8217;s that time again. Tomorrow is the Third Tuesday of September which means NSCoder night.</p>
<p>And this week Alex Blewitt (<a title="@alblue" href="http://twitter.com/alblue">@alblue</a>) will be talking about DVCS and Git. Yes, that&#8217;s right; someone else is going to be talking about Git.</p>
<p>So come along for the usual collection (array or set, your choice) of chat, food, drink and learning. Nourishment for body and mind. And me telling you how you should always work on a private branch and that commit messages should be written in the present tense.</p>
<p><strong>Where</strong>: <a title="The George Inn, Borough High Street" href="http://maps.google.co.uk/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=The+George+Inn,+City+of+London&amp;sll=53.800651,-4.064941&amp;sspn=16.659427,43.945313&amp;ie=UTF8&amp;hq=The+George+Inn&amp;hnear=The+George+Inn,+77+Borough+High+St,+City+of+London+SE1+1NH,+United+Kingdom&amp;z=15">The George Inn, Borough High Street</a><br />
<strong>When</strong>: 6:30 pm onwards</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/09/20/september-nscoder-night/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>August NSCoder Night — Now With Talks</title>
		<link>http://abizern.org/2010/08/05/nscoder-night-with-talks/</link>
		<comments>http://abizern.org/2010/08/05/nscoder-night-with-talks/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 15:20:43 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[NSCoder Night]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[nscodernight]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[social]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=361</guid>
		<description><![CDATA[Let&#8217;s try and add something new to our NSCoder Nights — talks. Our evenings don&#8217;t usually follow the norm of people all sat down and coding. I suppose that&#8217;s because of the choice of venue, but who would turn up for an evening in Starbucks? I&#8217;ve got a couple of volunteers lined up for the [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s try and add something new to our NSCoder Nights — talks.</p>
<p>Our evenings don&#8217;t usually follow the norm of people all sat down and coding. I suppose that&#8217;s because of the choice of venue, but who would turn up for an evening in Starbucks?</p>
<p>I&#8217;ve got a couple of volunteers lined up for the next couple of meetings, but I thought it would be a good idea to put some draft ground rules down.</p>
<p><strong>For Presenters:</strong></p>
<p>Keep talks short and focussed. 15-20 minutes should be enough time. Think of it as being an initiator of the discussion that might follow.</p>
<p>Forget about any audio-video support. We are in a pub, where there are other people around. A few slides on your laptop or iPad is the most you have to work with. If you do a slideshow I&#8217;ll happily host the slides or post a link back to where you have them.</p>
<p>Don&#8217;t be offended if not everyone listens to your presentation, or scuttle off during it. Some people are just not interested in the topic, or are having a more interesting discussion somewhere else. The talks are not the point of the evening, just something that happens during the evening.</p>
<p>Be prepared to expand upon and explain your ideas further if someone asks.</p>
<p><strong>For Listeners:</strong></p>
<p>Don&#8217;t feel you have to listen to the talk if you don&#8217;t want to, but please don&#8217;t have a conversation over it. If you start listening and decide to bail, do so in the least disruptive way possible.</p>
<p>Ask questions, make comments, ask for help with related code. The presentations are necessarily short, but that doesn&#8217;t mean you can&#8217;t keep talking about the topic.</p>
<p>If you feel you have something to talk about, let me know and I&#8217;ll add you to the list.</p>
<p><strong>Upcoming Talks:</strong></p>
<p>August &#8211; <a href="http://twitter.com/richardbuckle">Richard Buckle</a> on Test Driven Development<br />
September &#8211; <a href="http://twitter.com/alblue">Alex Blewitt</a> on Git/DVCS</p>
<p>If anyone has any amendments to propose for these rules or have subjects for talks, please let me know. See you on August 17th.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/08/05/nscoder-night-with-talks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Year of Git</title>
		<link>http://abizern.org/2010/03/24/a-year-of-git/</link>
		<comments>http://abizern.org/2010/03/24/a-year-of-git/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 16:52:31 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[365git]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tumblr]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=331</guid>
		<description><![CDATA[I’ve been inspired by Pieter Omvlee of Bohemian Coding and his 365Cocoa to set up my own contribution. I’m going to try and and fill a year with git tips and inspirations over at 365git. I’ve got a few weeks worth of ideas but if anyone wants to know anything or has a suggestion, I’ll [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been inspired by Pieter Omvlee of <a href="http://bohemiancoding.com">Bohemian Coding</a> and his <a href="http://365Cocoa.tumblr.com">365Cocoa</a> to set up my own contribution.</p>
<p>I’m going to try and and fill a year with <a href="http://git-scm.com">git</a> tips and inspirations over at <a href="http://365git.tumblr.com">365git</a>. I’ve got a few weeks worth of ideas but if anyone wants to know anything or has a suggestion, I’ll gratefully consider them.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/03/24/a-year-of-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three ways of excluding files from git</title>
		<link>http://abizern.org/2010/02/07/three-ways-of-excluding-files-from-git/</link>
		<comments>http://abizern.org/2010/02/07/three-ways-of-excluding-files-from-git/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 18:52:32 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[365git]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[exclude]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ignore]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://abizern.org/?p=278</guid>
		<description><![CDATA[Almost every git user knows about adding a .gitignore file to their repository to control the visibility of files and folders. This per project configuration will apply to all repositories of the same code base. But it’s not the only way. I’m going to tell you how to get git to ignore files on a [...]]]></description>
			<content:encoded><![CDATA[<p>Almost every git user knows about adding a <code>.gitignore</code> file to their repository to control the visibility of files and folders. This per project configuration will apply to all repositories of the same code base. But it’s not the only way. I’m going to tell you how to get <a title="http://git-scm.com" href="http://git-scm.com">git</a> to ignore files on a per computer and per repository basis. These could be better choices in some circumstances.</p>
<p>There are three types of exclude files; from highest to lowest order of precedence they are:</p>
<h2>Per Project: .gitignore file in the repository</h2>
<p>This is the usual way of adding an ignore file. Call it <code>.gitignore</code> and save it to the root of your project to apply to all the files (you can add different <code>.gitignore</code> files in subdirectories where they have lesser scope). It is a part of the repository, so it will need to be <code>git-add</code>ed and committed for each change. This is useful for repositories that are passed around with others who may not have a per computer exclude file, or when there are project specific files that need to be taken into account. Even easier if you have per computer file, you can copy it straight in to your project with a simple <code>cp ~/.gitignore .gitignore</code> and edit to handle your specific requirements.</p>
<h2>Per Repository: in .git/info/excludes</h2>
<p>You can exclude files on a per repository basis by editing the <code>.git/info/excludes</code> file in your repository. (Why it takes it from this location rather than <code>.git/config</code> I don’t know: add it to the list of git annoyances). These exclusions (or inclusions, you can override the higher level exclusions by prepending <code>!</code> to lines that you want to include) are not shared with the working directory, so they only apply to that particular repository. This is useful when you have particular requirements because of your workflow or machine setup.</p>
<h2>Per Computer: through ~/.gitconfig settings</h2>
<p>There should already be a <code>.gitconfig</code> file in your home directory. This is where the global setting for your git installation are stored; such as the user’s name and email address. Within this you can set a path to an excludes file that will apply to all git repositories on the computer in the same way as the name and email defined in this file apply to all repositories.</p>
<p>For example: Most of what I do is in <a title="Apple's Xcode site" href="http://developer.apple.com/tools/xcode/">Xcode</a> so I have the following ~/.gitignore file</p>
<div class="code">
<p># ~/.gitignore</p>
<p>*.DS_Store<br />
*.pbxuser<br />
*.mode1v3<br />
*.mode2v3<br />
*.perspectivev3</p>
</div>
<p>And in my <code>.gitconfig</code> file under the <code>[core]</code> section I have added the path to this file for the <code>excludesfile</code> key. (If you’re sharp eyed, you’ll notice that I don’t have an exclusion for <code>/build</code>. That’s because I don’t keep my products in my project directory, but that’s for a different post).</p>
<div class="code">
<p>&lt;snip&gt;…<br />
<span style="color: #dd0000;">[</span><span style="color: #003369;">core</span><span style="color: #dd0000;">]</span><br />
editor = /usr/bin/see -w -r -o new-window -j ‘git editor’ -m gitCommit -g 1:0<br />
excludesfile = /Users/abizern/.gitignore<br />
&lt;snip&gt;…</p>
</div>
<p>Now, I have a standard set of ignores that apply to all my git repositories on this machine without me having to add a specific <code>.gitignore</code> file to each one. This is probably most useful if you create a lot of repositories for yourself, but I recommend it to everyone. It’s lowest on the precedence scale and provides a neat catch-all.</p>
<h2>Summary</h2>
<p>Most of the time the first solution is quite adequate, having exclusions with a repository that is likely to have a public face is probably the most effective way of managing file visibility. But, as with most of git, there are ways of handling edge cases. You just need to know that they are there.</p>
<h2>Related Reading</h2>
<p>If you liked this post, have a look at my <a href="http://365git.tumblr.com/">365Git</a> site for more tips.</p>
<p><strong>REFERENCE:</strong> the <a title="gitignore(5) Man page on git-scm.com" href="http://www.kernel.org/pub/software/scm/git/docs/gitignore.html">gitignore</a> man page.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2010/02/07/three-ways-of-excluding-files-from-git/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some tips for lazy Xcoders</title>
		<link>http://abizern.org/2009/11/11/some-tips-for-lazy-xcoders/</link>
		<comments>http://abizern.org/2009/11/11/some-tips-for-lazy-xcoders/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 12:40:53 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[clang]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[commits]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://www.stompy.org/?p=177</guid>
		<description><![CDATA[We all know what we should be doing when writing code. Each methodology you choose to use has it&#8217;s own best practices, whether it&#8217;s working from full specifications, writing unit tests first, programming in pairs, yadda, yadda. But, as developers, we&#8217;re only human, and we&#8217;re lazy. We have tools to make things easy for us. [...]]]></description>
			<content:encoded><![CDATA[<p>We all know what we should be doing when writing code. Each methodology you choose to use has it&#8217;s own best practices, whether it&#8217;s working from full specifications, writing unit tests first, programming in pairs, yadda, yadda. But, as developers, we&#8217;re only human, and we&#8217;re lazy. We have tools to make things easy for us. Here are a few tips that you can use to help when you&#8217;re not as rigorous in your coding as you should be.</p>
<h2>Use a static analyser.</h2>
<p>You can use the <a href="http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/9#compilers">Clang Static Analyser</a> in Xcode by setting a build option. This will find a whole host of errors in your code, even down to unconventionally named functions.</p>
<p><img src="http://abizern.org/wp-content/uploads/2009/11/ClangBuildSetting.png" alt="ClangBuildSetting.png" width="502" height="122" /></p>
<p>Now you can just code away and have the compiler pick up your mistakes when you run &#8216;Build and Analyze&#8217; (Shift ⌘ A).</p>
<h2>Find your mistakes quickly</h2>
<p>Any real application you develop will have a large number of resources that need to be copied to your application bundle. The default projects that Xcode create for you will copy these files first before compiling.</p>
<p><img src="http://abizern.org/wp-content/uploads/2009/11/XcodeDefault.png" alt="XcodeDefault.png" width="232" height="88" /></p>
<p>But, the lazy Xcoder knows that there are probably errors in the code that need to get flagged by the compiler, so this copying is a waste of time. Reorder the build steps by dragging so that the compilation is done first.</p>
<p><img src="http://abizern.org/wp-content/uploads/2009/11/XcodeRecommended.png" alt="XcodeRecommended.png" width="219" height="86" /></p>
<p>Your builds will now break early (and often!).</p>
<h2>Don&#8217;t fear the version controller</h2>
<p>I&#8217;m going to stick my neck out and say that if you&#8217;re not using version control you&#8217;re an idiot. The lazy Xcoder uses a powerful system that lets him or her branch easily, make lots of little changes, and lots of mistakes (that can be backed out). These changes can then be bundled into larger commits to be merged into the main branch so that your co-workers don&#8217;t see what an idiot you&#8217;ve been.</p>
<p>One such version control system is <a href="http://git-scm.com/">git</a>. The lazy Xcoder writes a bit of code, checks it in out of habit and then compiles. The compiler picks up the mistakes, and he or she fixes them. Rather than make a new commit, and retype the commit message, just call:</p>
<p><code>git commit --amend -a -C HEAD</code></p>
<p>This will bring up the previous commit message in the editor, which you can amend if you wish. This new commit will replace the previous one. The <code>-a</code> option means you don&#8217;t even need to do a git add and the <code>-C HEAD</code> option means it will use the commit message from the last commit.</p>
<p>Of course, if you&#8217;re a rockstar programmer, you don&#8217;t make mistakes at this level. But I&#8217;m not, and I prefer to work with human nature rather than against it.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2009/11/11/some-tips-for-lazy-xcoders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating git with SubEthaEdit and Changes.app</title>
		<link>http://abizern.org/2009/11/08/integrating-git-with-subethaedit-and-changes/</link>
		<comments>http://abizern.org/2009/11/08/integrating-git-with-subethaedit-and-changes/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 16:41:02 +0000</pubDate>
		<dc:creator>Abizer</dc:creator>
				<category><![CDATA[Mac Development]]></category>
		<category><![CDATA[changes_app]]></category>
		<category><![CDATA[diff]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[subethaedit]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.stompy.org/?p=160</guid>
		<description><![CDATA[A while ago, I read a nice write up about using mercurial with SubEthaEdit and Changes. Here&#8217;s how to do the same thing with git instead of mercurial, separated into two parts in case you just want to apply one set of changes. Changes Support Step One: Make sure chdiff is installed. Open Changes.app and [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I read a <a href="http://schinckel.net/2008/04/26/mercurial-with-os-x-gui-tools/">nice write up</a> about using <a href="http://mercurial.selenic.com/">mercurial</a> with <a href="http://www.codingmonkeys.de/subethaedit/" title="Text editor from the Coding Monkeys">SubEthaEdit</a> and <a href="http://connectedflow.com/changes/" title="Diff viewer from Connected Flow">Changes</a>. Here&#8217;s how to do the same thing with <a href="http://git-scm.com/" title="Distributed Version Control System">git</a> instead of <a href="http://mercurial.selenic.com/">mercurial</a>, separated into two parts in case you just want to apply one set of changes.</p>
<h2>Changes Support</h2>
<p><strong>Step One: Make sure chdiff is installed.</strong></p>
<p>Open Changes.app and from the Changes menu select &#8220;Install terminal utility&#8221;. This will install the chdiff utility which is used by the script.
<p><strong>Step Two: Create a shell script to send diffs to Changes</strong>
<p>Create a shell script with the following contents.</p>
<div class="code"><span style="color:#236e25;"><em>#!/bin/sh<br />
</em></span>[ <span style="color:#c4620a;">$#</span> -eq <span style="color:#0000ff;">7</span> ] &amp;&amp; /usr/bin/env chdiff <span style="color:#760f15;">&quot;</span><span style="color:#c4620a;">$2</span><span style="color:#760f15;">&quot;</span> <span style="color:#760f15;">&quot;</span><span style="color:#c4620a;">$5</span><span style="color:#760f15;">&quot;</span></div>
<p>Where you save this and what you call it is up to you. Mine is called &#8216;.gitchanges&#8217;, saved it at the root of my home directory. Make sure the script is executable.</p>
<p><strong>Step Three: Edit the .gitconfig file to use this script to handle diffs.</strong></p>
<p>Open your <code>~/.gitconfig</code> file. This should already exist, at the very least it will contain you name and email. under the section called <code>[diff]</code> add the location and name of the file.  You may have to edit this to make sure it points to the name and location you chose in Step Two. (Make sure to use the correct path in your setup)</p>
<div class="code"><span style="color:#dd0000;">[</span><span style="color:#003369;">diff</span><span style="color:#dd0000;">]</span><br />
external = <span style="color:#881280;">&lt;path to file&gt;</span>/.gitchanges</div>
<h2>SubEthaEdit Support</h2>
<p><strong>Step One: Download and install the mode file for SubEthaEdit</strong>
</p>
<p>I wrote a SubEthaEdit mode for this which you can download from the <a href="http://abizern.github.com/gitcommit.mode/" title="GitHub Project page">github project page</a>. Please feel free to fork it and send me patches.</p>
<p><strong>Step Two: Edit the .gitconfig file to use SebEthaEdit as an external editor.</strong></p>
<p>Open your <code>~/.gitconfig</code> file. This time, under the <code>[core]</code> section, add the following line:</p>
<div class="code"><span style="color:#dd0000;">[</span><span style="color:#003369;">core</span><span style="color:#dd0000;">]</span><br />
editor = /usr/bin/see -w -r -o new-window -j &#8216;git editor&#8217; -m gitCommit -g 1:0</div>
<p>All those flags may seem daunting, but they are quite self-explanatory: the <code>-w</code> flag makes the Terminal wait for a response from SubEthaEdit. <code>-r</code> brings Terminal to the front after you&#8217;re done editing. <code>-o new-window</code> opens a new window for editing. I prefer this to having a new tab appear in whatever window I was working on. <code>-j 'git editor</code>&#8216; this sets the text that appears in the title bar, which you can change as you wish. <code>-m gitCommit</code> is what sets the mode to be used for editing. and <code>-g 1:0</code> puts the caret at the beginning of the file.</p>
<p>Now, when git asks you to write a commit message, or pick commits when running <code>git rebase -i</code> a SubEthaEdit window will open as the commit message editor. Make whatever changes you need then save the file (⌘-s) and then close the window (⌘-w) for these changes to take effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://abizern.org/2009/11/08/integrating-git-with-subethaedit-and-changes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

