On 17/06/2009, Bernd Jendrissek <bernd.jendris...@gmail.com> wrote:
> On Thu, Jun 18, 2009 at 12:54 AM, Matthias
> Pfafferodt<matthias.pfaffer...@mapfa.de> wrote:
>> at the moment I use svn to work with the freeciv code. For each patchset I
>> create a copy of the svn repo using 'cp -lr'. It is not the best way but
>> working ...
>>
>> How would I'm using git (my own local git repo) for the freeciv source
>> code? I
>> found git-svnimport and also more than enough web sides to explain git.
>> But
>> how to handle different patchsets? Create a new branch for each? Up to now
>> I
>> used cvs on my own projects (only one user) but with the freeciv code it
>> is
>> kind of confusing, especially rebasing to the up-to-date svn.
>
> My experience (we did it with git-svn here at work) is that it's a bit
> of an impedance mismatch; svn's limitations impose limitations on how
> you use git (I don't know if git-svnimport is any better): merges seem
> to make SVN go "WTF?" and freak out.
>
> Although I've never tried, I guess you could use a separate branch for
> each patchset, if you take care with how you bring it back into SVN.

Separate branches is what I use with git-svn, making a new branch
whenever I need to build on changes not yet in the main branch
(i.e. trunk, S2_1, etc.). As a contributor one has to submit patches
for inspection anyway, so when I do go to commit something, I just
checkout the destination branch, apply the previously posted patch
file, commit to git, then dcommit with git-svn. Unfortunately since
the underlying repo is still svn, we cannot use the powerful branch
merging features of git. :(

A while ago I wrote a mini intro to using git with freeciv svn:
https://mail.gna.org/public/freeciv-dev/2008-03/msg00048.html

Though that was over a year ago and I'm sure that some git
commands have changed since then (if something fails check
the updated docs).

As a matter of convenience I have a separate git repository for
S2_1, since there are many autoconf/packet related changes
which would require a complete ./autogen.sh && make whenever
switching to trunk.

I also like having a bunch of shell aliases for commonly used
command sequences:

alias gb='git branch'
alias gba='git branch -a'
alias gci='git commit -v'
alias gco='git checkout'
alias gd='git diff'
alias gdc='git diff --color'
alias gdci='git-svn dcommit'
alias gl='git log'
alias glt='git log --pretty=format:"%s%n%n%b"'
alias gps='git push'
alias gpu='git pull'
alias gr='git reset'
alias greb='git-svn rebase'
alias gsh='git show'
alias gshc='git show --stat -p --color'
alias gst='git status'


Using git branches is much more space efficient than copying
the svn repo each time, and incomparably faster. This was
actually the main reason I learned to use git a long time, though
git has many more advantages beyond just that. ;)


----------------------------------------------------------------
あなたも同化される。

_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to