git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* how to fetch a new svn branch after clone?
@ 2009-07-16 15:30 Changsheng Jiang
  2009-07-16 20:26 ` Marc Branchaud
  0 siblings, 1 reply; 5+ messages in thread
From: Changsheng Jiang @ 2009-07-16 15:30 UTC (permalink / raw)
  To: git

Hi list,

I know how to clone a svn repository with all branches and tags at the
initial step, but I find no answers of how to fetch a new svn branch
after clone.

For example, this

git svn clone http://svn.example.com/project -T trunk -b branches -t tags

will clone all branches. but that clone, the svn repository has a new
branch test with url http://svn.example.com/project/test, how to clone
it as the initial step?

Thanks.

                                                     Changsheng Jiang

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

* Re: how to fetch a new svn branch after clone?
  2009-07-16 15:30 how to fetch a new svn branch after clone? Changsheng Jiang
@ 2009-07-16 20:26 ` Marc Branchaud
  2009-07-17  2:00   ` Changsheng Jiang
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Branchaud @ 2009-07-16 20:26 UTC (permalink / raw)
  To: Changsheng Jiang; +Cc: git

The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.

However, before I describe that, can you confirm whether your new branch is in fact named

	http://svn.example.com/project/test

or is it really

	http://svn.example.com/project/test/<branchname>

Because if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').

However, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like

	branches = test/*:refs/remotes/*

might let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.

		M.


Changsheng Jiang wrote:
> Hi list,
> 
> I know how to clone a svn repository with all branches and tags at the
> initial step, but I find no answers of how to fetch a new svn branch
> after clone.
> 
> For example, this
> 
> git svn clone http://svn.example.com/project -T trunk -b branches -t tags
> 
> will clone all branches. but that clone, the svn repository has a new
> branch test with url http://svn.example.com/project/test, how to clone
> it as the initial step?
> 
> Thanks.
> 
>                                                      Changsheng Jiang
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: how to fetch a new svn branch after clone?
  2009-07-16 20:26 ` Marc Branchaud
@ 2009-07-17  2:00   ` Changsheng Jiang
       [not found]     ` <6786ed4f0907161918t5d4489a5uf1c315b07f850e2e@mail.gmail.com>
  2009-07-17 16:09     ` Marc Branchaud
  0 siblings, 2 replies; 5+ messages in thread
From: Changsheng Jiang @ 2009-07-17  2:00 UTC (permalink / raw)
  To: Marc Branchaud; +Cc: git

Thank Marc.

You are right, it should be the latter case with url
http://www.example.com/project/branches/test

But "git svn clone" has already added these lines to .git/config

[svn-remote "svn"]
	url = https://xxx.xxxx.com/svn/xxx
	fetch = trunk:refs/remotes/trunk
	branches = branches/*:refs/remotes/*
	tags = tags/*:refs/remotes/tags/*

And it still can not fetch new branch.

                                                      Changsheng Jiang

On Fri, Jul 17, 2009 at 04:26, Marc Branchaud<marcnarc@xiplink.com> wrote:
> The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.
>
> However, before I describe that, can you confirm whether your new branch is in fact named
>
>        http://svn.example.com/project/test
>
> or is it really
>
>        http://svn.example.com/project/test/<branchname>
>
> Because if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').
>
> However, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like
>
>        branches = test/*:refs/remotes/*
>
> might let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.
>
>                M.
>
>
> Changsheng Jiang wrote:
>> Hi list,
>>
>> I know how to clone a svn repository with all branches and tags at the
>> initial step, but I find no answers of how to fetch a new svn branch
>> after clone.
>>
>> For example, this
>>
>> git svn clone http://svn.example.com/project -T trunk -b branches -t tags
>>
>> will clone all branches. but that clone, the svn repository has a new
>> branch test with url http://svn.example.com/project/test, how to clone
>> it as the initial step?
>>
>> Thanks.
>>
>>                                                      Changsheng Jiang
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

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

* Re: how to fetch a new svn branch after clone?
       [not found]     ` <6786ed4f0907161918t5d4489a5uf1c315b07f850e2e@mail.gmail.com>
@ 2009-07-17  2:25       ` Changsheng Jiang
  0 siblings, 0 replies; 5+ messages in thread
From: Changsheng Jiang @ 2009-07-17  2:25 UTC (permalink / raw)
  To: Allen Johnson; +Cc: git

Thank Allen.

I deleted some branches in local git repository, since it's no need to
track every one's branch.

And after that, ''git svn fetch'' report error like this:

error: invalid object a0eb1d6f18d20c0b9f30062cd981e9b668aac75f
fatal: git-write-tree: error building trees
write-tree: command returned error: 128

Is it wrong to delete some svn branches in git by "git branch -r -d branch_name"

                                                      Changsheng Jiang



On Fri, Jul 17, 2009 at 10:18, Allen Johnson<akjohnson78@gmail.com> wrote:
> This setup works for me:
>
> # create branch directly in svn
> svn copy svn://hostname/project/trunk
> svn://hostname/project/branches/test -m "test"
>
> # update your local git repository
> git svn fetch
>
> # verify you have the branch by listing all remote branches
> git branch -r
>
> # you should see "test" in the list, now checkout that branch and do some work
> git checkout -b local-test test
>
> # perform some commits on that branch then sync with svn
> git commit ...
> git svn rebase
> git svn dcommit
>
> Hope that works for you.
>
> Allen
>
> On Thu, Jul 16, 2009 at 10:00 PM, Changsheng Jiang<jiangzuoyan@gmail.com> wrote:
>> Thank Marc.
>>
>> You are right, it should be the latter case with url
>> http://www.example.com/project/branches/test
>>
>> But "git svn clone" has already added these lines to .git/config
>>
>> [svn-remote "svn"]
>>        url = https://xxx.xxxx.com/svn/xxx
>>        fetch = trunk:refs/remotes/trunk
>>        branches = branches/*:refs/remotes/*
>>        tags = tags/*:refs/remotes/tags/*
>>
>> And it still can not fetch new branch.
>>
>>                                                      Changsheng Jiang
>>
>> On Fri, Jul 17, 2009 at 04:26, Marc Branchaud<marcnarc@xiplink.com> wrote:
>>> The latest 1.6.4-rc1 contains patches to git-svn for it to support more than one branch URL in an svn repository.
>>>
>>> However, before I describe that, can you confirm whether your new branch is in fact named
>>>
>>>        http://svn.example.com/project/test
>>>
>>> or is it really
>>>
>>>        http://svn.example.com/project/test/<branchname>
>>>
>>> Because if it's the former then I'm not sure if git-svn can handle your new branch.  The problem is that even though the branch is named 'test' it's a sibling to the 'branches' 'tags' and 'trunk' paths in the repository.  For git-svn to pick up branches, you point it at the path *containing* the branch names.  In the former case, to pick up project/test as the 'test' branch you'd have to point git-svn at the project directory, and that would cause it to also pick up project/tags, project/branches, and project/trunk as other branches (named 'tags', 'branches' and 'trunk').
>>>
>>> However, in the latter (test/<branchname>) case, with 1.6.4, I *think* git-svn will pick up the new branches under test if you add a new 'branches' line to the svn-remote's section in your .git/config file.  Something like
>>>
>>>        branches = test/*:refs/remotes/*
>>>
>>> might let you see the new branches.  The reason I can't be more certain is that if you've done a 'git svn fetch' since the branch was created then git-svn might not pick up the branch-creation commits later.  Unfortunately I don't know git-svn well enough to say for certain.
>>>
>>>                M.
>>>
>>>
>>> Changsheng Jiang wrote:
>>>> Hi list,
>>>>
>>>> I know how to clone a svn repository with all branches and tags at the
>>>> initial step, but I find no answers of how to fetch a new svn branch
>>>> after clone.
>>>>
>>>> For example, this
>>>>
>>>> git svn clone http://svn.example.com/project -T trunk -b branches -t tags
>>>>
>>>> will clone all branches. but that clone, the svn repository has a new
>>>> branch test with url http://svn.example.com/project/test, how to clone
>>>> it as the initial step?
>>>>
>>>> Thanks.
>>>>
>>>>                                                      Changsheng Jiang
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe git" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

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

* Re: how to fetch a new svn branch after clone?
  2009-07-17  2:00   ` Changsheng Jiang
       [not found]     ` <6786ed4f0907161918t5d4489a5uf1c315b07f850e2e@mail.gmail.com>
@ 2009-07-17 16:09     ` Marc Branchaud
  1 sibling, 0 replies; 5+ messages in thread
From: Marc Branchaud @ 2009-07-17 16:09 UTC (permalink / raw)
  To: Changsheng Jiang; +Cc: git

Changsheng Jiang wrote:
> Thank Marc.
> 
> You are right, it should be the latter case with url
> http://www.example.com/project/branches/test

Hmmm, that isn't a case I mentioned in my previous email.  Are you saying that the layout is actually

	http://www.example.com/project/branches/<some branches>
	http://www.example.com/project/branches/test/<some other branches>

If that's the case I think you might be stuck.  I think git-svn can't handle that layout (with branch names under both branches/ and branches/test/).

> But "git svn clone" has already added these lines to .git/config
> 
> [svn-remote "svn"]
> 	url = https://xxx.xxxx.com/svn/xxx
> 	fetch = trunk:refs/remotes/trunk
> 	branches = branches/*:refs/remotes/*
> 	tags = tags/*:refs/remotes/tags/*
> 
> And it still can not fetch new branch.

Yes.  If you had a layout that git-svn supported, you would need to add a _second_ branches line.

		M.

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

end of thread, other threads:[~2009-07-17 16:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 15:30 how to fetch a new svn branch after clone? Changsheng Jiang
2009-07-16 20:26 ` Marc Branchaud
2009-07-17  2:00   ` Changsheng Jiang
     [not found]     ` <6786ed4f0907161918t5d4489a5uf1c315b07f850e2e@mail.gmail.com>
2009-07-17  2:25       ` Changsheng Jiang
2009-07-17 16:09     ` Marc Branchaud

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).