<?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>This is my blog</title>
	<atom:link href="http://www.ronniealleva.org/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ronniealleva.org</link>
	<description>There are many like it but this one is mine</description>
	<lastBuildDate>Mon, 10 May 2010 07:06:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create a Review Board review using git svn and checked in code</title>
		<link>http://www.ronniealleva.org/index.php/2010/05/10/create-a-review-board-review-using-git-svn-and-checked-in-code/</link>
		<comments>http://www.ronniealleva.org/index.php/2010/05/10/create-a-review-board-review-using-git-svn-and-checked-in-code/#comments</comments>
		<pubDate>Mon, 10 May 2010 06:45:00 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[review board]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=150</guid>
		<description><![CDATA[Our group is starting to use Review Board more and more to conduct our code reviews.  But using it with git-svn, or with anything you&#8217;ve already checked into svn can be a real hassle.  You don&#8217;t want to have uncommitted code hanging around in your computer for extended periods of time for a number of [...]]]></description>
			<content:encoded><![CDATA[<p>Our group is starting to use <a href="http://www.reviewboard.org/">Review Board</a> more and more to conduct our code reviews.  But using it with git-svn, or with anything you&#8217;ve already checked into svn can be a real hassle.  You don&#8217;t want to have uncommitted code hanging around in your computer for extended periods of time for a number of reasons, so this rendered it difficult to use for code projects that take more than a week.</p>
<p>Since I like to eat, and hence get paid so that I can afford food, I have to work on things that take longer than a week.  But luckily, git can help get a diff for review board based only on a string in the commit comments.</p>
<p>This came about when one of my <a href="http://jlorenzen.blogspot.com/">co-workers</a> posted a bash scripts someone had written that would <a href="http://mojodna.net/2009/02/24/my-work-git-workflow.html">take a git diff and make it into a svn-like diff</a>.  And that worked great.  My first attempt was to modify it to do multiple files at once, but it ended up making a diff for each revision for each file (if you need that functionality, you can get that <a href="http://gist.github.com/391247">here</a>).</p>
<p>So I pulled out python and worked on a new script, which is at the bottom of this post, or you can get it <a href="http://gist.github.com/395726">here</a>.</p>
<p>Once you download the file, you run it like this from your git repository:</p>
<pre>git-create-review.py (some grep string) &gt; diff.output</pre>
<p>The script will take the argument as a string to search for in the commit comments. This is thanks to the <em>git log &#8211;grep=foo</em> command available in git. It outputs directly to the terminal,  which you can see I&#8217;m redirecting into diff.output.  Once you have the file, you can upload to Review Board as you normally would.</p>
<p>I did it by using a search string because we use JIRA to track our work in svn.  We have pre-commit hooks to ensure that we put a JIRA number on each commit.  This helps out git as it has something to search through to get the change list.</p>
<p><strong>Known issues</strong>:</p>
<p><strong>First</strong>: It will get all the changes between the first and last revision that had the search string.</p>
<p><em>Example:</em></p>
<blockquote><address>I change File.java under JIRA-123 (now at r1). </address>
<address>Another change to File.java under JIRA-321 (now at r2). </address>
<address>I change the file again under JIRA-123 (now r3). </address>
</blockquote>
<p>This script will take all changes between 1 and 3, even if I don&#8217;t want the JIRA-321 changes to show up.</p>
<p><strong>Second</strong>: it doesn&#8217;t have any context around removed/moved files. It still should pick up a renamed file as just a completely new file, but it doesn&#8217;t have any context of renaming.  But I believe that&#8217;s the case with svn anyway.</p>
<p><strong>Third</strong>:  I am by no means a good python programmer, and might not know all the conventions that people normally follow. The code below may cause eye hemorrhaging, face hemorrhaging&#8230;pretty much any of your organs could be hemorrhaged by looking at the code. CONSIDER THIS YOUR ONLY WARNING.</p>
<p>But I did some testing with newly created files, and removed files, and binary files, but I&#8217;m sure I missed some crazy edge cases.  Let me know if you hit any snags.</p>
<p>The script follows:</p>
<p><script src="http://gist.github.com/395726.js?file=git-create-review.py"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2010/05/10/create-a-review-board-review-using-git-svn-and-checked-in-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cloned a git-svn clone, now git svn fetch fails</title>
		<link>http://www.ronniealleva.org/index.php/2010/03/29/cloned-a-git-svn-clone-now-git-svn-fetch-fails/</link>
		<comments>http://www.ronniealleva.org/index.php/2010/03/29/cloned-a-git-svn-clone-now-git-svn-fetch-fails/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 22:53:50 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=137</guid>
		<description><![CDATA[If you go to the bottom of the page for git-svn, under the &#8220;Basic Examples&#8221; section, you&#8217;ll see in there a procedure to clone a git-svn repo that someone has painstakingly already cloned from svn.  That&#8217;s great, because it will save you hours and hours of mind numbing time that would normally take someone to [...]]]></description>
			<content:encoded><![CDATA[<p>If you go to the bottom of the page for <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a>, under the &#8220;Basic Examples&#8221; section, you&#8217;ll see in there a procedure to clone a git-svn repo that someone has painstakingly already cloned from svn.  That&#8217;s great, because it will save you hours and hours of mind numbing time that would normally take someone to clone an svn repo.</p>
<p>That person may be tremendously happy&#8230;that is, until, you try to &#8220;git svn fetch&#8221; to get new revisions and branched and what have you, and you get an error message like this:</p>
<blockquote><p>Last fetched revision of (some branch or tag) was r3421, but we are about to fetch: r3421!</p></blockquote>
<p>In an attempt to fix it, you may find <a href="http://www.jukie.net/bart/blog/20080916155113">this blog post</a>, saying to remove the .ref files from your svn directory, which also proves fruitless.</p>
<p>The fix: modify the .git/svn/.metadata file so that the branches-maxRev and tags-maxRev equals the latest commit revision in svn.  So it should look like this after you are done:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">; This file is used internally by git-svn
; You should not have to edit it
[svn-remote &quot;svn&quot;]
 reposRoot = (svn server name)
 uuid = c08781d2-f03e-0410-8c7c-e884ea3e41f3
 branches-maxRev = 17224
 tags-maxRev = 17224</pre></div></div>

<p>Where 17224 was our latest revision.</p>
<p>I got the idea from git-svn&#8217;s webpage, where it states:</p>
<blockquote><p>If the subset of branches or tags is changed after fetching, then .git/svn/.metadata must be manually edited to remove (or reset) branches-maxRev and/or tags-maxRev as appropriate.</p></blockquote>
<address> </address>
<p>I must caveat this with the fact that I have no idea why this works. Git svn is still black magic to me, and making this work is akin to me throwing muskrat bones onto a flaming pyre, and drawing conclusions from the charred remains.  Maybe someone with more git knowledge could drop it off here?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2010/03/29/cloned-a-git-svn-clone-now-git-svn-fetch-fails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Materialised views and Spring DAO Tests</title>
		<link>http://www.ronniealleva.org/index.php/2010/03/01/materialised-views-and-spring-dao-tests/</link>
		<comments>http://www.ronniealleva.org/index.php/2010/03/01/materialised-views-and-spring-dao-tests/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 07:02:15 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[DB]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=131</guid>
		<description><![CDATA[So, you have a materialized view in your DB.  That&#8217;s great.  Give yourself a cookie.
You also have created a set of tests in your DAO layer, using the AbstractTransactionalSpringContextTests.  Good for you, again.
But when you try to mix these two together, you may see tests failing and can&#8217;t immediately see why.  This can happen if [...]]]></description>
			<content:encoded><![CDATA[<p>So, you have a materialized view in your DB.  That&#8217;s great.  Give yourself a cookie.</p>
<p>You also have created a set of tests in your DAO layer, using the <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/test/AbstractTransactionalSpringContextTests.html">AbstractTransactionalSpringContextTests</a>.  Good for you, again.</p>
<p>But when you try to mix these two together, you may see tests failing and can&#8217;t immediately see why.  This can happen if you try to get data from the materialized view after attempting to save data to a table that the view accesses.</p>
<p>Well, it&#8217;s very simple, and probably pretty obvious.  It wasn&#8217;t immediately obvious to me why it was failing, and I didn&#8217;t really see anything online about it, so hopefully this will stop your search quickly.</p>
<p>First thing to realize is that running your DAO tests through the AbstractTransactionalSpringContextTests is that every test is run in a transaction.  That&#8217;s great most of the time.  Each test will run in a little isolated environment and the changes to the database will be rolled back at the end. You don&#8217;t have all kinds of test data strewn about afterwards as if it were the island in Cast Away.</p>
<p>The second thing to realize is that a materialized view will only be updated on commit.  There&#8217;s a lot more to it than that, but I am not a DBA and that&#8217;s all you need to know in general.</p>
<p>So, with those two things in mind, you can see how it might be a problem if you try to write tests against code that uses the materialized view.  All is not lost however.  If you put an <strong>endTransaction()</strong> call somewhere in your test, all of the DB calls you&#8217;ve made up to that point will be committed.  Also, any other calls made after that point will also be committed to the database.  Since that happens, you will be on your own to clean up after the test as you see fit.  Also, placing an endTransaction will only affect the test you place it in.  Any other test will still continue to run and rollback in the normal fashion.</p>
<p>What we ended up doing was making the tests that need to commit to the database small as possible.  We then wrapped the <strong>endTransaction()</strong> function in a function called <strong>setTestToCommit()</strong> (my co-worker <a href="http://jlorenzen.blogspot.com/">James&#8217;</a> suggestion), so that it makes more sense to read it, and placed it at the beginning of the test.</p>
<p>There&#8217;s lots more information about how it works <a href="http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/test/AbstractTransactionalSpringContextTests.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2010/03/01/materialised-views-and-spring-dao-tests/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Conky Hudson plugin</title>
		<link>http://www.ronniealleva.org/index.php/2010/01/24/conky-hudson-plugin/</link>
		<comments>http://www.ronniealleva.org/index.php/2010/01/24/conky-hudson-plugin/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 02:55:32 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=125</guid>
		<description><![CDATA[I just finished updating the conky hudson plugin.  You can get more information on main page here.  Hopefully, you like it.  If not, then&#8230;what do you want from me?
]]></description>
			<content:encoded><![CDATA[<p>I just finished updating the conky hudson plugin.  You can get more information on main page <a href="http://www.ronniealleva.org/index.php/conky-hudson-status/">here</a>.  Hopefully, you like it.  If not, then&#8230;what do you want from me?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2010/01/24/conky-hudson-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More git-svn fun: working with svn branches</title>
		<link>http://www.ronniealleva.org/index.php/2009/09/16/more-git-svn-fun-working-with-svn-branches/</link>
		<comments>http://www.ronniealleva.org/index.php/2009/09/16/more-git-svn-fun-working-with-svn-branches/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 05:47:05 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=50</guid>
		<description><![CDATA[So, last time I detailed using git to work with your svn trunk.  But many of you asked, &#8220;But Ralph, my svn repo has many branches and many tags because developers love branches and tags!  How can I work with that?&#8221;  Well, since no one reads this blog and no one actually [...]]]></description>
			<content:encoded><![CDATA[<p>So, <a href="http://www.ronniealleva.org/index.php/2008/08/28/using-git-and-subversion-in-5-easy-steps/">last time</a> I detailed using git to work with your svn trunk.  But many of you asked, &#8220;But Ralph, my svn repo has many branches and many tags because developers love branches and tags!  How can I work with that?&#8221;  Well, since no one reads this blog and no one actually asked me that, also misspelling my name in the process, let&#8217;s just pretend that what I write is relevant.</p>
<p>So you want to work with multiple svn branches (not to be confused with git branches).  What you have to do is clone the svn repository in a different way, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ git svn clone https://somesvnrepo/svn/project -T trunk -b branches -t tags</pre></div></div>

<p>This should work in most cases.  The arguments to the -T, -b, and -t switches are the paths that the trunk, branches, and tags are in respectively. Typically, your branches and tags should be what I put above, but just in case it is different in your case, there you go.</p>
<h2>Working with your shiny repo</h2>
<p>After a short time in which humans achieve interstellar travel, git finishes cloning, and you have access to the entire svn repository.  Now, let&#8217;s say you wanted to start working on trunk.  Like before, you should checkout a branch, but this time it&#8217;s going to use trunk as it&#8217;s parent:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ git checkout -b BranchOfTrunk trunk</pre></div></div>

<p>But Lo!  You have the entire repo, so you can checkout that branch from whatever branch you have in subversion.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ git checkout -b BranchOfSubversionBranch subversion-branch</pre></div></div>

<p>Now, you can switch between BranchOfTrunk and BranchOfSubversionBranch, and you&#8217;ll get all the code associated with trunk and subversion-branch respectively.  No more checkout of a branch ever again, wasting precious keystrokes you could use to post to Facebook.  </p>
<p>If a new svn branch is created on the server, make sure to run the following command to see it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ git svn fetch
. (updating blah blah)
.
.
$ git branch -a</pre></div></div>

<p>The last command will show you all the branches, local (your own branches) and remote (every dumb svn branch), for this repository.</p>
<p>NOTE: <strong>git svn fetch</strong> and <strong>git svn rebase</strong> are almost exactly the same.  <strong>fetch</strong> will update the entire git repository with anything not received from svn.  <strong>rebase</strong> is concerned only with the parent of the branch you have checked out.  If you recall last time, <strong>git svn rebase</strong> was equivalent to <strong>svn update</strong>.  Now you can work with the same workflow as I mentioned before, working, committing locally, rebasing, etc.  </p>
<h2>Merging from subversion branch to trunk?  BALDERDASH!</h2>
<p>Now, let&#8217;s say that you want to commit a series of changes into a subversion branch, but you also want to commit the same changes in trunk also.  What I&#8217;m going to show you is the workflow that I go through most of the time.  I think it&#8217;s the most effective way to accomplish it in git.  </p>
<p>First, you can run a fake dcommit.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ git svn dcommit --dry-run
Committing to https://svnserver/svn/project/branches/subversion-branch ...
diff-tree b64fdc9250bbe04b3246214ade509e0b0d9d912d~1 b64fdc9250bbe04b3246214ade509e0b0d9d912d</pre></div></div>

<p>The <strong>&#8220;&#8211;dry-run&#8221;</strong> is key here, for two reasons.  First, you&#8217;ll be able to see what branch you are actually committing to in subversion. Not a bad idea, since you&#8217;re working in a git repo that has all your subversion branches.</p>
<p>Second, you&#8217;ll see a diff tree with some of the commit hashes, one corresponding to each time you did a commit locally, in order.  You will want to keep the values of the hash around, because next we are going to <strong>&#8220;cherry-pick&#8221;</strong> them into trunk:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ git checkout BranchOfTrunk
Switched to branch &quot;BranchOfTrunk&quot;
$ git cherry-pick b64fdc9
Finished one cherry-pick.
Created commit e4a7971:  Your commit comments here
 12 files changed, 58 insertions(+), 66 deletions(-)</pre></div></div>

<p>You&#8217;ll notice I only used the first 7 digits of the hash (b64fdc9) to do the cherry-pick.  That&#8217;s all you need to use&#8230;git will pick out the revision from just those seven characters.  What this does is pulls the change from the other branch into this branch.  If you have more than one commit, you should do this multiple times, in the order of the commits.  But then you have the things you did on the branch ready to be checked into trunk!  </p>
<p>This is the way I usually work.  You may decide that doing a subversion merge is easier for what you are trying to do (I sometimes do also).  I&#8217;d also like to know if there is an easier way to do this.  This doesn&#8217;t seem the easiest way, but was the easiest way I could find so far.  And I googled for like&#8230;20 minutes.</p>
<p>Hopefully this helps&#8230;someone.  One person, at least.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2009/09/16/more-git-svn-fun-working-with-svn-branches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Script-fu: cat directly to X clipboard</title>
		<link>http://www.ronniealleva.org/index.php/2009/04/10/script-fucat-directly-to-x-clipboard/</link>
		<comments>http://www.ronniealleva.org/index.php/2009/04/10/script-fucat-directly-to-x-clipboard/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 18:48:52 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[command line]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=44</guid>
		<description><![CDATA[Have you ever wanted to &#8216;cat&#8217; a file directly to the clipboard? OF COURSE, why else would you be reading this sentence?
Simply install &#8216;xclip&#8217;, which is simple also, if you are on ubuntu:

sudo apt-get install xclip

Anything that you pipe to it goes to the X11 clipboard.  Once there, you can just hit the middle [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to &#8216;cat&#8217; a file directly to the clipboard? OF COURSE, why else would you be reading this sentence?</p>
<p>Simply install &#8216;xclip&#8217;, which is simple also, if you are on ubuntu:</p>
<pre>
sudo apt-get install xclip
</pre>
<p>Anything that you pipe to it goes to the X11 clipboard.  Once there, you can just hit the middle mouse button to paste it where you want, just as if you had highlighted it.  So you can do things like this:</p>
<pre>
$ cat some.file | xclip
$ nslookup somehost | xclip
$ ./runsomeawesomescriptthatyouwanttheoutputintheclipboard.sh | xclip
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2009/04/10/script-fucat-directly-to-x-clipboard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>maven-jmeter-plugin release</title>
		<link>http://www.ronniealleva.org/index.php/2009/01/12/maven-jmeter-plugin-release/</link>
		<comments>http://www.ronniealleva.org/index.php/2009/01/12/maven-jmeter-plugin-release/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 05:53:52 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=42</guid>
		<description><![CDATA[WOW what a long day since my last post!  IT WAS ONE DAY I SWEAR.  Anyway, I put up an information page for the maven-jmeter-plugin up here.
I also set up a google code project here for it.  Please let me know if you have any features or feedback on it.
Thanks!
]]></description>
			<content:encoded><![CDATA[<p>WOW what a long day since my last post!  IT WAS ONE DAY I SWEAR.  Anyway, I put up an information page for the maven-jmeter-plugin up <a href="http://www.ronniealleva.org/index.php/maven-jmeter-plugin/">here</a>.</p>
<p>I also set up a google code project <a href="http://code.google.com/p/jmeter-maven-plugin/">here</a> for it.  Please let me know if you have any features or feedback on it.</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2009/01/12/maven-jmeter-plugin-release/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A better JMeter Maven plugin</title>
		<link>http://www.ronniealleva.org/index.php/2008/12/22/a-better-jmeter-maven-plugin/</link>
		<comments>http://www.ronniealleva.org/index.php/2008/12/22/a-better-jmeter-maven-plugin/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 06:38:46 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[jmeter]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/?p=20</guid>
		<description><![CDATA[UPDATE: You can find the information about the JMeter Maven plugin here
Recently my co-worker James suggested we automate our tests on our project using JMeter and gave me his webpage about the trials and tribulations he went through to get it set up.  It linked to a wiki page, in which someone had created a [...]]]></description>
			<content:encoded><![CDATA[<p><i>UPDATE: You can find the information about the JMeter Maven plugin <a href="http://www.ronniealleva.org/index.php/maven-jmeter-plugin/">here</a></i></p>
<p>Recently my co-worker <a href="http://jlorenzen.blogspot.com/" target="_blank">James</a> suggested we automate our tests on our project using JMeter and gave me his <a href="http://jlorenzen.blogspot.com/2008/03/automated-performance-tests-using.html" target="_blank">webpage</a> about the trials and tribulations he went through to get it set up.  It linked to a <a href="http://wiki.apache.org/jakarta-jmeter/JMeterMavenPlugin">wiki page</a>, in which someone had created a JMeter plugin for Maven.</p>
<p>Well awesome, it shouldn&#8217;t be too hard to set up.  And it wasn&#8217;t, I had the JMeter tests up and running in a short amount of time.  But one of the problems was that I wanted to set it up in a more generic way so that we could define different parameters on each of the CI environments we ran.  </p>
<p>For this task, I first tried using filtering in maven, which I got working.  But what you end up with is a JMX file that is basically unusable by default in JMeter. If you ever wanted to run it again standalone in JMeter, you&#8217;d have to modify the variables in the JMX file to work correctly.  Vice versa, if you set up your test using JMeter, you have to remember to modify it so that the maven variables you need are in the places you need them.</p>
<p>JMeter already has a system in it where you can define variables in the JMX files (and give them defaults, fancy la la!).  For example, say you want to define a variable for a host name.  Inside your JMeter JMX file, you can do something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;stringProp</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;HTTPSampler.domain&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>${__P(someVariableName, localhost)}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/stringProp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now, you have defined someVariableName to be a variable within your JMX file.  The second value, in this case localhost, is the default if no variable override has been given.</p>
<p>The way to override these variables is with the -J option on the command, in this form:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #660033;">-JsomeVariableName</span>=yourhost.com</pre></div></div>

<p>and all the variables called someVariableName will have the value yourhost.com.</p>
<p>Now, with the minor modifications I have made to the JMeter Maven plugin, you can now define the values for these variables inside of your pom.xml, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jmeterUserProperties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;someVariableName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>yourhost.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/someVariableName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jmeterUserProperties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>and it is just the same as using -J on the JMeter command line.</p>
<p>The way we&#8217;re actually going to use it is to combine it with maven variables, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jmeterUserProperties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;someVariableName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>${ourhostname}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/someVariableName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/jmeterUserProperties<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>So now, we can just do:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mvn <span style="color: #660033;">-Dourhostname</span>=ourspecialhost ...</pre></div></div>

<p>and be able to run site specific JMeter tests with only changing the arguments on the command-line.</p>
<p>I will be putting together a page in the next day or so with all the libraries needed to set this up, similar to the wiki page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2008/12/22/a-better-jmeter-maven-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using Git and Subversion in 5 Easy Steps</title>
		<link>http://www.ronniealleva.org/index.php/2008/08/28/using-git-and-subversion-in-5-easy-steps/</link>
		<comments>http://www.ronniealleva.org/index.php/2008/08/28/using-git-and-subversion-in-5-easy-steps/#comments</comments>
		<pubDate>Fri, 29 Aug 2008 04:44:23 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/index.php/2008/08/28/using-git-and-subversion-in-5-easy-steps/</guid>
		<description><![CDATA[I recently wanted to use a distributed version control system to learn and to try it out, since I have been hearing great things about it.  The only issue is that my team (and like 1 million other teams universe wide) currently uses Subversion, and trying to get them to switch over would be like [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to use a distributed version control system to learn and to try it out, since I have been hearing great things about it.  The only issue is that my team (and like 1 million other teams universe wide) currently uses Subversion, and trying to get them to switch over would be like trying to punch a redwood down.</p>
<p>But! Not all is lost.  You can use git with Subversion.  This can give you some of the benefits of using a DVCS without having to change everything you do.  I believe you can do this also with Mercurial&#8230;I went with git because I had read somewhere it had the best support to working with Subversion. AND RANDOM INTERNET BLOGS ARE ALWAYS RIGHT.</p>
<p>First of all, I will say that I used <a href="http://utsl.gen.nz/talks/git-svn/intro.html">this</a> as a guide when I was working.  It&#8217;s a great start to doing this stuff.  I&#8217;ll also assume you can find and install git on your own, since you&#8217;re all-grow&#8217;d up now.</p>
<h2>Step 1: Creating a local repo</h2>
<p>Ok so let&#8217;s get started.  The first step is to get the subversion library.  That webpage I gave you gives you four different ways of doing it, but I decided to go with the fourth option, which is cloning the entire Subversion repository.  You can do that by doing:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git <span style="color: #c20cb9; font-weight: bold;">svn</span> clone https:<span style="color: #000000; font-weight: bold;">//</span>svnserver<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>trunk</pre></div></div>

<p>Now, you should know that this could take a while.  You might as well go and eat dinner for the next three days while this completes.  Just kidding, this took me about an hour or so while I was working remotely over a VPN, so it&#8217;s not so bad.  Our project has about 8000 revisions, and about 230 MBs of files.</p>
<p>So you&#8217;re probably wondering &#8220;But now if I have the whole history, isn&#8217;t it going to take like&#8230;a bazillion bytes on my disk?&#8221;  To that I say &#8220;Non&#8221;&#8230;it uses compression, and my git repo ended up being about 1 MB bigger than my subversion one.</p>
<h2>Step 2: Create a branch</h2>
<p>From there, you can start working in git!  The first thing you&#8217;ll probably want to do is create a branch:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git branch someNeatoBranch</pre></div></div>

<p>To change to that branch:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git checkout someNeatoBranch</pre></div></div>

<p>Now you are working on this particular branch.  Note you can do this in one step by doing:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git checkout <span style="color: #660033;">-b</span> someNeatoBranch</pre></div></div>

<p>which will create it and put you on it to work.</p>
<h2>Step 3: Commit locally</h2>
<p>Now you can edit the files to your heart&#8217;s content.  And commit locally as often as you like, by doing</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git commit <span style="color: #660033;">-a</span></pre></div></div>

<p>You can commit individual files by specifying them, but -a just grabs them all.</p>
<h2>Step 4: Commit back to Subversion</h2>
<p>Once you&#8217;re ready to commit back into the main Subversion repo, first you need to pull all the changes from there, to make sure there are no conflicts. You can do this by using this command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git <span style="color: #c20cb9; font-weight: bold;">svn</span> rebase</pre></div></div>

<p>This will pull down the latest code and apply your code on top of it, merging if necessary.  Then to commit back to Subversion, you use:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">git <span style="color: #c20cb9; font-weight: bold;">svn</span> dcommit</pre></div></div>

<p>And you will notice that your files are committed back to the repo without any more intervention from you!  But where are your comments?  Well, all the comments from the commits you did locally will be used to commit to Subversion.  It will also do that many commits.  So if you did 5 different commits locally, it will turn into 5 different Subversion commits.  As long as your team members don&#8217;t worry about the revision number spirialing up towards the heavens, it should be ok.</p>
<h2>Step 5: Brunch!</h2>
<p>This is a pretty simple workflow to get you started on using git with Subversion, but it&#8217;s not even half the story.  There&#8217;s so much more powerful stuff with the branching aspect, and I even haven&#8217;t tried it yet to share work with my coworkers before commiting to svn (I&#8217;m kinda like a git island at the moment).  But try it out, and then check out some of the resources below that helped me get started.</p>
<p>Also, you might want to check how my co-worker <a href="http://jlorenzen.blogspot.com/2008/08/me-lovin-git.html">James </a>one-upped me.  He was working on some highly experimental code that he wanted to share with a teammate, and created a true git repo in approximately 8 seconds, from existing code.</p>
<p><strong><br />
</strong></p>
<h2><strong>Resources</strong></h2>
<ul>
<li><a href="http://utsl.gen.nz/talks/git-svn/intro.html">An introduction to git-svn for Subversion/SVK users and deserters</a></li>
<li><a href="http://git.or.cz/course/svn.html">Git &#8211; SVN Crash Course</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2008/08/28/using-git-and-subversion-in-5-easy-steps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to create a tar of files you have updated in SVN</title>
		<link>http://www.ronniealleva.org/index.php/2008/07/29/how-to-create-a-tar-of-files-you-have-updated-in-svn/</link>
		<comments>http://www.ronniealleva.org/index.php/2008/07/29/how-to-create-a-tar-of-files-you-have-updated-in-svn/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 23:35:32 +0000</pubDate>
		<dc:creator>Ronnie</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.ronniealleva.org/index.php/2008/07/29/how-to-create-a-tar-of-files-you-have-updated-in-svn/</guid>
		<description><![CDATA[I had to recently send some modified files to someone so that they could take a look at what I was doing.  OH NOES!  How do I gather them all up at once?

tar cvzf somefile.tar.gz `svn stat &#124; awk '{print &#34;test -f &#34; $2 &#34; &#38;&#38; echo &#34; $2}' &#124; bash`

Word.
To break it down:
The svn [...]]]></description>
			<content:encoded><![CDATA[<p>I had to recently send some modified files to someone so that they could take a look at what I was doing.  OH NOES!  How do I gather them all up at once?</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> cvzf somefile.tar.gz <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">stat</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;test -f &quot; $2 &quot; &amp;&amp; echo &quot; $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bash</span><span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p><strong>Word.</strong></p>
<p>To break it down:</p>
<p>The svn stat command is getting all the files that have changed obviously.</p>
<p>The awk command its piped to is the real part that&#8217;s doing the work.  The awk command prints</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-f</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #c20cb9; font-weight: bold;">file</span></pre></div></div>

<p>Pipe that through bash, and you have commands, which essentially will echo the file if the file is a file.  Simple?  No?  I mean, it will not print it out if it&#8217;s a directory, so you don&#8217;t have to worry about it adding entire directories.</p>
<p>Surround that whole thing in backquotes (that&#8217;s the one with the tilde (that&#8217;s the one next to the &#8216;1&#8242; key ( I&#8217;m not telling you where the &#8216;1&#8242; key is)))  and give it as the argument to the tar command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ronniealleva.org/index.php/2008/07/29/how-to-create-a-tar-of-files-you-have-updated-in-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
