<?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>heipei's weblog &#187; git</title>
	<atom:link href="http://heipei.net/category/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://heipei.net</link>
	<description>Johannes 'heipei' Gilger</description>
	<lastBuildDate>Sat, 07 Jan 2012 17:22:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GitX 0.7 &#8211; Visual changelog</title>
		<link>http://heipei.net/2009/09/07/gitx-0-7-released/</link>
		<comments>http://heipei.net/2009/09/07/gitx-0-7-released/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 20:00:07 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://heipei.net/?p=573</guid>
		<description><![CDATA[GitX 0.7 was just released today. This is the latest release since 0.6.3 and the first real feature release for some time, although we don&#8217;t make that distinction to strictly. After the jump I&#8217;ll outline the cool new features and how to make use of them. GitX mailing-list We&#8217;ve been using our Lighthouse tracker to [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/weblog/gitx_logo.png" alt="GitX 0.7" class="alignleft"/><a href="http://gitx.frim.nl/">GitX 0.7</a> was just released today. This is the latest release since 0.6.3 and the first real feature release for some time, although we don&#8217;t make that distinction to strictly. After the jump I&#8217;ll outline the cool new features and how to make use of them.</p>
<h4>GitX mailing-list</h4>
<p>We&#8217;ve been using <a href="http://gitx.lighthouseapp.com/projects/17830-gitx/overview">our Lighthouse tracker</a> to respond to bugs and to discuss features for quite a while now. Email exchanges between Pieter and other contributors were getting more common, so we decided to open a <a href="http://googlegroups.com/group/gitx/">mailing-list for GitX</a>. We already got some nice patches through the list, which has the great advantage that patches can easily be reviewed inline and discussed. The use of the GitHub-wiki is discouraged, as is the Pull-request functionality.</p>
<h4>GitX survey</h4>
<p><a href="http://www.survs.com/survey?id=DCJKLP2B&#038;channel=E965G53EBB"><img src="/weblog/survs.jpg" alt="GitX survey" class="alignright" style="margin-top: -15px; border:0px;"/></a>To accompany this release, and to improve the input from our users, we have created a small (&lt; 5 min) survey for GitX. We&#8217;d be happy if you took the time to go through it. Link to the <a href="http://www.survs.com/survey?id=DCJKLP2B&#038;channel=E965G53EBB">GitX user survey</a></p>
<p>The juicy details after the jump:<br />
<span id="more-573"></span></p>
<h4>Operations on hunks/lines</h4>
<p><img src="/weblog/gitx_0.7_discard_hunk.png" alt="GitX" class="alignleft"/>Staging and unstaging hunks has been possible for some time. What&#8217;s new is the &#8220;Discard Hunk&#8221; button which simply gets rid of that change, i.e. uses apply &#8211;reverse. As usual, the warning-box that shows up can be silenced by Alt-Clicking the button.<br />
<img src="/weblog/gitx_0.7_stagelines.png" alt="GitX 0.7" class="aligncenter"/>The most obvious change is the ability to stage specific lines from a hunk, using the left mouse-button to drag-select a few lines and then hit &#8220;Stage lines&#8221;. This is by far the most advanced method to stage stuff in a git-gui up until now.</p>
<h4>History</h4>
<p>Two small changes that should make life easier are the orange color for you current branch in the rev-list and the menu-title, which displays your current HEAD as well.<img src="/weblog/gitx_0.7_head.png" alt="GitX" class="aligncenter"/><br />
The panes which hold the list of commits and the individual diffs can now be collapsed/uncollapsed using double-click or the keystroke &#8220;Command-Shift-Up/Down&#8221;. This gives you the ability to quickly maximize complicated history or diffs.</p>
<h4>Committing</h4>
<p><img src="/weblog/gitx_0.7_commit_info.png" alt="GitX" class="alignleft"/>The commit-view gained a &#8220;Sign-Off&#8221; button. Commits keep their author information when amending. And the (Un)staged-changes list gained a &#8220;Show in Finder&#8221; menu item. The diff now shows the committer, who can be someone other than the author of a patch. Commit-hooks now get executed upon committing.</p>
<h4>General</h4>
<p>A small preference called &#8220;Show white-space differences&#8221; shows you diffs with white-space-only changes. We also tried to make most of the alert-messages run non-modal, which means they won&#8217;t block other instances of GitX. The tree-view doesn&#8217;t try to display the content of binary-files anymore. Furthermore we updated a few passages of the UserManual to reflect the current state of GitX.</p>
<h4>Bugfixes</h4>
<p>The big heap of stuff were bugfixes, some trivial, very few regressions, some simply annoying and some features to protect users from doing harm to themselves. A few of those fixes were performance-related, and with the new Safari 4 the diff-view should suffer less.</p>
<h4>What&#8217;s in the pipeline for GitX 0.8</h4>
<p>One of the changes that almost made it to GitX 0.7 is the auto-refresh feature, which monitors the repository and reloads GitX automatically when something is changed. We&#8217;re confident that this feature will be in 0.8, if not earlier.</p>
<h4>Diffstat/shortlog</h4>
<p>Shortlog:</p>
<pre>Benjamin Kramer (9):
      HistoryView: Factor out email formatting
      HistoryView: Show committer if his name differs from the author's
      HistoryView: Show commit date
      HistoryView: Make table header large enough so the text doesn't shift
      Don't compile plain ObjC files as ObjC++
      Get rid of some unnecessary casts
      Remove a .DS_Store
      Fix an obvious typo
      Fix checkbox scaling warnings

Benoit Cerrina (1):
      PBGitRepository: Fix opening of large directories due to bug in NSFileWrapper.

Charles O'Rourke (2):
      Ticket #142: Add Show in Finder to Unstaged and Staged table views.
      Tickets #151 and #155: check for illegal branch names before creating.

Gerd Knops (1):
      Fix build with external build products directory

JD Smith (4):
      commit view: Ensure buttons display on top of text ... but beneath title line.
      diffHighlighter.js: Record the line index as attribute.
      commit.js: Refactor hunk retrieval. To work with subhunks, allow passing a header line explicitly to search for.
      commit.js: Interface for selecting lines to (un-)stage.

Joe Fiorini (3):
      Write commit message to file
      Enable arguments to be passed to executeHook.
      Trigger commit-msg hook when committing

Johannes Gilger (31):
      GitX: Make toolbar in history and commit view equal height
      Info.plist: Fix handling of directories
      PBGitCommit: Call git show with --no-color to be safe
      PBGitRepository: Display branch-name in window title
      PBGitRepository: Correctly indicate bare/non-bare repos
      history.js: Fix display of mode-change and rename
      PBGitCommitController: Fix unstaging of files
      PBWebChanges: Allow discarding of hunks
      PBGitRepository: Add method to remove branch
      PBGitWindowController: Use beginSheetModalForWindow instead of runModal
      keyboardNavigation: Fix keys 'c' and 'v' from webView
      PBGitCommit: Add "Sign-Off" button/method
      PBGitCommitController: Don't allow duplicate Sign-Offs
      PBGitHistory: Add "Show in Finder" to files
      PBGitIndexController: Renamed "Revert" to "Discard"
      Add PBCollapsibleSplitView as subclass of PBNiceSplitView
      PBCollapsibleSplitView: Enable collapse/uncollapse using keys
      Statusbar: Bring View-Mode buttons to front
      Keep window-title up-to-date in commit view
      commit.js: Fix discardHunk functionality
      This fixes a CSS-bug which makes the gitx-website display the same font with Firefox and Safari instead of using a serif with FF.
      Add empty line at end of previous release notes
      UserManual: Add disclaimer as to what GitX is
      GitX 0.7 Release-Notes
      UserManual: Add disclaimer as to what GitX is
      UserManual: Rewrite most parts for GitX 0.7
      About-Panel: Show git-describe using Info.plist
      Site: W3C-Valid and CSS/HTML corrections
      ReleaseNotes for v0.7 with author information
      Site: Get rid of auto-refresh description
      PBGitTree: Don't try to print binary-file contents

Mike Czepiel (1):
      Added very basic tag info menu item and alert.

Nicholas Riley (6):
      Reduce font size of staged/unstaged changes lists.
      Don't disturb editing state when inserting "Signed-off-by" line.
      Remove extraneous space in "Are you sure you wish to revert changes?" message.
      Set keyboard focus reasonably when switching between views.
      Clean up UI and add keyboard support for create branch sheet.
      Truncate the middle of pathnames in the Unstaged/Staged Changes lists.

Pieter de Bie (51):
      Update diffHighlighter test
      HistoryView: speed up diff display
      Allow executing of hooks
      Trigger pre and post-commit hooks when committing
      CommitController: Don't rewrap commit message when amending
      Allow a user to select which columns to display
      HistoryView: Autosave column information
      GitRevList: fix crash when loading 0 commits
      GitRevList -- Try to read the encoding of the commit message
      GitRevList: cache the values of string encodings
      GitRevList: Use std::map.find() rather than count()
      GitCommitController: clean up index functions
      CommitController: Use a dictionary lookup when refreshing index
      GitCommitController: Also use dictionary lookup for untracked files
      PBChangedFile: remove shouldBeDeleted boolean
      Rename 'CachedChanges" to "StagedChanges" for greater consistency
      Add an example of how drag-selection for staging lines could work.
      HistoryView: Resize the detail webview
      Site: add link to Twitter
      PBEasyPipe: Add method that allows you to specify the environment stuff
      PBGitRepository: Specify environment when calling hooks
      PBGitRepository: Add support for changing the environment when executing commands
      NSSTring_RegEx: Add support for regular expressions to NSString
      PBGitCommitController: retain author information of previous commit
      Preferences: Resize views
      Add preference to ignore whitespace differences in history view
      CommitController: don't mutate array we enumerate when refreshing index
      HistoryView: only add parents if parents array exists
      Site: update links to reflect move to mailing list
      Remove use of deprecated stringWithCString
      PBGitConfig: Add missing sentinel
      CommitController: Notify observers when adding files
      History fileview: select current item on rightclick
      Display context menu in the history tree to show related commits
      HistoryController: Add some marks
      WebHistoryController: Refactor menu search to be recursive
      HistoryController: Use a programatically created context menu
      WebHistoryView: Also use the tree context menu
      HistoryController: Add "Open Files" menu item
      CommitController: Reject merges
      PBGitRepository: Clean up the readFromURL: method
      CommitController: Don't turn of off automatic rearranging
      Site: smush.it images
      Also set blobMode / blobSha for unstaged changes.
      PBChangedFile: Add assert to make sure we're not doing something stupid
      IndexController: re-add ellipsis to "Discard Changes" menu item
      DiffHighlighter: Remove weird end line
      HistoryView: Add "SHA" Column and make it hidden by default
      Update releasenotes, as autorefresh won't make it into 0.7
      Add a few more release points
      Add a link to the user survey

Steven Michalske (1):
      HistoryView: Change the way the HEAD is displayed

Stonewall Ballard (1):
      Add preferences for opening things at launch.

dbr (1):
      When selecting a folder in tree-view, display the path rather than the &lt;PBGitTree: 0x...&gt; object.
</pre>
<p>The shortstat has this to say:</p>
<pre>
 84 files changed, 5474 insertions(+), 1470 deletions(-)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/09/07/gitx-0-7-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xcode: &#8220;git describe&#8221; in your app &#8211; again</title>
		<link>http://heipei.net/2009/09/07/xcode-git-describe-in-your-app-again/</link>
		<comments>http://heipei.net/2009/09/07/xcode-git-describe-in-your-app-again/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 10:21:25 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://heipei.net/?p=654</guid>
		<description><![CDATA[A while back I wrote about having the output of &#8220;git describe&#8221; as your version-string in your Mac-OS app, only to discover that this doesn&#8217;t work that well since the string in the Info.plist is supposed to be an constantly increasing number of the form x.y.z.zzzz, which doesn&#8217;t really work with the SHAs git gives [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/weblog/gitx-about.png" alt="GitX" class="alignleft"/>A while back <a href="http://heipei.net/2009/02/23/xcode-git-describe-in-your-infoplist/">I wrote about having the output of &#8220;git describe&#8221; as your version-string</a> in your Mac-OS app, only to discover that this doesn&#8217;t work that well since the string in the Info.plist is supposed to be an constantly increasing number of the form x.y.z.zzzz, which doesn&#8217;t really work with the SHAs git gives you. But since I really wanted that feature I kept searching and found a solution which seems to work pretty well and doesn&#8217;t interfere with the version-string.</p>
<p><b>Introducing a new key to Info.plist</b><br />
First of you&#8217;ll need an additional key in your Info.plist where your custom version-string will be stored. I used &#8220;CFBundleGitVersion&#8221; and set its content to &#8220;GIT_VERSION&#8221;. You can simply do that in XCode.</p>
<p><b>The build-script</b><br />
You&#8217;ll still need a build-script, <a href="http://heipei.net/2009/02/23/xcode-git-describe-in-your-infoplist/">like I described before</a>. A really simple one would be:<br />
<code>VERSION=$(cd $PROJECT_DIR; git describe)<br />
echo -n "#define GIT_VERSION $VERSION" > $PROJECT_TEMP_DIR/revision<br />
touch Info.plist</code>If that doesn&#8217;t work you might need to include some PATH exports above, but I wanted to keep this example to the relevant parts.</p>
<p><b>Info.plist preprocessing</b><br />
Now you can preprocess the Info.plist when building your app, using the revision-file as a header. This means that your GIT_VERSION string will be replaced. Edit your Build-Settings like this:<img src="/weblog/gitx-info-plist-prep.png" alt="Info.plist preprocessing using git describe" class="aligncenter"/><br />
<b>Using the string in the About-window</b><br />
So, now your Info.plist contains a meaningful string. You want that to be displayed to the user when he opens the &#8220;About&#8221; window, but you don&#8217;t want to write your own window. First you have to write an IBAction in some controller that&#8217;s in your MainMenu.xib. Then you&#8217;ll have to reconnect the About-button to that action from your controller, which should look like this:</p>
<pre>- (IBAction)showAboutPanel:(id)sender
{
	NSString *gitversion = [[[NSBundle mainBundle] infoDictionary]
		objectForKey:@"CFBundleGitVersion"];
	NSMutableDictionary *dict = nil;
	if (gitversion)
		dict = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
			gitversion, @"Version", nil];

	[NSApp orderFrontStandardAboutPanelWithOptions:dict];
}</pre>
<p>So, if gitversion is set then the default Version-string is overwritten with it when calling the about-panel, while for Mac-OS the extra-key in your Info.plist is completely meaningless and to differentiate between version you can still use a simple integer. If that was to hard to follow just have a look <a href="http://github.com/pieter/gitx/commit/0b81911d76a819fea58d7c1aba98302cb8703d70">at the commit in the GitX-repo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/09/07/xcode-git-describe-in-your-app-again/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The beauty of snail-mail</title>
		<link>http://heipei.net/2009/06/27/the-beauty-of-snail-mail/</link>
		<comments>http://heipei.net/2009/06/27/the-beauty-of-snail-mail/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 14:24:16 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://heipei.net/?p=614</guid>
		<description><![CDATA[My GitHub Octocat sticker arrived yesterday. I had almost forgotten about it, so it was an even nicer surprise to find a letter from Redwood City, CA in my mailbox today. I asked for the sticker on March 4 this year, quite some time ago ;) I have to say that it&#8217;s really nice to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/heipei/3664632307/" title="The beauty of snail-mail by heipei, on Flickr"><img src="http://farm4.static.flickr.com/3408/3664632307_067308aea4.jpg" width="500" height="222" alt="The beauty of snail-mail" class="aligncenter"/></a><br />
My <a href="http://github.com/blog/369-get-your-github-stickers">GitHub Octocat sticker</a> arrived yesterday. I had almost forgotten about it, so it was an even nicer surprise to find a letter from Redwood City, CA in my mailbox today. I asked for the sticker on March 4 this year, quite some time ago ;)<br />
I have to say that it&#8217;s really nice to see that these guys didn&#8217;t back away from sending one tiny sticker cross-atlantic in a hand-labeled envelope. Cool thing!</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/06/27/the-beauty-of-snail-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>genkernel 3.4.10-r2 with dmraid and hibernate-support</title>
		<link>http://heipei.net/2009/05/13/genkernel-3410-r2-with-dmraid-and-hibernate-support/</link>
		<comments>http://heipei.net/2009/05/13/genkernel-3410-r2-with-dmraid-and-hibernate-support/#comments</comments>
		<pubDate>Wed, 13 May 2009 14:27:11 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://heipei.net/?p=547</guid>
		<description><![CDATA[This comes from the I-have-to-pay-my-electrical-bill and from the learn-something-fun-about-your-system-everyday-department. As you know I&#8217;ve got Gentoo on my workstation. When I still lived in my dorm it was running 24/7 (last but not least to supply everyone with the latest episodes of popular shows). When I moved I started using a hacked-together suspend-to-ram script which worked [...]]]></description>
			<content:encoded><![CDATA[<p>This comes from the I-have-to-pay-my-electrical-bill and from the learn-something-fun-about-your-system-everyday-department. As you know I&#8217;ve got Gentoo on my workstation. When I still lived in my dorm it was running 24/7 (last but not least to supply everyone with the latest episodes of popular shows). When I moved I started using a hacked-together suspend-to-ram script which worked well enough for the last year or so. Seeing how quick and (seemingly easy) hibernate/suspend-to-disk worked on my new netbook I decided to once again give it a try on my workstation.<br />
Since my system has one of those stupid fake-raids I have always needed an initrd to boot the kernel. The initrd calls dmraid, which maps the strange arrays into usable disk-devices (don&#8217;t ask me). The preferred way of creating an initrd with Gentoo is genkernel, which can be used to build a kernel as well. The only problem was that genkernel still lacks support for suspend (user-space suspend, see <a href="http://bugs.gentoo.org/156445">Gentoo Bug</a>), while I can&#8217;t do without dmraid.</p>
<p>So I fired up git and <a href="http://git.lochraster.org:2080/?p=heipei/genkernel.git;a=summary">started hacking on the genkernel-code</a> and now have a system which does suspend-to-disk and dmraid. Having said that, I must stress that <strong>you should really know what you&#8217;re doing</strong> if you&#8217;re trying to use this. You could potentially shoot yourself in the foot if for some reason a hibernated image gets loaded after your harddrives have already been mounted. I try to avoid that in my patch by calling suspend_resume immediately after dmraid has been called (and only there). Improvements or constructive flames would be highly appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/05/13/genkernel-3410-r2-with-dmraid-and-hibernate-support/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Xcode: git describe in your Info.plist</title>
		<link>http://heipei.net/2009/02/23/xcode-git-describe-in-your-infoplist/</link>
		<comments>http://heipei.net/2009/02/23/xcode-git-describe-in-your-infoplist/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 11:50:41 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://hackvalue.de/heipei/?p=421</guid>
		<description><![CDATA[Debugging programs for yourself (or from bug-reports from other people) requires knowing which version caused the bug. Of course most people think in terms of major releases, but a developer needs to know the exact revision, as this might make the crucial difference. UNIX command-line programs usually offer a &#8211;version switch, which returns detailed version [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/heipei/weblog/xcode_git_describe.png" alt="Xcode git describe" class="alignleft"/>Debugging programs for yourself (or from bug-reports from other people) requires knowing which version caused the bug. Of course most people think in terms of major releases, but a developer needs to know the exact revision, as this might make the crucial difference. UNIX command-line programs usually offer a &#8211;version switch, which returns detailed version and build-option information.</p>
<p>If you want to have something similar with Xcode you can use the &#8220;New Run Script Build Phase&#8221; to add a simple script to your build-process. In the case of GitX, the code looks like this (the original can be found at <a href="http://github.com/indirect/xcode-git-build-scripts/tree/master">xcode-git-build-scripts at GitHub</a>):</p>
<pre>#!/usr/bin/env ruby

version = `/usr/bin/env git describe`.chomp

info_file = File.join(ENV['BUILT_PRODUCTS_DIR'], ENV['INFOPLIST_PATH'])
info = File.open(info_file, "r").read

version_re = /([t ]+&lt;key&gt;CFBundleVersion&lt;/key&gt;n[t ]+&lt;string&gt;).*?(&lt;/string&gt;)/
info =~ version_re
bundle_version_string = $1 + version + $2

info.gsub!(version_re, bundle_version_string)
File.open(info_file, "w") { |file| file.write(info) }
puts "Set version string to '#{version}'"
</pre>
<p>Needless to say that this script is not very error-resistant, but since ruby is included with OSX and people compiling GitX usually have git installed, it should work in most cases.<br />
<b>Update</b><br />
I just discovered that the CFBundVersion is supposed to be a monotically increasing integer, separated only by periods. This is required by MacOS and things like Sparkle. The string &#8220;git describe&#8221; returns doesn&#8217;t match these criteria, obviously. So, if you encounter problems, you should fall back to using the format of x.y.z.&lt;commits&gt; where x.y.z is your major release number and &lt;commits&gt; is the number of commits since mentioned tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/02/23/xcode-git-describe-in-your-infoplist/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>git: full-length side-by-side diffs</title>
		<link>http://heipei.net/2009/01/29/git-full-length-side-by-side-diffs/</link>
		<comments>http://heipei.net/2009/01/29/git-full-length-side-by-side-diffs/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 08:46:19 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://hackvalue.de/heipei/?p=403</guid>
		<description><![CDATA[Got this one from the git-ml (which I read via gmane, but that&#8217;s a different post): I&#8217;m not very good at reviewing patches. Especially not if it&#8217;s something like JavaScript. git at least colorizes its diffs, which makes it somewhat better. But as soon as you have a big file which is being patched in [...]]]></description>
			<content:encoded><![CDATA[<p>Got this one from the git-ml (which I read via gmane, but that&#8217;s a different post):<br />
I&#8217;m not very good at reviewing patches. Especially not if it&#8217;s something like JavaScript. git at least colorizes its diffs, which makes it somewhat better. But as soon as you have a big file which is being patched in multiple, disconnected places (different &#8220;hunks&#8221; in git terminology), so that the context between these hunks is missing, it gets to messy imho.</p>
<div align="center"><a href="http://www.flickr.com/photos/heipei/3236351860/" title="git-difftool in action by heipei, on Flickr"><img src="http://farm4.static.flickr.com/3346/3236351860_90f114d5c1.jpg" width="500" height="369" alt="git-difftool in action" /></a></div>
<p>Fortunately there is an easy solution: In git there is contrib/difftool, which makes it easy to display git diffs side-by-side with a viewer of your choice. Of course that meant vimdiff for me. To see all the lines of a file (and not just the changed + a little context) I call git-difftool like this:<br />
<code>git-difftool --tool=vimdiff -U99999</code>Now you can alias that command and use the normal rev-parse arguments. As you can see on the screenshot you can easily distinguish between removed lines, added lines and changed lines. For changed lines the part that was changed is highlighted.</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/01/29/git-full-length-side-by-side-diffs/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>mutt: pretty printing, git,zsh: dirty work-tree</title>
		<link>http://heipei.net/2009/01/16/mutt-pretty-printing-gitzsh-dirty-work-tree/</link>
		<comments>http://heipei.net/2009/01/16/mutt-pretty-printing-gitzsh-dirty-work-tree/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 17:15:49 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://hackvalue.de/heipei/?p=386</guid>
		<description><![CDATA[OK, I can already hear you saying &#8220;here we go again&#8221;. Well, I&#8217;m sorry that I&#8217;m not really in the mood to report much on my personal life (though, rest assured, everything is really going smooth, so don&#8217;t worry). Maybe this blog will undergo certain changes in the near future, but right now I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p>OK, I can already hear you saying &#8220;here we go again&#8221;. Well, I&#8217;m sorry that I&#8217;m not really in the mood to report much on my personal life (though, rest assured, everything is really going smooth, so don&#8217;t worry). Maybe this blog will undergo certain changes in the near future, but right now I&#8217;m not at liberty to discuss this (just wait a few more weeks).<br />
For today I&#8217;ve got two small tips for you. The first is about printing directly from mutt (not that I print mails that often). If you&#8217;re not satisfied with the default output you can use <a href="http://www.gnu.org/software/a2ps/">a2ps</a> (which has many other uses as well!) to produce a more readable output. To do that simply place this into your .muttrc:<code>set print_command="a2ps -r --columns=2 -j -B|lpr"</code> This of course assumes that you can use lpr to print on your system (which is my preferred way of printing stuff).<br />
<img src="/heipei/weblog/git_dirty.jpg" alt="git/zsh dirty work tree" class="alignleft"/>The next tip builds on <a href="/heipei/2008/08/05/zsh-git-branch-prompt-and-cygwin/">my previous post about a zsh prompt showing the current branch</a> if inside a git repo. Instead of just showing the branch-name we want to indicate whether the working directory is clean or if it has uncommitted changes. With git there are two kinds of &#8220;dirty&#8221; though: changes in the index but not committed and changes not in the index. So we have two indicators, which makes the whole thing look like the image. Red is changes not in index, and green is changes already added to the index. The code you&#8217;re gonna need in your .zshrc looks like this:</p>
<pre>
# Set a nice git-prompt (calls git_status())
git_prompt_info() {
  local git_dir ref br;
  git_dir=$(git rev-parse --git-dir 2&gt; /dev/null) || return
  ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || return
  branch_prompt=${ref#refs/heads/}
  if [ -n "$branch_prompt" ]; then
    status_icon=$(git_status)
    echo "$status_icon%{$fg[yellow]%} [$branch_prompt]"
  fi
}
# Show character if index and/or work-tree are dirty
git_status() {
  my_status=$(git status)

  if [[ "$my_status" == *"Changes to be committed"* ]]; then
    output="%{$fg[green]%}+"
  fi

  if [[ "$my_status" == *"Changed but not updated"* ]]; then
    output="$output%{$fg[red]%}*"
  fi

  echo $output
}</pre>
<p>Now all you&#8217;ve gotta do is call $(git_prompt_info) somewhere in your RPS1.</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2009/01/16/mutt-pretty-printing-gitzsh-dirty-work-tree/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GitHub Commit Badge</title>
		<link>http://heipei.net/2008/08/20/github-commit-badge/</link>
		<comments>http://heipei.net/2008/08/20/github-commit-badge/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 14:47:09 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Langeweile]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[github git commit badge banner website javascript]]></category>

		<guid isPermaLink="false">http://hackvalue.de/heipei/?p=311</guid>
		<description><![CDATA[After searching (and finding no existing solution), I created a small JavaScript-based commit-badge/banner which you can show of on your website to point at the latest (or a specific) commit in a Github-repo. This is what it looks like (if you see blank space here or something fubar please reload the page and after that [...]]]></description>
			<content:encoded><![CDATA[<p>After searching (and finding no existing solution), <a href="https://github.com/heipei/github-commit-badge/tree">I created a small JavaScript-based commit-badge/banner</a> which you can show of on your website to point at the latest (or a specific) commit in a Github-repo. This is what it looks like (if you see blank space here or something fubar please reload the page and after that complain ;):</p>
<div id="gcb-container">
    <script type="text/javascript">
<!--
        var Badges = [
            {
                "username": "heipei",
                "repo": "github-commit-badge",
                "branch": "master"
            },
            {
                "username": "git",
                "repo": "git",
                "branch": "master"
            },
            {
                "username": "brotherbard",
                "repo": "gitx",
                "branch": "experimental"
            }
        ];
-->
    </script><br />
    <script type="text/javascript" src="http://heipei.net/files/github-commit-badge/github-commit-badge.js"></script>
</div>
<p>(A live version with more than one repo can be seen <a href="http://heipei.net/files/github-commit-badge/">here.</a>)<br />
So far this badge works with Firefox, Safari 3.x and Opera. I haven&#8217;t had the resources or motivation to make it work on IE though.<br />
This has been my first foray into the world of JavaScript and DOM, and the first time I really wrote a CSS from scratch, so expect things to be buggy and the code to look slightly amateurish. The script uses JavaScript-libs, which I packed into one big file. <a href="http://jquery.com/">jQuery</a> is used to get the data from the <a href="http://github.com/guides/the-github-api">Github API</a>, <a href="http://www.datejs.com/">Datejs</a> for parsing the timestamp and an <a href="http://pajhome.org.uk/crypt/md5/">MD5-lib</a> for requesting the gravatars.<br />
If you want to use it on your website you should just download everything from Github and put it on your webspace. The README shows you how to embed it into your webpage (I made sure that the CSS-elements don&#8217;t clash with your existing stylesheets).<br />
If you want to contribute to it you&#8217;re welcome to (the easiest way is forking the repo at Github), but please don&#8217;t try to make it into a monster-app which does much more than it was intended to do.<br />
Thanks go out to <a href="http://drnicwilliams.com/">DrNic</a> for contributing and also for his <a href="http://github.com/drnic/github-badges/tree/master">Github-badges</a> project for the good code-examples.<br />
(By the way, Github asked for a JavaScript-version <a href="http://github.com/blog/109-supercharged-commits-on-your-site">in this blog-post</a>, so here it is. I hope they&#8217;re not mad at me for stealing the two tiny logos. ;)<br />
<strong>Update:</strong> I notified defunkt of GitHub and what do you know, I got featured on their blog (<a href="http://github.com/blog/149-more-javascript-github-badges">entry here</a>). Awesome. I hope I can put some further touches into the project in the next few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2008/08/20/github-commit-badge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zsh git-branch prompt and cygwin</title>
		<link>http://heipei.net/2008/08/05/zsh-git-branch-prompt-and-cygwin/</link>
		<comments>http://heipei.net/2008/08/05/zsh-git-branch-prompt-and-cygwin/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 22:00:34 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[git zsh cygwin prompt]]></category>

		<guid isPermaLink="false">http://hackvalue.de/heipei/?p=260</guid>
		<description><![CDATA[This is a post about a few things at once, since I have all these little tips/hints I&#8217;d like to make public which don&#8217;t deserve their own post ;) Ok, first about the git-branch status on your zsh. What is that good for? Well, I often find myself working in git-repositories with different local branches [...]]]></description>
			<content:encoded><![CDATA[<p>This is a post about a few things at once, since I have all these little tips/hints I&#8217;d like to make public which don&#8217;t deserve their own post ;)<br />
Ok, first about the git-branch status on your zsh. What is that good for? Well, I often find myself working in git-repositories with different local branches (obviously), and sometimes you lose track which branch you have checked out in which repository at the moment. Instead of issuing &#8220;git branch&#8221; all the time (also note that the git-&lt;command&gt; syntax is no longer valid, the commands are used without the dash now!) you can use that unused space on the right side of your prompt to display the active branch of the current directory (given it is a git repository of course). This is what it will look like (the yellow text is the current branch):<br />
<a class="thickbox" rel="" href='http://hackvalue.de/heipei/wp-content/gallery/screenshots/zsh-git-cygwin.gif' title=''><img src='http://hackvalue.de/heipei/wp-content/gallery/screenshots/zsh-git-cygwin.gif' alt='zsh-git-cygwin.gif' class='ngg-singlepic ngg-center' /></a>To achieve that (and the colors too) you have to put the following into your .zshrc:</p>
<pre>setopt prompt_subst
autoload -U colors
colors
function __prompt_git()
{
        local git_dir ref br top;
        git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
        ref=$(git symbolic-ref HEAD 2> /dev/null) || return
        br=${ref#refs/heads/}
        top=$(cat $git_dir/patches/$br/current 2>/dev/null) \
                  &#038;&#038; top="/$top"
                  echo "[$br$top]"
}
export PS1='[%?]%{$fg[green]%}%n%{$reset_color%}@%m:%~\$ '
export RPS1='%{$fg[yellow]%}$(__prompt_git) %{$reset_color%}%*'
if [[ "$USER" == "root" ]] ; then
        export PS1='[%?]%{$fg[red]%}%n%{$reset_color%}@%m:%~# '
fi
</pre>
<p>(RPS1 is the right side of the prompt)<br />
This colors your username green and red if you&#8217;re root (really helpful). I&#8217;ve picked up the habit of giving remote hosts different colors for the username so that when I have many terminals open I can identify the corresponding host not only by name but also by color. The number in front of the username is the return-code of the command just executed.</p>
<p><img src='http://hackvalue.de/heipei/wp-content/gallery/logos/cygwin-logo.jpg' alt='cygwin-logo.jpg' class='alignleft' />The title of this post (and the screenshot) already mentioned the second topic. Cygwin. I heard about it before but always dismissed it as a poor attempt to bring something into an operating system in a strange and crippled way just because some people are too scared to switch to a unix system. Well, being at home right now (and using Windows XP here because I am too lazy to switch this old machine and also play the occasional game in my free time ;) made me try cygwin, and I have to say I am impressed. I don&#8217;t use it extensively, to be honest I only use it to be able to ssh/scp without using gui-software like PuTTY/WinSCP, to use git without a gui and to have a decent zsh with screen in it. Oh yeah, and vim. Basically all the little life-savers you have with linux (tar, grep, less, sed, man). Just being able to download a tarball (like git or stow) and compiling/installing it like on any unix is quite convenient too. And that works fine with cygwin. You can also access you normal windows-drives and it has a tool (cygstart) to open files with the associated programes (like &#8220;open&#8221; in Mac OS). Last but not least you can even run an ssh-server, which seems weird at first, but comes in handy when all you want to do is shutdown you windows-box remotely ;). So if you don&#8217;t like the rxvt you can always use putty to ssh to localhost (yeah, I don&#8217;t do that neither).</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2008/08/05/zsh-git-branch-prompt-and-cygwin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The GitHub</title>
		<link>http://heipei.net/2008/06/24/the-github/</link>
		<comments>http://heipei.net/2008/06/24/the-github/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 20:46:26 +0000</pubDate>
		<dc:creator>Jojo</dc:creator>
				<category><![CDATA[Geekstuff]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[git github review]]></category>

		<guid isPermaLink="false">http://hackvalue.de/heipei/?p=173</guid>
		<description><![CDATA[Ok, I hinted that I would do a more thorough review of GitHub, the new and easy-to-use git repository hosting site. Although I&#8217;m still no power-user I&#8217;ve come to know the features that make GitHub worth using and so far unique. The &#8220;Fork&#8221; feature is probably the most important one. Instead of just cloning a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com"><img src="/heipei/weblog/github.png" alt="GitHub" class="alignleft"/></a>Ok, I hinted that I would do a more thorough review of GitHub, the new and easy-to-use git repository hosting site. Although I&#8217;m still no power-user I&#8217;ve come to know the features that make GitHub worth using and so far unique.<br />
The &#8220;Fork&#8221; feature is probably the most important one. Instead of just cloning a repository and working on it locally, you can fork it on GitHub. When you fork a project everyone can see you did, and has a nice flashy graph-view so they can see where you branched and what commits you made that are not (yet) in the upstream. <img src="/heipei/weblog/fork.png" alt="GitHub fork" class="alignleft"/>And if you have introduced changes that you think would benefit the project you can send people (e.g. the original project owner) a &#8220;pull-request&#8221;. The recipient can then easily fetch/merge your changes into his project. It really doesn&#8217;t get much easier to contribute to (open-source) projects. I certainly did for the first time ;)</p>
<div align="center"><img src="/heipei/weblog/branch.png" alt="GitHub forks"/></div>
<p>Then there are feeds. You can watch projects, which means that your feed includes any commits/comments on the watched projects. It goes without saying that this can be quickly overwhelming for active projects. <img src="/heipei/weblog/github_comment.png" alt="GitHub" class="alignleft"/>Comments can be made on specific lines in a commit (or on the whole commit), which is a great feature (think of it as the equivalent to patches being discussed line-by-line in mailing-lists). I still prefer mails though ;)<br />
The syntax-highlighting looks pretty good. I&#8217;ve already mentioned the very pale interface (as in low-contrast) and it still has not changed. But I think that most people really browse the commit history in their local clones anyway.<br />
Each project has an attached Wiki too, so you can add a few pages (or a lot if you wish).<br />
To conclude I can say that GitHub is a great service, since it has a free plan for public projects. I would not need it for my personal projects, but to run a or contribute to a open-source project it&#8217;s perfect. The amount you use its features is up to you. If you already have a Wiki, already have an active mailing-list and discuss patches there too then you can just use GitHub as the central source code repository (plus the forks of course). The real work is done on your local repository with git anyway, but y&#8217;already knew that I guess ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://heipei.net/2008/06/24/the-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

