# git-svn clone duplicates content

3 messages from 2008-03-13 to 2008-03-13. Participants: martin f krafft, Björn Steinbrink.
Thread: https://gitlist.dev/t/12666

## martin f krafft, 2008-03-13 09:52

Subject: git-svn clone duplicates content
Message-ID: <20080313095215.GA22241@piper.oerlikon.madduck.net>
URL: https://gitlist.dev/e/20080313095215.GA22241%40piper.oerlikon.madduck.net

```
Hi list,

if I

  git-svn clone --stdlayout svn://svn.debian.org/svn/python-modules/packages/python-docutils

then I get

  drwx------ 3 madduck madduck 4096 2008-03-13 10:11 debian/
  drwx------ 3 madduck madduck 4096 2008-03-13 10:11 trunk/
  drwx------ 3 madduck madduck 4096 2008-03-13 10:11 trunk/debian/

and the diff between the two debian directories is equivalent to the
last commit to the trunk. If I create a new branch off the remote
'trunk' branch, then the trunk/ directory will be gone, as it
should.

I am a bit wary to dcommit off anything else than master though for
I've already killed SVN repos with git-svn in the past. I'd rather
not to that to Debian's python-modules repo, or else would have to
spend the rest of my life hidden on some island.

It seems that master is branched off a tag in this case.
Does anyone have an idea what's going on?
Is this something weird in the svn or with git-svn?

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
what do you mean, it's not packaged in debian?
 
spamtraps: madduck.bogus@madduck.net

```

## Björn Steinbrink, 2008-03-13 11:30

Subject: Re: git-svn clone duplicates content
Message-ID: <20080313113013.GA31522@atjola.homenet>
URL: https://gitlist.dev/e/20080313113013.GA31522%40atjola.homenet
In-Reply-To: <20080313095215.GA22241@piper.oerlikon.madduck.net>

```
On 2008.03.13 10:52:15 +0100, martin f krafft wrote:
> Hi list,
> 
> if I
> 
>   git-svn clone --stdlayout svn://svn.debian.org/svn/python-modules/packages/python-docutils
> 
> then I get
> 
>   drwx------ 3 madduck madduck 4096 2008-03-13 10:11 debian/
>   drwx------ 3 madduck madduck 4096 2008-03-13 10:11 trunk/
>   drwx------ 3 madduck madduck 4096 2008-03-13 10:11 trunk/debian/
> 
> and the diff between the two debian directories is equivalent to the
> last commit to the trunk. If I create a new branch off the remote
> 'trunk' branch, then the trunk/ directory will be gone, as it
> should.
> 
> I am a bit wary to dcommit off anything else than master though for
> I've already killed SVN repos with git-svn in the past. I'd rather
> not to that to Debian's python-modules repo, or else would have to
> spend the rest of my life hidden on some island.
> 
> It seems that master is branched off a tag in this case.
> Does anyone have an idea what's going on?
> Is this something weird in the svn or with git-svn?

The "fetch" part of git-svn will create a master branch if it doesn't
exist(*) and makes it point to whatever branch was last fetched. In your
case, it seems that the last change on the svn side was to create tag
0.4-5, so master pointed to that one.

As things are, a "git reset --hard remotes/trunk" (or wherever you want
your master to descend from) is pretty mandatory after git svn clone.
The example in the man page "kind of" mentions that. ;-)

Björn

(*) Which can be a bit "surprising", because even if you don't want a
    master branch and deleted the original one, the next fetch will
    create a new one.

```

## martin f krafft, 2008-03-13 11:36

Subject: Re: git-svn clone duplicates content
Message-ID: <20080313113621.GA13221@piper.oerlikon.madduck.net>
URL: https://gitlist.dev/e/20080313113621.GA13221%40piper.oerlikon.madduck.net
In-Reply-To: <20080313113013.GA31522@atjola.homenet>

```
also sprach Björn Steinbrink <B.Steinbrink@gmx.de> [2008.03.13.1230 +0100]:
> The "fetch" part of git-svn will create a master branch if it
> doesn't exist(*) and makes it point to whatever branch was last
> fetched. In your case, it seems that the last change on the svn
> side was to create tag 0.4-5, so master pointed to that one.

That makes sense.

> As things are, a "git reset --hard remotes/trunk" (or wherever you
> want your master to descend from) is pretty mandatory after git
> svn clone. The example in the man page "kind of" mentions that.
> ;-)

I saw that a bit later too. Thanks for the explanation regardless!

-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"and if the cloud bursts, thunder in your ear
 you shout and no one seems to hear
 and if the band you're in starts playing different tunes
 i'll see you on the dark side of the moon."
                                                   -- pink floyd, 1972
 
spamtraps: madduck.bogus@madduck.net

```
