<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Solutionizing .NET</title>
	<atom:link href="https://solutionizing.net/feed/" rel="self" type="application/rss+xml" />
	<link>https://solutionizing.net</link>
	<description>Random thoughts on custom development in SharePoint.</description>
	<lastBuildDate>Fri, 05 Oct 2012 04:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">3982353</site><cloud domain='solutionizing.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s0.wp.com/i/buttonw-com.png</url>
		<title>Solutionizing .NET</title>
		<link>https://solutionizing.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://solutionizing.net/osd.xml" title="Solutionizing .NET" />
	<atom:link rel='hub' href='https://solutionizing.net/?pushpress=hub'/>
	<item>
		<title>Find Me On Los Techies</title>
		<link>https://solutionizing.net/2012/10/04/find-me-on-los-techies/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Fri, 05 Oct 2012 04:07:45 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=910</guid>

					<description><![CDATA[After a while cross-posting, I decided to retire this blog in favor of my blog on Los Techies. Hope you&#8217;ll join the conversation there!]]></description>
										<content:encoded><![CDATA[<p>After a while cross-posting, I decided to retire this blog in favor of <a title="Keith Dahlby on Los Techies" href="http://lostechies.com/keithdahlby/">my blog on Los Techies</a>. Hope you&#8217;ll join the conversation there!</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">910</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>posh-git Release v0.3</title>
		<link>https://solutionizing.net/2011/04/06/posh-git-release-v0-3/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Wed, 06 Apr 2011 13:34:31 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[posh-git]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=902</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 together a getting-started post, but I decided to make it even easier. Assuming Git and [&#8230;]]]></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>Update:</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>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">902</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>RenderAction with ASP.NET MVC 3 Sessionless Controllers</title>
		<link>https://solutionizing.net/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/</link>
					<comments>https://solutionizing.net/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/#comments</comments>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Mon, 06 Dec 2010 08:53:17 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<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">http://solutionizing.net/?p=883</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 renamed simply [SessionState]. The attribute accepts a SessionStateBehavior argument, one of Default, Disabled, ReadOnly or [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>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 <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. 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="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png"><br />
<img data-attachment-id="887" data-permalink="https://solutionizing.net/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/sessionless-renderaction-home/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png" data-orig-size="610,233" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Sessionless Controller: RenderAction with SessionState" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png?w=610" class="alignnone size-full wp-image-887" title="Sessionless Controller: RenderAction with SessionState" src="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png?w=780" alt="Sessionless Controller: RenderAction with SessionState"   srcset="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png 610w, https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png?w=150&amp;h=57 150w, https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png?w=300&amp;h=115 300w" sizes="(max-width: 610px) 100vw, 610px" /></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="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png"><img data-attachment-id="885" data-permalink="https://solutionizing.net/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/sessionless-renderaction-disabled/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png" data-orig-size="610,238" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Sessionless Controller: RenderAction with Disabled SessionState" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png?w=610" class="alignnone size-full wp-image-885" title="Sessionless Controller: RenderAction with Disabled SessionState" src="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png?w=780" alt="Sessionless Controller: RenderAction with Disabled SessionState"   srcset="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png 610w, https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png?w=150&amp;h=59 150w, https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png?w=300&amp;h=117 300w" sizes="(max-width: 610px) 100vw, 610px" /></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>, will be in for a nasty NullRef surprise if it&#8217;s rendered by controller without. It would be nice if the framework either gave some sort of warning about this, or if they used a Null Object pattern instead of 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>, <em>even if <code>SessionState</code> is enabled</em>:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png"><img data-attachment-id="886" data-permalink="https://solutionizing.net/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/sessionless-renderaction-exception/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png" data-orig-size="610,362" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Sessionless Controller Exception" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png?w=610" class="alignnone size-full wp-image-886" title="Sessionless Controller Exception" src="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png?w=780" alt="Sessionless Controller Exception: Session state has created a session id, but cannot save it because the response was already flushed by the application."   srcset="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png 610w, https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png?w=150&amp;h=89 150w, https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png?w=300&amp;h=178 300w" sizes="(max-width: 610px) 100vw, 610px" /></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> for the ASP.NET MVC 3 Release Candidate. Hopefully the inconsistencies of the latter two cases will be resolved or at least documented before RTM.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solutionizing.net/2010/12/06/renderaction-with-asp-net-mvc-3-sessionless-controllers/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">883</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-home.png" medium="image">
			<media:title type="html">Sessionless Controller: RenderAction with SessionState</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-disabled.png" medium="image">
			<media:title type="html">Sessionless Controller: RenderAction with Disabled SessionState</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/12/sessionless-renderaction-exception.png" medium="image">
			<media:title type="html">Sessionless Controller Exception</media:title>
		</media:content>
	</item>
		<item>
		<title>Code Review with Git Patches and Outlook via PowerShell</title>
		<link>https://solutionizing.net/2010/12/05/code-review-with-git-patches-and-outlook-via-powershell/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Mon, 06 Dec 2010 02:31:00 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[format-patch]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=872</guid>

					<description><![CDATA[In the spirit of &#8220;simplest thing that works,&#8221; my team has a rather low-fidelity approach to code reviews: patch files and e-mail. Nothing fancy, but we find it works rather well. It&#8217;s even easier thanks to git format-patch, which lets me easily generate a patch per commit, but I was never able to get send-email [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In the spirit of &#8220;simplest thing that works,&#8221; my team has a rather low-fidelity approach to code reviews: patch files and e-mail. Nothing fancy, but we find it works rather well. It&#8217;s even easier thanks to <code>git format-patch</code>, which lets me easily generate a patch per commit, but I was never able to get <code>send-email</code> to work quite like I wanted. Instead, I whipped together a PowerShell script in a few minutes that does just the trick:</p>
<pre>function patch ($ref = 'master..', $Message = '', [switch]$KeepFiles) {
  $patchPaths = $(git format-patch -C -o C:/Temp/Patches $ref)
  if($patchPaths) {
    $outlook = New-Object -ComObject Outlook.Application
    $mail = $outlook.CreateItem(0)
    [void]$mail.Recipients.Add('myteam@mycompany.com')
    $mail.Subject = "Review - $Message"
    $commits = $(git log -C --pretty=format:'%s' --reverse $ref) | foreach {  "&lt;li&gt;$_&lt;/li&gt;" }
    $mail.HTMLBody = "&lt;ol style=`"font: 11pt Calibri`"&gt;$commits&lt;/ol&gt;"
    $patchPaths | foreach {
      [void]$mail.Attachments.Add($_)
      if(!$KeepFiles) { Remove-Item $_ }
    }
    $mail.Display()
  } else {
    Write-Warning 'Nothing to patch!'
  }
}</pre>
<h3>Usage:</h3>
<p>Create patch of everything on current branch since master:</p>
<pre>patch -m "Issue 123 - This is neat"</pre>
<p>Create patch of last two commits, without message:</p>
<pre>patch HEAD~2..</pre>
<p>Create patch of everything except the current commit, with message:</p>
<pre>patch master..HEAD~1 'Refactoring for Story 234'</pre>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">872</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>Better git-svn Through Aliases: git up &#038; git dci</title>
		<link>https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/</link>
					<comments>https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/#comments</comments>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Fri, 26 Nov 2010 09:21:17 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[git-svn]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=823</guid>

					<description><![CDATA[I&#8217;ve been using git-svn for almost a year now, and have settled on a low-friction workflow that has been working really well. First, a few notes about how I work with Git and Subversion&#8230; For the most part, we avoid Subversion branching and merging, so I optimize for working in trunk. Forget about using Git [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;ve been using git-svn for almost a year now, and have settled on a low-friction workflow that has been working really well. First, a few notes about how I work with Git and Subversion&#8230;</p>
<ol>
<li>For the most part, we avoid Subversion branching and merging, so I optimize for working in trunk.</li>
<li>Forget about using Git <code>push</code> and <code>pull</code> for collaborating with others. git-svn stores extra metadata that isn&#8217;t pushed with the rest of the repository, so git-svn operations will fail on cloned repos. Furthermore, each repository&#8217;s git-svn commits are unique, so pulling from another repository will fetch its parallel history (if you have to do this, <code>git rebase -i</code> can help filter out the overlapping commits). That said, I do use push/pull to collaborate with myself across machines, though I always operate against Subversion from one machine.</li>
<li>All substantial work is done in local topic branches, with master reserved exclusively for tracking what&#8217;s in (or to be immediately committed to) Subversion.</li>
</ol>
<h2>git up</h2>
<p>First up is the alias that stands in for <code>svn update</code>, to make sure I&#8217;m always working from the latest changes:</p>
<blockquote><p><del><code>!git svn fetch &amp;&amp; git push . remotes/trunk:master &amp;&amp; git push -f origin master:master &amp;&amp; git rebase master</code></del></p></blockquote>
<p><strong>Update Nov. 30, 2010:</strong> After reports that people were having issues calling <code>git up</code> from master, I&#8217;ve modified the alias slightly:</p>
<blockquote><p><code>!git svn fetch &amp;&amp; git svn rebase -l &amp;&amp; git push . remotes/trunk:master &amp;&amp; git push -f origin master</code></p></blockquote>
<p>If this is your first alias, the command to set the alias would be:</p>
<blockquote><p><code>git config alias.up "!git svn fetch &amp;&amp; git svn rebase -l &amp;&amp; git push . remotes/trunk:master &amp;&amp; git push -f origin master"</code></p></blockquote>
<p>Step by step, this alias does the following:</p>
<ol>
<li>Fetch the latest from Subversion. I use <code>svn fetch</code> instead of <code>svn rebase</code> because the former also fetches from Subversion branches; we&#8217;ll do our own rebase later.</li>
<li>Rebase my current branch against its Subversion parent. <code>-l</code> skips a remote fetch, since we just did one.</li>
<li>Update my local master branch to match Subversion&#8217;s trunk. If you didn&#8217;t use <code>--std-layout</code>, you might need to replace <em>remotes/trunk</em> with <em>remotes/git-svn</em> or whatever your git-svn ref is.</li>
<li>Push master to my origin remote, which serves as a backup and allows me to collaborate with myself between machines (if you don&#8217;t have a Git remote, feel free to omit this).</li>
<li><del>Rebase my current branch against master (and therefore Subversion).</del></li>
</ol>
<p>The key is item #2: automating the synchronization of master and Subversion means I never have to think about it again. I can either rebase a topic branch against master to get reasonably fresh commits, or use <code>git up</code> to grab the latest (mostly when preparing to commit into Subversion). Without this alias, I tended to waste a fair amount of time switching back to master periodically just to make sure it&#8217;s up-to-date enough.</p>
<h2>When do I git up?</h2>
<p>You can use <code>git up</code> pretty much any time you want — on master, on a topic branch or even with a detached HEAD — as long as your working copy and index are clean. If you have work in progress but need Subversion&#8217;s latest, you can either <code>git stash</code> or make a temporary commit and then <code>git reset HEAD^</code> after the update. I used to favor the former, but am starting to prefer the latter because I tend to be undisciplined about cleaning up stashes that <code>git stash pop</code> didn&#8217;t delete due to merge conflicts.</p>
<h2>git dci</h2>
<p>Satisfied with this abstraction for pulling changes from Subversion, I then applied the same logic to committing into Subversion:</p>
<blockquote><p><code>!git svn dcommit &amp;&amp; git push . remotes/trunk:master &amp;&amp; git push -f origin master &amp;&amp; git checkout master</code></p></blockquote>
<p>The dci alias (short for dcommit) does the following:</p>
<ol>
<li>Commit my local changes into Subversion, generating a Subversion commit for each new Git commit. If a modified file has also changed in Subversion since your last update, the dcommit will fail — <code>git up</code>, resolve conflicts and try again.</li>
<li>Keep master in sync with Subversion&#8230;</li>
<li>&#8230;and origin.</li>
<li>And finally, switch back to master, which will now reference the latest git-svn commit. From here I can either delete my finished topic branch, or rebase against master (<code>git rebase master <em>branch-name</em></code>) and get back to work.</li>
</ol>
<p>Again, by automating most of what I was already doing I can be confident that I will always come out of a dcommit in a well-known, consistent state from which I can proceed without extra thought.</p>
<h2>When do I dci?</h2>
<p><code>git dci</code> should be used when you want to commit HEAD and its uncommitted ancestors into Subversion. In my experience, this usually falls into one of three scenarios:</p>
<h3>1. Entire Branch</h3>
<p>You have a topic branch and want to replay all of its commits into Subversion one by one. In this case, simply checkout the branch and call <code>git dci</code>:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-simple.png"><img class="alignnone size-full" title="git dci Entire Branch" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-simple.png?w=780" alt="git dci Entire Branch"   /></a></p>
<p>I use this most often, as I prefer granular commits and a linear history.</p>
<p><strong>Update Dec. 4, 2010:</strong> Donn <a title="Twitter / Donn Felker" href="http://twitter.com/donnfelker/status/10397762684190720">pointed out</a> that I gloss over my use of an <code>lg</code> alias, which provides a concise graph of history. The alias is described <a title="pimping out git log" href="http://www.jukie.net/bart/blog/pimping-out-git-log">here</a>.</p>
<h3>2. Squashed Branch</h3>
<p>The exception to my linear history preference is if the build would break between intermediate commits. For example, I might upgrade a dependency in one commit and then fix the build in the next commit. One could certainly use a squash merge or interactive rebase, but sometimes I prefer to keep the granular history in Git.</p>
<p>So how do we accomplish this with git-svn? Well git-svn essentially treats merge commits as the sum of their parts, relative to the previous Subversion commit — it squashes for us. To make our single Subversion commit, we&#8217;ll just switch to master and use <code>git merge --no-ff</code>:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png"><img loading="lazy" data-attachment-id="848" data-permalink="https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/git-dci-merge1/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png" data-orig-size="720,555" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="git merge &amp;#8211;no-ff" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png?w=720" class="alignnone size-full wp-image-848" title="git merge --no-ff" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png?w=780" alt="git merge --no-ff"   srcset="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png 720w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png?w=150&amp;h=116 150w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png?w=300&amp;h=231 300w" sizes="(max-width: 720px) 100vw, 720px" /></a></p>
<p>The <code>--no-ff</code> flag forces the creation of a merge commit even though we should be able to fast-forward (if we up&#8217;d first, that is). You can make this the default behavior for master by setting branch.master.mergeoptions (I use <code>--no-ff --no-commit</code>).</p>
<p>Once we have our merge commit, we again use <code>git dci</code> to push all its changes into Subversion:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png"><img loading="lazy" data-attachment-id="849" data-permalink="https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/git-dci-merge2/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png" data-orig-size="720,536" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="git dci After Merge" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png?w=720" class="alignnone size-full wp-image-849" title="git dci After Merge" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png?w=780" alt="git dci After Merge"   srcset="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png 720w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png?w=150&amp;h=112 150w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png?w=300&amp;h=223 300w" sizes="(max-width: 720px) 100vw, 720px" /></a></p>
<p>Note that the dev2 commits remain untouched by git-svn, and Subversion has the combined changes:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png"><img loading="lazy" data-attachment-id="850" data-permalink="https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/git-dci-merge3/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png" data-orig-size="612,234" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="git-svn Merge Commit in Subversion" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png?w=612" class="alignnone size-full wp-image-850" title="git-svn Merge Commit in Subversion" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png?w=780" alt="git-svn Merge Commit in Subversion"   srcset="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png 612w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png?w=150&amp;h=57 150w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png?w=300&amp;h=115 300w" sizes="(max-width: 612px) 100vw, 612px" /></a></p>
<h3>3. Detached HEAD</h3>
<p>The final scenario is really no different from either #1 or #2, but it&#8217;s worth pointing out that you can use <code>git dci</code> from any HEAD, not just on a branch. For example, suppose I have a few refactoring commits that I created as part of feature work which I would like to share with the team now while I finish up the feature. In this case, I can checkout (or merge from) the last of the commits I want to share:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png"><img loading="lazy" data-attachment-id="845" data-permalink="https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/git-dci-detached1/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png" data-orig-size="720,365" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Checkout Detached HEAD" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png?w=720" class="alignnone size-full wp-image-845" title="Checkout Detached HEAD" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png?w=780" alt="Checkout Detached HEAD"   srcset="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png 720w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png?w=150&amp;h=76 150w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png?w=300&amp;h=152 300w" sizes="(max-width: 720px) 100vw, 720px" /></a></p>
<p>And <code>git dci</code> from the detached HEAD to save those changes:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png"><img loading="lazy" data-attachment-id="846" data-permalink="https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/git-dci-detached2/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png" data-orig-size="720,384" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="git dci from Detached HEAD" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png?w=720" class="alignnone size-full wp-image-846" title="git dci from Detached HEAD" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png?w=780" alt="git dci from Detached HEAD"   srcset="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png 720w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png?w=150&amp;h=80 150w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png?w=300&amp;h=160 300w" sizes="(max-width: 720px) 100vw, 720px" /></a></p>
<p>Note that <code>git dci</code> left me on master. Now to continue on dev3, I just rebase against master so Git is aware that the dci&#8217;d commits have been updated with git-svn metadata:</p>
<p><a href="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png"><img loading="lazy" data-attachment-id="847" data-permalink="https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/git-dci-detached3/" data-orig-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png" data-orig-size="720,175" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="git rebase master dev3" data-image-description="" data-image-caption="" data-medium-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png?w=300" data-large-file="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png?w=720" class="alignnone size-full wp-image-847" title="git rebase master dev3" src="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png?w=780" alt="git rebase master dev3"   srcset="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png 720w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png?w=150&amp;h=36 150w, https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png?w=300&amp;h=73 300w" sizes="(max-width: 720px) 100vw, 720px" /></a></p>
<p>If I want to get even more sophisticated, I could cherry-pick then dci individual commits, or I could create a copy of the branch and use interactive rebase to exclude the commits that I don&#8217;t want to dci yet. Just remember to rebase the topic branch against master when you&#8217;re done.</p>
<p>If you have any additional git-svn tips or questions, please let me know.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solutionizing.net/2010/11/26/git-svn-aliases-git-up-and-git-dci/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">823</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-simple.png" medium="image">
			<media:title type="html">git dci Entire Branch</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge1.png" medium="image">
			<media:title type="html">git merge --no-ff</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge2.png" medium="image">
			<media:title type="html">git dci After Merge</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-merge3.png" medium="image">
			<media:title type="html">git-svn Merge Commit in Subversion</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached1.png" medium="image">
			<media:title type="html">Checkout Detached HEAD</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached2.png" medium="image">
			<media:title type="html">git dci from Detached HEAD</media:title>
		</media:content>

		<media:content url="https://solutionizing.net/wp-content/uploads/2010/11/git-dci-detached3.png" medium="image">
			<media:title type="html">git rebase master dev3</media:title>
		</media:content>
	</item>
		<item>
		<title>Git-Achievements in PowerShell</title>
		<link>https://solutionizing.net/2010/10/05/git-achievements-powershell/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Tue, 05 Oct 2010 15:00:20 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[git-achievements]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=832</guid>

					<description><![CDATA[Reading through Jason&#8217;s post on using Git-Achievements with msysGit, I couldn&#8217;t help but get it working with PowerShell. The result is a single PowerShell script added to my Git-Achievements repository, tagged here on the off chance I decided to upload my achievements. To install posh-git-achievements&#8230; Fork my repository on GitHub (or if you have an [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Reading through Jason&#8217;s post on <a title="Git-Achievements on Windows" href="http://www.lostechies.com/blogs/jason_meridth/archive/2010/09/24/git-achievements-on-windows.aspx">using Git-Achievements with msysGit</a>, I couldn&#8217;t help but get it working with PowerShell. The result is a single PowerShell script added to <a title="dahlbyk's git-achievements" href="http://github.com/dahlbyk/git-achievements">my Git-Achievements repository</a>, tagged <a title="powershell on dahlbyk's git-achievements" href="http://github.com/dahlbyk/git-achievements/tree/powershell">here</a> on the off chance I decided to upload my achievements.</p>
<p>To install posh-git-achievements&#8230;</p>
<ol>
<li>Fork <a title="git-achievements on dahlbyk" href="http://github.com/dahlbyk/git-achievements">my repository</a> on GitHub (or if you have an existing repository, add me as a remote and pull)</li>
<li>Clone your fork of the repository (into C:\Git\git-achievements, for this example)</li>
<li>Open your <a href="http://technet.microsoft.com/en-us/library/ee692764.aspx">PowerShell profile</a> and add the following:<br />
<code>Set-Alias git C:\Git\git-achievements\git-achievements.ps1</code></li>
<li>&#8220;dot source&#8221; your profile to reload it in your current session (or just start a new session):<br />
<code>. $PROFILE</code></li>
<li>Check the install:<br />
<code>git achievements --help</code></li>
</ol>
<p>If all goes according to plan, this should unlock your first achievement.</p>
<p>Note that this will pass every <code>git</code> call through a few extra layers, including calls made for the posh-git prompt. But if you can tolerate the performance hit, it&#8217;s a rather fun way to expand your working knowledge of Git. Enjoy!</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">832</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>msysGit error setting certificate verify locations</title>
		<link>https://solutionizing.net/2010/09/26/msysgit-error-setting-certificate-verify-locations/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Sun, 26 Sep 2010 15:02:55 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[msysGit]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=830</guid>

					<description><![CDATA[I had never had any problems using msysGit with SSL until last night, when I came across the following error: $ git pull Password: error: error setting certificate verify locations: CAfile: /bin/curl-ca-bundle.crt CApath: none while accessing https://dahlbyk@github.com/dahlbyk/posh-git.git/info/refs fatal: HTTP request failed There were a number of suggestions in the comments on GitHub&#8217;s Smart HTTP post, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I had never had any problems using msysGit with SSL until last night, when I came across the following error:</p>
<pre>$ git pull
Password:
error: error setting certificate verify locations:
 CAfile: /bin/curl-ca-bundle.crt
 CApath: none
 while accessing https://dahlbyk@github.com/dahlbyk/posh-git.git/info/refs

fatal: HTTP request failed</pre>
<p>There were a number of suggestions in the comments on <a title="Smart HTTP Support - GitHub" href="http://github.com/blog/642-smart-http-support">GitHub&#8217;s Smart HTTP post</a>, but they mostly seemed like hacks (most common: copy file from msysGit elsewhere, or turn off <code>http.sslverify</code>). A much easier fix is just to set <code>http.sslcainfo</code> to the absolute path of the <code>curl-ca-bundle.crt</code> file in your msysGit install&#8217;s <code>bin</code> folder:</p>
<pre>$ git config --global http.sslcainfo "/c/Program Files (x86)/Git/bin/curl-ca-bundle.crt"</pre>
<p>I chose to do this at the <code>--global</code> level so the setting won&#8217;t be overwritten by future msysGit installs.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">830</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>posh-git Release v0.2</title>
		<link>https://solutionizing.net/2010/08/28/posh-git-release-v0-2/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Sat, 28 Aug 2010 17:20:19 +0000</pubDate>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[posh-git]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=819</guid>

					<description><![CDATA[I just tagged the v0.2 release of posh-git, which you can download here. This is the last release supporing msysgit 1.6.5 and 1.7.0. In this release&#8230; PowerShell Module Thanks to a contribution from David Muhundro, posh-git now exposes its functions through a module (.psm1). The module exposes a number of functions whose usage can be [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I just tagged the <a title="posh-git v0.2 on GitHub" href="http://github.com/dahlbyk/posh-git/tree/v0.2">v0.2 release</a> of <a title="posh-git on GitHub" href="http://github.com/dahlbyk/posh-git">posh-git</a>, which you can <a title="posh-git Downloads" href="http://github.com/dahlbyk/posh-git/downloads">download here</a>. This is the last release supporing msysgit 1.6.5 and 1.7.0. In this release&#8230;</p>
<h3>PowerShell Module</h3>
<p>Thanks to a contribution from <a href="http://www.mohundro.com/blog/">David Muhundro</a>, posh-git now exposes its functions through a module (.psm1). The module exposes a number of functions whose usage can be seen in the example profile.</p>
<h3>Tab Expansion Updates</h3>
<ul>
<li><a href="http://code.google.com/p/tortoisegit/">TortoiseGit</a> commands: <code>tgit &lt;tab&gt;</code></li>
<li>git-svn operations: <code>git svn &lt;tab&gt;</code></li>
<li>Stash completion for <code>git stash</code> operations: <code>show, apply, drop, pop, branch</code></li>
<li>Branch completion for <code>git reset</code> and <code>git rebase</code></li>
<li>Completion of deleted files for <code>git rm</code></li>
<li>For most commands, tab completion should now work if other command flags are in use. For example, <code>git rebase -i &lt;tab&gt;</code> works as expected.</li>
</ul>
<p>Thanks to <a href="http://www.jeremyskinner.co.uk/">Jeremy Skinner</a> and <a href="http://www.markembling.info/">Mark Embling</a> for their contributions to this release.</p>
<h3>Next Steps</h3>
<p>The most common complaint about posh-git is performance, which has already been addressed for the next release (available in my master branch). However, the fix requires taking a dependency on msysgit 1.7.1, which has not been officially released yet.  Still, it has been working fine for me.</p>
<p>Beyond that, we still need to address the first two items on my list from the last release&#8230;</p>
<ul>
<li>Testing! I&#8217;d like to figure out a way to run some integration tests  that verify a given repository state renders the expected prompt. If you  have suggestions how to approach this, or know how other Git  integration projects are tested, please let us know over at the <a href="http://groups.google.com/group/posh-git/">Google Group</a>.</li>
<li>Documentation! How to get started, what the project provides, etc.</li>
</ul>
<p>If you have any other feature requests or find issues, please let us know.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">819</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>St. Louis Day of .NET &#8211; August 20-21, 2010</title>
		<link>https://solutionizing.net/2010/07/21/st-louis-day-of-dot-net-2010/</link>
					<comments>https://solutionizing.net/2010/07/21/st-louis-day-of-dot-net-2010/#comments</comments>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Thu, 22 Jul 2010 03:33:54 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[STLDODN]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=811</guid>

					<description><![CDATA[One of my favorite developer events of 2009 was St. Louis Day of .NET. Not only were the facilities (Ameristar Casino) top-notch, but there were a ton of great sessions and I got to pick the brains of some really sharp people. This year&#8217;s event looks to be even better, with a huge variety of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One of my favorite developer events of 2009 was <a href="http://www.stlouisdayofdotnet.com/">St. Louis Day of .NET</a>. Not only were the facilities (Ameristar  Casino) top-notch, but there were a ton of great sessions and I got to  pick the brains of some really sharp people. This year&#8217;s event looks to  be even better, with a <a href="http://www.stlouisdayofdotnet.com/Sessions.aspx" target="_blank">huge variety of sessions</a> on principles, practices and plenty of programming. I will be presenting two sessions:</p>
<h3>Dynamic .NET Demystified</h3>
<p>Dynamic  .NET has gone mainstream with the recent promotion of the Dynamic  Language Runtime into .NET 4. This session will discuss what the DLR is,  how it works with C# 4 and Visual Basic 10, and why this doesn&#8217;t mean  C# has jumped the shark. We will also look at some ways in which these  features can be used to solve real-world problems.</p>
<h3>LINQ Internals II: System.Interactive</h3>
<p>System.Interactive is a library distributed with Microsoft&#8217;s Reactive  Extensions, currently available on DevLabs, which provides a number of  useful extensions to the LINQ Standard Query Operators. These extensions  include operators to add and contain side effects, handle exceptions,  generate and combine sequences, and much more. This session will review  the new operators and discuss interesting problems they can be used to  solve. Note that Rx is available for .NET 3.5 SP1, Silverlight 3 and  .NET 4.0, so this session is not just for those developing on the  bleeding edge.</p>
<h2>Free Stuff</h2>
<p>The organizers were kind enough to provide speakers with some  discount codes, so I figured this is as good a place as any to give  those out. Two lucky commenters will get a code worth $75 off the cover  price, with the grand prize being <em>free admission</em>. All you have to  do is leave a comment (with a valid e-mail address) convincing me that you deserve these rich rewards  over my other suitors. And if your reasons are all terrible, I&#8217;ll ask  random.org. Deadline is 23:59 CDT on Monday, July 26th.</p>
<p>Hope to see you there!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://solutionizing.net/2010/07/21/st-louis-day-of-dot-net-2010/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">811</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Refactoring&#8221; Notes</title>
		<link>https://solutionizing.net/2010/07/08/refactoring-notes/</link>
		
		<dc:creator><![CDATA[Keith Dahlby]]></dc:creator>
		<pubDate>Fri, 09 Jul 2010 04:10:18 +0000</pubDate>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Refactor]]></category>
		<guid isPermaLink="false">http://solutionizing.net/?p=792</guid>

					<description><![CDATA[I&#8217;m not going to bother with a review of Martin Fowler&#8216;s Refactoring: Improving the Design of Existing Code. It&#8217;s good enough that its catalog, available in expanded form online, now provides the definitive vocabulary shared by dozens of refactoring tools across nearly every major development platform. Though I was already familiar with the majority of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m not going to bother with a review of <a href="http://martinfowler.com/">Martin Fowler</a>&#8216;s <a href="http://www.amazon.com/exec/obidos/ASIN/0201485672"><em>Refactoring: Improving the Design of Existing Code</em></a>. It&#8217;s good enough that its catalog, available in <a title="Refactorings in Alphabetical Order" href="http://www.refactoring.com/catalog/">expanded form online</a>, now provides the definitive vocabulary shared by dozens of refactoring tools across nearly every major development platform. Though I was already familiar with the majority of the catalog, I thought it would be worth reading the other chapters, the notes from which you will find below with my additions indicated with <em>emphasis</em>. I&#8217;ve also included thoughts on various entries in the catalog.</p>
<h2>Principles in Refactoring</h2>
<ul>
<li>58: You  don&#8217;t decide to refactor, you refactor because you want to do something  else, and refactoring helps you do that other thing.</li>
<li>62: Beck  &#8211; Maintaining the current behavior of the system, how can you make your  system more valuable, either by increasing its quality, or by reducing  its cost. … Now you have a more valuable program because it has  qualities that we will appreciate tomorrow. … There is a second, rarer  refactoring game. Identify indirection that isn&#8217;t paying for itself and  take it out.</li>
<li>62:  Problems with Refactoring
<ul>
<li>Don&#8217;t know limitations</li>
<li><em>Is refactoring because a      tool  tells you to a bad reason?</em></li>
</ul>
</li>
<li>65:  Modify your code ownership policies to smooth refactoring.</li>
<li>66: <strong>Code  has to work before you refactor.</strong></li>
<li>Ward  Cunningham: Unfinished refactoring = technical debt.</li>
<li>68: You  still think about potential changes, you still consider flexible  solutions. But instead of implementing these flexible solutions, you ask  yours, <strong>&#8220;How difficult is it going to be to refactor a simple solution  into the flexible solution?&#8221;</strong> If, as happens most of the time, the answer  is &#8220;pretty easy,&#8221; then you just implement the simple solution.</li>
<li>70:  Changes that improve performance usually make the program harder to work  with.</li>
<li>If you  optimize all code equally, you end up with 90 percent of the  optimizations wasted, because you are optimizing code that isn&#8217;t run  much.</li>
</ul>
<h2>Bad Smells in Code</h2>
<p>An expanded catalog of code smells is <a title="Code Smells on Software Development Wiki" href="http://c2.com/cgi/wiki?CodeSmell">available online</a>.</p>
<ol>
<li>Duplicate Code</li>
<li>Long Method</li>
<li>Large Class</li>
<li>Long Parameter List</li>
<li>Divergent Change
<ul>
<li>One class that suffers many       kinds of changes</li>
</ul>
</li>
<li>Shotgun Surgery
<ul>
<li>One change that alters many       classes</li>
</ul>
</li>
<li>Feature Envy</li>
<li>Data Clumps</li>
<li>Primitive Obsession</li>
<li>Switch Statements</li>
<li>Parallel Inheritance      Hierarchies</li>
<li>Lazy Class</li>
<li>Speculative Generality</li>
<li>Temporary Field</li>
<li>Message Chains
<ul>
<li><em>a.k.a. Law of Demeter</em></li>
</ul>
</li>
<li>Middle Man</li>
<li>Inappropriate Intimacy
<ul>
<li>Circular Reference =&gt;       Change Bidirectional Association to Unidirectional</li>
</ul>
</li>
<li>Alternative Classes with Different Interfaces</li>
<li>Incomplete Library Class
<ul>
<li>Introduce       Foreign Method       =&gt; Extension Methods</li>
</ul>
</li>
<li>Data Class
<ul>
<li>Favor setters and       encapsulated collections</li>
<li><em>Very OO-centric &#8211; FP would       argue that immutable data classes are preferred</em></li>
<li>Hide       Method =&gt;       Immutability</li>
<li>87: &#8220;Data classes are       like children. They are okay as a starting point, but to participate as a       grownup object, they need to take some responsibility.&#8221;</li>
</ul>
</li>
<li>Refused Bequest
<ul>
<li>Smell is stronger if the       subclass is reusing behavior but does not want to support the interface       of the superclass. (NotSupportedException)</li>
<li>Apply Replace       Inheritance with Delegation</li>
</ul>
</li>
<li>Comments
<ul>
<li>88: When you feel the need       to write a comment, first try to refactor the code so that any comment       becomes superfluous.</li>
</ul>
</li>
</ol>
<h2>Building Tests</h2>
<ul>
<li>Tests should be fully automatic and self-checking.</li>
<li>Interesting that a distinction is drawn between      unit and functional tests, but there&#8217;s no mention of integration tests as middle ground</li>
<li>97: &#8220;When you gget a bug      report, start by writing a unit test that exposes the bug.&#8221;
<ul>
<li><em>This is my #1 use case for test-first</em></li>
</ul>
</li>
<li>98: &#8220;The key is to test      the areas that you are most worried about going wrong.&#8221;</li>
<li>101: &#8220;Don&#8217;t let the fear      that testing can&#8217;t catch all bugs stop you from writing the tests that      will catch most bugs.&#8221;</li>
</ul>
<p>If this is the first you&#8217;ve read of unit testing, check out a book  dedicated to the subject like <a title="Review: Pragmatic Unit Testing  In C# with NUnit (2nd Edition)" href="https://solutionizing.net/2010/05/17/review-pragmatic-unit-testing-in-c-with-nunit-2nd-edition/">Pragmatic  Unit Testing</a>.</p>
<h2>Catalog Notes</h2>
<ul>
<li>Composing Methods
<ul>
<li>Replace Method with Method       Object<br />
<em>local variables =&gt; method object fields to facilitate extracting methods</em></li>
</ul>
</li>
<li>Moving Features Between      Objects
<ul>
<li>Introduce Foreign Method =       Extension Methods</li>
<li>Introduce Local Extension =       Subclass or Proxy</li>
</ul>
</li>
<li>Organizing Data
<ul>
<li>Replace Data Value with       Object<br />
<em> replace primitive with a type that means something (decimal =&gt; Money)</em></li>
<li>Replace Type Code with       State/Strategy<br />
<em>inheritance is often abused, but this is one of its best use cases</em></li>
</ul>
</li>
<li>Simplifying Conditional      Expressions
<ul>
<li>Introduce Null Object<br />
<em> OO approach to avoiding null checks, also not to be abused</em></li>
</ul>
</li>
<li>Making Method Calls Simpler
<ul>
<li>Separate Query from Modifier<br />
<em>mutation and query operations don&#8217;t mix</em></li>
<li>Replace Parameter with       Method<br />
<em> this rarely applies to new code, but rather is found in methods that have evolved over time</em></li>
<li>Hide Method
<ul>
<li><em>Related:</em> Remove from Interface — useful to let a method &#8220;hide in public&#8221; for easier testing without cluttering up its expected usage as implementer of an interface</li>
</ul>
</li>
<li>Replace Error Code with       Exception<br />
<em>if a circumstance is truly exceptional, exceptions are often better than error codes&#8230;</em></li>
<li>Replace Exception with Test<br />
<em>&#8230;but if it&#8217;s not exceptional, don&#8217;t incur the overhead; for example, return a Null Object</em></li>
</ul>
</li>
<li>Dealing with Generalization
<ul>
<li>Extract Subclass, Superclass       and Interface</li>
<li>Collapse Hierarchy</li>
<li>Form Template Method</li>
<li>Replace Inheritance with       Delegation</li>
<li>Replace Delegation with       Inheritance</li>
</ul>
</li>
</ul>
<h2>Big Refactorings</h2>
<ul>
<li>359: &#8220;Do as much as you need      to achieve your real task. You can always come back tomorrow.&#8221;</li>
<li>360: &#8220;You refactor not      because it is fun but because there are things you expect to be able to do      with your programs if you refactor that you can&#8217;t do if you don&#8217;t      refactor.&#8221;
<ul>
<li><em>I need to remember this!!</em></li>
</ul>
</li>
</ul>
<p>These are hard to identify, but provide the biggest return on investment. Think of them as high-level goals accomplished through low-level changes from the above catalog.</p>
<ul>
<li>Tease Apart Inheritance</li>
<li>Convert Procedural Design to       Objects
<ul>
<li><em>Also,</em> Convert to Functions</li>
</ul>
</li>
<li>Separate Domain from Presentation
<ul>
<li><em>MVP, MVC, MVVM&#8230;use something!</em></li>
</ul>
</li>
<li>Extract Hierarchy</li>
</ul>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">792</post-id>
		<media:content url="https://2.gravatar.com/avatar/bc16183eea430722b5115e6bc9a95900c4cd00e9c48ec048fae57d147e57b78c?s=96&#38;d=identicon&#38;r=PG" medium="image">
			<media:title type="html">dahlbyk</media:title>
		</media:content>
	</item>
	</channel>
</rss>
