{"thread":{"id":"8435","subject":"git-svn and googlecode.com?","startedAt":"2007-06-05T08:11:25Z","lastAt":"2007-06-05T10:11:48Z","messageCount":3,"participants":["Rogan Dawes","Andy Parkins"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"44043","messageId":"46651AAD.4010705@dawes.za.net","threadId":"8435","inReplyTo":null,"subject":"git-svn and googlecode.com?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-06-05T08:11:25Z","receivedAt":"2007-06-05T08:11:25Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Hi,\n\nThanks to Martin, I got git svnimport working on the Spring Rich Client \nSourceforge repository. The published SVN checkout command line was:\n\nsvn co https://spring-rich-c.svn.sourceforge.net/svnroot/spring-rich-c \\\n  spring-rich-c\n\nThis translated into a git svnimport invocation of:\n\ngit-svnimport -i -v -o origin -T trunk/spring-richclient -t tags \\\n  -b branches \\\nhttps://spring-rich-c.svn.sourceforge.net/svnroot/spring-rich-c/\n\nwhich works very well.\n\n From this I assume that the usual translation from Sourceforge \npublished command lines works something like:\n\ngit svnimport -i -v -o origin -T trunk/<first path component> -t tags \\\n  -b branches <URL>\n\nUsing a similar approach for a repo at code.google.com, I tried:\n\n(Original) svn checkout http://webgoat.googlecode.com/svn/trunk/ webgoat\n\n(Funny, the initial path component had a space in it?!)\n\n0 $ git-svn clone -T \"trunk/ webgoat\" \nhttps://webgoat.googlecode.com/svn/trunk/\nInitialized empty Git repository in .git/\nUsing higher level of URL: https://webgoat.googlecode.com/svn/trunk => \nhttps://webgoat.googlecode.com/svn\nW: Ignoring error from SVN, path probably does not exist: (175002): RA \nlayer request failed: REPORT request failed on '/svn/!svn/bc/100': \nREPORT of '/svn/!svn/bc/100': 200 OK (https://webgoat.googlecode.com)\nPath 'trunk/trunk/ webgoat' was probably deleted:\nRA layer request failed: REPORT request failed on '/svn/!svn/bc/126': \nREPORT of '/svn/!svn/bc/126': 200 OK (https://webgoat.googlecode.com)\nWill attempt to follow revisions r101 .. r126 committed before the deletion\n0 $\n\nThis didn't actually do anything other than creating the .git directory \nstructure, and creating one svn related file, even though it exited with \na zero status (the prompt above includes the exit status of the previous \ncommand), and gave no diagnostics or error messages (other than \"Using \nhigher level . . . \")\n\n1 $ find .git\n.git\n.git/branches\n.git/config\n.git/description\n.git/HEAD\n.git/hooks\n.git/hooks/applypatch-msg\n.git/hooks/commit-msg\n.git/hooks/post-commit\n.git/hooks/post-receive\n.git/hooks/post-update\n.git/hooks/pre-applypatch\n.git/hooks/pre-commit\n.git/hooks/pre-rebase\n.git/hooks/update\n.git/info\n.git/info/exclude\n.git/objects\n.git/objects/info\n.git/objects/pack\n.git/refs\n.git/refs/heads\n.git/refs/tags\n.git/remotes\n.git/svn\n.git/svn/.metadata\n.git/svn/trunk\n.git/svn/trunk/.rev_db.4033779f-a91e-0410-96ef-6bf7bf53c507\n\nHowever, the following command line does seem to work:\n\ngit-svn clone -T \"trunk/ webgoat\" https://webgoat.googlecode.com/svn/\n\nNote that I manually removed the \"trunk\" component from the URL. This \nsuggests that there is something missing in the automatic \"Using higher \nlevel\" detection code.\n\nHope this helps someone diagnose this bug, as well as use git for \naccessing GoogleCode projects in the future.\n\nRogan\n"},{"id":"44047","messageId":"200706051005.46603.andyparkins@gmail.com","threadId":"8435","inReplyTo":"46651AAD.4010705@dawes.za.net","subject":"Re: git-svn and googlecode.com?","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2007-06-05T09:05:44Z","receivedAt":"2007-06-05T09:05:44Z","isPatch":false,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2007 June 05, Rogan Dawes wrote:\n\n> (Original) svn checkout http://webgoat.googlecode.com/svn/trunk/ webgoat\n>\n> (Funny, the initial path component had a space in it?!)\n\nI suspect that that is not the case.  The form of svn checkout is:\n\n svn checkout <url> <directory>\n\nSo your command is saying check out http://webgoat.googlecode.com/svn/trunk/ \nto the local directory \"webgoat\".  That is to say - it doesn't have a space \nin it and in fact is nothing to do with the URL at all.\n\n> 0 $ git-svn clone -T \"trunk/ webgoat\"\n> https://webgoat.googlecode.com/svn/trunk/\n> Initialized empty Git repository in .git/\n> Using higher level of URL: https://webgoat.googlecode.com/svn/trunk =>\n> https://webgoat.googlecode.com/svn\n> W: Ignoring error from SVN, path probably does not exist: (175002): RA\n> layer request failed: REPORT request failed on '/svn/!svn/bc/100':\n> REPORT of '/svn/!svn/bc/100': 200 OK (https://webgoat.googlecode.com)\n> Path 'trunk/trunk/ webgoat' was probably deleted:\n\n... which explains this error because there is no path \"trunk/ webgoat\".\n\n\n> However, the following command line does seem to work:\n>\n> git-svn clone -T \"trunk/ webgoat\" https://webgoat.googlecode.com/svn/\n\nOh dear; I'm surprised it worked as well as it did.  I just ran this command, \nwhich seemed to work well:\n\n $ git-svn clone -T trunk http://webgoat.googlecode.com/svn/ webgoat-local\n\nThis clones webgoat.googlecode.com/svn to the local directory webgoat-local; \nyou can change \"webgoat-local\" to anything you want, it's just naming the \ndirectory on your own computer.\n\nIf you're the maintainer then perhaps you will want to change \"http\" \nto \"https\" as well.\n\n> Note that I manually removed the \"trunk\" component from the URL. This\n> suggests that there is something missing in the automatic \"Using higher\n> level\" detection code.\n\nI think there is no bug; it's simply a misunderstanding.  git-svn working \nwonderfully for me.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIET\nandyparkins@gmail.com\n"},{"id":"44054","messageId":"466536E4.9040804@dawes.za.net","threadId":"8435","inReplyTo":"200706051005.46603.andyparkins@gmail.com","subject":"Re: git-svn and googlecode.com?","fromName":"Rogan Dawes","fromEmail":"lists@dawes.za.net","sentAt":"2007-06-05T10:11:48Z","receivedAt":"2007-06-05T10:11:48Z","isPatch":false,"sender":{"key":"lists@dawes.za.net","avatar":null},"body":"Andy Parkins wrote:\n> On Tuesday 2007 June 05, Rogan Dawes wrote:\n> \n>> (Original) svn checkout http://webgoat.googlecode.com/svn/trunk/ webgoat\n>>\n>> (Funny, the initial path component had a space in it?!)\n> \n> I suspect that that is not the case.  The form of svn checkout is:\n> \n>  svn checkout <url> <directory>\n> \n> So your command is saying check out http://webgoat.googlecode.com/svn/trunk/ \n> to the local directory \"webgoat\".  That is to say - it doesn't have a space \n> in it and in fact is nothing to do with the URL at all.\n> \n\nI guess I didn't explain it very well. The checked out project had a \ndirectory with a leading space in it:\n\n0 $ ls -alp\ntotal 0\ndrwxr-xr-x+  3 rdawes Domain Users 0 Jun  4 14:20  webgoat/\ndrwxr-xr-x+  4 rdawes Domain Users 0 Jun  4 14:20 ./\ndrwx------+ 28 rdawes ????????     0 Jun  5 09:43 ../\ndrwxr-xr-x+ 10 rdawes Domain Users 0 Jun  4 14:20 .git/\n\nNote the leading space before webgoat/?\n\ni.e. the initial path component actually does have a space in it.\n\n>> 0 $ git-svn clone -T \"trunk/ webgoat\"\n>> https://webgoat.googlecode.com/svn/trunk/\n>> Initialized empty Git repository in .git/\n>> Using higher level of URL: https://webgoat.googlecode.com/svn/trunk =>\n>> https://webgoat.googlecode.com/svn\n>> W: Ignoring error from SVN, path probably does not exist: (175002): RA\n>> layer request failed: REPORT request failed on '/svn/!svn/bc/100':\n>> REPORT of '/svn/!svn/bc/100': 200 OK (https://webgoat.googlecode.com)\n>> Path 'trunk/trunk/ webgoat' was probably deleted:\n> \n> ... which explains this error because there is no path \"trunk/ webgoat\".\n\nNot so, see below.\n\n>> However, the following command line does seem to work:\n>>\n>> git-svn clone -T \"trunk/ webgoat\" https://webgoat.googlecode.com/svn/\n> \n> Oh dear; I'm surprised it worked as well as it did.  I just ran this command, \n> which seemed to work well:\n> \n>  $ git-svn clone -T trunk http://webgoat.googlecode.com/svn/ webgoat-local\n> \n> This clones webgoat.googlecode.com/svn to the local directory webgoat-local; \n> you can change \"webgoat-local\" to anything you want, it's just naming the \n> directory on your own computer.\n\nSure. But then you cd into webgoat-local/, do an \"ls -l\", and you'll see \nexactly the same thing I showed above.\n\nI'm still running your command above, but I'm seeing\n\nW: -empty_dir: trunk/ webgoat/main/project/JavaSource/org\n\nNote the space       ^\n\n> If you're the maintainer then perhaps you will want to change \"http\" \n> to \"https\" as well.\n> \n>> Note that I manually removed the \"trunk\" component from the URL. This\n>> suggests that there is something missing in the automatic \"Using higher\n>> level\" detection code.\n> \n> I think there is no bug; it's simply a misunderstanding.  git-svn working \n> wonderfully for me.\n\nUm, I think that you did exactly what I said I did, namely removing the \n\"trunk\" component from the URL. Contrast:\n\nYours:\n$ git-svn clone -T trunk http://webgoat.googlecode.com/svn/ \\\n     webgoat-local\n\nMine (original):\n$ git-svn clone -T \"trunk/ webgoat\" \\\n     https://webgoat.googlecode.com/svn/trunk/\n                                        ^^^^^\nMine (eventual):\n\n$ git-svn clone -T \"trunk/ webgoat\" https://webgoat.googlecode.com/svn/\n\nI'm sure there WAS a misunderstanding. It was me not understanding how \nto translate an SVN command line to a proper git command line, \naccounting for trunks, etc. That was one of the reasons I made the post, \nto clear it up, and to make sure that anyone searching for hints on how \nto use git to clone google code projects will find something, since I \ndidn't.\n\nSo, it seems that the rule for googlecode is something like:\n\nIf the published command line is:\n\n  svn checkout https://<project>.googlecode.com/svn/trunk/ <project>\n\nYou can clone this project using git-svn with the following command:\n\n  git-svn clone -T trunk https://<project>.googlecode.com/svn/ <localdir>\n\nIf this results in too many levels of directories in the checked out \nproject (e.g. \"/workspace/webgoat/ webgoat/\"), take the extra directory \ncomponent and add it to the -T parameter (e.g. \"-T 'trunk/ webgoat'\")\n\nHopefully this helps the next person.\n\nThanks for your response.\n\nRogan\n"}]}