git/list[1] front-page[2] threads[3] people[4] search[5] about
 

AW: Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument)

From
HHHarald Heigl <harald@heigl-online.at>
Date
Apr 11, 2011, 08:09 UTC
Message-ID
<000901cbf81f$d3c52b60$7b4f8220$@heigl-online.at>
In-Reply-To
<4DA2A762.1020203@drmicha.warpmail.net>

Hi! Thanks for your fast answer, you lead me to the right direction, problem solved! see answers below.

Show 28 quoted lines
> -----Ursprüngliche Nachricht-----
> Von: Michael J Gruber [mailto:git@drmicha.warpmail.net]
> Gesendet: Montag, 11. April 2011 09:02
> An: HH-developing@heigl-online.at
> Cc: git@vger.kernel.org
> Betreff: Re: Weird behaviour when importing from a subversion repository
> (empty dir/ambiguous argument)
> 
> HH-developing@heigl-online.at venit, vidit, dixit 10.04.2011 12:28:
> > Hi everybody!
> > I’m a software developer in lower Austria and started introducing
> subversion in my company some time ago. It was mainly for myself to have a
> history. Now when I looked for myself I came to git.
> > When I’m more comfortable with it we’ll switch at company too.
> >
> > So I’ve tried to clone our main project and I got an error. I have to say I
> cloned some other even bigger subversion projects and it worked, so
> something must be special here.
> > I hope you read this long mail, I tried to separate it in sections and tried to
> shorten the output a little bit.
> >
> >
> > My command:
> > git svn clone "[subversionrepo]"  [gitclonedir] -T trunk -b branches
> > -t tags --username [subversionuser]
> >
> 
> "git svn --version" please :)

Sorry I forgot to say: 1.7.4 on windows (msysgit) and 1.7.4.3 on linux (ubuntu-server) Had the same behaviour on both oft hem.

Show 59 quoted lines
> 
> >
> > The error:
> > fatal: ambiguous argument
> 'a41f9bd5959dde85035bd047bf730cc62eaee12a^..1cb281cf44644da76ed9476
> 4f7770bb9e11d7424': unknown revision or path not in the working tree.
> > Use '--' to separate paths from revisions rev-list
> >
> a41f9bd5959dde85035bd047bf730cc62eaee12a^..1cb281cf44644da76ed94764
> f77
> > 70bb9e11d7424: command returned error: 128 if I do the same with --no-
> follow-parent, it works, but I assume then I’m losing the branch/tag
> connection to the trunk. If I’m losing the branches I can live with it (I think I
> did more branching in the last days with git, then with subversion the last
> year ☺ ), but I’m interested and if there is a possibility I’ll prefer to import the
> subversion project completely.
> >
> >
> >
> > I did some further investigation:
> > „git log a41f9bd5959dde85035bd047bf730cc62eaee12a“ works giving me:
> >     git-svn-id: [subversionrepo]/branches/Pluginstruktur-HEH@158
> > ebb3a944-7b90-0446-bc25-369ed2d31b3f
> > git log a41f9bd5959dde85035bd047bf730cc62eaee12a^ (this should be the
> > parent, right?) says „unknown revision or path not in the working
> > tree.“
> >
> >
> >
> > I think it’s a failure I did in subversion some months ago:
> > Rev 158: Created an empty folder 'Pluginstruktur-HEH'.
> > Rev 159: Deleted folder ‚ Pluginstruktur-HEH‘ (don’t ask why) Rev 160:
> > branched from trunk to branches/Pluginstruktur-HEH
> >
> > So in Rev 158 there was an empty folder in branches, in Rev 159 no folder
> and in Rev160 a non empty folder out oft he trunk.
> > Perhaps this ist the problem, because between Rev 158 and Rev159 there
> was a single empty folder an das I found out git doesn’t track empty folders.
> Perhaps that’s why Rev158 (git:
> a41f9bd5959dde85035bd047bf730cc62eaee12a) doesn’t have a parent here.
> 
> The problem is that r158 has no parent - you started with an empty folder
> and created a new root commit (just like git checkout --orphan) which
> happens to be empty.
> 
> In several places, "git svn" assumes that "A^ B" makes sense, particular that
> A has a parent. We fixed a couple of these in the past, which is why I asked
> for your version above.
> 
> > Maybe you can shed some led in this and how I may solve this.  Can I just
> leave out revision 158 and 159 when doing git svn clone, because it was
> nothing more than creating an empty folder and deleting an empty folder?
> I’ve read somewhere on the net you can also use a svndump as base for a git
> import, perhaps I then may leave rev 158/159 out in the dumb, but I don’t
> know how to use exactly an svndump as a git import and also if this wuld be a
> solution for me.
> 
> You could first clone up to and including r157, and then fetch from r160 in
> your case. Still, "git svn" should be able to cope.
That lead me to the right direction: I was thinking of git cloning the whole history and not thinking about that you could do a partitial clone of a subversion directory and then fetch from somewhere in between, so I did:
 git svn clone "[subversionrepo]"  [gitclonedir] -T trunk -b branches -t tags --username [subversionuser] -r 0:157
 git svn fetch -r 160:HEAD
> 
> Michael

So left out the two misleading revisions and it worked! Thanks again, still learning on git :-) Regards, Harald

Previous: Michael J Gruber
Message 3 of 3 in “Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument)”
  1. hh-developing@heigl-online.atApr 10, 2011
  2. Michael J GruberApr 11, 2011
  3. AW: Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument)Harald Heigl, Apr 11, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.