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

Re: [PATCH] SVN import: Use one log call

From
Junio C Hamano <junkio@cox.net>
Date
Nov 29, 2005, 20:22 UTC
Message-ID
<7vhd9vdx1o.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<pan.2005.11.29.07.13.02.145977@smurf.noris.de>
Matthias Urlichs <smurf@smurf.noris.de> writes:
> One "svn log" (or its equivalent) per revision adds delay and server load.
> Instead, open two SVN connections -- one for the log, and one for the files.
Thanks, applied and pushed out.

BTW, I've never successfully managed to run svnimport from my private svn repository. Admittedly the repository does not follow the recommended layout and that probably is the major cause (it started its life when svn documentation recommended {trunk,branches,tags}/{projectA,projectB,projectC} layout. {projectA,projectB,projectC}/{trunk,branches,tags} is the layout they recommend these days, I think [*1*]).

It does not use any branches (it is primarily a random collection of small throwaway scripts). The repository hosts many unrelated pieces ("http://127.0.0.1/svn/private/" is the root level of the repository), organized like this:

    $ svn ls http://127.0.0.1/svn/private/
    attic/
    main/
    tags/
   main/ is the active one (trunk), and it has bunch of
   unrelated subdirectories.
   attic/ is where I prepared to "svn mv" things from main/ that
   are no longer needed, but is empty.
   tags/ have one tree that is a copy of one of the subtrees
   under main/ from distant past.
I wanted to convert one of the subsubdirectory of main to git.
    $ svn ls http://127.0.0.1/svn/private/main/sources/photocat
    Makefile
    Notes
    cmdmason.pm
    ...

What is the svnimport command line I should give? Luckily, I do not have "tags" or "branches" under private/main/sources/, so I tried to cheat like this, hoping it would mistake "photocat" is the trunk of "main/sources" project in the repository. No such luck.

$ cd /var/tmp && rm -fr try0 && mkdir try0 && cd try0 $ git svnimport -v -i -t photocat http://127.0.0.1/svn/private main/sources 1: Unrecognized path: /main/sources 1: Unrecognized path: /main/in-place 1: Unrecognized path: /main ... 1500: Unrecognized path: /main/sources/photocat/db/catalog.sql 1501: Unrecognized path: /main/sources/photocat/data/035-maribon-making.yaml DONE; creating master branch cp: cannot stat `/var/tmp/try0/.git/refs/heads/origin': No such file or directory fatal: master: not a valid SHA1 $

If your answer is "your repository layout is too weird and nonstandard, you are screwed", that is perfectly fine. I do not want you to bend over backwards to butcher the import script to support it, if it is too nonstandard. I already converted what I wanted to convert manually already; history being linear without branches, that was easy enough.

But I thought it would never hurt to ask ;-).
[Footnote]
*1*

http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-5-sect-6.1 shows two layouts, one with {trunk,tags,branches} at the top level of each project, another with nested projects (if you look at "utils" in the picture as a project with two subcomponents "calc" and "calendar"), with {trunk,tags,branches} under each subproject. I think the current code should import from "calendar" or "calc" level just fine, but I wonder if we want to support importing from "utils" level.

Previous: Matthias UrlichsNext: Matthias Urlichs
Message 2 of 7 in “SVN import: Use one log call”
  1. SVN import: Use one log callMatthias Urlichs, Nov 29, 2005
  2. Junio C HamanoNov 29, 2005
  3. Matthias UrlichsNov 30, 2005
  4. Nicolas PitreNov 30, 2005
  5. Matthias UrlichsNov 30, 2005
  6. Junio C HamanoNov 30, 2005
  7. Matthias UrlichsNov 30, 2005

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.