Using git-svn with review board?

Riccardo Iaconelli riccardo at kde.org
Fri May 23 13:53:10 CEST 2008


On 3/18/08, Riccardo Iaconelli <riccardo at kde.org> wrote:
>
> 2008/3/18 Sebastian Kuegler <sebas at 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 평화
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/panel-devel/attachments/20080523/59813604/attachment.html 


More information about the Panel-devel mailing list