<?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>Solutionizing .NET (Keith Dahlby)</title>
	<atom:link href="http://lostechies.com/keithdahlby/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/keithdahlby</link>
	<description>Git, .NET and more</description>
	<lastBuildDate>Mon, 07 May 2012 15:04:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>posh-git v0.4</title>
		<link>http://lostechies.com/keithdahlby/2012/05/07/posh-git-v0-4/</link>
		<comments>http://lostechies.com/keithdahlby/2012/05/07/posh-git-v0-4/#comments</comments>
		<pubDate>Mon, 07 May 2012 15:04:49 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[posh-git]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=106</guid>
		<description><![CDATA[I figure a year between releases is plenty, so I&#8217;ve tagged a v0.4 release of posh-git. Really the notion of versions for a bunch of scripts on which noone depends seems a bit silly&#8230;if a feature seems to be missing,&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2012/05/07/posh-git-v0-4/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I figure a year between <a title="posh-git Release v0.3" href="http://lostechies.com/keithdahlby/2011/04/06/posh-git-release-v0-3/">releases</a> is plenty, so I&#8217;ve tagged a <a title="posh-git v0.3 on GitHub" href="https://github.com/dahlbyk/posh-git/tree/v0.4">v0.4 release</a> of <a title="posh-git on GitHub" href="https://github.com/dahlbyk/posh-git">posh-git</a>.</p>
<p>Really the notion of versions for a bunch of scripts on which noone  depends seems a bit silly&#8230;if a feature seems to be missing, get latest from master. If it&#8217;s still missing, send me a pull request (or log an issue). But I suppose it&#8217;s good to check in periodically to document what we&#8217;ve been up to.</p>
<p>New in this release:</p>
<ul>
<li>Git 1.7.2 or better is required
<ul>
<li>And I fixed a bug that prevented it from working with 1.7.10.</li>
</ul>
</li>
<li>Prompt status now plays nicely with <a href="http://github.com/JeremySkinner/posh-hg">posh-hg</a> without extra hacks</li>
<li>Functions are now provided for using <code>ssh-agent</code> to save credentials
<ul>
<li>If you get a warning that <code>ssh-agent</code> could not be found, either add an <code>ssh-agent</code> PowerShell alias or <a href="http://blog.ryanrust.net/?p=67">add the path to <code>Git\bin</code> in your <code>PATH</code> environment variable</a></li>
</ul>
</li>
<li>Branch in prompt status is now colored according to being ahead of or behind a tracked reference (see <a title="posh-git Readme" href="https://github.com/dahlbyk/posh-git#readme">readme</a> for an explanation of default colors)</li>
<li>Added tab expansion for a bunch of new commands and options (remote refs, <code>revert</code>, <code>tfs</code>, <code>bisect</code>, <code>submodule</code>, and more!)</li>
<li>Tab expansion works for aliases of <code>git</code> (I recommend <code>g</code>)<br />
<em>Contributed by <a href="http://fooberry.com/">Mark Borcherding</a></em></li>
<li>The list of commands expanded by default now covers most porcelain commands.
<ul>
<li>You can always get all commands to expand by setting <code>$GitTabSettings.AllCommands = $true</code></li>
</ul>
</li>
<li>Values of <code>$LASTERRORCODE</code> for the last real command are preserved through the prompt</li>
<li>If prompt performance for a repository is not acceptable, that repo&#8217;s path can be added to <code>$GitPromptSettings.RepositoriesInWhichToDisableFileStatus</code><br />
<em>Contributed by <a href="http://saintgimp.org">Eric Lee</a></em></li>
<li>posh-git should work in the Nuget Package Manager Console, though you&#8217;ll probably want to <a title="Git customizing colors for Windows including posh-git" href="http://sedodream.com/2012/05/05/GitCustomizingColorsForWindowsIncludingPoshgit.aspx">change the colors</a></li>
<li>The <code>GIT_DIR</code> environment variable is used if defined<br />
<em>Contributed by <a href="http://rod.42n.pl">Daniel Dabrowski</a></em></li>
</ul>
<p><a title="posh-git Contributors" href="https://github.com/dahlbyk/posh-git/graphs/contributors">Several others</a> have contributed bug fixes as well—thanks everyone! It&#8217;s pretty awesome to work on something that someone else cares enough about to help improve.</p>
<p>If all goes according to plan, the next time you hear from me (about posh-git) will be to announce that migration to <a href="https://github.com/libgit2/libgit2sharp">LibGit2Sharp</a> is complete. I&#8217;m optimistic that the move will address the persistent performance concerns for large repositories. If you have a particularly troublesome repo, feel free to try <a href="https://github.com/dahlbyk/posh-git/commits/libgit2">my libgit2 branch</a> and let me know if it&#8217;s better (or worse).</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2012/05/07/posh-git-v0-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>posh-git on Herding Code</title>
		<link>http://lostechies.com/keithdahlby/2012/01/29/posh-git-on-herding-code/</link>
		<comments>http://lostechies.com/keithdahlby/2012/01/29/posh-git-on-herding-code/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 04:16:14 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[posh-git]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=97</guid>
		<description><![CDATA[Earlier this month I had the opportunity to record an episode of Herding Code with GitHubbers Paul Betts and Phil Haack on the state of Git for Windows: Herding Code 132. Topics included discussions on why Git hates developers and&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2012/01/29/posh-git-on-herding-code/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Earlier this month I had the opportunity to record an episode of <a href="http://herdingcode.com/">Herding Code</a> with GitHubbers <a href="http://blog.paulbetts.org/">Paul Betts</a> and <a href="http://haacked.com/">Phil Haack</a> on the state of Git for Windows: <a title="Herding Code 132: Phil Haack, Keith Dahlby and Paul Betts on Git for Windows developers" href="http://herdingcode.com/?p=384">Herding Code 132</a>. Topics included discussions on why Git hates developers and why Mercurial proponents&#8217; claim that Git doesn&#8217;t preserve history is &#8220;nonsense.&#8221; I think the show turned out pretty well, and we got some hints as to what we can expect from GitHub for Windows. Thanks to the Herding Code guys for having us on!</p>
<p>Speaking of <a href="https://github.com/dahlbyk/posh-git">posh-git</a>, there are a bunch of new goodies in my master branch including tab expansion for remote branches, support for the Nuget console, and easier integration with <a href="https://github.com/JeremySkinner/posh-hg">posh-hg</a>. I&#8217;ll post more details with the upcoming v0.4 release.</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2012/01/29/posh-git-on-herding-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Los Techies at CodeMash 2.0.1.2</title>
		<link>http://lostechies.com/keithdahlby/2011/10/24/los-techies-at-codemash-2012/</link>
		<comments>http://lostechies.com/keithdahlby/2011/10/24/los-techies-at-codemash-2012/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 13:00:33 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CodeMash]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=93</guid>
		<description><![CDATA[Every January a swarm of geeks descend on the Kalahari Resort in Sandusky, OH for CodeMash, a top-notch cross-platform, family-friendly developer conference. This year&#8217;s event features an impressive session list including presentations by Scott Hanselman, Jon Skeet, Glenn Block of&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/10/24/los-techies-at-codemash-2012/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Every January a swarm of geeks descend on the <a href="http://www.kalahariresorts.com/oh/">Kalahari Resort</a> in Sandusky, OH for <a href="http://codemash.org/">CodeMash</a>, a top-notch cross-platform, family-friendly developer conference. This year&#8217;s event features an impressive <a href="http://codemash.org/Sessions">session list</a> including presentations by <a title="Scott Hanselman" href="http://hanselman.com/">Scott Hanselman</a>, <a title="Jon Skeet" href="http://msmvps.com/blogs/jon_skeet/">Jon Skeet</a>, <a href="http://twitter.com/gblock">Glenn Block</a> of <a href="http://codebetter.com/glennblock/">CodeBetter</a>, <a href="http://twitter.com/ferventcoder">Rob Reynolds</a> of <a href="http://devlicious.com/blogs/rob_reynolds/">Devlicious</a>&#8230;the list goes on. And that&#8217;s just in the .NET track! Also on that list you&#8217;ll find three sessions featuring members of Los Techies:</p>
<ul>
<li>
<div><a href="http://codemash.org/Sessions#Actor+Model+Programming+in+C%23">Actor Model Programming in C#</a> by <a href="http://twitter.com/phatboyg">Chris Patterson</a></div>
</li>
<li>
<div><a href="http://codemash.org/Sessions#Crafting+Wicked+Domain+Models">Crafting Wicked Domain Models</a> by <a href="http://twitter.com/jbogard">Jimmy Bogard</a></div>
</li>
<li>
<div><a href="http://codemash.org/Sessions#Dynamic+.NET+Demystified">Dynamic .NET Demystified</a> by <a href="http://twitter.com/dahlbyk">me</a></div>
</li>
</ul>
<p>I had a great time at CodeMash last year, and this year is shaping up to be even better. <a href="http://codemash.org/register">Registration</a> opens <em>today</em> (Oct. 24) at 10:24 AM EDT and you&#8217;ll want to reserve your spot soon—last year&#8217;s event sold out in less than four days!</p>
<p>If you do make it to the event, please ping me on <a href="http://twitter.com/dahlbyk">Twitter</a> so we can meet up!</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/10/24/los-techies-at-codemash-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git Beyond the D in DVCS</title>
		<link>http://lostechies.com/keithdahlby/2011/10/14/git-beyond-the-d-in-dvcs/</link>
		<comments>http://lostechies.com/keithdahlby/2011/10/14/git-beyond-the-d-in-dvcs/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 06:23:33 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=83</guid>
		<description><![CDATA[Jimmy&#8217;s post is a nice reminder of the advantages of a distributed version control system. But having ramped up on Git primarily through git-svn, I thought it would be worth enumerating some of the advantages I&#8217;ve found just in my&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/10/14/git-beyond-the-d-in-dvcs/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Jimmy&#8217;s <a title="The D in DVCS" href="http://lostechies.com/jimmybogard/2011/10/14/the-d-in-dvcs/">post</a> is a nice reminder of the advantages of a <strong>distributed</strong> version control system. But having ramped up on Git primarily through <a title="Better git-svn Through Aliases" href="http://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/">git-svn</a>, I thought it would be worth enumerating some of the advantages I&#8217;ve found just in my local workflow:</p>
<h2>1. Local Branching</h2>
<p>More than anything, cheap local branches have changed how I work. I don&#8217;t know any developers that have the luxury of only working on one thing at a time. Not only do local branches provide the perfect mechanism to compartmentalize work on different features (or just ideas you&#8217;d like to try), but Git&#8217;s branching mechanism also works great for trying different approaches to the same problem. It&#8217;s trivial to reset a branch back a few commits if an idea doesn&#8217;t work out, or create a new branch from a few commits ago to see if there&#8217;s a better way.</p>
<p>The other advantage of local branches is that they&#8217;re not public unless you want them to be. Not only are centralized branches slower to work with and commit to, the ceremony required to set them (if you have permission at all) attaches a feeling of permanence—I&#8217;m less likely to commit something that&#8217;s not necessarily finished, but may still be useful. I don&#8217;t have these reservations with Git—my main repository at work has maybe 20 branches of refactorings, spikes and other works in progress that I&#8217;m free to revisit as time allows without feeling self-conscious about their current lack of polish.</p>
<h2>2. Smarter Merging</h2>
<p>Because of Git&#8217;s focus on file content rather than file location, it&#8217;s much better at resolving merge conflicts for you, especially across renames. That&#8217;s not to say you&#8217;ll never get conflicts, but they&#8217;re typically real conflicts—files deleted in one branch and modified in another, overlapping Visual Studio project file changes, etc. And for those you can hook up a 3-way merge tool like <a title="Beyond Compare" href="http://www.scootersoftware.com/">Beyond Compare</a> or <a title="P4Merge" href="http://www.perforce.com/product/components/perforce_visual_merge_and_diff_tools">P4Merge</a> to make quick work of them.</p>
<h2>3. Pause and Resume</h2>
<p>So your boss comes in and says something to the effect of &#8220;stop everything you&#8217;re doing and make this change for the CEO.&#8221; What do you do? In SVN you might create a patch file of your work in progress and revert. In TFS you might shelve your changes up to the server. In Git you have a two options that are built right in:</p>
<ol>
<li><code>git stash</code>, which pushes the changes in your index and working directory onto a local stack of stashes from which you can pop at any time. Your typical workflow would look something like this:
<pre>$ git stash save "I love interruptions!"
$ git checkout master -b pti
# ... save the day ...
$ git checkout my-feature
$ git stash pop</pre>
<p>The disadvantage of stashes is that they&#8217;re not explicitly tied to the branch where the work happened. The longer it takes to get back to what you were working on, the higher the chance you&#8217;ll forget you had some work stashed.</li>
<li>Stage all your changes and make a temporary commit that you&#8217;ll later revert:
<pre>$ git add -A &amp;&amp; git commit -m "I love interruptions!"
$ git checkout master -b pti
# ... save the day ...
$ git checkout my-feature
$ git reset HEAD~</pre>
<p>The kicker is the final command, which moves the <code>my-feature</code> branch pointer back one (to <code>HEAD</code>&#8216;s parent) but leaves the working directory unchanged—keeping your old work in progress. The advantage of this approach is that the temporary commit lives with the branch where the changes belong.</li>
</ol>
<p>It doesn&#8217;t take long for both of these operations to become second-nature, greatly decreasing the impact of these interruptions.</p>
<h2>4. Rewriting History</h2>
<p>Pretending a temporary commit never happened is just one example of rewriting history, which becomes a fundamental operation for an intermediate/advanced Git user. But first, our cardinal rule:</p>
<p style="padding-left: 30px;"><strong>Once a commit is pushed, it&#8217;s permanent.</strong></p>
<p>History that has been shared with others is off-limits for rewriting unless you have explicitly communicated that history may be rewritten. For example, I routinely overwrite branches I push based on pull request feedback, but once something hits <a href="https://github.com/dahlbyk/posh-git">posh-git</a>&#8216;s master branch it&#8217;s there for good.</p>
<p>So with that out of the way, I present my corollary to the cardinal rule:</p>
<p style="padding-left: 30px;"><strong>Until you push, pretend you&#8217;re perfect.</strong></p>
<p>In the simplest case, this might simply mean using <code>git commit --amend</code> to fix a typo in the last commit&#8217;s message, or include changes to a file that you forgot to save. For more complex needs, like pretending you wrote your tests <em>before</em> the implementation, check out the amazing <a href="http://book.git-scm.com/4_interactive_rebasing.html">interactive rebase</a>.</p>
<h2>5. The Staging Area</h2>
<p>Some people view Git&#8217;s staging area as an annoyance—an extra step between code and commit. I simply see it as your standard commit dialog with all the boxes unchecked by default. Checking all the boxes is as simple as <code>git add -A</code>, which I alias as <code>git aa</code> (<code>git config --global alias.aa "add -A"</code>). Or you can use <code>git commit -a</code> to stage all changes before commiting (though this won&#8217;t pick up additions or deletions).</p>
<p>The real power, though, comes from the ability to stage (<code>git add --patch</code>) and unstage (<code>git reset --patch</code>) parts of your changes before commiting. You can even use <code>git checkout --patch</code> to revert some changes in your working directory without affecting others, or even to pull in partial changes from another commit altogether.</p>
<p>I use this feature on an almost daily basis to separate cosmetic changes from refactoring from new feature work, without having to undo some changes so that I can commit the others. The result is more smaller, atomic commits that separate inert changes from those that actually change behavior.</p>
<h2>Tip of the Iceberg</h2>
<p>Ultimately these are just a few of the things that have convinced me Git is worth the learning curve, worth the cost to migrate, worth the cost to retrain your staff; and this doesn&#8217;t even touch on the advantages and flexibility of Git&#8217;s distributed nature. I just hope to pique your interest enough that you give it a try for yourself.</p>
<p>And if you&#8217;re already using Git, how does this compare with your list of must-have features?</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/10/14/git-beyond-the-d-in-dvcs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Allowing a Windows Service to Interact with Desktop without LocalSystem</title>
		<link>http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/</link>
		<comments>http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 17:38:35 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build server]]></category>
		<category><![CDATA[Cruise Control .NET]]></category>
		<category><![CDATA[WatiN]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=76</guid>
		<description><![CDATA[One of the biggest roadblocks with getting automated browser tests (we use WatiN) running in a Windows Continuous Integration environment is figuring out how to let the build server interact with the desktop. Typically there have been two options: Don&#8217;t&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the biggest roadblocks with getting automated browser tests (we use <a href="http://watin.org/" title="WatiN">WatiN</a>) running in a Windows Continuous Integration environment is figuring out how to let the build server interact with the desktop. Typically there have been two options:</p>
<ol>
<li>Don&#8217;t run your build server as a Windows Service. I don&#8217;t like this option as it&#8217;s harder to maintain.</li>
<li>Run the build service as Local System with &#8220;Allow service to interact with desktop&#8221;. This limits your ability to manipulate the context in which builds run, for example it&#8217;s quite tricky (I believe it&#8217;s possible with <a title="Sysinternals PsExec" href="http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx">PsExec</a>) to configure Internet Explorer settings (turn off Auto-Complete, etc) for LocalSystem.<br />
<a href="http://lostechies.com/keithdahlby/files/2011/08/AllowServiceToInteractWithDesktop.png"><img title="Allow service to interact with desktop" src="http://lostechies.com/keithdahlby/files/2011/08/AllowServiceToInteractWithDesktop.png" alt="&quot;Allow service to interact with desktop&quot; in Windows Service Properties" width="410" height="461" /></a></li>
</ol>
<p>A third option now is to run the build service as a user of your choice and set &#8220;Allow service to interact with desktop&#8221; through the Windows Registry. A <a title="Interact With Desktop when Installing Windows Service" href="http://www.codeproject.com/KB/install/cswindowsservicedesktop.aspx">Code Project article</a> identified the necessary Registry setting, but still suggested the account must be LocalSystem. However, the same setting appears to work for other accounts as well. I&#8217;ve put together a simple PowerShell script to make the change; just run it with administrative privileges:</p>
<div id="gist-1143996" class="gist">

        <div class="gist-file">
          <div class="gist-data gist-syntax">
              <div class="highlight"><pre><div class='line' id='LC1'>$svcName = Get-Service -DisplayName *cruise* | select -Exp Name</div><div class='line' id='LC2'>$svcKey = Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\$svcName</div><div class='line' id='LC3'><br/></div><div class='line' id='LC4'># Set 9th bit, from http://www.codeproject.com/KB/install/cswindowsservicedesktop.aspx</div><div class='line' id='LC5'>$newType = $svcKey.GetValue(&#39;Type&#39;) -bor 0x100</div><div class='line' id='LC6'>Set-ItemProperty $svcKey.PSPath -Name Type -Value $newType</div><div class='line' id='LC7'><br/></div></pre></div>
          </div>

          <div class="gist-meta">
            <a href="https://gist.github.com/raw/1143996/ac0be09d826d141ac41d1466aac4cb110e399c7c/Enable-AllowInteractWithDesktop" style="float:right;">view raw</a>
            <a href="https://gist.github.com/1143996#file_enable_allow_interact_with_desktop" style="float:right;margin-right:10px;color:#666">Enable-AllowInteractWithDesktop</a>
            <a href="https://gist.github.com/1143996">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
          </div>
        </div>
</div>

<p>If you&#8217;re not a PowerShell person:</p>
<ol>
<li><code>$svcName = Get-Service -DisplayName *cruise* | select -Exp Name</code><br/>Find the name of the Cruise Control service (CCService).</li>
<li><code>$svcKey = Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\$svcName</code><br/>Grab the Registry key for the service.</li>
<li><code>$newType = $svcKey.GetValue('Type') -bor 0x100</code><br/>Get the Type value with the 9th bit set.</li>
<li><code>Set-ItemProperty $svcKey.PSPath -Name Type -Value $newType</code><br/>Set the Type value. The PowerShell Registry provider isn&#8217;t particularly intuitive here, IMO.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/08/13/allowing-a-windows-service-to-interact-with-desktop-without-localsystem/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>posh-git Release v0.3</title>
		<link>http://lostechies.com/keithdahlby/2011/04/06/posh-git-release-v0-3/</link>
		<comments>http://lostechies.com/keithdahlby/2011/04/06/posh-git-release-v0-3/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 23:54:37 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[posh-git]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=52</guid>
		<description><![CDATA[On a whim, I&#8217;ve decided to tag a v0.3 release of posh-git (which has been stable for a few months now). In this release&#8230; Installer Previously the setup process for posh-git was undefined. Daniel Hoelbling was kind enough to put&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/04/06/posh-git-release-v0-3/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On a whim, I&#8217;ve decided to tag a <a title="posh-git v0.3 on GitHub" href="https://github.com/dahlbyk/posh-git/tree/v0.3">v0.3 release</a> of <a title="posh-git on GitHub" href="https://github.com/dahlbyk/posh-git">posh-git</a> (which has  been stable for a few months now). In this release&#8230;</p>
<h3>Installer</h3>
<p>Previously the setup process for posh-git was undefined. Daniel  Hoelbling was kind enough to put together a <a title="Using git from  Powershell just got easier: Posh-git" href="http://www.tigraine.at/2010/09/01/using-git-from-powershell-just-got-easier-posh-git/">getting-started  post</a>, but I decided to make it even easier. Assuming Git and  PowerShell are configured correctly (see <a title="posh-git Readme" href="https://github.com/dahlbyk/posh-git#readme">readme</a> for  details), getting started is trivial:</p>
<pre>cd C:\Wherever
git clone https://github.com/dahlbyk/posh-git.git
.\posh-git\install.ps1</pre>
<p>At this point the sample posh-git profile will be loaded as part of   your PowerShell profile. If you don&#8217;t like the sample profile, feel free   to grab the pieces you want and discard the rest (so you can use <a href="https://github.com/JeremySkinner/posh-hg">posh-hg</a> too,  perhaps).</p>
<p><strong></strong> If you already have posh-git installed, just <code>cd</code> into your posh-git directory and pull from my <code>master</code> branch:</p>
<pre># If you don't already have me as a remote...
git remote add dahlbyk
git pull --rebase dahlbyk master
</pre>
<p>You don&#8217;t need to run <code>install.ps1</code> again; just open a new PowerShell session and you&#8217;re good to go.</p>
<h3>Performance</h3>
<p>By taking a dependency on msysgit 1.7.1, all status information is  now retrieved in a single call (<code>git status -s -b</code>). This  still means <code>git status</code> is called for every prompt, so if <code>status</code> is slow for your repository your prompt will be slow too.</p>
<p>If it&#8217;s still too slow for your taste, you also have the option to  set <code>$GitPromptSettings.EnableFileStatus = $false</code>.  This will  preserve branch information for the prompt, but skip  everything else  (counts and tab completion for added/modified/deleted  files).</p>
<p>Finally, you can set <code>$GitPromptSettings.Debug = $true</code> to   see how long the various steps take behind the scenes. If your   environment is anything like mine, the majority of the time will be   spent in <code>git</code> calls.</p>
<h3>Tab Expansion Updates</h3>
<ul>
<li>Fix for <code>git rm</code> during deleted/updated merge conflict</li>
<li>Branch expansion for <code>cherry-pick</code>, <code>diff</code>, <code>difftool</code>,  <code>log</code> and <code>show</code></li>
<li>Normal expansion through simple aliases (e.g. <code>alias.dt =  difftool</code> supports <code>git dt &lt;tab&gt;</code>)</li>
</ul>
<h3>Next Steps</h3>
<ul>
<li>I&#8217;d still like to get some testing in place so I don&#8217;t break things  unintentionally</li>
<li>I&#8217;m considering moving away from regex to parse commands for tab   expansion — anyone feel like writing a git command parser in PowerShell?</li>
<li>I&#8217;d like it to be easier to use posh-git and posh-hg together, so I  may revisit how they hook into tab expansion</li>
</ul>
<p>As always, your feedback is appreciated. If you&#8217;d like posh-git  updates between release posts, you can also <a title="@dahlbyk" href="http://twitter.com/dahlbyk">follow  me on Twitter</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/04/06/posh-git-release-v0-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Git Tip: Hide ^M (Carriage Return) in Diff</title>
		<link>http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/</link>
		<comments>http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 05:20:33 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[git]]></category>
		<category><![CDATA[msysgit]]></category>

		<guid isPermaLink="false">http://lostechies.com/keithdahlby/?p=40</guid>
		<description><![CDATA[A common point of confusion when getting started with Git on Windows is line endings, with Windows still using CR+LF while every other modern OS uses LF only. Git provides three ways to deal with this discrepancy, as described in&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A common point of confusion when getting started with Git on Windows is line endings, with Windows still using CR+LF while every other modern OS uses LF only. Git provides three ways to deal with this discrepancy, as described in the msysGit installer:</p>
<ol>
<li>Checkout Windows-style, commit Unix-style (core.autocrlf = true)</li>
<li>Checkout as-is, commit Unix-style (core.autocrlf = input)</li>
<li>Checkout as-is, commit as-is (core.autocrlf = false)</li>
</ol>
<p>The first option is the default, which I find rather unfortunate—I don&#8217;t consider line ending manipulation to be the responsibility of my VCS. Instead, I prefer to keep <code>core.autocrlf</code> set to <code>false</code> and let my text editors deal with line endings. (If you like having <code>core.autocrlf</code> set to <code>true</code> or <code>input</code>, I&#8217;d love to hear why.)</p>
<p>One downside of turning off <code>autocrlf</code> is that the output of <code>git diff</code> highlights CR characters (indicated by <code>^M</code>) as whitespace errors. To turn off this &#8220;error&#8221;, you can use the <code>core.whitespace</code> setting:</p>
<pre>git config --global core.whitespace cr-at-eol
</pre>
<p>If your <code>core.whitespace</code> is already set, you should add <code>cr-at-eol</code> to the end of the comma-delimited list instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/04/06/windows-git-tip-hide-carriage-return-in-diff/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>F# + Razor View Engine = FSRazor</title>
		<link>http://lostechies.com/keithdahlby/2011/02/07/fsharp-plus-razor-view-engine-equals-fsrazor/</link>
		<comments>http://lostechies.com/keithdahlby/2011/02/07/fsharp-plus-razor-view-engine-equals-fsrazor/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 02:39:00 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[fsharp]]></category>
		<category><![CDATA[fsrazor]]></category>
		<category><![CDATA[mvc 3]]></category>
		<category><![CDATA[razor]]></category>

		<guid isPermaLink="false">/blogs/dahlbyk/archive/2011/02/06/fsharp-plus-razor-view-engine-equals-fsrazor.aspx</guid>
		<description><![CDATA[Last month InfoQ posted some info from the ASP.NET team about using F# with the new Razor view engine. It seemed like it should be pretty simple, so I thought I&#8217;d give it a shot. My (very rough) progress so&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/02/07/fsharp-plus-razor-view-engine-equals-fsrazor/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last month InfoQ <a title="Razor with F# and Other Languages" href="http://www.infoq.com/news/2011/01/Razor-Extensions">posted</a> some info from the ASP.NET team about using F# with the new Razor view engine. It seemed like it should be pretty simple, so I thought I&#8217;d give it a shot. My (very rough) progress so far is available on <a title="dahlbyk/FSRazor - GitHub" href="https://github.com/dahlbyk/FSRazor">GitHub</a>. The solution includes a sample project with a simple F# view using expression blocks:</p>
<pre>﻿&lt;h2&gt;@("FS" + "Razor")&lt;/h2&gt;&lt;p&gt;@(&nbsp;&nbsp;&nbsp; let even_odd s =&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; match s % 2 with&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 0 -&gt; sprintf "%i is even!" s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | _ -&gt; sprintf "%i is odd!" s&nbsp;&nbsp;&nbsp; DateTime.Now.Second |&gt; even_odd&nbsp;&nbsp;&nbsp; )&lt;/p&gt;</pre>
<p>A useless example, but it works&#8230;as long as there aren&#8217;t unmatched parentheses (within a string or comment). So far the parser is a simple port of the C# parser, and as such is very procedural&mdash;it&#8217;s unclear if the underlying parser model will afford much wiggle room to take advantage of F#.</p>
<p>It&#8217;s been an interesting learning experience, as my first attempt to do &#8220;normal .NET&#8221; inheritance-based development in F#. Some random thoughts based on work so far&#8230;</p>
<ul>
<li>I still struggle to remember F#&#8217;s syntax for familiar class constructs (ctor, method, property, etc)</li>
<li>I&#8217;ve been disappointed so far by my attempts to F#-ize the C# port</li>
<li>I finally bothered to look up how to add <a title="Assembly Information for F# Libraries" href="http://thevalerios.net/matt/2009/01/assembly-information-for-f-libraries/">assembly information in F#<br /></a></li>
<li>I learned about a few <a title="Three Hidden Extensibility Gems in ASP.NET 4 by Phil Haack" href="http://haacked.com/archive/2010/05/16/three-hidden-extensibility-gems-in-asp-net-4.aspx">new ASP.NET 4 features</a>, in particular <a title="System.Web.PreApplicationStartMethodAttribute on MSDN" href="http://msdn.microsoft.com/en-us/library/system.web.preapplicationstartmethodattribute.aspx">PreApplicationStartMethodAttribute</a> which uses a magic string (read: undiscoverable) to identify a method which can register the .fshtml build provider</li>
</ul>
<p>There&#8217;s still a bunch of work yet to do, and I&#8217;d love some help if anyone is actually interested in using this in production&#8230;</p>
<ul>
<li>Tests for the parser and code generator</li>
<li>Handling implicit transitions (@ without explicit block)
</li>
<li>Handling strings/comments</li>
<li>Handling statement blocks</li>
<li>Figuring out where F# needs special treatment in Razor (extra features or syntax that won&#8217;t work)</li>
<li>MVC support? (@model)</li>
<li>WebPages support? (<a href="https://github.com/dahlbyk/FSRazor/tree/WebPages">branch</a> doesn&#8217;t work yet)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/02/07/fsharp-plus-razor-view-engine-equals-fsrazor/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Red Gate should have said&#8230;</title>
		<link>http://lostechies.com/keithdahlby/2011/02/04/red-gate-should-have-said/</link>
		<comments>http://lostechies.com/keithdahlby/2011/02/04/red-gate-should-have-said/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 00:46:00 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[red-gate]]></category>
		<category><![CDATA[reflector]]></category>

		<guid isPermaLink="false">/blogs/dahlbyk/archive/2011/02/03/red-gate-should-have-said.aspx</guid>
		<description><![CDATA[Red Gate Software&#8217;s recent open letter to the .NET community has caused a bit of a stir. Here&#8217;s an alternate version that may have gone over better&#8230; In August 2008, Red Gate took over stewardship of .NET Reflector, one of&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2011/02/04/red-gate-should-have-said/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Red Gate Software&#8217;s recent <a href="http://www.red-gate.com/products/dotnet-development/reflector/announcement">open letter to the .NET community</a> has caused a bit of a stir. Here&#8217;s an alternate version that may have gone over better&#8230;</p>
<blockquote>
<p>In August 2008, Red Gate took over stewardship of <a href="http://www.red-gate.com/products/dotnet-development/reflector/">.NET Reflector</a>, one of the most popular .NET developer tools around. At the time, <a href="http://www.simple-talk.com/opinion/opinion-pieces/the-future-of-reflector-/">we said</a> we would &#8220;continue to offer the tool for free to the community,&#8221; and we&#8217;ve made good on that promise. Since then, we&#8217;ve invested heavily in .NET Reflector:</p>
<ul>
<li>A Visual Studio plug-in, allowing you to jump direcetly to classes and methods in Reflector</li>
<li>Support for .NET 4 assemblies</li>
<li>Support for C# 4 and Visual Basic 10 language features</li>
<li>Support for opening assemblies from the Global Assembly Cache</li>
<li>Numerous bug fixes</li>
</ul>
<p>Unfortunately, these investments have come at a higher cost than anticipated. As of version 7, due for release in March 2011, we will charge $35 for .NET Reflector. Version 6.7  will continue to be available for free&mdash;forever, but we hope you&#8217;ll find the <a href="http://www.simple-talk.com/community/blogs/clivet/archive/2011/02/01/99118.aspx" title="New features in V7 of .NET Reflector.">new features of version 7</a> to be worth the investment.</p>
<p>We appreciate your continued trust in Red Gate to provide the best in tools for .NET developers.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2011/02/04/red-gate-should-have-said/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>RenderAction with ASP.NET MVC 3 Sessionless Controllers</title>
		<link>http://lostechies.com/keithdahlby/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/</link>
		<comments>http://lostechies.com/keithdahlby/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 14:54:00 +0000</pubDate>
		<dc:creator>Keith Dahlby</dc:creator>
				<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[ControllerSessionState]]></category>
		<category><![CDATA[ControllerSessionStateAttribute]]></category>
		<category><![CDATA[mvc 3]]></category>
		<category><![CDATA[RenderAction]]></category>
		<category><![CDATA[SessionStateAttribute]]></category>

		<guid isPermaLink="false">/blogs/dahlbyk/archive/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers.aspx</guid>
		<description><![CDATA[One of the new features of ASP.NET MVC 3 is a controller-level attribute to control the availability of session state. In the RC the attribute, which lives in the System.Web.SessionState namespace, is [ControllerSessionState]; for RTM ScottGu says it will be&#160;&#8230; <a href="http://lostechies.com/keithdahlby/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/">Continue&#160;reading&#160;<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the new features of ASP.NET MVC 3 is a controller-level<br />
attribute to control the availability of session state. In the RC the<br />
attribute, which lives in the <code>System.Web.SessionState</code> namespace, is <code>[ControllerSessionState]</code>; for RTM <a href="http://twitter.com/scottgu/status/6086923391082496">ScottGu says</a> it will be renamed simply <code>[SessionState]</code>. The attribute accepts a <a title="System.Web.SessionState.SessionStateBehavior on MSDN" href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionstatebehavior.aspx"><code>SessionStateBehavior</code></a> argument, one of <code>Default</code>, <code>Disabled</code>, <code>ReadOnly</code> or <code>Required</code>. A question that came up during a Twitter discussion a few weeks back is how the different behaviors affect <code>Html.RenderAction()</code>, so I decided to find out.</p>
<h3>The Setup</h3>
<p>I started with an empty MVC 3 project and the Razor view engine.<br />
We&#8217;ll let a view model figure out what&#8217;s going on with our controller&#8217;s <code>Session</code>:</p>
<pre>public class SessionModel{    public SessionModel(Controller controller, bool delaySession = false)    {        SessionID = delaySession ? "delayed" : GetSessionId(controller.Session);        Controller = controller.GetType().Name;    }

    public string SessionID { get; private set; }    public string Controller { get; private set; }

    private static string GetSessionId(HttpSessionStateBase session)    {        try        {            return session == null ? "null" : session.SessionID;        }        catch (Exception ex)        {            return "Error: " + ex.Message;        }    }}</pre>
<p>The model is rendered by two shared views. <code>Index.cshtml</code> gives us some simple navigation and renders actions from our various test controllers:</p>
<pre>@model SessionStateTest.Models.SessionModel@{    View.Title = Model.Controller;    Layout = "~/Views/Shared/_Layout.cshtml";}&lt;h2&gt;Host: @Model.Controller (@Model.SessionID)&lt;/h2&gt;&lt;ul&gt;    &lt;li&gt;@Html.ActionLink("No Attribute", "Index", "Home")&lt;/li&gt;    &lt;li&gt;@Html.ActionLink("Exception", "Index", "Exception")&lt;/li&gt;    &lt;li&gt;@Html.ActionLink("Default", "Index", "DefaultSession")&lt;/li&gt;    &lt;li&gt;@Html.ActionLink("Disabled", "Index", "DisabledSession")&lt;/li&gt;    &lt;li&gt;@Html.ActionLink("ReadOnly", "Index", "ReadOnlySession")&lt;/li&gt;    &lt;li&gt;@Html.ActionLink("Required", "Index", "RequiredSession")&lt;/li&gt;&lt;/ul&gt;@{    Html.RenderAction("Partial", "Home");    Html.RenderAction("Partial", "Exception");    Html.RenderAction("Partial", "DefaultSession");    Html.RenderAction("Partial", "DisabledSession");    Html.RenderAction("Partial", "ReadOnlySession");    Html.RenderAction("Partial", "RequiredSession");}</pre>
<p><code>Partial.cshtml</code> just dumps the model:</p>
<pre>@model SessionStateTest.Models.SessionModel&lt;div&gt;Partial: @Model.Controller (@Model.SessionID)&lt;/div&gt;</pre>
<p>Finally, we need a few test controllers which will all inherit from a simple <code>HomeController</code>:</p>
<pre>public class HomeController : Controller{    public virtual ActionResult Index()    {        return View(new SessionModel(this));    }

    public ActionResult Partial()    {        return View(new SessionModel(this));    }}

[ControllerSessionState(SessionStateBehavior.Default)]public class DefaultSessionController : HomeController { }

[ControllerSessionState(SessionStateBehavior.Disabled)]public class DisabledSessionController : HomeController { }

[ControllerSessionState(SessionStateBehavior.ReadOnly)]public class ReadOnlySessionController : HomeController { }

[ControllerSessionState(SessionStateBehavior.Required)]public class RequiredSessionController : HomeController { }</pre>
<p>And finally, a controller that uses the <code>SessionModel</code> constructor&#8217;s optional <code>delaySession</code> parameter. This parameter allows us to test <code>RenderAction</code>&#8216;s <code>Session</code> behavior if the host controller doesn&#8217;t use <code>Session</code>:</p>
<pre>public class ExceptionController : HomeController{    public override ActionResult Index()    {        return View(new SessionModel(this, true));    }}</pre>
<h3>The Reveal</h3>
<p>So what do we find? Well the short answer is that the host controller&#8217;s <code>SessionStateBehavior</code> takes precedence. In the case of <code>Home</code>, <code>Default</code>, <code>ReadOnly</code>, and <code>Required</code>, we have access to <code>Session</code> information in all rendered actions:<a href="http://solutionizing.files.wordpress.com/2010/12/sessionless-renderaction-home.png"><br />
<img class="alignnone size-full wp-image-887" src="http://solutionizing.files.wordpress.com/2010/12/sessionless-renderaction-home.png" alt="Sessionless Controller: RenderAction with SessionState" border="0" height="233" width="610" /></a></p>
<p>If the host controller is marked with <code>SessionStateBehavior.Disabled</code>, all the rendered actions see <code>Session</code> as <code>null</code>:<br />
<a href="http://solutionizing.files.wordpress.com/2010/12/sessionless-renderaction-disabled.png"><img class="alignnone size-full wp-image-885" src="http://solutionizing.files.wordpress.com/2010/12/sessionless-renderaction-disabled.png" alt="Sessionless Controller: RenderAction with Disabled SessionState" border="0" height="238" width="610" /></a></p>
<p>I see this is the key finding to remember: an action that depends on <code>Session</code>, even if its controller is marked with <code>SessionStateBehavior.Required</code>,<br />
 will be in for a nasty NullRef surprise if it&#8217;s rendered by controller<br />
without. It would be nice if the framework either gave some sort of<br />
warning about this, or if they used a Null Object pattern instead of<br />
just letting <code>Session</code> return <code>null</code>.</p>
<p>Finally, things get really weird if a <code>Session</code>-dependent action is rendered from a host controller that doesn&#8217;t reference <code>Session</code>, <i>even if <code>SessionState</code> is enabled</i>:</p>
<p><a href="http://solutionizing.files.wordpress.com/2010/12/sessionless-renderaction-exception.png"><img class="alignnone size-full wp-image-886" src="http://solutionizing.files.wordpress.com/2010/12/sessionless-renderaction-exception.png" alt="Sessionless Controller Exception: Session state has created a session id, but cannot save it because the response was already flushed by the application." border="0" height="362" width="610" /></a></p>
<p>It&#8217;s pretty clear the issue has something to do with where <code>RenderAction()</code> happens in the request lifecycle, but it&#8217;s unclear how to resolve it short of accessing <code>Session</code> in the host controller.</p>
<p>So there we have it&#8230;a comprehensive testing of sessionless controllers and <code>RenderAction</code><br />
 for the ASP.NET MVC 3 Release Candidate. Hopefully the inconsistencies<br />
of the latter two cases will be resolved or at least documented before<br />
RTM.</p>
]]></content:encoded>
			<wfw:commentRss>http://lostechies.com/keithdahlby/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

