<?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>Ivan Zlatev &#187; Git</title>
	<atom:link href="http://ivanz.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://ivanz.com</link>
	<description></description>
	<lastBuildDate>Sun, 22 Apr 2012 18:15:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>msysGit Tip: Files Constantly Reported as Modified Fix</title>
		<link>http://ivanz.com/2009/07/18/msysgit-tip-files-constantly-reported-as-modified-fix/</link>
		<comments>http://ivanz.com/2009/07/18/msysgit-tip-files-constantly-reported-as-modified-fix/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 01:43:10 +0000</pubDate>
		<dc:creator>Ivan Zlatev</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://i-nz.net/?p=665</guid>
		<description><![CDATA[<a href="http://ivanz.com/2009/07/18/msysgit-tip-files-constantly-reported-as-modified-fix/" title="msysGit Tip: Files Constantly Reported as Modified Fix"></a>I copied my Mono mcs Git working copy from Linux to Windows for use with MSysGit only to find out that even after git reset &#8211;hard almost all files were being reported as modified by git status. It turns out &#8230;<p class="read-more"><a href="http://ivanz.com/2009/07/18/msysgit-tip-files-constantly-reported-as-modified-fix/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://ivanz.com/2009/07/18/msysgit-tip-files-constantly-reported-as-modified-fix/" title="msysGit Tip: Files Constantly Reported as Modified Fix"></a><p>I copied my Mono mcs Git working copy from Linux to Windows for use with MSysGit only to find out that even after <em>git reset &#8211;hard</em> almost all files were being reported as modified by <em>git status</em>. It turns out it has to do with the file permissions (executable bit I think) and the inability of msysgit to apply them on Windows.</p>
<pre>$ git diff class/Accessibility/makefile.build
diff --git a/class/Accessibility/makefile.build b/class/Accessibility/makefile
old mode 100755
new mode 100644</pre>
<p>The fix is to make git ignore some file mode stuff via:</p>
<pre>git config core.fileMode false</pre>
<p>Another useful setting on Windows is:</p>
<pre>git config core.autocrlf true</pre>
 <img src="http://ivanz.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=665" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://ivanz.com/2009/07/18/msysgit-tip-files-constantly-reported-as-modified-fix/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Git bisect &#8211; the awesome way to find the Mr. Bug commit</title>
		<link>http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/</link>
		<comments>http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 01:48:56 +0000</pubDate>
		<dc:creator>Ivan Zlatev</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://i-nz.net/?p=390</guid>
		<description><![CDATA[<a href="http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/" title="Git bisect - the awesome way to find the Mr. Bug commit"></a>I had my first experience with git bisect the other day and it&#8217;s awesome. What happened is that I introduced a regression which was uncovered by a failing test. Yes,  yes I know I should have ran the full test &#8230;<p class="read-more"><a href="http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/" title="Git bisect - the awesome way to find the Mr. Bug commit"></a><p>I had my first experience with <em>git bisect</em> the other day and it&#8217;s awesome. What happened is that I introduced a regression which was uncovered by a failing test. Yes,  yes I know I should have ran the full test suite, but I did the mistake to only run the specific set of unit test for that particular component. Now, the tricky part is that the particular test had no direct connection with the last set of commits so I had absolutely no clue which commit had caused it. Thanks to our QA team and build bot I was supplied with a range of commits which caused the regression. This is when <em>git bisect</em> came into play.</p>
<p>Supplied a range of commits <em>git bisect</em> automatically</p>
<p>1. Given a supplied range of commits starts chopping sets of them and applying in a binary search fashion until you mark the current commit as good. Say if you have 50 commits to bisect it will apply the first 25 if you mark the 25th commit as good then the regression is in those 25 commits so it will apply the first 12 of those and then if you mark them as bad it will apply the next 13 and it will then keep subsetting until you hit the bad commit. Nice and quick.</p>
<p>2. Create a temporary bisect branch where it operates (which when done is automatically removed as well)</p>
<p>The workflow is as follows:</p>
<pre>git bisect start

# Mark current commit as bad
git bisect bad

# Set the first good commit - the start of the bisect commit set
git bisect good some-commit-here

.. compile and run tests ...

# Mark the current commit as either bad or good
# Git will automatically apply the next subset of commits if bad
git bisect good / bad

# Done bisecting - we found the bad commit
git bisect reset</pre>
<p>There are lots of other cool things that you can do like <tt><em>visualize</em> the bisect set, <em>skip</em> range of commits in side the set or even <em>log</em> your actions to a file so that if you make a mistake somewhere you can just reply the actions from the log file. Ah and last but not least you can also use g<em>it reset</em> to manually move up the bisect commits set. For more info check out the <a href="http://www.kernel.org/pub/software/scm/git/docs/git-bisect.html">manual</a>.<br />
</tt></p>
 <img src="http://ivanz.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=390" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://ivanz.com/2009/03/27/git-bisect-the-awesome-way-to-find-the-mr-bug-commit/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Git automatic smart ChangeLog merging</title>
		<link>http://ivanz.com/2009/03/19/git-automatic-smart-changelog-merging/</link>
		<comments>http://ivanz.com/2009/03/19/git-automatic-smart-changelog-merging/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 21:29:36 +0000</pubDate>
		<dc:creator>Ivan Zlatev</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://i-nz.net/?p=323</guid>
		<description><![CDATA[<a href="http://ivanz.com/2009/03/19/git-automatic-smart-changelog-merging/" title="Git automatic smart ChangeLog merging"></a>This might be old news for some, but there is a merge driver for Git that can automatically perform smart merges of ChangeLogs. I&#8217;ve used it for months now and it has always worked flawlessly. 1) Install git-merge-changelog which is &#8230;<p class="read-more"><a href="http://ivanz.com/2009/03/19/git-automatic-smart-changelog-merging/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://ivanz.com/2009/03/19/git-automatic-smart-changelog-merging/" title="Git automatic smart ChangeLog merging"></a><p>This might be old news for some, but there is a merge driver for Git that can automatically perform smart merges of ChangeLogs. I&#8217;ve used it for months now and it has always worked flawlessly.</p>
<p>1) Install <em>git-merge-changelog</em> which is part of <a href="http://www.gnu.org/software/gnulib/"><em>gnulib</em></a> . For openSUSE you can use my repository at <a href="http://download.opensuse.org/repositories/home:/i-nZ/">http://download.opensuse.org/repositories/home:/i-nZ/</a></p>
<p>2) Make Git aware of it by adding the following to your <em>~/.gitconfig</em></p>
<pre>[merge "merge-changelog"]
name = GNU-style ChangeLog merge driver
driver = /usr/bin/git-merge-changelog %O %A %B</pre>
<p>3) For each repository where you want to use this driver make Git aware of it by adding to <em>$GIT_REPO/.git/info/attributes</em> the following (create the file if it doesn&#8217;t exist):</p>
<pre>ChangeLog    merge=merge-changelog</pre>
<p>That&#8217;s it! Enjoy.</p>
 <img src="http://ivanz.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=323" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://ivanz.com/2009/03/19/git-automatic-smart-changelog-merging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selective import of SVN branches into a git/git-svn repository</title>
		<link>http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/</link>
		<comments>http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 20:16:39 +0000</pubDate>
		<dc:creator>Ivan Zlatev</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://i-nz.net/?p=279</guid>
		<description><![CDATA[<a href="http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/" title="Selective import of SVN branches into a git/git-svn repository"></a>Use Case You are using Git and git-svn on a big project which has lots of branches and tags but you only need to work with a small selection of those and you don&#8217;t want to import all of the &#8230;<p class="read-more"><a href="http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/" title="Selective import of SVN branches into a git/git-svn repository"></a><h3>Use Case</h3>
<p>You are using Git and git-svn on a big project which has lots of branches and tags but you only need to work with a small selection of those and you don&#8217;t want to import all of the rest.</p>
<h3>Import an individual SVN branch</h3>
<p>1) Define the new branch in <em>.git/config</em> :</p>
<pre>[svn-remote "release-branch"]
        url = svn+ssh://xxxx@mono-cvs.ximian.com/source/branches/mono-2-2/mcs
        fetch = :refs/remotes/git-svn-release-branch</pre>
<p>2) Import the SVN branch. SVN_BRANCHED_REVISION is the the revision when the branch happened in SVN.</p>
<pre>[~]$ git svn fetch release-branch -r SVN_BRANCHED_REVISION</pre>
<p>3) Hook up a local Git branch to the remote branch:</p>
<pre>[~]$ git branch --track release git-svn-release-branch</pre>
<p>5) Checkout and update</p>
<pre>[~]$ git checkout release
[~]$ git svn rebase</pre>
<p>Done!</p>
<h3>Delete the branch checkout</h3>
<p>The following command sequence will delete (locally only) the SVN branch and its history:</p>
<pre>[~]$ git branch -D release
[~]$ git branch -D -r git-svn-release-branch
[~]$ rm -rf .git/svn/git-svn-release-branch
[~]$ git gc</pre>
<h3>Now what?</h3>
<p>Well, for starters given that you are ready to commit something to trunk and you also want to &#8220;backport&#8221; to the release branch you just have to do:</p>
<pre>[~]$ git svn dcommit
[~]$ git checkout release &amp;&amp; git svn rebase
[~]$ git cherry-pick master &amp;&amp; git svn dcommit
[~]$ git checkout master</pre>
 <img src="http://ivanz.com/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=279" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

