# git-svnimport: what to do after -i?

8 messages from 2007-08-22 to 2007-08-24. Participants: Jing Xue, Steven Walter, Julian Phillips.
Thread: https://gitlist.dev/t/9612

## Jing Xue, 2007-08-22 15:33

Subject: git-svnimport: what to do after -i?
Message-ID: <20070822113325.1bihryuk4gko8kgs@intranet.digizenstudio.com>
URL: https://gitlist.dev/e/20070822113325.1bihryuk4gko8kgs%40intranet.digizenstudio.com

```

I am new to git. Last night I used "git svnimport -i" to import a svn  
project. It finished successfully. The only problem now is I can't  
seem to be able to checkout a working copy. In other words, I have a  
'projectFoo' directory, with only .git in it, but not any actual  
working files. "git-branch" shows two branches, master and origin.  
"git-checkout master" returns successfully, but does nothing.

I guess that's because I used -i without fully understanding what it  
implies. Is there any way to checkout a working directory?

Thanks in advance for any ideas.
-- 
Jing Xue

```

## Steven Walter, 2007-08-22 16:58

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <20070822165846.GA17815@dervierte>
URL: https://gitlist.dev/e/20070822165846.GA17815%40dervierte
In-Reply-To: <20070822113325.1bihryuk4gko8kgs@intranet.digizenstudio.com>

```
On Wed, Aug 22, 2007 at 11:33:25AM -0400, Jing Xue wrote:
> 
> I am new to git. Last night I used "git svnimport -i" to import a svn  
> project. It finished successfully. The only problem now is I can't  
> seem to be able to checkout a working copy. In other words, I have a  
> 'projectFoo' directory, with only .git in it, but not any actual  
> working files. "git-branch" shows two branches, master and origin.  
> "git-checkout master" returns successfully, but does nothing.
> 
> I guess that's because I used -i without fully understanding what it  
> implies. Is there any way to checkout a working directory?
> 
> Thanks in advance for any ideas.
> -- 
> Jing Xue

See if "git reset --hard master" doesn't check out the files for you.  I
seem to recall an issue where, after an import, no files were checked
out.  reset fixed it for me.
-- 
-Steven Walter <stevenrwalter@gmail.com>
"A human being should be able to change a diaper, plan an invasion,
butcher a hog, conn a ship, design a building, write a sonnet, balance
accounts, build a wall, set a bone, comfort the dying, take orders,
give orders, cooperate, act alone, solve equations, analyze a new
problem, pitch manure, program a computer, cook a tasty meal, fight
efficiently, die gallantly. Specialization is for insects."
   -Robert Heinlein

```

## Jing Xue, 2007-08-22 17:04

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <20070822130442.7mioy28ps0sg48sc@intranet.digizenstudio.com>
URL: https://gitlist.dev/e/20070822130442.7mioy28ps0sg48sc%40intranet.digizenstudio.com
In-Reply-To: <20070822165846.GA17815@dervierte>

```

Quoting Steven Walter <stevenrwalter@gmail.com>:

>
> See if "git reset --hard master" doesn't check out the files for you.  I
> seem to recall an issue where, after an import, no files were checked
> out.  reset fixed it for me.

Nope...  Tried that and "git reset --hard HEAD". Both simply print:

HEAD is now at 7be0678... <the last commit message imported>.

Thanks.
-- 
Jing Xue

```

## Jing Xue, 2007-08-23 01:28

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <20070823012836.GA18796@falcon.digizenstudio.com>
URL: https://gitlist.dev/e/20070823012836.GA18796%40falcon.digizenstudio.com
In-Reply-To: <20070822113325.1bihryuk4gko8kgs@intranet.digizenstudio.com>

```
OK, got it working. It had more to do with the module/trunk path than
the -i.

My svn projects are organized like:
projectFoo
    -trunk
    -tags
    -branches

So I initially used:

git svnimport -C projectFoo -r -A svn-authors -I .gitignore -T projectFoo svn://jabba trunk

which resulted in the empty working directory - with or without the -i.

What ended up working is this:

git svnimport -C projectFoo -r -A svn-authors -I .gitignore -T projectFoo -P trunk svn://jabba

Cheers.
-- 
Jing Xue

```

## Julian Phillips, 2007-08-23 07:29

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <Pine.LNX.4.64.0708230827440.26254@beast.quantumfyre.co.uk>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0708230827440.26254%40beast.quantumfyre.co.uk
In-Reply-To: <20070823012836.GA18796@falcon.digizenstudio.com>

```
On Wed, 22 Aug 2007, Jing Xue wrote:

> OK, got it working. It had more to do with the module/trunk path than
> the -i.
>
> My svn projects are organized like:
> projectFoo
>    -trunk
>    -tags
>    -branches
>
> So I initially used:
>
> git svnimport -C projectFoo -r -A svn-authors -I .gitignore -T projectFoo svn://jabba trunk
>
> which resulted in the empty working directory - with or without the -i.
>
> What ended up working is this:
>
> git svnimport -C projectFoo -r -A svn-authors -I .gitignore -T projectFoo -P trunk svn://jabba
>
> Cheers.

I haven't used svnimport in a while (and never with subprojects), but you 
seem to be specifying that projectFoo is your trunk - which doesn't seem 
right.

I would have expected the command to be:

git svnimport -C projectFoo -r -A svn-authors -I .gitignore svn://jabba projectFoo

-- 
Julian

  ---
Everything you know is wrong!

```

## Jing Xue, 2007-08-23 13:00

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <20070823130031.GA17092@falcon.digizenstudio.com>
URL: https://gitlist.dev/e/20070823130031.GA17092%40falcon.digizenstudio.com
In-Reply-To: <Pine.LNX.4.64.0708230827440.26254@beast.quantumfyre.co.uk>

```
On Thu, Aug 23, 2007 at 08:29:54AM +0100, Julian Phillips wrote:
> 
> I haven't used svnimport in a while (and never with subprojects), but you 
> seem to be specifying that projectFoo is your trunk - which doesn't seem 
> right.
> 
> I would have expected the command to be:
> 
> git svnimport -C projectFoo -r -A svn-authors -I .gitignore svn://jabba 
> projectFoo

Thanks for bringing it up. :)

My svn structure (see my last email) is somewhat reversed from what
svnimport assumes, which seems to be more along the lines of:

repoRoot
  -trunk
    -projectFoo
    -projectBar
  -tags
    -projectFoo
    -projectBar
  -branches
    -projectFoo
    -projectBar

So in my case I had to kind of cheat svnimport into thinking
'projectFoo' is the name of the "trunk" directory, and 'trunk' is the
actually project name. And I had to create 'dummytags' and
'dummybranches' at repoRoot level (following somebody else's tip found
on this list).

Of course doing so has two problems:

1. I can only import one project at one time, but my plan is to have
separated git repo for each project going forward, so this works out
just fine.

2. I can't actually import any tags and branches because my real tags
and branches are under projectFoo/tags and projectFoo/branches. This is
somewhat a loss, but we can cope with it by having the svn repo around
as the history book.

But then if there is any better way to achieve this, I would certainly
be interested and eager to learn. Thanks.

-- 
Jing Xue

```

## Julian Phillips, 2007-08-24 00:18

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <Pine.LNX.4.64.0708240113360.32194@beast.quantumfyre.co.uk>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0708240113360.32194%40beast.quantumfyre.co.uk
In-Reply-To: <20070823130031.GA17092@falcon.digizenstudio.com>

```
On Thu, 23 Aug 2007, Jing Xue wrote:

> On Thu, Aug 23, 2007 at 08:29:54AM +0100, Julian Phillips wrote:
>>
>> I haven't used svnimport in a while (and never with subprojects), but you
>> seem to be specifying that projectFoo is your trunk - which doesn't seem
>> right.
>>
>> I would have expected the command to be:
>>
>> git svnimport -C projectFoo -r -A svn-authors -I .gitignore svn://jabba
>> projectFoo
>
> Thanks for bringing it up. :)
>
> My svn structure (see my last email) is somewhat reversed from what
> svnimport assumes, which seems to be more along the lines of:
>
> repoRoot
>  -trunk
>    -projectFoo
>    -projectBar
>  -tags
>    -projectFoo
>    -projectBar
>  -branches
>    -projectFoo
>    -projectBar
>
> So in my case I had to kind of cheat svnimport into thinking
> 'projectFoo' is the name of the "trunk" directory, and 'trunk' is the
> actually project name. And I had to create 'dummytags' and
> 'dummybranches' at repoRoot level (following somebody else's tip found
> on this list).

Ah, yes ... sorry.  I've actually ended up using a homebrew script for 
parsing svn dump files and feeding git-fast-import for a number of 
reasons, so I'm a bit rusty with svnimport, and never looked at multiple 
projects in one repo anyway.  (One of which was that svnimport wasn't 
creating a correct import actually - some files and directories were 
simply missing).

> Of course doing so has two problems:
>
> 1. I can only import one project at one time, but my plan is to have
> separated git repo for each project going forward, so this works out
> just fine.
>
> 2. I can't actually import any tags and branches because my real tags
> and branches are under projectFoo/tags and projectFoo/branches. This is
> somewhat a loss, but we can cope with it by having the svn repo around
> as the history book.
>
> But then if there is any better way to achieve this, I would certainly
> be interested and eager to learn. Thanks.

I guess you've tried including projectFoo in the url?  Other than that, 
perhaps git-svn may have better luck?

-- 
Julian

  ---
I'm not a real movie star -- I've still got the same wife I started out
with twenty-eight years ago.
 		-- Will Rogers

```

## Jing Xue, 2007-08-24 01:06

Subject: Re: git-svnimport: what to do after -i?
Message-ID: <20070824010619.GA18265@falcon.digizenstudio.com>
URL: https://gitlist.dev/e/20070824010619.GA18265%40falcon.digizenstudio.com
In-Reply-To: <Pine.LNX.4.64.0708240113360.32194@beast.quantumfyre.co.uk>

```
On Fri, Aug 24, 2007 at 01:18:49AM +0100, Julian Phillips wrote:
> On Thu, 23 Aug 2007, Jing Xue wrote:
> 
> >So in my case I had to kind of cheat svnimport into thinking
> >'projectFoo' is the name of the "trunk" directory, and 'trunk' is the
> >actually project name. And I had to create 'dummytags' and
> >'dummybranches' at repoRoot level (following somebody else's tip found
> >on this list).
> 
> Ah, yes ... sorry.  I've actually ended up using a homebrew script for 
> parsing svn dump files and feeding git-fast-import for a number of 
> reasons, so I'm a bit rusty with svnimport, and never looked at multiple 
> projects in one repo anyway.  (One of which was that svnimport wasn't 
> creating a correct import actually - some files and directories were 
> simply missing).

That's... not good to hear about. I should probably look at svn dump as
well.

> I guess you've tried including projectFoo in the url?  Other than that, 
> perhaps git-svn may have better luck?

I tried that too but decided against it as it's relatively OK to lose
some ancient history, but messing up ongoing development due to any
possible issues in the git-svn layer would be quite different a story.
(and from what you just mentioned, that's not entirely a paranoia 8-)

Thanks.
-- 
Jing

```
