<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Commentaires sur : Git, CIA and branch merging</title>
	<atom:link href="http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/</link>
	<description>Rien de tel qu'un blog pour partager ses projets les plus fous</description>
	<pubDate>Tue, 06 Jan 2009 01:39:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>Par : Buxy</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17523</link>
		<dc:creator>Buxy</dc:creator>
		<pubDate>Tue, 08 Jul 2008 06:12:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17523</guid>
		<description>It looks possible indeed (as the hook is called after the local refs have been updated apparently) but difficult to fix without completely rewriting the script to replace each stop condition with the old commit of the given refname. You'd have to parse the whole input and store the data in an array/hash to be able to refer to it. Not really worth the effort IMO. :)</description>
		<content:encoded><![CDATA[<p>It looks possible indeed (as the hook is called after the local refs have been updated apparently) but difficult to fix without completely rewriting the script to replace each stop condition with the old commit of the given refname. You&#8217;d have to parse the whole input and store the data in an array/hash to be able to refer to it. Not really worth the effort IMO. <img src='http://www.ouaza.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Joey Hess</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17517</link>
		<dc:creator>Joey Hess</dc:creator>
		<pubDate>Mon, 07 Jul 2008 23:25:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17517</guid>
		<description>Seems to work, but on reviewing, I think there's still a problem. What if branches A and B are pushed at the same time? Then, when processing A, it will filter out all commits in B; when processing B it will filter all commits in A. And in the end, all commits can be filtered out, even though some are really new.

I guess I rarely enough get into that situation that I can live with it though.</description>
		<content:encoded><![CDATA[<p>Seems to work, but on reviewing, I think there&#8217;s still a problem. What if branches A and B are pushed at the same time? Then, when processing A, it will filter out all commits in B; when processing B it will filter all commits in A. And in the end, all commits can be filtered out, even though some are really new.</p>
<p>I guess I rarely enough get into that situation that I can live with it though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Joey Hess</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17512</link>
		<dc:creator>Joey Hess</dc:creator>
		<pubDate>Mon, 07 Jul 2008 23:10:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17512</guid>
		<description>Yeah, without a theirs (or ours?) merge, you have to have had a sequence of events where all merges between branches were fast-forwards to get into that state, I think .

I think the --symbolic-full-name approach can work, though probably it should &#124; egrep -v "^\^$refname$"</description>
		<content:encoded><![CDATA[<p>Yeah, without a theirs (or ours?) merge, you have to have had a sequence of events where all merges between branches were fast-forwards to get into that state, I think .</p>
<p>I think the &#8211;symbolic-full-name approach can work, though probably it should | egrep -v &#8220;^\^$refname$&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Buxy</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17506</link>
		<dc:creator>Buxy</dc:creator>
		<pubDate>Mon, 07 Jul 2008 21:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17506</guid>
		<description>Joey, I don't know git-merge-theirs (it's not in sid's git) but the usual merge strategies will not give the same commit if the previous commit is different so it's a rather uncommon situation IMO.

Anyway, maybe you can work-around this by using &lt;code&gt;git rev-parse --symbolic-full-name --not --branches &#124; grep -v $refname&lt;/code&gt; so that commits are not expanded to their sha1 and you will only grep out the right branch instead of all those that share the same sha1.</description>
		<content:encoded><![CDATA[<p>Joey, I don&#8217;t know git-merge-theirs (it&#8217;s not in sid&#8217;s git) but the usual merge strategies will not give the same commit if the previous commit is different so it&#8217;s a rather uncommon situation IMO.</p>
<p>Anyway, maybe you can work-around this by using <code>git rev-parse --symbolic-full-name --not --branches | grep -v $refname</code> so that commits are not expanded to their sha1 and you will only grep out the right branch instead of all those that share the same sha1.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Joey Hess</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17505</link>
		<dc:creator>Joey Hess</dc:creator>
		<pubDate>Mon, 07 Jul 2008 21:20:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17505</guid>
		<description>Buxy, git-rev-parse will list the same commit multiple times if there are multiple branches that used to diverge, but are all now merged to the same point.

For example, if I have master, foo, and bar, and in both foo and bar, I do a 'git merge -s theirs master'. Now, when I push foo and bar to the server, git-rev-parse will list the same sha1 3 times (with ^). But if all three are filtered out, all the stop points are gone.</description>
		<content:encoded><![CDATA[<p>Buxy, git-rev-parse will list the same commit multiple times if there are multiple branches that used to diverge, but are all now merged to the same point.</p>
<p>For example, if I have master, foo, and bar, and in both foo and bar, I do a &#8216;git merge -s theirs master&#8217;. Now, when I push foo and bar to the server, git-rev-parse will list the same sha1 3 times (with ^). But if all three are filtered out, all the stop points are gone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Buxy</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17503</link>
		<dc:creator>Buxy</dc:creator>
		<pubDate>Mon, 07 Jul 2008 19:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17503</guid>
		<description>I just installed a new plugin (wp-syntax) to be able to embed a code snippet properly... HTH. You get syntax highlighting as bonus.</description>
		<content:encoded><![CDATA[<p>I just installed a new plugin (wp-syntax) to be able to embed a code snippet properly&#8230; HTH. You get syntax highlighting as bonus.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Buxy</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17502</link>
		<dc:creator>Buxy</dc:creator>
		<pubDate>Mon, 07 Jul 2008 19:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17502</guid>
		<description>Anonymous, git-commit-notice is an Alioth-specific variation of the script that is in git's contrib directory (/usr/share/doc/git-core/contrib/hooks/post-receive-email on a Debian system).

Joey, I'm sorry for the dashes, but wordpress is trying to be smarter than it should... it's replacing on the fly the double dashes and the quotes even if they are inside a &#60;pre&#62; or &#60;code&#62;.

&lt;code&gt;git rev-parse --not --branches&lt;/code&gt; list the current SHA1 of all branches but preceded by "^". We remove the currently updated branch from that list and we use that list as many stop points for git rev-list thanks to its &lt;code&gt;--stdin&lt;/code&gt; option. Why whould git rev-parse return the same commit multiple times ?</description>
		<content:encoded><![CDATA[<p>Anonymous, git-commit-notice is an Alioth-specific variation of the script that is in git&#8217;s contrib directory (/usr/share/doc/git-core/contrib/hooks/post-receive-email on a Debian system).</p>
<p>Joey, I&#8217;m sorry for the dashes, but wordpress is trying to be smarter than it should&#8230; it&#8217;s replacing on the fly the double dashes and the quotes even if they are inside a &lt;pre&gt; or &lt;code&gt;.</p>
<p><code>git rev-parse --not --branches</code> list the current SHA1 of all branches but preceded by &#8220;^&#8221;. We remove the currently updated branch from that list and we use that list as many stop points for git rev-list thanks to its <code>--stdin</code> option. Why whould git rev-parse return the same commit multiple times ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Joey Hess</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17500</link>
		<dc:creator>Joey Hess</dc:creator>
		<pubDate>Mon, 07 Jul 2008 17:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17500</guid>
		<description>Hmm, you also need to double the dashes in git rev-parse. (It accepts "-not", but just outputs "-not".)

Even with that fixed, I'm still seeing floods if I merge master into a branch and push.

Let's see.. refname is refs/heads/branch, and 'git rev-parse --not --branches'
lists its ref, multiple times (once for the branch, once for master) but the grep filters it out. So rev-list doesn't stop. I think it should only grep out one instance of $(git rev-parse $refname).

So, currently untested:

        for merged in $(git rev-parse --not --branches &#124; perl -e '$r=shift; while () { if (!$seen &#38;&#38; /$r/) { $seen=1 } else { print } }' $(git rev-parse $refname) &#124; git rev-list --reverse --stdin $oldrev..$newrev); do
                /srv/git/ikiwiki.info/.git/hooks/ciabot_git.pl $merged $branchname
        done</description>
		<content:encoded><![CDATA[<p>Hmm, you also need to double the dashes in git rev-parse. (It accepts &#8220;-not&#8221;, but just outputs &#8220;-not&#8221;.)</p>
<p>Even with that fixed, I&#8217;m still seeing floods if I merge master into a branch and push.</p>
<p>Let&#8217;s see.. refname is refs/heads/branch, and &#8216;git rev-parse &#8211;not &#8211;branches&#8217;<br />
lists its ref, multiple times (once for the branch, once for master) but the grep filters it out. So rev-list doesn&#8217;t stop. I think it should only grep out one instance of $(git rev-parse $refname).</p>
<p>So, currently untested:</p>
<p>        for merged in $(git rev-parse &#8211;not &#8211;branches | perl -e &#8216;$r=shift; while () { if (!$seen &amp;&amp; /$r/) { $seen=1 } else { print } }&#8217; $(git rev-parse $refname) | git rev-list &#8211;reverse &#8211;stdin $oldrev..$newrev); do<br />
                /srv/git/ikiwiki.info/.git/hooks/ciabot_git.pl $merged $branchname<br />
        done</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Joey Hess</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17499</link>
		<dc:creator>Joey Hess</dc:creator>
		<pubDate>Mon, 07 Jul 2008 16:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17499</guid>
		<description>Thanks.. Note that you have utf-8 hyphens rather than dashes, which makes it kinda hard to copy and paste. Also, git rev-list complained until I doubled the hyphens (--reverse --stdin). Aside from that, I think it works, pasted into my post-reveive as-is (no need to complicate things with the git-commit-notice script).</description>
		<content:encoded><![CDATA[<p>Thanks.. Note that you have utf-8 hyphens rather than dashes, which makes it kinda hard to copy and paste. Also, git rev-list complained until I doubled the hyphens (&#8211;reverse &#8211;stdin). Aside from that, I think it works, pasted into my post-reveive as-is (no need to complicate things with the git-commit-notice script).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Par : Anonymous</title>
		<link>http://www.ouaza.com/wp/2008/07/07/git-cia-branch-merging/#comment-17497</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 07 Jul 2008 13:47:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.ouaza.com/wp/?p=158#comment-17497</guid>
		<description>And what Debian package can we find git-commit-notice in? :)</description>
		<content:encoded><![CDATA[<p>And what Debian package can we find git-commit-notice in? <img src='http://www.ouaza.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
