<?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>experimentalworks</title>
	<atom:link href="http://blog.experimentalworks.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.experimentalworks.net</link>
	<description></description>
	<lastBuildDate>Fri, 27 Jan 2012 10:07:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Removing a directory from a git repository the fast way</title>
		<link>http://blog.experimentalworks.net/2012/01/removing-a-directory-from-a-git-repository-the-fast-way/</link>
		<comments>http://blog.experimentalworks.net/2012/01/removing-a-directory-from-a-git-repository-the-fast-way/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:58:46 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=526</guid>
		<description><![CDATA[Note to myself:
To remove a directory from an existing git repository there are various ways to do it. The obvious way is

$ git filter-branch --tree-filter 'rm -rf directory/'


Which is just fine for smaller repositories but can take a long time on large repositories with a lot of large files in that directory.
The faster way ...]]></description>
			<content:encoded><![CDATA[<p>Note to myself:<br />
To remove a directory from an existing git repository there are various ways to do it. The obvious way is<br />
<code><br />
$ git filter-branch --tree-filter 'rm -rf directory/'<br />
</code></p>
<p>Which is just fine for smaller repositories but can take a long time on large repositories with a lot of large files in that directory.<br />
The faster way is to manipulate only the index:<br />
<code><br />
git filter-branch --index-filter 'git ls-files -- DIRECTORY | xargs git update-index --remove' --tag-name-filter cat --prune-empty -f -- --all;<br />
</code></p>
<ul>
<li><em>git ls-files</em> will give you a list of files in the DIRECTORY</li>
<li><em>git update-index</em> will remove those files from the index</li>
<li>And the tag filter is there to include tags</li>
<li>&#8211;prune-empty tells filter-branch to ignore empty commits.</li>
</ul>
<p>Done.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=526&amp;md5=a2b84e5105562290b6f6eb0268a0fa8a" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2012/01/removing-a-directory-from-a-git-repository-the-fast-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random thoughts about contributions</title>
		<link>http://blog.experimentalworks.net/2011/09/random-thoughts-about-contributions/</link>
		<comments>http://blog.experimentalworks.net/2011/09/random-thoughts-about-contributions/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 13:50:15 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=520</guid>
		<description><![CDATA[The PHP community announced that they will be switching to Git. This lead to some discussion on Twitter, wether it is good to go directly to Github or use git.php.net as the gateway to ensure control over ACLs. People were argueing that github encourages people to contribute and that the PHP community is stuck ...]]></description>
			<content:encoded><![CDATA[<p>The PHP community announced that they will be switching to Git. This lead to some discussion on Twitter, wether it is good to go directly to Github or use git.php.net as the gateway to ensure control over ACLs. People were argueing that github encourages people to contribute and that the PHP community is stuck in the 90s if they don&#8217;t switch completly over to Git.</p>
<p>So my 2 cents:</p>
<p>What really makes people contribute:</p>
<ol>
<li>A nice and encouraging community</li>
<li>Respect the work of others</li>
<li>Don&#8217;t take everything for granted</li>
</ol>
<p>What doesn&#8217;t encourage people:</p>
<ol>
<li>Continous rants about how to do things or not</li>
<li>Telling people what they do is totally wrong</li>
<li>Not contribute yourself</li>
</ol>
<p>Open Source Projects are community driven. There is a place for discussion, but note that Open Source Communities are open, so people will come in and start ranting about things. If you are serious about a certain problem and want to solve it, contribute! If you want things to change, contribute! If you want to have your opinion heard, contribute! But do not try to squeeze argumentations in 140 characters and think everyone will follow you, just because it&#8217;s you.</p>
<p>Personally I&#8217;m getting tired of this, making me either not to contribute anymore (and you guys are stuck with SVN :)) or just ignore people.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=520&amp;md5=d03fafe691b218ab6ef24a7b38d4f383" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2011/09/random-thoughts-about-contributions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to run clojure.test in Slime and Swank</title>
		<link>http://blog.experimentalworks.net/2011/01/how-to-run-clojure-test-in-slime-and-swank/</link>
		<comments>http://blog.experimentalworks.net/2011/01/how-to-run-clojure-test-in-slime-and-swank/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 17:51:20 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[clojure]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[slime]]></category>
		<category><![CDATA[swank]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=492</guid>
		<description><![CDATA[
$ lein swank

In emacs use M-x slime-connect to connect to swank.

user&#62; (use 'clojure.test)
nil
user&#62; (use :reload 'geocommit.test.services) (run-test 'geocommit.test.services)
{:type :summary, :test 3, :pass 9, :fail 0, :error 0}
]]></description>
			<content:encoded><![CDATA[<pre>
$ lein swank
</pre>
<pre>
In emacs use M-x slime-connect to connect to swank.
</pre>
<pre>
user&gt; (use 'clojure.test)
nil
user&gt; (use :reload 'geocommit.test.services) (run-test 'geocommit.test.services)
{:type :summary, :test 3, :pass 9, :fail 0, :error 0}
</pre>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=492&amp;md5=e12018c671ff5ee06bffd448c914cba2" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2011/01/how-to-run-clojure-test-in-slime-and-swank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Locate your commits or how to use geocommit.</title>
		<link>http://blog.experimentalworks.net/2011/01/locate-your-commits-or-how-to-use-geocommit/</link>
		<comments>http://blog.experimentalworks.net/2011/01/locate-your-commits-or-how-to-use-geocommit/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 14:48:30 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Entropia]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=478</guid>
		<description><![CDATA[This blog post will show you how to use geocommit in your projects. It shows how to install the Chrome and Firefox extensions to add support for geocommit to github.com and bitbucket.org]]></description>
			<content:encoded><![CDATA[<p>We recently launched <a href="http://geocommit.com">geocommit.com</a>. Geocommit is a service to add geolocation data to your commits. You only need a working WiFi connection. <em>No GPS module is required</em>.</p>
<p>This blogpost gives you an example how to use geocommit and the geocommit.com services. I&#8217;ll show how to use geocommits in your <a href="http://git-scm.org">Git</a> or <a href="http://mercurial.selenic.com">mercurial</a> project. How to make <a href="http://github.com">github</a> and <a href="http://bitbucket.org">bitbucket</a> more beautiful with our Chrome and Firefox extensions and how to get a fancy map of your geocommits.</p>
<h3>What is geocommit</h3>
<p>First of all, geocommit is a text format to attach geolocation data to version control system commits. The geocommit <a href="http://geocommit.com">website</a> has detailed information about the geocommit format.<br />
Second, geocommit is a <em>service</em> to store and analyse your geocommit data. We offer a set of tools and a webservice to make geocommit cool. The Git implementation <em>git geo</em> runs on Mac OS X and Linux. The Mercurial implementation <em>hg-geo</em> runs only under Linux. Mac OS support is under way.</p>
<h3>Git &#038; Geocommit</h3>
<p>To start with geocommit, install <a href="http://github.com/peritus/geocommit">git geo</a>:</p>
<pre>
<b>$ pip install geocommit</b>
</pre>
<p>Go to a project directory and enable geocommit support:</p>
<pre>
$ cd myproject.git
<b>$ git geo setup</b>
geocommit setup
Installing geocommit hook in /home/dsp/awesomeproject/.git/hooks/post-rewrite
Installing geocommit hook in /home/dsp/awesomeproject/.git/hooks/post-merge
Installing geocommit hook in /home/dsp/awesomeproject/.git/hooks/post-commit
</pre>
<p>This will enable geocommit support in your project. If you commit something with git commit, git geo will try to get your current location and add a geocommit. If no WiFi connection is enabled, no geocommit will be created.</p>
<p>Check your geocommits:</p>
<pre>
<b>$ git log --show-notes='geocommit'</b>
commit 5a34e6ebc8cb5c2a394ca26505c1d375095161c4
Merge: 25cf72d 828af6e
Author: David Soria Parra <dsp @php.net>
Date:   Tue Jan 4 14:00:55 2011 +0100

    Merge branch 'master' of https://github.com/jezdez/geocommit

Notes (geocommit):
    geocommit (1.0)
    lat: 48.1211828
    long: 11.4853565
    hacc: 39.0
    src: nmg
</dsp></pre>
<p>Let&#8217;s push our geocommits to github:</p>
<pre>
<b>$ git geo push</b>
</pre>
<p><em>git geo push</em> accepts the same options as git push. It pulls geocommits first, merges them and then pushes geocommits and the given branch to the remote repository.<br />
That&#8217;s everything you need. Easy, isn&#8217;t it? So let&#8217;s see how to enable geocommits on Mercurial and then talk about the Chrome and Firefox extensions.</p>
<hr />
<strong>Deep dive</strong><br />
git geo stores geocommits in git notes. We use the namespace <em>geocommit</em> for that. Git notes have some cool properties. They are metadata and don&#8217;t change the commit hash. Therefore they can be added to a commit at anytime. They are displayed on github and can be deleted without any problem. You also can decide yourself when to push geocommits or not. You can delete already pushed geocommits without breaking the repository or changing any commit sha1. The drawback is that it is hard to deal with git notes from time to time. git notes is a new feature in git and not yet fully supported. We have to write a script to merge git notes as git notes merge is not available before git 1.7.7. </p>
<hr />
<h3>Mercurial &#038; geocommit</h3>
<p>You can add support for geocommits to Mercurial by installing the <a href="http://bitbucket.org/segv/hg-geo">hg-geo</a> extension. Clone the extension and enable it in your hgrc:</p>
<pre>
<b>$ hg clone http://bitbucket.org/segv/hg-geo</b>
$ echo "[extensions]\ngeo=/path/to/hg-geo/geo.py"
$ hg help geo
</pre>
<p>The extension will add an additional line to every commit that you do.</p>
<pre>
<b>$ hg commit</b>
<b>$ hg log -v</b>
changeset:   9:236a0f4c3d2e
tag:         tip
user:        David Soria Parra <dsp @php.net>
date:        Sun Jan 02 03:01:04 2011 +0100
files:       .hgtags
description:
Added tag v1.0.0 for changeset 3079e3ff3083

geocommit(1.0): lat 48.1211306, long 11.4853251, hacc 30.0, src nmg;
</dsp></pre>
<p>Now push your geocommits to <a href="http://bitbucket.org">bitbucket</a>.</p>
<pre>
<b>$ hg push</b>
</pre>
<hr />
<strong>Deep dive</strong><br />
As Mercurial doesn&#8217;t have a way to store metadata, we are adding the geocommit data to the commit message itself. The obvious advantage is that you can use hg-geo with plain Mercurial. You do not need to enable hg-geo on the remote site to push geocommits (like Mercurial bookmarks). The disadvantage is that we modify the commit message and therefore the commit hash. There is no easy way to delete geocommits once they are created.</p>
<hr />
<h3>bitbucket.org and github.com</h3>
<p>We can push geocommits easily now. But how to use them? We can install the Firefox or Chrome extension. This will display a map next to your commit!</p>
<p><strong>Firefox</strong><br />
To install the geocommit extension for Firefox you need Greasemonkey. Greasemonkey is a well know and supported extension that enables user scripts to safely modify the displayed website.</p>
<p>Install Greasemonkey from <a href="https://addons.mozilla.org/de/firefox/addon/748/>addons.mozilla.org and then install the geocommit script from <a href="http://userscripts.org/scripts/show/93129">userscripts.org</a>. You can then browse bitbucket.org or github.com and see a map of your geocommit:</p>
<p><a href="http://blog.experimentalworks.net/wp-content/uploads/2011/01/bb.png"><img src="http://blog.experimentalworks.net/wp-content/uploads/2011/01/bb-300x160.png" alt="bitbucket with geocommit support" title="bitbucket with geocommit support" width="300" height="160" class="alignnone size-medium wp-image-493" /></a></p>
<p><a href="http://blog.experimentalworks.net/wp-content/uploads/2011/01/gh.png"><img src="http://blog.experimentalworks.net/wp-content/uploads/2011/01/gh-300x130.png" alt="github with geocommit support" title="github with geocommit support" width="300" height="130" class="alignnone size-medium wp-image-494" /></a></p>
<p><strong>Chrome</strong><br />
On Chrome install the plugin from<br />
<a href="https://chrome.google.com/extensions/detail/mchakdojblmfdjnhbdopinejdffjjgga">chrome.google.com</a></p>
<h3>Post Hook</h3>
<p>We offer a post hook that you can use with github.com and bitbucket.org. Your commits will be tracked by gecommit.com and we will create a global and a project specific map as well as provide further analytics as soon as possible.</p>
<p><strong>github.com</strong><br />
To install the hook go to th eadmin section of your repository and select <em>Service Hooks</em>.<br />
<a href="http://blog.experimentalworks.net/wp-content/uploads/2011/01/gh-hook1.png"><img src="http://blog.experimentalworks.net/wp-content/uploads/2011/01/gh-hook1-300x113.png" alt="" title="gh-hook1" width="300" height="113" class="alignnone size-medium wp-image-499" /></a></p>
<p>Add <em>http://hook.geocommit.com/api/github</em> as a POST service hook.<br />
<a href="http://blog.experimentalworks.net/wp-content/uploads/2011/01/gh-hook2.png"><img src="http://blog.experimentalworks.net/wp-content/uploads/2011/01/gh-hook2-300x131.png" alt="" title="gh-hook2" width="300" height="131" class="alignnone size-medium wp-image-500" /></a></p>
<p><strong>on bitbucket.org</strong><br />
Go to the admin seciton of your repository and select <em>Services</em><br />
<a href="http://blog.experimentalworks.net/wp-content/uploads/2011/01/bb-hook1.png"><img src="http://blog.experimentalworks.net/wp-content/uploads/2011/01/bb-hook1-300x117.png" alt="" title="bb-hook1" width="300" height="117" class="alignnone size-medium wp-image-502" /></a></p>
<p>Add <em>http://hook.geocommit.com/api/bitbucket</em> as a POST service hook<br />
<a href="http://blog.experimentalworks.net/wp-content/uploads/2011/01/bb-hook21.png"><img src="http://blog.experimentalworks.net/wp-content/uploads/2011/01/bb-hook21-300x140.png" alt="" title="bb-hook2" width="300" height="140" class="alignnone size-medium wp-image-504" /></a></p>
<p>Thats about it. Browse <a href="http://www.geocommit.com/full.html">www.geocommit.com/full.html</a> to checkout your commits on our map.</p>
<p>Questions?!<br />
Enjoy!</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=478&amp;md5=b0683e17a20690f1777df225416c7de9" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2011/01/locate-your-commits-or-how-to-use-geocommit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review remote changes offline in Mercurial</title>
		<link>http://blog.experimentalworks.net/2010/09/review-remote-changes-offline-in-mercurial/</link>
		<comments>http://blog.experimentalworks.net/2010/09/review-remote-changes-offline-in-mercurial/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 12:01:36 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=467</guid>
		<description><![CDATA[If you want to review remote changes from Mercurial offline you cannot use hg incoming. For sure there is a nice way to do it. So here is what I do to get changes from a repository to review them later without pulling them into my repo before reviewing. It also has the advantage ...]]></description>
			<content:encoded><![CDATA[<p>If you want to review remote changes from Mercurial offline you cannot use <em>hg incoming</em>. For sure there is a nice way to do it. So here is what I do to get changes from a repository to review them later without pulling them into my repo before reviewing. It also has the advantage that you can review changesets that include a given file. This is not possible with <em>hg incoming</em>.</p>
<p>Read the incoming changes and save them in a bundle file:</p>
<pre>$ hg incoming --bundle incoming.bundle http://selenic.com/hg
</pre>
<p>Now you can disconnect and review them offline.</p>
<pre>$ hg -R incoming.bundle log --no-merges -p -- hgext/bookmarks.py
(log pops up)
</pre>
<p>The <em>-R incoming.bundle</em> option tells Mercurial to use the bundle as an overlay for the current repository. The <em>&#8211;no-merges</em> option tells Mercurial to not display merges (which I usually use for reviewing patches) and the <em>-p</em> option is there to display the applied patches in the output. I use <em>&#8211; hgext/bookmarks.py</em> to display only changesets related to the bookmark extension.</p>
<p>Everything&#8217;s good, let&#8217;s pull it:</p>
<pre>$ hg pull incoming.bundle
pulling from incoming.bundle
searching for changes
adding changesets
adding manifests
adding file changes
added 113 changesets with 281 changes to 204 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
</pre>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=467&amp;md5=baf1c6062c9543325ac9a671d32d9b02" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2010/09/review-remote-changes-offline-in-mercurial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercurial Bookmarks Revisited &#8211; Part I</title>
		<link>http://blog.experimentalworks.net/2010/06/mercurial-bookmarks-revisited-part-i/</link>
		<comments>http://blog.experimentalworks.net/2010/06/mercurial-bookmarks-revisited-part-i/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 08:53:51 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Version Control]]></category>
		<category><![CDATA[bookmarks]]></category>
		<category><![CDATA[dvcs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=453</guid>
		<description><![CDATA[Bookmarks is an extension to the Mercurial SCM, which adds git-like branches to Mercurial. The extension is distributed together with Mercurial.
Recently the extension has received a major update. Time to look back.

This is a series of blogposts that consists of three parts:
 
 (1) Part   I: History of Bookmarks
 (2) Part  ...]]></description>
			<content:encoded><![CDATA[<p>Bookmarks is an extension to the <a href="http://mercurial-scm.org">Mercurial SCM</a>, which adds git-like branches to Mercurial. The extension is distributed together with Mercurial.<br />
Recently the extension has received a major update. Time to look back.</p>
<p>This is a series of blogposts that consists of three parts:</p>
<p> <strong>(1) Part   I: History of Bookmarks</strong><br />
 (2) Part  II: Daily Bookmarking<br />
 (3) Part III: Pushable Bookmarks</p>
<p><strong>UPDATE</strong> I&#8217;m aware that people wait for Part II. Let me see if I can write about it this weekend&#8230;in the meantime, click the flattr button :)<br />
<span id="more-453"></span><br />
I stumbled over Mercurial in August 2007. Back then I had already<br />
used <a href="http://git-scm.org">Git</a> for 6 months, but wanted<br />
to try out different distributed version control systems (<a href="http://en.wikipedia.org/wiki/Distributed_revision_control">DVCS</a>).<br />
I soon began to like Mercurial&#8217;s approach because of its simple and<br />
intuitive interface and its clean codebase. While playing around<br />
with Mercurial for a few weeks I was content with its concepts.<br />
There was one feature missing<br />
that I really like in Git: <a href="http://www.kernel.org/pub/software/scm/git/docs/git-branch.html">git-like branches</a>.</p>
<p>Unlike in Mercurial or in any other version control system, branches in<br />
Git are simply lightweight markers pointing to a commit. Every ancestor of<br />
the commit is considered part of the branch. Back then, this sounded odd to me. Later I realized it was a really good tool to create small local branches. You can create a small branch<br />
for a feature, merge it into your mainline, and remove the branch<br />
without anyone knowing you ever had a branch called<br />
<em>&#8216;stupid-little-feature</em>&#8216;. To make a long story short: It&#8217;s a good<br />
idea to have a similar concept in Mercurial, but none existed back in 2008.</p>
<p>In June 2008 I started developing Mercurial References providing lightweight branches similar to those available in Git. Although the initial work was appreciated by the community, it was rejected<br />
in favor of a concept more natural to Mercurial. Matt Mackall, the author of<br />
Mercurial proposed Mercurial Bookmarks.</p>
<h3>Bookmarks</h3>
<p>The concept of <a href="http://en.wikipedia.org/wiki/Bookmark">bookmarks</a> is easy:<br />
You can bookmark a commit with a unique name.  So it&#8217;s similar to<br />
a tag, with one exception, a bookmark advanced when you commit.<br />
(Like real bookmarks when you go to the next page).</p>
<p>I wrote an initial version of Mercurial Bookmarks in August, that<br />
was finally accepted in October. This improved git like workflows<br />
in Mercurial but still the implementation was far away from what I<br />
wanted. By adding the notion of a so called &#8220;current bookmark&#8221;, it<br />
got better. Still bookmarks had one major drawback in comparison<br />
to git style branches. They were local only. There was no way to<br />
push or pull bookmarks.</p>
<h3>Pushable bookmarks</h3>
<p>This was the status for the past two years. I tried to make bookmarks<br />
pushable during this time. A proposal by me how extensions in general<br />
can exchange arbitrary information over the wire was rejected in<br />
early 2009 because it was too unrestrictive for the protocol. A new<br />
concept, so called &#8216;pushkey concept&#8217; was developed in 2009.  This<br />
was discussed and accepted during the Mercurial Sprint in Paris,<br />
January 2010.</p>
<p>Matt Mackall, who now gets <a href="http://mercurial.selenic.com/sponsors/">sponsored</a> to work on Mercurial,<br />
worked on the <a href="http://selenic.com/hg/rev/ca4fc993087c">initial implementation</a>of pushkey and<br />
pushable bookmarks. And finally after two years of ongoing complains<br />
by people about local-only bookmarks, Mercurial 1.6 will have<br />
pushable bookmarks and introduces a great new concept to exchange<br />
metadata information between repositories.</p>
<p>The next blogpost will show you how to use bookmarks.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=453&amp;md5=6168d680a8f2a3c2086cec08e10d8f7c" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2010/06/mercurial-bookmarks-revisited-part-i/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Advanced Git Slides</title>
		<link>http://blog.experimentalworks.net/2010/06/advanced-git-slides/</link>
		<comments>http://blog.experimentalworks.net/2010/06/advanced-git-slides/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 12:43:24 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Version Control]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=442</guid>
		<description><![CDATA[Here are the slide from my Advanced Git talk:

Advanced GitView more presentations from segv.]]></description>
			<content:encoded><![CDATA[<p>Here are the slide from my Advanced Git talk:</p>
<div style="width:425px" id="__ss_4509679"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/segv/advanced-git" title="Advanced Git">Advanced Git</a></strong><object id="__sse4509679" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=advancedgit-100615155156-phpapp01&#038;rel=0&#038;stripped_title=advanced-git" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse4509679" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=advancedgit-100615155156-phpapp01&#038;rel=0&#038;stripped_title=advanced-git" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/segv">segv</a>.</div>
</div>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=442&amp;md5=813c6bb8e7078b5c8e360148b314d9dd" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2010/06/advanced-git-slides/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php-trunk macport</title>
		<link>http://blog.experimentalworks.net/2010/05/php-trunk-macport/</link>
		<comments>http://blog.experimentalworks.net/2010/05/php-trunk-macport/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:48:39 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[dtrace]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=435</guid>
		<description><![CDATA[macports is a widely used ports system for Mac OS. It's repository contains hundreds of application that can be compiled and installed. The repository contains php 5.3. So if you want to run PHP from subversion you still have to compile it yourself and install it yourself outside your managed ports environment. I created ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.macports.org/ ">macports</a> is a widely used ports system for Mac OS. It&#8217;s repository contains hundreds of application that can be compiled and installed. The repository contains php 5.3. So if you want to run PHP from subversion you still have to compile it yourself and install it yourself outside your managed ports environment. I created a rather simple Portfile to build it from PHP&#8217;s <a href="http://svn.php.net/repository/php/php-src/trunk/">trunk</a>. </p>
<p>To use the php-trunk portsfile. Just extract the tarball into a directory and&#8230;<br />
<code><br />
 $ tar xzvf php-trunk-port.tar.gz<br />
 $ cd php-trunk-port<br />
<del datetime="2010-05-24T18:23:38+00:00"> $ echo "file://`pwd`" > /opt/local/etc/macports/sources.conf</del><br />
 $ echo "file://`pwd`" >> /opt/local/etc/macports/sources.conf<br />
 $ port install php-trunk<br />
</code></p>
<p>And the best thing about the port: It compiles PHP with dtrace support :).</p>
<p>Please note the Portfile is very simple and is not tested with the additional modules provided by macports. So use it at your own risk and enhance it.</p>
<p><a href="http://patches.experimentalworks.net/php-trunk-port.tar.gz">DOWNLOAD</a></p>
<p>UPDATE: as philip noted, it should be >> instead of >.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=435&amp;md5=c30dbdf415711fde1cf1109e756ca7f9" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2010/05/php-trunk-macport/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP 5.3.99-dev and DTrace Part I</title>
		<link>http://blog.experimentalworks.net/2010/04/php-5-3-99-dev-and-dtrace-part-i/</link>
		<comments>http://blog.experimentalworks.net/2010/04/php-5-3-99-dev-and-dtrace-part-i/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 17:10:13 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[dtrace]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=432</guid>
		<description><![CDATA[For those not following the PHP development. We backported the DTraces probes from the abandoned PHP 6.0 branch, back to the new trunk PHP 5.3.99-dev. It is called 5.3.99 because the PHP dev community has not decided yet on a version number (5.4 or 6.0).

To compile PHP with DTrace, on Solaris or Mac OS ...]]></description>
			<content:encoded><![CDATA[<p>For those not following the PHP development. We backported the DTraces probes from the abandoned PHP 6.0 branch, back to the new trunk PHP 5.3.99-dev. It is called 5.3.99 because the PHP dev community has not decided yet on a version number (5.4 or 6.0).</p>
<p>To compile PHP with DTrace, on Solaris or Mac OS do:</p>
<pre>
  $ svn co http://svn.php.net/repository/php/php-src/trunk php
  $ cd php
  $ ./buildconf --force
  $ ./configure --enable-dtrace
  $ make
</pre>
<p>To check if your PHP has DTraces probes enabled, you can check the phpinfo() using</p>
<pre>
 $ php -i | grep DTrace
</pre>
<p>or use DTrace directly></p>
<pre>
 $ sudo dtrace -ln 'php*:::' -c 'php -m'

88836    php4614               php               dtrace_compile_file compile-file-entry
88837    php4614               php               dtrace_compile_file compile-file-return
88838    php4614               php                        zend_error error
88839    php4614               php  ZEND_CATCH_SPEC_CONST_CV_HANDLER exception-caught
88840    php4614               php     zend_throw_exception_internal exception-thrown
88841    php4614               php           dtrace_execute_internal execute-entry
88842    php4614               php                    dtrace_execute execute-entry
88843    php4614               php           dtrace_execute_internal execute-return
88844    php4614               php                    dtrace_execute execute-return
88845    php4614               php                    dtrace_execute function-entry
88846    php4614               php                    dtrace_execute function-return
88847    php4614               php              php_request_shutdown request-shutdown
88848    php4614               php               php_request_startup request-startup
</pre>
<p>Have fun with DTrace in PHP.</p>
<p>A few examples will follow in the next days.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=432&amp;md5=3e14fabfad7b52726cb9e5e4394527f1" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2010/04/php-5-3-99-dev-and-dtrace-part-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with Sessions in Compojure</title>
		<link>http://blog.experimentalworks.net/2010/02/dealing-with-sessions-in-compojure/</link>
		<comments>http://blog.experimentalworks.net/2010/02/dealing-with-sessions-in-compojure/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 10:46:31 +0000</pubDate>
		<dc:creator>dsp</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://blog.experimentalworks.net/?p=407</guid>
		<description><![CDATA[The blog post gives you a short introduction into the session management of Compojure.]]></description>
			<content:encoded><![CDATA[<p>I recently started working with <a href="http://compojure.org">Compojure</a>, a <a href="http://en.wikipedia.org/wiki/Web_Application_Framework">web framework</a> for programming language <a href="http://clojure.org">Clojure</a>. After playing around with basic GET and POST requests I tried to store and load data from a session. As Compojure is quiet new, there is not much documentation how to deal with sessions, particularly as Compojure and it&#8217;s API still changes fast.</p>
<p>In the following post I&#8217;ll show a brief example on how to create a login page with Compojure 0.3.2 running on Clojure 1.1.0.</p>
<p><span id="more-407"></span></p>
<h4>What is Clojure?</h4>
<p>Clojure is a <a href="http://en.wikipedia.org/wiki/Lisp_(programming_language)">Lisp</a> dialect. So it&#8217;s a programming language based on the principles of Lisp. The interesting part about Clojure is that it runs on the <a href="http://en.wikipedia.org/wiki/Java_Virtual_Machine">Java Virtual Machine</a>. As a developer you can therefore use the bright variety of Java written libraries in your code without touching one line of <a href="http://en.wikipedia.org/wiki/Java_(programming_language)">Java</a>. Use the power of Java libraries together with the power of Lisp.</p>
<h4>What is Compojure?</h4>
<p>Compojure is a web framework for Clojure. It handles <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">incoming request</a>, offers an easy way to create <a href="http://java.sun.com/products/servlet/">servlets</a> and provides basic functionality for <a href="http://en.wikipedia.org/wiki/HTML">HTML</a> templates. The current stable version 0.3.2. Compojure is a young project and things change fast there, so be aware that a 0.3.2 application might not run on 0.4.</p>
<h4>What is a session?</h4>
<p>Basically it&#8217;s a per-user store managed by the server. For example a server backend can store the credentials of a user that it received in a request in this store making it possible to identify the user again when he or she does a second request. Usually this functionality is achieved by a library or by the interpreter itself (for example in <a href="http://php.net">PHP</a>) and is implemented by storing the session data either in memory or on disk together with a unique identifier that is then stored in a cookie at the users computer. So when the user comes back, the cookie is read and the identifier is used to find the data for the user.</p>
<h3>The application</h3>
<h4>A basic example</h4>
<p>Before we work with a session, let&#8217;s create a simple webpage that displays hello world for us.<br />
<script src="http://gist.github.com/316604.js"></script></p>
<p>The example is straight forward. We define a set of <em>routes</em>. In our example the route is &#8220;/*&#8221;, so it matches everything. The route then takes a function as a second argument. In our case we use the templating mechanism of Compojure and create a simple HTML response with the <font face="monospace">(html)</font> macro.</p>
<p>We then start the server using the <font face="monospace">(run-server)</font> macro and binding our routes to a specified mountpoint. I won&#8217;t go into details about servlets but usually it is sufficient if you have a servlet running on the mountpoint &#8220;/*&#8221; and then a set of routes.</p>
<p>To run the server you can use a small script like this one:<br />
<code><br />
#!/bin/sh<br />
CLASSPATH=.:~/dev/clojure/compojure.jar:~/dev/clojure/clojure.jar<br />
java -cp $CLASSPATH clojure.lang.Script net/experimentalworks/clojure/serve.clj<br />
</code></p>
<h4>Adding sessions</h4>
<p>Before we can start adding sessions we have to be aware that Compojure has a mechanism called <em>decorating</em>. So you can decorate a set or routes with what Compojure calls a middleware. We will think of it as a way to enable advanced mechanism. To add the session mechanism to a set of routes use the <font face="monospace">(decorate)</font> macro as shown in the following code:</p>
<p><script src="http://gist.github.com/316609.js"></script></p>
<p>Note the that we define a session decoration. At the moment sessions only support in-memory storage (which by the way should be usually the way you want to manage sessions). The <font face="monospace">:memory</font> keyword here is to tell Compojure to store it&#8217;s sessions in memory. Although you can omit the keyword, I prefer writing it down so people can easily figure out how our session is stored.</p>
<h4>Creating a login</h4>
<p>Let&#8217;s create a login. We will first add a new route called <font face="monospace">/login/:user</font>. This will tell Compojure that the last part of the query string is a parameter and it should extract it. We can then access the value using <font face="monospace">(:user params)</font>. We use the <font face="monospace">(session-assoc)</font> function to associate our username with the session-key <font face="monospace">:loggedin</font>. Here is what the code looks like:<br />
<script src="http://gist.github.com/316614.js"></script></p>
<p>You can then &#8220;login&#8221; to your site using <font face="monospace">http://localhost:8080/login/test</font> and you Compojure will recognize you again if you go back to <font face="monospace">http://localhost:8080/</font></p>
<h4>Logout</h4>
<p>To logout, we clear the key itself. Let&#8217;s a have a look directly into the code. We use the <font face="monospace">(session-dissoc)</font> function to drop the key (it seems that clear-session is broken in my <a href="http://github.com/weavejester/compojure">Compojure checkout</a> for whatever reasons..need to debug *debug*).<br />
<script src="http://gist.github.com/316623.js"></script><br />
Use <font face="monospace">http://localhost:8080/logout</font> to get rid of your session.</p>
<h4>Conclusion</h4>
<p>The basic idea behind Compojure sessions is simple and I hope you were able to grasp the idea a little bit. What can be annoying and what I didn&#8217;t show you is that you might run into problems within the actual implementation, although the basic stuff should work fine. Once you figured out the basics you can read and write sessions withing seconds and the code becomes clean and beautiful. Feel free to comment on this article if you like the post, it&#8217;s the only measurement for me that I can use to make sure I&#8217;m not writing stupid stuff.</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.experimentalworks.net/?flattrss_redirect&amp;id=407&amp;md5=c5813cff4a835393efe1fea8b95d7f2d" title="Flattr" target="_blank"><img src="http://blog.experimentalworks.net/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.experimentalworks.net/2010/02/dealing-with-sessions-in-compojure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

