git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn questions: how to clone/init non-standard layout branches/tags?
@ 2007-11-03  8:19 Luke Lu
  2007-11-03 10:56 ` Benoit SIGOURE
  0 siblings, 1 reply; 9+ messages in thread
From: Luke Lu @ 2007-11-03  8:19 UTC (permalink / raw)
  To: git

There are a few svn repositories that use non-standard layout like this:

<path_to_project>/trunk
<path_to_project>/production
<path_to_project>/some_branch

production and some_branch are indeed branched from trunk.

1. How do you init/clone svn repositories like that?
2. Is there a way to add a new svn branch like that (say production  
or some_branch) to an existing git-svn repository that has trunk cloned?

Thanks!

__Luke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03  8:19 git-svn questions: how to clone/init non-standard layout branches/tags? Luke Lu
@ 2007-11-03 10:56 ` Benoit SIGOURE
  2007-11-03 13:59   ` Lars Hjemli
  0 siblings, 1 reply; 9+ messages in thread
From: Benoit SIGOURE @ 2007-11-03 10:56 UTC (permalink / raw)
  To: Luke Lu; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:

> There are a few svn repositories that use non-standard layout like  
> this:
>
> <path_to_project>/trunk
> <path_to_project>/production
> <path_to_project>/some_branch
>
> production and some_branch are indeed branched from trunk.
>
> 1. How do you init/clone svn repositories like that?

I seem to remember that you can pass more than one `-b' option to git- 
svn clone, so I'd basically do (untested):
git svn clone <url> -T trunk -b production -b some_branch

> 2. Is there a way to add a new svn branch like that (say production  
> or some_branch) to an existing git-svn repository that has trunk  
> cloned?

I don't know, but that'd be great indeed.

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 10:56 ` Benoit SIGOURE
@ 2007-11-03 13:59   ` Lars Hjemli
  2007-11-03 20:01     ` Luke Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Hjemli @ 2007-11-03 13:59 UTC (permalink / raw)
  To: Benoit SIGOURE; +Cc: Luke Lu, git

On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:
> > 2. Is there a way to add a new svn branch like that (say production
> > or some_branch) to an existing git-svn repository that has trunk
> > cloned?
>
> I don't know, but that'd be great indeed.
>

You can simply add "fetch" lines to  the relevant "svn-remote" section
in .git/config.

-- 
larsh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 13:59   ` Lars Hjemli
@ 2007-11-03 20:01     ` Luke Lu
  2007-11-03 20:32       ` Lars Hjemli
  0 siblings, 1 reply; 9+ messages in thread
From: Luke Lu @ 2007-11-03 20:01 UTC (permalink / raw)
  To: Lars Hjemli; +Cc: Benoit SIGOURE, git


On Nov 3, 2007, at 6:59 AM, Lars Hjemli wrote:

> On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
>> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:
>>> 2. Is there a way to add a new svn branch like that (say production
>>> or some_branch) to an existing git-svn repository that has trunk
>>> cloned?
>>
>> I don't know, but that'd be great indeed.
>>
>
> You can simply add "fetch" lines to  the relevant "svn-remote" section
> in .git/config.

I did try to add a "fetch" line for the production branch like this:

[svn-remote "svn"]
         url = svn+ssh://host/svn/project
         fetch = production:refs/remotes/svn-prod
         fetch = trunk:refs/remotes/git-svn

which is modeled after http://lists-archives.org/git/420712-git-svn- 
remote-tracking-branch-question.html

But when I try to checkout the production branch like this:

git checkout -b prod remotes/svn-prod

I got this:
git checkout: updating paths is incompatible with switching branches/ 
forcing
Did you intend to checkout 'remotes/svn-prod' which can not be  
resolved as commit?

Can you shed some light on this? (git version is 1.5.3.4)

Thanks!

__Luke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 20:01     ` Luke Lu
@ 2007-11-03 20:32       ` Lars Hjemli
  2007-11-03 20:41         ` Luke Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Hjemli @ 2007-11-03 20:32 UTC (permalink / raw)
  To: Luke Lu; +Cc: Benoit SIGOURE, git

On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:
> On Nov 3, 2007, at 6:59 AM, Lars Hjemli wrote:
> > On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
> >> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:
> >>> 2. Is there a way to add a new svn branch like that (say production
> >>> or some_branch) to an existing git-svn repository that has trunk
> >>> cloned?
> >>
> >> I don't know, but that'd be great indeed.
> >>
> >
> > You can simply add "fetch" lines to  the relevant "svn-remote" section
> > in .git/config.
>
> I did try to add a "fetch" line for the production branch like this:
>
> [svn-remote "svn"]
>          url = svn+ssh://host/svn/project
>          fetch = production:refs/remotes/svn-prod
>          fetch = trunk:refs/remotes/git-svn
>
> which is modeled after http://lists-archives.org/git/420712-git-svn-
> remote-tracking-branch-question.html
>
> But when I try to checkout the production branch like this:
>
> git checkout -b prod remotes/svn-prod
>
> I got this:
> git checkout: updating paths is incompatible with switching branches/
> forcing
> Did you intend to checkout 'remotes/svn-prod' which can not be
> resolved as commit?

Did you forget to run 'git svn fetch' after modifying your .git/config?

--
larsh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 20:32       ` Lars Hjemli
@ 2007-11-03 20:41         ` Luke Lu
  2007-11-03 20:52           ` Lars Hjemli
  0 siblings, 1 reply; 9+ messages in thread
From: Luke Lu @ 2007-11-03 20:41 UTC (permalink / raw)
  To: Lars Hjemli; +Cc: Benoit SIGOURE, git


On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:

> On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:
>> On Nov 3, 2007, at 6:59 AM, Lars Hjemli wrote:
>>> On Nov 3, 2007 11:56 AM, Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
>>>> On Nov 3, 2007, at 9:19 AM, Luke Lu wrote:
>>>>> 2. Is there a way to add a new svn branch like that (say  
>>>>> production
>>>>> or some_branch) to an existing git-svn repository that has trunk
>>>>> cloned?
>>>>
>>>> I don't know, but that'd be great indeed.
>>>>
>>>
>>> You can simply add "fetch" lines to  the relevant "svn-remote"  
>>> section
>>> in .git/config.
>>
>> I did try to add a "fetch" line for the production branch like this:
>>
>> [svn-remote "svn"]
>>          url = svn+ssh://host/svn/project
>>          fetch = production:refs/remotes/svn-prod
>>          fetch = trunk:refs/remotes/git-svn
>>
>> which is modeled after http://lists-archives.org/git/420712-git-svn-
>> remote-tracking-branch-question.html
>>
>> But when I try to checkout the production branch like this:
>>
>> git checkout -b prod remotes/svn-prod
>>
>> I got this:
>> git checkout: updating paths is incompatible with switching branches/
>> forcing
>> Did you intend to checkout 'remotes/svn-prod' which can not be
>> resolved as commit?
>
> Did you forget to run 'git svn fetch' after modifying your .git/ 
> config?

Yes, I did. It didn't seem to do anything. $? is 0. the master/trunk  
is up-to-date but the production branch has never been fetched. If  
this is supposed to work, the fetch might be triggered upon next  
update in trunk?

__Luke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 20:41         ` Luke Lu
@ 2007-11-03 20:52           ` Lars Hjemli
  2007-11-03 21:26             ` Luke Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Hjemli @ 2007-11-03 20:52 UTC (permalink / raw)
  To: Luke Lu; +Cc: Benoit SIGOURE, git

On Nov 3, 2007 9:41 PM, Luke Lu <git@vicaya.com> wrote:
> On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:
> > On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:
> >> I did try to add a "fetch" line for the production branch like this:
> >>
> >> [svn-remote "svn"]
> >>          url = svn+ssh://host/svn/project
> >>          fetch = production:refs/remotes/svn-prod
> >>          fetch = trunk:refs/remotes/git-svn
> >>
> >> which is modeled after http://lists-archives.org/git/420712-git-svn-
> >> remote-tracking-branch-question.html
> >>
> > Did you forget to run 'git svn fetch' after modifying your .git/
> > config?
>
> Yes, I did. It didn't seem to do anything.

Hmm, it works for me, I've been adding and removing branches like this
for months, but my .git/config is slightly different:

[svn-remote "svn"]
        url = svn://example.org
        fetch = project/trunk:refs/remotes/svn/trunk
        fetch = project/branches/topic:refs/remotes/svn/topic

I don't know if this difference is important, though...

-- 
larsh

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 20:52           ` Lars Hjemli
@ 2007-11-03 21:26             ` Luke Lu
  2007-11-07 22:56               ` Luke Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Luke Lu @ 2007-11-03 21:26 UTC (permalink / raw)
  To: Lars Hjemli; +Cc: Benoit SIGOURE, git


On Nov 3, 2007, at 1:52 PM, Lars Hjemli wrote:

> On Nov 3, 2007 9:41 PM, Luke Lu <git@vicaya.com> wrote:
>> On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:
>>> On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:
>>>> I did try to add a "fetch" line for the production branch like  
>>>> this:
>>>>
>>>> [svn-remote "svn"]
>>>>          url = svn+ssh://host/svn/project
>>>>          fetch = production:refs/remotes/svn-prod
>>>>          fetch = trunk:refs/remotes/git-svn
>>>>
>>>> which is modeled after http://lists-archives.org/git/420712-git- 
>>>> svn-
>>>> remote-tracking-branch-question.html
>>>>
>>> Did you forget to run 'git svn fetch' after modifying your .git/
>>> config?
>>
>> Yes, I did. It didn't seem to do anything.
>
> Hmm, it works for me, I've been adding and removing branches like this
> for months, but my .git/config is slightly different:
>
> [svn-remote "svn"]
>         url = svn://example.org
>         fetch = project/trunk:refs/remotes/svn/trunk
>         fetch = project/branches/topic:refs/remotes/svn/topic
>
> I don't know if this difference is important, though...

I tried to test this on a local repository like file:///path/project.  
It seems to work and get everything properly upon git svn fetch.  
However it doesn't work for the production branch. If I modify the  
fetch line a bit to svn/prod instead of svn-prod and try git svn  
fetch again. It would hang for about 2 minutes and return 0 and show  
nothing in progress. A .git/svn/svn/prod directory is created but  
it's empty.

One thing that might be special for this branch is that it gets  
deleted and recreated/copied all the time from trunk. I wonder if git- 
svn use some kind of heuristics to determine if there is anything to  
fetch and silently failing...

__Luke

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: git-svn questions: how to clone/init non-standard layout branches/tags?
  2007-11-03 21:26             ` Luke Lu
@ 2007-11-07 22:56               ` Luke Lu
  0 siblings, 0 replies; 9+ messages in thread
From: Luke Lu @ 2007-11-07 22:56 UTC (permalink / raw)
  To: Luke Lu; +Cc: Lars Hjemli, Benoit SIGOURE, git

In case others encounter this problem and want to find a solution...

On Nov 3, 2007, at 2:26 PM, Luke Lu wrote:
> On Nov 3, 2007, at 1:52 PM, Lars Hjemli wrote:
>> On Nov 3, 2007 9:41 PM, Luke Lu <git@vicaya.com> wrote:
>>> On Nov 3, 2007, at 1:32 PM, Lars Hjemli wrote:
>>>> On Nov 3, 2007 9:01 PM, Luke Lu <git@vicaya.com> wrote:
>>>>> I did try to add a "fetch" line for the production branch like  
>>>>> this:
>>>>>
>>>>> [svn-remote "svn"]
>>>>>          url = svn+ssh://host/svn/project
>>>>>          fetch = production:refs/remotes/svn-prod
>>>>>          fetch = trunk:refs/remotes/git-svn
>>>>>
>>>>> which is modeled after http://lists-archives.org/git/420712-git- 
>>>>> svn-
>>>>> remote-tracking-branch-question.html
>>>>>
>>>> Did you forget to run 'git svn fetch' after modifying your .git/
>>>> config?
>>>
>>> Yes, I did. It didn't seem to do anything.
>>
>> Hmm, it works for me, I've been adding and removing branches like  
>> this
>> for months, but my .git/config is slightly different:
>>
>> [svn-remote "svn"]
>>         url = svn://example.org
>>         fetch = project/trunk:refs/remotes/svn/trunk
>>         fetch = project/branches/topic:refs/remotes/svn/topic
>>
>> I don't know if this difference is important, though...
>
> I tried to test this on a local repository like file:///path/ 
> project. It seems to work and get everything properly upon git svn  
> fetch. However it doesn't work for the production branch. If I  
> modify the fetch line a bit to svn/prod instead of svn-prod and try  
> git svn fetch again. It would hang for about 2 minutes and return 0  
> and show nothing in progress. A .git/svn/svn/prod directory is  
> created but it's empty.
>
> One thing that might be special for this branch is that it gets  
> deleted and recreated/copied all the time from trunk. I wonder if  
> git-svn use some kind of heuristics to determine if there is  
> anything to fetch and silently failing...

After some permutations, this is the config that worked for me:

[svn-remote "svn"]
	url = svn+ssh://host/svn
	fetch = project/trunk:refs/remotes/git-svn
	fetch = project/production:refs/remotes/svn/production

The primary difference is that I moved 'project' from url to the  
fetch specs. My original single trunk config looked like this:

[svn-remote "svn"]
	url = svn+ssh://host/svn/project/trunk
	fetch = :refs/remotes/git-svn

I wish that "git svn fetch" could be more verbose about what's going  
on in this case.

__Luke

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-11-07 22:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-03  8:19 git-svn questions: how to clone/init non-standard layout branches/tags? Luke Lu
2007-11-03 10:56 ` Benoit SIGOURE
2007-11-03 13:59   ` Lars Hjemli
2007-11-03 20:01     ` Luke Lu
2007-11-03 20:32       ` Lars Hjemli
2007-11-03 20:41         ` Luke Lu
2007-11-03 20:52           ` Lars Hjemli
2007-11-03 21:26             ` Luke Lu
2007-11-07 22:56               ` Luke Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).