threads / discuss / 16179

git-svn: Having a "rare" structure

Subject: git-svn: Having a "rare" structure

## tl;dr

5 messages between Nov 5, 2008 and Nov 5, 2008.

replies: 4people: 2as markdown or json

Marc Fargas· Nov 5, 2008, 10:04 UTC · lore
Hi all,
First of all, please CC responses to me as I'm not subscribed to this list ;)

On the subject, I use git-svn to for most of my stuff and also to "interact" with some SVN projects out there, there's one that is driving me mad.

The Django project has a (somehow) rare SVN structure that I almost managet to make git-svn understand, but a recent "rarity" to the structure broke it again and I haven't succeeded in making git-svn understand it, so I'm trying to get some guidance on how to make git-svn understand the structure.

Right know the Django SVN repo is like that: browse: http://code.djangoproject.com/browser/django svn url: http://code.djangoproject.com/svn/django

trunk/ tags/notable_moments/ tags/releases/ branches/* branches/features/ branches/releases/

Until now, the last two didn't exist and git-svn was working nicely, but now "features" and "releases" were created, and git-svn is taking them as if they were branches, while they arent (branches are in subdirectories of those two).

My git repo was done like that until now:
    git svn init --prefix svn/
http://code.djangoproject.com/svn/django -T trunk -b branches -t
'tags/*/*'
    git svn fetch

With that, git-svn understood that tags were in the subdirectories of tags/{notable_moments,releases}/ but I can't do that with the branches as there are branches also in the top branches/ directory.

I do not really care about those branches on the top directory as those are old, so I really only need git-svn to understand the {features,releases}/* thing. So:

How can I do something like "-b branches/{features,releases}/*" making git-svn ignore the other top-level branches? Or, can I make it understand both, the top-level ones and the ones inside those two subdirectories?

Note that I just gueesed the "-b branches/{features,releases}/*" thing; I didn't try it, tryiing takes lots of time and bandwidth ;\\

Thanks for all, Marc

-- 
http://www.marcfargas.com - will be finished someday.
Michael J Gruber· Nov 5, 2008, 13:07 UTC · re: Marc Fargas · lore

Re: git-svn: Having a "rare" structure

Marc Fargas venit, vidit, dixit 05.11.2008 11:04:
Show 49 quoted lines
> Hi all,
> 
> First of all, please CC responses to me as I'm not subscribed to this list ;)
> 
> On the subject, I use git-svn to for most of my stuff and also to
> "interact" with some SVN projects out there, there's one that is
> driving me mad.
> 
> The Django project has a (somehow) rare SVN structure that I almost
> managet to make git-svn understand, but a recent "rarity" to the
> structure broke it again and I haven't succeeded in making git-svn
> understand it, so I'm trying to get some guidance on how to make
> git-svn understand the structure.
> 
> Right know the Django SVN repo is like that:
> browse: http://code.djangoproject.com/browser/django
> svn url:  http://code.djangoproject.com/svn/django
> 
> trunk/
> tags/notable_moments/
> tags/releases/
> branches/*
> branches/features/
> branches/releases/
> 
> Until now, the last two didn't exist and git-svn was working nicely,
> but now "features" and "releases" were created, and git-svn is taking
> them as if they were branches, while they arent (branches are in
> subdirectories of those two).
> 
> My git repo was done like that until now:
> 
>     git svn init --prefix svn/
> http://code.djangoproject.com/svn/django -T trunk -b branches -t
> 'tags/*/*'
>     git svn fetch
> 
> With that, git-svn understood that tags were in the subdirectories of
> tags/{notable_moments,releases}/ but I can't do that with the branches
> as there are branches also in the top branches/ directory.
> 
> I do not really care about those branches on the top directory as
> those are old, so I really only need git-svn to understand the
> {features,releases}/* thing. So:
> 
> How can I do something like "-b branches/{features,releases}/*" making
> git-svn ignore the other top-level branches? Or, can I make it
> understand both, the top-level ones and the ones inside those two
> subdirectories?

You can use "-T trunk -t 'tags/*/*'" and then set up the branches config by hand:

git config svn-remote.svn.branches 'django/branches/features/*:refs/remotes/svn/features/*'

git config --add svn-remote.svn.branches 'django/branches/releases/*:refs/remotes/svn/releases/*'

In fact, you should be able to use your previous branches config when fetching up to r9093, then switch to the config I suggested, and the fetch from r9094.

Cheers, Michael

Marc Fargas· Nov 5, 2008, 15:36 UTC · re: Michael J Gruber · lore

Re: git-svn: Having a "rare" structure

Hi,

On Wed, Nov 5, 2008 at 2:07 PM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 9 quoted lines
> git config svn-remote.svn.branches
> 'django/branches/features/*:refs/remotes/svn/features/*'
>
> git config --add svn-remote.svn.branches
> 'django/branches/releases/*:refs/remotes/svn/releases/*'
>
> In fact, you should be able to use your previous branches config when
> fetching up to r9093, then switch to the config I suggested, and the
> fetch from r9094.

I'll try it right now, I have one q... I've been fetching from svn so I now have "like a mess" in the branches dir (and their history) is there a way to make git-svn forget about everything after r9093 so I can do the config change and re-fetch since then? That'd be awesome.

Thanks a lot for the tip! ;)

Sincerelly, Marc

-- 
http://www.marcfargas.com - will be finished someday.
Michael J Gruber· Nov 5, 2008, 17:41 UTC · re: Marc Fargas · lore

Re: git-svn: Having a "rare" structure

Marc Fargas venit, vidit, dixit 05.11.2008 16:36:
Show 18 quoted lines
> Hi,
> 
> On Wed, Nov 5, 2008 at 2:07 PM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> git config svn-remote.svn.branches
>> 'django/branches/features/*:refs/remotes/svn/features/*'
>>
>> git config --add svn-remote.svn.branches
>> 'django/branches/releases/*:refs/remotes/svn/releases/*'
>>
>> In fact, you should be able to use your previous branches config when
>> fetching up to r9093, then switch to the config I suggested, and the
>> fetch from r9094.
> 
> I'll try it right now, I have one q... I've been fetching from svn so
> I now have "like a mess" in the branches dir (and their history) is
> there a way to make git-svn forget about everything after r9093 so I
> can do the config change and re-fetch since then? That'd be awesome.

You can delete the bogus branches (using git branch -rd or git update-ref -d), but I'm not sure if you can reset git svn's state info: You may try messing with .git/svn/.metadata.

I tried the approach I suggested in the last post for real, and things seem to work. Only gotcha is I don't know whether django folks will stick with putting branches under {releases,features}, that would create problems.

Cheers, Michael

Marc Fargas· Nov 5, 2008, 17:46 UTC · re: Michael J Gruber · lore

Re: git-svn: Having a "rare" structure

Hi,

On Wed, Nov 5, 2008 at 6:41 PM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

> You can delete the bogus branches (using git branch -rd or git
> update-ref -d), but I'm not sure if you can reset git svn's state info:
> You may try messing with .git/svn/.metadata.
I'll try it, if not I'll recreate the repo from scratch ;)) Thanks for the tips!
> I tried the approach I suggested in the last post for real, and things
> seem to work. Only gotcha is I don't know whether django folks will
> stick with putting branches under {releases,features}, that would create
> problems
They say they won't put more folders in branches/ ;))
Thanks again for the tips, that will solve lots of trouble. Thanks!

Cheers. Marc

-- 
http://www.marcfargas.com - will be finished someday.

← back to recent threads