# Fwd: git svn with non-standard svn layout

2 messages from 2011-09-24 to 2011-09-25. Participants: Chris Harris, Phil Hord.
Thread: https://gitlist.dev/t/28484

## Chris Harris, 2011-09-24 18:37

Subject: Fwd: git svn with non-standard svn layout
Message-ID: <CANPpUWxnp3-ySO3oBEsWTQA=oWXEzKS1bddP9LjAsR1EyPxbVQ@mail.gmail.com>
URL: https://gitlist.dev/e/CANPpUWxnp3-ySO3oBEsWTQA%3DoWXEzKS1bddP9LjAsR1EyPxbVQ%40mail.gmail.com
In-Reply-To: <CANPpUWyX+n7kMKZpCV=Oy=UmJb=9H=uZseYzU2-h1FLh2nzg8w@mail.gmail.com>

```
I am using  git version 1.7.6.4 built from the latest stable source on
github.   Running Ubuntu with kernel 2.6.38-11-generic

I can't seem to git git svn to see my branches correctly.
Unfortunately my svn repository is not open source, so I can not post
it here, but I will try to explain my issue.
We use a non standard svn layout like the following
branches
        V4.1
                V4.1.0
                V4.1.1
dev


dev is our trunk, and our branches have 2 levels.
I first use git init, then setup my config as follows
[svn-remote "svn"]
url = file:///home/chris/svnrepo
fetch = dev:refs/remotes/trunk
branches = branches/V4.1/{V4.1.1}:refs/remotes/branches/*
For this example I am just trying to make a single branch work.
After a fetch all revisions are ok. master correctly points to
remotes/trunk,but gitk shows the following:

o remotes/branches/V4.1.1
|
o some commit
|
|
|    o master - remotes/trunk
|    |
|    o another commit
|    /
|
etc
( sorry for the bad ascii art. )
My issue is that trunk ( master ) appears to be a  branch from V4.1.1
instead of  V4.1.1 being a branch from trunk ( master )
git log --graph shows the same structure.
Any suggestions on how to configure this so git svn maps my
non-standard layout correctly?
Thank you
Chris

```

## Phil Hord, 2011-09-25 03:45

Subject: Re: git svn with non-standard svn layout
Message-ID: <CABURp0qcS4qNuKDjC=g2tak+1eQWyzgVj_8ac9u1mdm4uX0yMg@mail.gmail.com>
URL: https://gitlist.dev/e/CABURp0qcS4qNuKDjC%3Dg2tak%2B1eQWyzgVj_8ac9u1mdm4uX0yMg%40mail.gmail.com
In-Reply-To: <CANPpUWxnp3-ySO3oBEsWTQA=oWXEzKS1bddP9LjAsR1EyPxbVQ@mail.gmail.com>

```
On Sat, Sep 24, 2011 at 2:37 PM, Chris Harris <chris.harris123@gmail.com> wrote:
> I am using  git version 1.7.6.4 built from the latest stable source on
> github.   Running Ubuntu with kernel 2.6.38-11-generic
>
> I can't seem to git git svn to see my branches correctly.
> Unfortunately my svn repository is not open source, so I can not post
> it here, but I will try to explain my issue.
> We use a non standard svn layout like the following
> branches
>         V4.1
>                 V4.1.0
>                 V4.1.1
> dev
>
>
> dev is our trunk, and our branches have 2 levels.
> I first use git init, then setup my config as follows
> [svn-remote "svn"]
> url = file:///home/chris/svnrepo
> fetch = dev:refs/remotes/trunk
> branches = branches/V4.1/{V4.1.1}:refs/remotes/branches/*
> For this example I am just trying to make a single branch work.
> After a fetch all revisions are ok. master correctly points to
> remotes/trunk,but gitk shows the following:
>
> o remotes/branches/V4.1.1
> |
> o some commit
> |
> |
> |    o master - remotes/trunk
> |    |
> |    o another commit
> |    /
> |
> etc
> ( sorry for the bad ascii art. )
> My issue is that trunk ( master ) appears to be a  branch from V4.1.1
> instead of  V4.1.1 being a branch from trunk ( master )

In git's estimation,  there is no difference between these two cases.
Visually you may think there is a difference, but graphically (in the
"network graph" sense of the word) they are exactly the same thing.

Consider this history:
o---o---A---B---C <== trunk
         \
          D---E---F  <== V4.1.1

Compare it to this "other" history:
          B---C <== trunk
         /
o---o---A---D---E---F  <== V4.1.1

You might say the first one looks "right" and the second one looks
"wrong".  But in fact, they are the same graph.  They both say that
B's parent is A and D's parent is A.  B and D share a common ancestor
at A.

Here's another view:
          B---C <== trunk
         /
o---o---A
         \
          D---E---F  <== V4.1.1

You may want to read this nice description of the DAG:
http://eagain.net/articles/git-for-computer-scientists/

> git log --graph shows the same structure.
> Any suggestions on how to configure this so git svn maps my
> non-standard layout correctly?

Try git log --graph --date-order to see a slightly different take on things.

Phil

```
