git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument)
@ 2011-04-10 10:28 HH-developing
  2011-04-11  7:01 ` Michael J Gruber
  0 siblings, 1 reply; 3+ messages in thread
From: HH-developing @ 2011-04-10 10:28 UTC (permalink / raw)
  To: git

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]



The error:
fatal: ambiguous argument 'a41f9bd5959dde85035bd047bf730cc62eaee12a^..1cb281cf44644da76ed94764f7770bb9e11d7424': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions
rev-list a41f9bd5959dde85035bd047bf730cc62eaee12a^..1cb281cf44644da76ed94764f7770bb9e11d7424: 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.



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.

Thanks in advance, kind regards,
Harald

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

* Re: Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument)
  2011-04-10 10:28 Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument) HH-developing
@ 2011-04-11  7:01 ` Michael J Gruber
  2011-04-11  8:09   ` AW: " Harald Heigl
  0 siblings, 1 reply; 3+ messages in thread
From: Michael J Gruber @ 2011-04-11  7:01 UTC (permalink / raw)
  To: HH-developing; +Cc: git

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

> 
> The error:
> fatal: ambiguous argument 'a41f9bd5959dde85035bd047bf730cc62eaee12a^..1cb281cf44644da76ed94764f7770bb9e11d7424': unknown revision or path not in the working tree.
> Use '--' to separate paths from revisions
> rev-list a41f9bd5959dde85035bd047bf730cc62eaee12a^..1cb281cf44644da76ed94764f7770bb9e11d7424: 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.

Michael

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

* AW: Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument)
  2011-04-11  7:01 ` Michael J Gruber
@ 2011-04-11  8:09   ` Harald Heigl
  0 siblings, 0 replies; 3+ messages in thread
From: Harald Heigl @ 2011-04-11  8:09 UTC (permalink / raw)
  To: git

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

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

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

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

end of thread, other threads:[~2011-04-11  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-10 10:28 Weird behaviour when importing from a subversion repository (empty dir/ambiguous argument) HH-developing
2011-04-11  7:01 ` Michael J Gruber
2011-04-11  8:09   ` AW: " Harald Heigl

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).