[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Using git-svn with review board?
From:       "Riccardo Iaconelli" <riccardo () kde ! org>
Date:       2008-05-23 11:53:10
Message-ID: f57cdca40805230453y5368791aq5894705158abcbdc () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

On 3/18/08, Riccardo Iaconelli <riccardo@kde.org> wrote:
>
> 2008/3/18 Sebastian Kuegler <sebas@kde.org>:
>
>> On Tuesday 18 March 2008 15:45:27 Marijn Kruisselbrink wrote:
>> > Sebastian Kuegler wrote:
>> > > I can imagine that this forms a real barrier for some (me), but maybe
>> > > someone has already solved that?
>> >
>> > I'm using this small shell-script to generate a diff between the current
>> > working copy and HEAD that review-board will accept with git-svn. This
>> > does assume that HEAD is actually an svn revision, I don't think it
>> will
>> > work when you have already comitted changes locally.
>> >
>> > #!/bin/sh
>> > REV=`git-svn find-rev HEAD`
>> > git-diff --no-prefix $* HEAD | sed -e 's/^+++ .*/&  (working copy)/' -e
>> > "s/^--- .*/&  (revision $REV)/"
>>
>> My preferred workflow would be:
>>
>> - Have master branch up to date from SVN
>> - Work on stuff in branches
>> - Merge changes from master into those branches as I see fit
>
>
> You should rebase, not merge. ;-)
>
>
>> - When something in a branch should be committed, I'd merge this commit
>> into
>>  master and dcommit it (possibly after going through RB)
>> - When a branch is done, I'd merge the whole branch into master and
>> dcommit
>>  that
>>
>> So that involves committing locally. Changing you scriptlet to find the
>> latest
>> SVN revision would be necessary in that case, no?
>>
>>
> the script looks good, you probably have to add
> git-rev-list --date-order --max-count=1 <git-svn>
>
> where <git-svn> is the name of the remote branch (git branch -r)
> which maps the svn repo. that gives you the other argument for git diff.


To bring this topic back, the shell script becomes:
#!/bin/sh
REV=`git svn find-rev $(git-rev-list --date-order --max-count=1 git-svn)`
git diff --no-prefix $* HEAD | sed -e 's/^+++ .*/&  (working copy)/' -e
"s/^--- .*/&  (revision $REV)/"

Where the lastest 'git-svn' in line 2 (the one just under #!/bin/sh) is the
name of the remote branch which tracks svn.

And it's named 'git-svn' by default...

Hope this helps... here works like a charm.

-Riccardo
-- 
GPG key:
3D0F6376
When encrypting, please encrypt also for this subkey:
9EBD7FE1
-----
Pace Peace Paix Paz Frieden Pax Pokój Friður Fred Béke 和平
Hasiti Lapé Hetep Malu Mир Wolakota Santiphap Irini Peoch שלום
Shanti Vrede Baris Rój Mír Taika Rongo Sulh Mir Py'guapy 평화

[Attachment #5 (text/html)]

<div><span class="gmail_quote">On 3/18/08, <b class="gmail_sendername">Riccardo \
Iaconelli</b> &lt;<a href="mailto:riccardo@kde.org">riccardo@kde.org</a>&gt; \
wrote:</span><blockquote class="gmail_quote" \
style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> \
2008/3/18 Sebastian Kuegler &lt;<a href="mailto:sebas@kde.org" target="_blank" \
onclick="return top.js.OpenExtLink(window,event,this)">sebas@kde.org</a>&gt;:<br><div \
class="gmail_quote"><span class="q"><blockquote class="gmail_quote" \
style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt \
0.8ex;padding-left:1ex">

<div>On Tuesday 18 March 2008 15:45:27 Marijn Kruisselbrink wrote:<br>
&gt; Sebastian Kuegler wrote:<br>
&gt; &gt; I can imagine that this forms a real barrier for some (me), but maybe<br>
&gt; &gt; someone has already solved that?<br>
&gt;<br>
&gt; I&#39;m using this small shell-script to generate a diff between the current<br>
&gt; working copy and HEAD that <span id="st" name="st" \
class="st">review</span>-<span id="st" name="st" class="st">board</span> will accept \
with <span id="st" name="st" class="st">git</span>-<span id="st" name="st" \
class="st">svn</span>. This<br>

&gt; does assume that HEAD is actually an <span id="st" name="st" \
class="st">svn</span> revision, I don&#39;t think it will<br> &gt; work when you have \
already comitted changes locally.<br> &gt;<br>
&gt; #!/bin/sh<br>
&gt; REV=`<span id="st" name="st" class="st">git</span>-<span id="st" name="st" \
class="st">svn</span> find-rev HEAD`<br> &gt; <span id="st" name="st" \
class="st">git</span>-diff --no-prefix $* HEAD | sed -e &#39;s/^+++ .*/&amp; \
&nbsp;(working copy)/&#39; -e<br> &gt; &quot;s/^--- .*/&amp; &nbsp;(revision \
$REV)/&quot;<br> <br>
</div>My preferred workflow would be:<br>
<br>
- Have master branch up to date from <span id="st" name="st" \
                class="st">SVN</span><br>
- Work on stuff in branches<br>
- Merge changes from master into those branches as I see \
fit</blockquote></span><div><br>You should rebase, not merge. \
;-)<br>&nbsp;</div><span class="q"><blockquote class="gmail_quote" \
style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt \
0.8ex;padding-left:1ex">

- When something in a branch should be committed, I&#39;d merge this commit into<br>
 &nbsp;master and dcommit it (possibly after going through RB)<br>
- When a branch is done, I&#39;d merge the whole branch into master and dcommit<br>
 &nbsp;that<br>
<br>
So that involves committing locally. Changing you scriptlet to find the latest<br>
<span id="st" name="st" class="st">SVN</span> revision would be necessary in that \
case, no?<br> <div><br></div></blockquote></span></div><br>the script looks good, you \
probably have to add<br><span id="st" name="st" class="st">git</span>-rev-list \
--date-order --max-count=1 &lt;<span id="st" name="st" class="st">git</span>-<span \
id="st" name="st" class="st">svn</span>&gt;<br clear="all"> <br>where &lt;<span \
id="st" name="st" class="st">git</span>-<span id="st" name="st" \
class="st">svn</span>&gt; is the name of the remote branch (<span id="st" name="st" \
class="st">git</span> branch -r)<br> which maps the <span id="st" name="st" \
class="st">svn</span> repo. that gives you the other argument for <span id="st" \
name="st" class="st">git</span> diff.</blockquote><div>&nbsp;</div>To bring this \
topic back, the shell script becomes:<br> </div><div></div>#!/bin/sh<br>REV=`<span \
id="st" name="st" class="st">git </span><span id="st" name="st" class="st">svn</span> \
find-rev $(git-rev-list --date-order --max-count=1 git-svn)`<br><span id="st" \
name="st" class="st">git </span>diff --no-prefix $* HEAD | sed -e &#39;s/^+++ \
.*/&amp; &nbsp;(working copy)/&#39; -e &quot;s/^--- .*/&amp; &nbsp;(revision \
$REV)/&quot;<br clear="all"> <p>Where the lastest &#39;git-svn&#39; in line 2 (the \
one just under #!/bin/sh) is the name of the remote branch which tracks \
svn.<br></p><p>And it&#39;s named &#39;git-svn&#39; by default...</p><p>Hope this \
helps... here works like a charm.</p> <p>-Riccardo</p>-- <br>GPG \
key:<br>3D0F6376<br>When encrypting, please encrypt also for this \
subkey:<br>9EBD7FE1<br>-----<br>Pace Peace Paix Paz Frieden Pax Pokój Friður Fred \
Béke 和平<br>Hasiti Lapé Hetep Malu Mир Wolakota Santiphap Irini Peoch \
שלום<br> Shanti Vrede Baris Rój Mír Taika Rongo Sulh Mir Py&#39;guapy 평화



_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic