git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Standard "git svn init ; git svn fetch" behavior
@ 2008-07-15 11:24 "Peter Valdemar Mørch (Lists)"
  2008-07-15 14:37 ` Peter Harris
  0 siblings, 1 reply; 3+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2008-07-15 11:24 UTC (permalink / raw)
  To: git

Hi,

I've now converted my svn repos to git with

$ git-svn init -T trunk -t tags -b branches file://some/path
$ git svn fetch

Wonderful!

I have two questions about the result:

1) It seems the svn tags were converted into git branches such as 
"tags/mytag". Is that normal?

2) Why does master end up being off of tags/mytag instead of off of trunk?

###################################
Re: 1) It seems the svn tags were converted into git branches such as 
"tags/mytag". Is that normal?
###################################

$ git tag -l
returns nothing and
$ git branch -a
returns all my svn tags as "tags/<tag>" git branches and all my svn 
branches as expected in "the root".

Is that by design? Are there any downsides of creating a script that

foreach $tag ( m|tags/(.*)| ) {
   git tag $tag $tag
   git branch -r -D $tag
}

I'm cool with doing that, I just wanted to know if this is the expected 
behaviour, and/or whether I'll run into trouble later because of a 
wierdly converted subversion repository.


###################################
Re: 2) Why does master end up being off of tags/mytag instead of off of 
trunk?
###################################

I would have expected, that "master" ended up tracking "trunk", and not 
tags/mytag. Why track an obscure tag instead of trunk?

The tail of the fetch:

Successfully followed parent
W: +empty_dir: tags/mytag/probe/userHomedir/foo/cache/zlcache
W: +empty_dir: tags/mytag/probe/userHomedir/foo/pna_menu_items
r7375 = 5d3012afabccd348a5a5b81c5cf28532d324ea1b (tags/mytag)
Checking out files: 100% (2184/2184), done.
Checked out HEAD:
   file:///home/pvm/cm/repos/tags/mytag r7375

("mytag" and "foo" replaced internal identifiers present in real output...)

$ git log --pretty=oneline --decorate -n 1

5d3012afabccd348a5a5b81c5cf28532d324ea1b (refs/remotes/tags/mytag, 
refs/heads/master) Tag mytag

I rectified it with simply

$ git branch -m master old
$ git checkout -b master trunk
$ git branch -d old

Just wondering: Why is this behaviour the default? Is it a bug?

Is there a smarter way to find out what branchpoint was used to create 
"master"? (I'm new to git, and find it difficult to see what my branches 
were "made from")

Peter

-- 
Peter Valdemar Mørch
http://www.morch.com

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

* Re: Standard "git svn init ; git svn fetch" behavior
  2008-07-15 11:24 Standard "git svn init ; git svn fetch" behavior "Peter Valdemar Mørch (Lists)"
@ 2008-07-15 14:37 ` Peter Harris
  2008-07-15 20:14   ` "Peter Valdemar Mørch (Lists)"
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Harris @ 2008-07-15 14:37 UTC (permalink / raw)
  To: Peter Valdemar Mørch (Lists); +Cc: git

On Tue, Jul 15, 2008 at 7:24 AM, "Peter Valdemar Mørch (Lists)" wrote:
>
> 1) It seems the svn tags were converted into git branches such as
> "tags/mytag". Is that normal?

Yes.

Subversion doesn't really have tags. They're just branches with 'tag'
in the name. git-svn wants them to be branches on the git side so that
it can track future commits to the 'tag'.

> Re: 2) Why does master end up being off of tags/mytag instead of off of
> trunk?
>
> I would have expected, that "master" ended up tracking "trunk", and not
> tags/mytag. Why track an obscure tag instead of trunk?

Some projects work on trunk and keep a maint branch. Some projects
work on branches, and only merge bug fixes to trunk. To facilitate
this model, git-svn tries to guess which branch is your working
branch, and picks that one to be master.

In this case, you were unlucky enough to have the most recent commit
be on a tag-branch.

> Is there a smarter way to find out what branchpoint was used to create
> "master"? (I'm new to git, and find it difficult to see what my branches
> were "made from")

Git doesn't know what any particular branch was "made from", as the
branch point in question may be an ancestor of any number of other
branches.

git-svn does keep track of the subversion branch you are working on.
"git svn info"

Peter Harris

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

* Re: Standard "git svn init ; git svn fetch" behavior
  2008-07-15 14:37 ` Peter Harris
@ 2008-07-15 20:14   ` "Peter Valdemar Mørch (Lists)"
  0 siblings, 0 replies; 3+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2008-07-15 20:14 UTC (permalink / raw)
  Cc: git

Peter, thanks for your swift reply! It cleared up things for me.

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

end of thread, other threads:[~2008-07-15 20:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15 11:24 Standard "git svn init ; git svn fetch" behavior "Peter Valdemar Mørch (Lists)"
2008-07-15 14:37 ` Peter Harris
2008-07-15 20:14   ` "Peter Valdemar Mørch (Lists)"

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