working with git-svn (was ...)

Derek Atkins derek at ihtfp.com
Mon Jul 1 17:56:35 EDT 2013


On Mon, July 1, 2013 5:41 pm, John Ralls wrote:
>
>
>> Why can't I:
>>
>> ( cd master-repo && git-svn-mirror )
>>
>> git clone --local -b <branch> master-repo branch-wc
>> cd branch-wc
>> ...
>> git-update
>> (do work)
>> git commit  (do I need to do this? -- I'm guessing I do)
>> git svn dcommit
>
> That's what I'm suggesting.

It seemed like you were suggesting more than this.  Basically I'm asking
if this would work:

[SVN REPO] -(git svn)> [GIT SVN (master-repo)] -(git)> [branch wc]
    ^                                                      |
    +----------------- (git svn dcommit) ------------------+

(where I would use either git-svn or git-svn-mirror in the first link,
and use git svn dcommit to push back from the branch wc to SVN)

>        Note that git-svn-mirror can push to a
> bare repo, but won't if one isn't specified with --git-repo. Git svn
> operates on a working repo, and git-svn-mirror uses git svn
> (via the perl API that's part of git) to fetch from the SVN repo. As long
> as you always dcommit from your WC and use git-update to keep the refs
> pointed
> in the right place, it should work fine. The bare repo thing is there just
> to
> be able to work with Github or Gitolite. Git-svn-mirror will whine if
> there's
> nothing to push to, but it will still work OK.

In my case there is no reason to have git-svn-mirror push to anything.  At
least, I don't see any reason to push to anything.

>>> Granted, you can script a lot of that, but it's still more work than
>>> having an intermediate maintained with
>>> git-svn-mirror from github.com/Gnucash/helper-scripts on your home
>>> network
>>> and updated via a commit
>>> hook or a cron job. Then you can git-update; git-svn-dcommit in each WC
>>> as
>>> needed without having to be
>>> bouncing between the git-svn-master and the WC for every batch of
>>> commits.
>>> Your laptop can have a
>>> mirror clone of the intermediate just as you're planning for Gnucash in
>>> order to consolidate fetches.
>>
>> What does git-svn-mirror do specially, beyond what a git svn fetch would
>> do in a "pull-only" repo?  I'm asking because I do not know exactly how
>> the existing git-svn repo is pulled/updated at work (yes, there is on).
>> So *theoretically* I could clone --mirror that one similarly to how I'd
>> work with the gnucash tree, but I'd only do that if I could dcommit back
>> without causing issues.  And honestly I don't know how to test that
>> without actually doing a commit.
>
> Git-svn-mirror's main job is to deal with the different way tags
> are handled in SVN and git: In SVN they're really branches, and in git
> they're
> just references. Git svn makes them git branches, then git-svn-mirror
> turns
> the tag branches into git tags. That works much better when you're using
> a git visualizer like gitk -- as long as nobody commits changes to a tag,
> which
> is fine with SVN but will cause trouble with git.

Okay, so the main thing that git-svn-mirror does beyond raw git-svn is
converting svn tags to git tags?  Is that the only thing?  If so, I
probably don't really care that much for work..

> As long as you dcommit back, the repo at the office won't be able to tell
> whether
> you committed with SVN or git. Do use git-update even if the office repo
> isn't
> changing the SVN tags into git tags (git update doesn't actually do
> anything with
> that) it will help keep your git svn pointers working correctly.

Okay, so I should always use git-update in my wc checkout, where I plan to
dcommit back, regardless whether upstream is using raw git-svn or
git-svn-mirror?  Got it.

Welcome to the brave new world.

-derek

-- 
       Derek Atkins                 617-623-3745
       derek at ihtfp.com             www.ihtfp.com
       Computer and Internet Security Consultant



More information about the gnucash-devel mailing list