git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git svn pointing at svn branch instead of trunk?
@ 2009-08-22 18:40 skillzero
  2009-08-22 20:46 ` Eric Wong
  2009-08-30 20:30 ` Daniele Segato
  0 siblings, 2 replies; 5+ messages in thread
From: skillzero @ 2009-08-22 18:40 UTC (permalink / raw)
  To: git

When I used git svn to clone a repository, it ended up pointing master
at a tag in svn instead of trunk. For example, git svn info shows the
URL for the tag instead of trunk. git log master also shows the most
recent commit is the creation of that tag in svn, but then the next
commit is the most recent commit to trunk. It's like it's mixing
things from the tag with things from trunk. The most recent commit in
svn was to create the tag that master is now pointing to in case that
matters.

Is there something in the svn repository that might cause this? What's
the correct way to reset what git svn thinks master should point to?
And how should I get rid of the commit on master that created the tag
without messing up git svn (e.g. can I just git reset or will that
confuse git svn later?).

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

* Re: git svn pointing at svn branch instead of trunk?
  2009-08-22 18:40 git svn pointing at svn branch instead of trunk? skillzero
@ 2009-08-22 20:46 ` Eric Wong
  2009-08-22 22:12   ` skillzero
  2009-08-30 20:30 ` Daniele Segato
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Wong @ 2009-08-22 20:46 UTC (permalink / raw)
  To: skillzero; +Cc: git

skillzero@gmail.com wrote:
> When I used git svn to clone a repository, it ended up pointing master
> at a tag in svn instead of trunk. For example, git svn info shows the
> URL for the tag instead of trunk. git log master also shows the most
> recent commit is the creation of that tag in svn, but then the next
> commit is the most recent commit to trunk. It's like it's mixing
> things from the tag with things from trunk. The most recent commit in
> svn was to create the tag that master is now pointing to in case that
> matters.

Hi,

So you have something like this?

----------trunk
              \
               \-> tag

It looks like it's mixed but that's because trunk is an ancestor of your
tag, so the majority of commits (see git-svn-id:) look like they're from
trunk except the latest git-svn-id: which should have the URL of the tag
in it.  So in short, everything here is OK.

> Is there something in the svn repository that might cause this? What's
> the correct way to reset what git svn thinks master should point to?
> And how should I get rid of the commit on master that created the tag
> without messing up git svn (e.g. can I just git reset or will that
> confuse git svn later?).

I changed this recently in b186a261b1f7ec1fbda8c5f6d84595f3a7716d92
git svn used to always pick the newest change in the entire SVN repo
to point master to, now it'll attempt to find "trunk" to be master.

You can git reset anything on your master without affecting git svn.

If you have commits on master, just cherry pick them to a new branch
that's based off trunk and then reset master to be that new branch.

-- 
Eric Wong

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

* Re: git svn pointing at svn branch instead of trunk?
  2009-08-22 20:46 ` Eric Wong
@ 2009-08-22 22:12   ` skillzero
  2009-08-23  2:51     ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: skillzero @ 2009-08-22 22:12 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

On Sat, Aug 22, 2009 at 1:46 PM, Eric Wong<normalperson@yhbt.net> wrote:

> So you have something like this?
>
> ----------trunk
>              \
>               \-> tag
>
> It looks like it's mixed but that's because trunk is an ancestor of your
> tag, so the majority of commits (see git-svn-id:) look like they're from
> trunk except the latest git-svn-id: which should have the URL of the tag
> in it.  So in short, everything here is OK.

Yes, that's what I see: most of the commits have a /trunk URL except
the last one has a /tags/TagX URL.

When the next commit happens on master (I don't have svn commit access
on the svn repo to try it myself), will git svn automatically track
master->trunk again? Or is there something I need to change to tell it
"master tracks svn's /trunk"? I normally do git svn fetch and git svn
rebase (while on master, I do all my own commits on a separate
branch).

> I changed this recently in b186a261b1f7ec1fbda8c5f6d84595f3a7716d92
> git svn used to always pick the newest change in the entire SVN repo
> to point master to, now it'll attempt to find "trunk" to be master.

Thanks, I'll build that and try it out. That sounds like what was confusing me.

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

* Re: git svn pointing at svn branch instead of trunk?
  2009-08-22 22:12   ` skillzero
@ 2009-08-23  2:51     ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2009-08-23  2:51 UTC (permalink / raw)
  To: skillzero; +Cc: git

skillzero@gmail.com wrote:
> On Sat, Aug 22, 2009 at 1:46 PM, Eric Wong<normalperson@yhbt.net> wrote:
> 
> > So you have something like this?
> >
> > ----------trunk
> >              \
> >               \-> tag
> >
> > It looks like it's mixed but that's because trunk is an ancestor of your
> > tag, so the majority of commits (see git-svn-id:) look like they're from
> > trunk except the latest git-svn-id: which should have the URL of the tag
> > in it.  So in short, everything here is OK.
> 
> Yes, that's what I see: most of the commits have a /trunk URL except
> the last one has a /tags/TagX URL.
> 
> When the next commit happens on master (I don't have svn commit access
> on the svn repo to try it myself), will git svn automatically track
> master->trunk again? Or is there something I need to change to tell it
> "master tracks svn's /trunk"? I normally do git svn fetch and git svn
> rebase (while on master, I do all my own commits on a separate
> branch).

You need to reset your master to trunk so it knows to track trunk
instead of tags/TagX

-- 
Eric Wong

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

* Re: git svn pointing at svn branch instead of trunk?
  2009-08-22 18:40 git svn pointing at svn branch instead of trunk? skillzero
  2009-08-22 20:46 ` Eric Wong
@ 2009-08-30 20:30 ` Daniele Segato
  1 sibling, 0 replies; 5+ messages in thread
From: Daniele Segato @ 2009-08-30 20:30 UTC (permalink / raw)
  To: skillzero; +Cc: git

Il giorno sab, 22/08/2009 alle 11.40 -0700, skillzero@gmail.com ha
scritto:
> When I used git svn to clone a repository, it ended up pointing master
> at a tag in svn instead of trunk. For example, git svn info shows the
> URL for the tag instead of trunk. git log master also shows the most
> recent commit is the creation of that tag in svn, but then the next
> commit is the most recent commit to trunk. It's like it's mixing
> things from the tag with things from trunk. The most recent commit in
> svn was to create the tag that master is now pointing to in case that
> matters.

I had the same problem a while ago.

When git-svn is done cloning you find yourself in the "master" branch
(check by executing git branch) and it's content is the last svn-commit.
If the last svn commit is a tag or in a branch you'll end up in that
tag/branch

> Is there something in the svn repository that might cause this? What's
> the correct way to reset what git svn thinks master should point to?
> And how should I get rid of the commit on master that created the tag
> without messing up git svn (e.g. can I just git reset or will that
> confuse git svn later?).

execute:
git branch -r

it will list all the remote branches:

usually one will be "trunk"

if you now execute:

git reset --hard remotes/trunk

it will reset your current local branch (master) to the remote trunk and
will start to truck that remote branch (trunk)

I'm a git newbie, so if i said something wrong I hope someone will
correct me.

Cheers,
Daniele

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

end of thread, other threads:[~2009-08-30 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-22 18:40 git svn pointing at svn branch instead of trunk? skillzero
2009-08-22 20:46 ` Eric Wong
2009-08-22 22:12   ` skillzero
2009-08-23  2:51     ` Eric Wong
2009-08-30 20:30 ` Daniele Segato

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