{"thread":{"id":"54883","subject":"[bug] git svn fetch: defect history - missing merges and wrong tag ancestors","startedAt":"2020-12-25T22:25:55Z","lastAt":"2021-02-07T20:26:04Z","messageCount":3,"participants":["M. Buecher"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"413015","messageId":"8d48309d968019307915432395e226fc@mailbox.org","threadId":"54883","inReplyTo":null,"subject":"[bug] git svn fetch: defect history - missing merges and wrong tag ancestors","fromName":"M. Buecher","fromEmail":"maddes+git@maddes.net","sentAt":"2020-12-25T22:24:21Z","receivedAt":"2020-12-25T22:25:55Z","isPatch":false,"sender":{"key":"maddes+git@maddes.net","avatar":null},"body":"Dear all,\n\nI finally had the time to start converting some older Subversion \nrepositories to git repositiers and run into issues with repos using \n\"parallel\" branches, so-called vendor branches [1] in Subversion to \ntrack upstream changes via snapshots in a separate branch and merge them \ninto the custom build on trunk.\n\nJust wanting to convert the Subversion history as-is to git.\nI studied the git-svn reference docs [2] plus the related chapter of the \nProGit book [3] and assume that I understood how git-svn works.\nStill I'm not a git expert, just a sporadic user.\n\nSomehow `git svn fetch` (2.29.2.windows.3) looses merge information \nbetween vendor branch and trunk plus tags are referencing the \npredecessors instead of the original ancestor.\nMaybe there is a manual way to fix this for that small repository, but \nit wouldn't be feasible for larger repositories, that's why I deceided \nto write this bug report.\nIs there anything I missed? (see my procedure below)\n\nFortunately I ran quite early into these issues and also with a very \nsmall repository of just 11 commits, so I can provide a small \nreproduction case (see below after the links).\nHoping you can enhance `git svn fetch`.\n\nAny help is appreciated, thanks in advance\nMatthias Bücher\n\n\n[Links]\n[1] \nhttp://svnbook.red-bean.com/en/1.8/svn.advanced.vendorbr.html#svn.advanced.vendorbr.mirrored-sources\n[2] https://git-scm.com/docs/git-svn\n[3] \nhttps://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git\n\n\n[System Info]\ngit version:\ngit version 2.29.2.windows.3\ncpu: x86_64\nbuilt from commit: d054eb1fc46ff23e7c95756a7c747e2f2864b478\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Windows 10.0 19042\ncompiler info: gnuc: 10.2\nlibc info: no libc information available\n$SHELL (typically, interactive shell): C:\\Program \nFiles\\Git\\usr\\bin\\bash.exe\n\n[Enabled Hooks]\nnone\n\n\n[Commits in Subversion]\nA Subversion repository dump is attached, plus a test where I recreated \nthe same history directly in a git repository without an issue.\n\n* trunk:  a------------d--e--h--i--j--k\n*                     /     /\n* vendor: a (empty)--b-----f\n*                    ^     ^\n* tags:              c     g\n\n* Vendor releases: b, f\n* Custom modifications: e, i, j, k\n* Tags: really just used as tags, although Subversion internally they \nare branches. Therefore wanting to create lightweight git tags, although \nannotated git tags would be fine too.\n\n\n[Expected Subversion to git repo conversion]\n* trunk => branch \"main\"\n* branches/* => branch \"*\"\n* tags/* => tag \"*\"\n* vendor/current => branch \"vendor/current\" (can be renamed later to \njust \"vendor\")\n* vendor/* => tag \"vendor/*\" (except for vendor/current)\n\nExpected \"tags\":\nvendor/5.4 = rev b (maybe c when annotated)\nvendor/5.8 = rev f (maybe g when annotated)\n\n\n[Wrong Results]\nMerges from \"vendor/current\" branch to trunk get lost.\nTags are referencing the predecessors of the expected commit.\n\n\n[Procedure]\n```\n### a) preparation\ncd /d/Coding\n#\ncd dd-formmailer\nsvn log --xml --quiet | grep author | sort -u | perl -pe \n's/.*>(.*?)<.*/$1 = /' > authors-transform.txt\n## edit authors-transform.txt accordingly\n\n### b) git-svn adapted from ProGit book, but with \"svn/\" prefix\ncd /d/Coding\ngit svn init --stdlayout --no-metadata --prefix=\"svn/\" -- \n'svn+ssh://svn@vcs/dd-formmailer' dd-formmailer-git\ncd dd-formmailer-git\n## edit .git/config for additional vendor branches and tags\n<< __EOF\n...\n[svn-remote \"svn\"]\n\t...\n\tfetch = trunk:refs/remotes/svn/trunk\n#\tbranches = vendor/current:refs/remotes/svn/vendor/current ## non-glob \ndefinition not working for branches\n\tbranches = vendor/{current}:refs/remotes/svn/vendor/*\n\tbranches = branches/*:refs/remotes/svn/*\n\ttags = vendor/*:refs/remotes/svn/tags/vendor/*\n\ttags = tags/*:refs/remotes/svn/tags/*\n__EOF\n##\ncat .git/config\ngit svn fetch --authors-file ../dd-formmailer/authors-transform.txt\n#\ngit branch -vv --list ; git for-each-ref\ngitk --all &\n```\n\n[Log]\n$ cat .git/config\n[core]\n         repositoryformatversion = 0\n         filemode = false\n         bare = false\n         logallrefupdates = true\n         symlinks = false\n         ignorecase = true\n[svn-remote \"svn\"]\n         noMetadata = 1\n         url = svn+ssh://svn@vcs/dd-formmailer\n         fetch = trunk:refs/remotes/svn/trunk\n         branches = vendor/{current}:refs/remotes/svn/vendor/*\n         branches = branches/*:refs/remotes/svn/*\n         tags = vendor/*:refs/remotes/svn/tags/vendor/*\n         tags = tags/*:refs/remotes/svn/tags/*\n\n$ git svn fetch --authors-file ../dd-formmailer/authors-transform.txt\nr1 = 158d53044a5628897379403647a19ea13594b532 \n(refs/remotes/svn/vendor/current)\n         A       _svn__guideline.txt\n         A       _svn_client_config.txt\n         A       _svn_dir_ignore_list.txt\nr1 = a795b654edbc296e6f38da398f032a4851fd0a9e (refs/remotes/svn/trunk)\n         A       dd-formmailer.css\n         A       dd-formmailer.php\n         A       lang/BrazilianPortuguese.php\n         A       lang/Catalan.php\n         A       lang/Danish.php\n         A       lang/Deutsch.php\n         A       lang/Dutch.php\n         A       lang/English.php\n         A       lang/Finnish.php\n         A       lang/French.php\n         A       lang/Greek.php\n         A       lang/Italian.php\n         A       lang/NorwegianBokmaal.php\n         A       lang/Polish.php\n         A       lang/Portuguese.php\n         A       lang/Romanian.php\n         A       lang/Russian.php\n         A       lang/Slovak.php\n         A       lang/Slovene.php\n         A       lang/Spanish.php\n         A       lang/Swedish.php\n         A       lang/Turkish.php\n         A       recaptchalib.php\nr2 = 8fd8668dbed2dde6b55306c71b3b629f5ed794ec \n(refs/remotes/svn/vendor/current)\nFound possible branch point: \nsvn+ssh://svn@vcs/dd-formmailer/vendor/current => \nsvn+ssh://svn@vcs/dd-formmailer/vendor/5.4, 1\nFound branch parent: (refs/remotes/svn/tags/vendor/5.4) \n158d53044a5628897379403647a19ea13594b532\nFollowing parent with do_switch\n         A       dd-formmailer.css\n         A       dd-formmailer.php\n         A       lang/BrazilianPortuguese.php\n         A       lang/Catalan.php\n         A       lang/Danish.php\n         A       lang/Deutsch.php\n         A       lang/Dutch.php\n         A       lang/English.php\n         A       lang/Finnish.php\n         A       lang/French.php\n         A       lang/Greek.php\n         A       lang/Italian.php\n         A       lang/NorwegianBokmaal.php\n         A       lang/Polish.php\n         A       lang/Portuguese.php\n         A       lang/Romanian.php\n         A       lang/Russian.php\n         A       lang/Slovak.php\n         A       lang/Slovene.php\n         A       lang/Spanish.php\n         A       lang/Swedish.php\n         A       lang/Turkish.php\n         A       recaptchalib.php\nSuccessfully followed parent\nr3 = 7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f \n(refs/remotes/svn/tags/vendor/5.4)\n         A       dd-formmailer.css\n         A       dd-formmailer.php\n         A       lang/BrazilianPortuguese.php\n         A       lang/Catalan.php\n         A       lang/Danish.php\n         A       lang/Deutsch.php\n         A       lang/Dutch.php\n         A       lang/English.php\n         A       lang/Finnish.php\n         A       lang/French.php\n         A       lang/Greek.php\n         A       lang/Italian.php\n         A       lang/NorwegianBokmaal.php\n         A       lang/Polish.php\n         A       lang/Portuguese.php\n         A       lang/Romanian.php\n         A       lang/Russian.php\n         A       lang/Slovak.php\n         A       lang/Slovene.php\n         A       lang/Spanish.php\n         A       lang/Swedish.php\n         A       lang/Turkish.php\n         A       recaptchalib.php\nr4 = 7ec3663fd8e7c9fcfeb2742968a948d6978776d4 (refs/remotes/svn/trunk)\n         M       dd-formmailer.css\n         M       dd-formmailer.php\n         A       dd-verify.php\nr5 = e65ba2bdcd12a1935c1a327507dad6b7117f452b (refs/remotes/svn/trunk)\n         A       calendar.gif\n         A       date_chooser.js\n         M       dd-formmailer.css\n         M       dd-formmailer.php\n         A       lang/Belarussian.php\n         A       lang/Czech.php\n         A       lang/Estonian.php\n         A       lang/Japanese.php\n         A       lang/Vietnamese.php\n         M       recaptchalib.php\nr6 = 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc \n(refs/remotes/svn/vendor/current)\nFound possible branch point: \nsvn+ssh://svn@vcs/dd-formmailer/vendor/current => \nsvn+ssh://svn@vcs/dd-formmailer/vendor/5.8, 3\nFound branch parent: (refs/remotes/svn/tags/vendor/5.8) \n8fd8668dbed2dde6b55306c71b3b629f5ed794ec\nFollowing parent with do_switch\n         A       calendar.gif\n         A       date_chooser.js\n         M       dd-formmailer.css\n         M       dd-formmailer.php\n         A       lang/Belarussian.php\n         A       lang/Czech.php\n         A       lang/Estonian.php\n         A       lang/Japanese.php\n         A       lang/Vietnamese.php\n         M       recaptchalib.php\nSuccessfully followed parent\nr7 = cc00cb187386298cf974dda69f151d2ad4795917 \n(refs/remotes/svn/tags/vendor/5.8)\n         A       calendar.gif\n         A       date_chooser.js\n         M       dd-formmailer.css\n         M       dd-formmailer.php\n         M       dd-verify.php\n         A       lang/Belarussian.php\n         A       lang/Czech.php\n         A       lang/Estonian.php\n         A       lang/Japanese.php\n         A       lang/Vietnamese.php\n         M       recaptchalib.php\nChecking svn:mergeinfo changes since r5: 1 sources, 1 changed\nW: Cannot find common ancestor between \ne65ba2bdcd12a1935c1a327507dad6b7117f452b and \n9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc. Ignoring merge info.\nr8 = 9a5cd8f55f377f469280171cd87219b8f528c693 (refs/remotes/svn/trunk)\n         M       dd-formmailer.php\nr9 = 8143782376d9fbc91a9181b367b72701205b017f (refs/remotes/svn/trunk)\n         M       dd-formmailer.php\nr10 = 6f563fc4c511ddcc53c2ffc5d26c1e116725bc6b (refs/remotes/svn/trunk)\n         M       _svn_client_config.txt\nr11 = e9130854178d2c2743a981f303cdd7f34e54b052 (refs/remotes/svn/trunk)\nsvnserve: E210002: Network connection closed unexpectedly\nChecked out HEAD:\n   svn+ssh://svn@vcs/dd-formmailer/trunk r11\n\n$ git branch -vv --list ; git for-each-ref\n* main e913085 Updated client config for Windows Scripts\ne9130854178d2c2743a981f303cdd7f34e54b052 commit refs/heads/main\n7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f commit \nrefs/remotes/svn/tags/vendor/5.4\ncc00cb187386298cf974dda69f151d2ad4795917 commit \nrefs/remotes/svn/tags/vendor/5.8\ne9130854178d2c2743a981f303cdd7f34e54b052 commit refs/remotes/svn/trunk\n9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc commit \nrefs/remotes/svn/vendor/current\n\n\nProcerdure:\n===========\n\n### a) preparation\ncd /d/Coding\n#\ncd dd-formmailer\nsvn log --xml --quiet | grep author | sort -u | perl -pe 's/.*>(.*?)<.*/$1 = /' > authors-transform.txt\n## edit authors-transform.txt accordingly\n\n### b) git-svn adapted from ProGit book, but with \"svn/\" prefix\ncd /d/Coding\ngit svn init --stdlayout --no-metadata --prefix=\"svn/\" -- 'svn+ssh://svn@vcs/dd-formmailer' dd-formmailer-git\ncd dd-formmailer-git\n## edit .git/config for additional branches and tags\n<< __EOF\n...\n[svn-remote \"svn\"]\n\t...\n\tfetch = trunk:refs/remotes/svn/trunk\n\tbranches = vendor/{current}:refs/remotes/svn/vendor/*\n\tbranches = branches/*:refs/remotes/svn/*\n\ttags = vendor/*:refs/remotes/svn/tags/vendor/*\n\ttags = tags/*:refs/remotes/svn/tags/*\n__EOF\n##\ncat .git/config\ngit svn fetch --authors-file ../dd-formmailer/authors-transform.txt\n#\ngit branch -vv --list ; git for-each-ref\ngitk --all &\n\n\nLog:\n====\n$ cat .git/config\n[core]\n        repositoryformatversion = 0\n        filemode = false\n        bare = false\n        logallrefupdates = true\n        symlinks = false\n        ignorecase = true\n[svn-remote \"svn\"]\n        noMetadata = 1\n        url = svn+ssh://svn@vcs/dd-formmailer\n        fetch = trunk:refs/remotes/svn/trunk\n        branches = vendor/{current}:refs/remotes/svn/vendor/*\n        branches = branches/*:refs/remotes/svn/*\n        tags = vendor/*:refs/remotes/svn/tags/vendor/*\n        tags = tags/*:refs/remotes/svn/tags/*\n\n$ git svn fetch --authors-file ../dd-formmailer/authors-transform.txt\nr1 = 158d53044a5628897379403647a19ea13594b532 (refs/remotes/svn/vendor/current)\n        A       _svn__guideline.txt\n        A       _svn_client_config.txt\n        A       _svn_dir_ignore_list.txt\nr1 = a795b654edbc296e6f38da398f032a4851fd0a9e (refs/remotes/svn/trunk)\n        A       dd-formmailer.css\n        A       dd-formmailer.php\n        A       lang/BrazilianPortuguese.php\n        A       lang/Catalan.php\n        A       lang/Danish.php\n        A       lang/Deutsch.php\n        A       lang/Dutch.php\n        A       lang/English.php\n        A       lang/Finnish.php\n        A       lang/French.php\n        A       lang/Greek.php\n        A       lang/Italian.php\n        A       lang/NorwegianBokmaal.php\n        A       lang/Polish.php\n        A       lang/Portuguese.php\n        A       lang/Romanian.php\n        A       lang/Russian.php\n        A       lang/Slovak.php\n        A       lang/Slovene.php\n        A       lang/Spanish.php\n        A       lang/Swedish.php\n        A       lang/Turkish.php\n        A       recaptchalib.php\nr2 = 8fd8668dbed2dde6b55306c71b3b629f5ed794ec (refs/remotes/svn/vendor/current)\nFound possible branch point: svn+ssh://svn@vcs/dd-formmailer/vendor/current => svn+ssh://svn@vcs/dd-formmailer/vendor/5.4, 1\nFound branch parent: (refs/remotes/svn/tags/vendor/5.4) 158d53044a5628897379403647a19ea13594b532\nFollowing parent with do_switch\n        A       dd-formmailer.css\n        A       dd-formmailer.php\n        A       lang/BrazilianPortuguese.php\n        A       lang/Catalan.php\n        A       lang/Danish.php\n        A       lang/Deutsch.php\n        A       lang/Dutch.php\n        A       lang/English.php\n        A       lang/Finnish.php\n        A       lang/French.php\n        A       lang/Greek.php\n        A       lang/Italian.php\n        A       lang/NorwegianBokmaal.php\n        A       lang/Polish.php\n        A       lang/Portuguese.php\n        A       lang/Romanian.php\n        A       lang/Russian.php\n        A       lang/Slovak.php\n        A       lang/Slovene.php\n        A       lang/Spanish.php\n        A       lang/Swedish.php\n        A       lang/Turkish.php\n        A       recaptchalib.php\nSuccessfully followed parent\nr3 = 7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f (refs/remotes/svn/tags/vendor/5.4)\n        A       dd-formmailer.css\n        A       dd-formmailer.php\n        A       lang/BrazilianPortuguese.php\n        A       lang/Catalan.php\n        A       lang/Danish.php\n        A       lang/Deutsch.php\n        A       lang/Dutch.php\n        A       lang/English.php\n        A       lang/Finnish.php\n        A       lang/French.php\n        A       lang/Greek.php\n        A       lang/Italian.php\n        A       lang/NorwegianBokmaal.php\n        A       lang/Polish.php\n        A       lang/Portuguese.php\n        A       lang/Romanian.php\n        A       lang/Russian.php\n        A       lang/Slovak.php\n        A       lang/Slovene.php\n        A       lang/Spanish.php\n        A       lang/Swedish.php\n        A       lang/Turkish.php\n        A       recaptchalib.php\nr4 = 7ec3663fd8e7c9fcfeb2742968a948d6978776d4 (refs/remotes/svn/trunk)\n        M       dd-formmailer.css\n        M       dd-formmailer.php\n        A       dd-verify.php\nr5 = e65ba2bdcd12a1935c1a327507dad6b7117f452b (refs/remotes/svn/trunk)\n        A       calendar.gif\n        A       date_chooser.js\n        M       dd-formmailer.css\n        M       dd-formmailer.php\n        A       lang/Belarussian.php\n        A       lang/Czech.php\n        A       lang/Estonian.php\n        A       lang/Japanese.php\n        A       lang/Vietnamese.php\n        M       recaptchalib.php\nr6 = 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc (refs/remotes/svn/vendor/current)\nFound possible branch point: svn+ssh://svn@vcs/dd-formmailer/vendor/current => svn+ssh://svn@vcs/dd-formmailer/vendor/5.8, 3\nFound branch parent: (refs/remotes/svn/tags/vendor/5.8) 8fd8668dbed2dde6b55306c71b3b629f5ed794ec\nFollowing parent with do_switch\n        A       calendar.gif\n        A       date_chooser.js\n        M       dd-formmailer.css\n        M       dd-formmailer.php\n        A       lang/Belarussian.php\n        A       lang/Czech.php\n        A       lang/Estonian.php\n        A       lang/Japanese.php\n        A       lang/Vietnamese.php\n        M       recaptchalib.php\nSuccessfully followed parent\nr7 = cc00cb187386298cf974dda69f151d2ad4795917 (refs/remotes/svn/tags/vendor/5.8)\n        A       calendar.gif\n        A       date_chooser.js\n        M       dd-formmailer.css\n        M       dd-formmailer.php\n        M       dd-verify.php\n        A       lang/Belarussian.php\n        A       lang/Czech.php\n        A       lang/Estonian.php\n        A       lang/Japanese.php\n        A       lang/Vietnamese.php\n        M       recaptchalib.php\nChecking svn:mergeinfo changes since r5: 1 sources, 1 changed\nW: Cannot find common ancestor between e65ba2bdcd12a1935c1a327507dad6b7117f452b and 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc. Ignoring merge info.\nr8 = 9a5cd8f55f377f469280171cd87219b8f528c693 (refs/remotes/svn/trunk)\n        M       dd-formmailer.php\nr9 = 8143782376d9fbc91a9181b367b72701205b017f (refs/remotes/svn/trunk)\n        M       dd-formmailer.php\nr10 = 6f563fc4c511ddcc53c2ffc5d26c1e116725bc6b (refs/remotes/svn/trunk)\n        M       _svn_client_config.txt\nr11 = e9130854178d2c2743a981f303cdd7f34e54b052 (refs/remotes/svn/trunk)\nsvnserve: E210002: Network connection closed unexpectedly\nChecked out HEAD:\n  svn+ssh://svn@vcs/dd-formmailer/trunk r11\n\n$ git branch -vv --list ; git for-each-ref\n* main e913085 Updated client config for Windows Scripts\ne9130854178d2c2743a981f303cdd7f34e54b052 commit refs/heads/main\n7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f commit refs/remotes/svn/tags/vendor/5.4\ncc00cb187386298cf974dda69f151d2ad4795917 commit refs/remotes/svn/tags/vendor/5.8\ne9130854178d2c2743a981f303cdd7f34e54b052 commit refs/remotes/svn/trunk\n9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc commit refs/remotes/svn/vendor/current\n"},{"id":"413341","messageId":"84b991e2c08c8d0d2154d2f0a2b1b3c5@mailbox.org","threadId":"54883","inReplyTo":"8d48309d968019307915432395e226fc@mailbox.org","subject":"Re: [bug] git svn fetch: defect history - missing merges and wrong tag ancestors","fromName":"M. Buecher","fromEmail":"maddes+git@maddes.net","sentAt":"2021-01-03T18:12:23Z","receivedAt":"2021-01-03T18:13:30Z","isPatch":false,"sender":{"key":"maddes+git@maddes.net","avatar":null},"body":"\nOn 2020-12-25 23:24, M. Buecher wrote:\n> Dear all,\n> \n> I finally had the time to start converting some older Subversion\n> repositories to git repositiers and run into issues with repos using\n> \"parallel\" branches, so-called vendor branches [1] in Subversion to\n> track upstream changes via snapshots in a separate branch and merge\n> them into the custom build on trunk.\n> \n> Just wanting to convert the Subversion history as-is to git.\n> I studied the git-svn reference docs [2] plus the related chapter of\n> the ProGit book [3] and assume that I understood how git-svn works.\n> Still I'm not a git expert, just a sporadic user.\n> \n> Somehow `git svn fetch` (2.29.2.windows.3) looses merge information\n> between vendor branch and trunk plus tags are referencing the\n> predecessors instead of the original ancestor.\n> Maybe there is a manual way to fix this for that small repository, but\n> it wouldn't be feasible for larger repositories, that's why I deceided\n> to write this bug report.\n> Is there anything I missed? (see my procedure below)\n> \n> Fortunately I ran quite early into these issues and also with a very\n> small repository of just 11 commits, so I can provide a small\n> reproduction case (see below after the links).\n> Hoping you can enhance `git svn fetch`.\n\nTested further with re-created Subversion repositories, that either \nlooked the same but made sure that svn:mergeinfo is present (Subversion \n >=1.5 via \"cherry pick merge\", no \"2-URL merge\"), or that has the vendor branch being copied from trunk (both attached).\nOnly when the vendor branch was a copy from trunk, then svn-git got the \nmerges correct. Otherwise - even with svn:mergeinfo - it does not get \nthe merges.\n\nAssumption:\nIt seems that git svn handles trunk and branches in a special way, but \nSubversion actually does not have branches.\nIn Subversion there are just directories and files, and a branch/tag is \njust a copy of another directory+revision and merges can happen between \nany directories independent if they have related ancestry or not.\n\nWorkaround:\nAs git svn does not recognize all merges correctly (especially \ncross-branch copies) those lost links must be added manually.\nI wrote a small GNU awk script (attached) to determine all cross-branch \ncopies from an `svnadmin dump`. This way the first revision when \nsomething got copied is known.\nRunning git svn just to that revision, then fixing the parents and \ncontinuing with git svn up the next revision.\nThis helps git svn to find the correct ancestors and correctly build the \nfollow merges.\nThe parents can be changed with `git replace -f --graft <commit> \n<existing correct parents> <additional correct parents>`.\nAdditionally before continuing with git svn this `git replace` change \ncan be made permanent with `git-filter-repo --force --replace-refs \ndelete-no-add`.\n\n\n> Any help is appreciated, thanks in advance\n> Matthias Bücher\n> \n> \n> [Links]\n> [1]\n> http://svnbook.red-bean.com/en/1.8/svn.advanced.vendorbr.html#svn.advanced.vendorbr.mirrored-sources\n> [2] https://git-scm.com/docs/git-svn\n> [3] \n> https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git\n> \n> \n> [System Info]\n> git version:\n> git version 2.29.2.windows.3\n> cpu: x86_64\n> built from commit: d054eb1fc46ff23e7c95756a7c747e2f2864b478\n> sizeof-long: 4\n> sizeof-size_t: 8\n> shell-path: /bin/sh\n> uname: Windows 10.0 19042\n> compiler info: gnuc: 10.2\n> libc info: no libc information available\n> $SHELL (typically, interactive shell): C:\\Program \n> Files\\Git\\usr\\bin\\bash.exe\n> \n> [Enabled Hooks]\n> none\n> \n> \n> [Commits in Subversion]\n> A Subversion repository dump is attached, plus a test where I\n> recreated the same history directly in a git repository without an\n> issue.\n> \n> * trunk:  a------------d--e--h--i--j--k\n> *                     /     /\n> * vendor: a (empty)--b-----f\n> *                    ^     ^\n> * tags:              c     g\n> \n> * Vendor releases: b, f\n> * Custom modifications: e, i, j, k\n> * Tags: really just used as tags, although Subversion internally they\n> are branches. Therefore wanting to create lightweight git tags,\n> although annotated git tags would be fine too.\n> \n> \n> [Expected Subversion to git repo conversion]\n> * trunk => branch \"main\"\n> * branches/* => branch \"*\"\n> * tags/* => tag \"*\"\n> * vendor/current => branch \"vendor/current\" (can be renamed later to\n> just \"vendor\")\n> * vendor/* => tag \"vendor/*\" (except for vendor/current)\n> \n> Expected \"tags\":\n> vendor/5.4 = rev b (maybe c when annotated)\n> vendor/5.8 = rev f (maybe g when annotated)\n> \n> \n> [Wrong Results]\n> Merges from \"vendor/current\" branch to trunk get lost.\n> Tags are referencing the predecessors of the expected commit.\n> \n> \n> [Procedure]\n> ```\n> ### a) preparation\n> cd /d/Coding\n> #\n> cd dd-formmailer\n> svn log --xml --quiet | grep author | sort -u | perl -pe\n> 's/.*>(.*?)<.*/$1 = /' > authors-transform.txt\n> ## edit authors-transform.txt accordingly\n> \n> ### b) git-svn adapted from ProGit book, but with \"svn/\" prefix\n> cd /d/Coding\n> git svn init --stdlayout --no-metadata --prefix=\"svn/\" --\n> 'svn+ssh://svn@vcs/dd-formmailer' dd-formmailer-git\n> cd dd-formmailer-git\n> ## edit .git/config for additional vendor branches and tags\n> << __EOF\n> ...\n> [svn-remote \"svn\"]\n> \t...\n> \tfetch = trunk:refs/remotes/svn/trunk\n> #\tbranches = vendor/current:refs/remotes/svn/vendor/current ##\n> non-glob definition not working for branches\n> \tbranches = vendor/{current}:refs/remotes/svn/vendor/*\n> \tbranches = branches/*:refs/remotes/svn/*\n> \ttags = vendor/*:refs/remotes/svn/tags/vendor/*\n> \ttags = tags/*:refs/remotes/svn/tags/*\n> __EOF\n> ##\n> cat .git/config\n> git svn fetch --authors-file ../dd-formmailer/authors-transform.txt\n> #\n> git branch -vv --list ; git for-each-ref\n> gitk --all &\n> ```\n> \n> [Log]\n> $ cat .git/config\n> [core]\n>         repositoryformatversion = 0\n>         filemode = false\n>         bare = false\n>         logallrefupdates = true\n>         symlinks = false\n>         ignorecase = true\n> [svn-remote \"svn\"]\n>         noMetadata = 1\n>         url = svn+ssh://svn@vcs/dd-formmailer\n>         fetch = trunk:refs/remotes/svn/trunk\n>         branches = vendor/{current}:refs/remotes/svn/vendor/*\n>         branches = branches/*:refs/remotes/svn/*\n>         tags = vendor/*:refs/remotes/svn/tags/vendor/*\n>         tags = tags/*:refs/remotes/svn/tags/*\n> \n> $ git svn fetch --authors-file ../dd-formmailer/authors-transform.txt\n> r1 = 158d53044a5628897379403647a19ea13594b532 \n> (refs/remotes/svn/vendor/current)\n>         A       _svn__guideline.txt\n>         A       _svn_client_config.txt\n>         A       _svn_dir_ignore_list.txt\n> r1 = a795b654edbc296e6f38da398f032a4851fd0a9e (refs/remotes/svn/trunk)\n>         A       dd-formmailer.css\n>         A       dd-formmailer.php\n>         A       lang/BrazilianPortuguese.php\n>         A       lang/Catalan.php\n>         A       lang/Danish.php\n>         A       lang/Deutsch.php\n>         A       lang/Dutch.php\n>         A       lang/English.php\n>         A       lang/Finnish.php\n>         A       lang/French.php\n>         A       lang/Greek.php\n>         A       lang/Italian.php\n>         A       lang/NorwegianBokmaal.php\n>         A       lang/Polish.php\n>         A       lang/Portuguese.php\n>         A       lang/Romanian.php\n>         A       lang/Russian.php\n>         A       lang/Slovak.php\n>         A       lang/Slovene.php\n>         A       lang/Spanish.php\n>         A       lang/Swedish.php\n>         A       lang/Turkish.php\n>         A       recaptchalib.php\n> r2 = 8fd8668dbed2dde6b55306c71b3b629f5ed794ec \n> (refs/remotes/svn/vendor/current)\n> Found possible branch point:\n> svn+ssh://svn@vcs/dd-formmailer/vendor/current =>\n> svn+ssh://svn@vcs/dd-formmailer/vendor/5.4, 1\n> Found branch parent: (refs/remotes/svn/tags/vendor/5.4)\n> 158d53044a5628897379403647a19ea13594b532\n> Following parent with do_switch\n>         A       dd-formmailer.css\n>         A       dd-formmailer.php\n>         A       lang/BrazilianPortuguese.php\n>         A       lang/Catalan.php\n>         A       lang/Danish.php\n>         A       lang/Deutsch.php\n>         A       lang/Dutch.php\n>         A       lang/English.php\n>         A       lang/Finnish.php\n>         A       lang/French.php\n>         A       lang/Greek.php\n>         A       lang/Italian.php\n>         A       lang/NorwegianBokmaal.php\n>         A       lang/Polish.php\n>         A       lang/Portuguese.php\n>         A       lang/Romanian.php\n>         A       lang/Russian.php\n>         A       lang/Slovak.php\n>         A       lang/Slovene.php\n>         A       lang/Spanish.php\n>         A       lang/Swedish.php\n>         A       lang/Turkish.php\n>         A       recaptchalib.php\n> Successfully followed parent\n> r3 = 7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f \n> (refs/remotes/svn/tags/vendor/5.4)\n>         A       dd-formmailer.css\n>         A       dd-formmailer.php\n>         A       lang/BrazilianPortuguese.php\n>         A       lang/Catalan.php\n>         A       lang/Danish.php\n>         A       lang/Deutsch.php\n>         A       lang/Dutch.php\n>         A       lang/English.php\n>         A       lang/Finnish.php\n>         A       lang/French.php\n>         A       lang/Greek.php\n>         A       lang/Italian.php\n>         A       lang/NorwegianBokmaal.php\n>         A       lang/Polish.php\n>         A       lang/Portuguese.php\n>         A       lang/Romanian.php\n>         A       lang/Russian.php\n>         A       lang/Slovak.php\n>         A       lang/Slovene.php\n>         A       lang/Spanish.php\n>         A       lang/Swedish.php\n>         A       lang/Turkish.php\n>         A       recaptchalib.php\n> r4 = 7ec3663fd8e7c9fcfeb2742968a948d6978776d4 (refs/remotes/svn/trunk)\n>         M       dd-formmailer.css\n>         M       dd-formmailer.php\n>         A       dd-verify.php\n> r5 = e65ba2bdcd12a1935c1a327507dad6b7117f452b (refs/remotes/svn/trunk)\n>         A       calendar.gif\n>         A       date_chooser.js\n>         M       dd-formmailer.css\n>         M       dd-formmailer.php\n>         A       lang/Belarussian.php\n>         A       lang/Czech.php\n>         A       lang/Estonian.php\n>         A       lang/Japanese.php\n>         A       lang/Vietnamese.php\n>         M       recaptchalib.php\n> r6 = 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc \n> (refs/remotes/svn/vendor/current)\n> Found possible branch point:\n> svn+ssh://svn@vcs/dd-formmailer/vendor/current =>\n> svn+ssh://svn@vcs/dd-formmailer/vendor/5.8, 3\n> Found branch parent: (refs/remotes/svn/tags/vendor/5.8)\n> 8fd8668dbed2dde6b55306c71b3b629f5ed794ec\n> Following parent with do_switch\n>         A       calendar.gif\n>         A       date_chooser.js\n>         M       dd-formmailer.css\n>         M       dd-formmailer.php\n>         A       lang/Belarussian.php\n>         A       lang/Czech.php\n>         A       lang/Estonian.php\n>         A       lang/Japanese.php\n>         A       lang/Vietnamese.php\n>         M       recaptchalib.php\n> Successfully followed parent\n> r7 = cc00cb187386298cf974dda69f151d2ad4795917 \n> (refs/remotes/svn/tags/vendor/5.8)\n>         A       calendar.gif\n>         A       date_chooser.js\n>         M       dd-formmailer.css\n>         M       dd-formmailer.php\n>         M       dd-verify.php\n>         A       lang/Belarussian.php\n>         A       lang/Czech.php\n>         A       lang/Estonian.php\n>         A       lang/Japanese.php\n>         A       lang/Vietnamese.php\n>         M       recaptchalib.php\n> Checking svn:mergeinfo changes since r5: 1 sources, 1 changed\n> W: Cannot find common ancestor between\n> e65ba2bdcd12a1935c1a327507dad6b7117f452b and\n> 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc. Ignoring merge info.\n> r8 = 9a5cd8f55f377f469280171cd87219b8f528c693 (refs/remotes/svn/trunk)\n>         M       dd-formmailer.php\n> r9 = 8143782376d9fbc91a9181b367b72701205b017f (refs/remotes/svn/trunk)\n>         M       dd-formmailer.php\n> r10 = 6f563fc4c511ddcc53c2ffc5d26c1e116725bc6b (refs/remotes/svn/trunk)\n>         M       _svn_client_config.txt\n> r11 = e9130854178d2c2743a981f303cdd7f34e54b052 (refs/remotes/svn/trunk)\n> svnserve: E210002: Network connection closed unexpectedly\n> Checked out HEAD:\n>   svn+ssh://svn@vcs/dd-formmailer/trunk r11\n> \n> $ git branch -vv --list ; git for-each-ref\n> * main e913085 Updated client config for Windows Scripts\n> e9130854178d2c2743a981f303cdd7f34e54b052 commit refs/heads/main\n> 7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f commit \n> refs/remotes/svn/tags/vendor/5.4\n> cc00cb187386298cf974dda69f151d2ad4795917 commit \n> refs/remotes/svn/tags/vendor/5.8\n> e9130854178d2c2743a981f303cdd7f34e54b052 commit refs/remotes/svn/trunk\n> 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc commit \n> refs/remotes/svn/vendor/current\n\n#!/bin/gawk -f\n### GNU awk: https://www.gnu.org/software/gawk/manual/\n\n### analyze-svn-dump-for-cross-branch-copies.sh\n###\n### Parameters:\n### * csv=\";\" (or \",\") - export main information as CSV\n### * details=1 - see all copied pathes\n###\n### Copyright (C) 2021  Matthias Bücher, Germany <maddes@maddes.net>\n###\n### This program is free software: you can redistribute it and/or modify\n### it under the terms of the GNU General Public License as published by\n### the Free Software Foundation, either version 3 of the License, or\n### (at your option) any later version.\n###\n### This program is distributed in the hope that it will be useful,\n### but WITHOUT ANY WARRANTY; without even the implied warranty of\n### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n### GNU General Public License for more details.\n###\n### You should have received a copy of the GNU General Public License\n### along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\n\n### ATTENTION! function code has to be adapted to the structure of the repository and its historical changes\nfunction getBranchOfNodePath(nodepath,    branch) {\n  branch = \"\"\n  ### --- A) special cases\n  ## /vendor/*\n  if (match(nodepath, /^vendor\\/[^/]*/)) {\n    branch = substr(nodepath, RSTART, RLENGTH)\n  }\n  ## /tags/vendor/*\n  else if (match(nodepath, /^tags\\/vendor\\/[^/]*/)) {\n    branch = substr(nodepath, RSTART, RLENGTH)\n  }\n  ### --- B) standard layout: /branches/*, /tags/*, /trunk\n  else if (match(nodepath, /^branches\\/[^/]*/)) {\n    branch = substr(nodepath, RSTART, RLENGTH)\n  }\n  else if (match(nodepath, /^tags\\/[^/]*/)) {\n    branch = substr(nodepath, RSTART, RLENGTH)\n  }\n  else if (match(nodepath, /^trunk\\//)) {\n    branch = substr(nodepath, RSTART, RLENGTH-1)\n  }\n  ### --- C) fallback: remove last component\n  else {\n    branch = gensub(/\\/[^/]+$/, \"\", \"\", nodepath)\n  }\n  #\n  return branch\n}\n\n\nBEGIN {\n  FS = \"\\n\"\n}\n\nBEGINFILE {\n  ## initialize variables\n  revision = \"\"\n  nodepath = \"\"\n  nodecopyrev = \"\"\n  nodecopypath = \"\"\n  ## initialize arrays\n  delete cross_branch_copies\n  delete cross_branch_copies_first\n}\n\n/^Revision-number: / {\n  revision = $0\n  sub(/^Revision-number: /, \"\", revision)\n  sub(/^\\s+/, \"\", revision)\n  sub(/\\s+$/, \"\", revision)\n  #\n  nodepath = \"\"\n  nodecopyrev = \"\"\n  nodecopypath = \"\"\n}\n\n/^Node-path: / {\n  nodepath = $0\n  sub(/^Node-path: /, \"\", nodepath)\n  #\n  nodecopyrev = \"\"\n  nodecopypath = \"\"\n}\n\n/^Node-copyfrom-rev: / {\n  nodecopyrev = $0\n  sub(/^Node-copyfrom-rev: /, \"\", nodecopyrev)\n}\n\n/^Node-copyfrom-path: / {\n  nodecopypath = $0\n  sub(/^Node-copyfrom-path: /, \"\", nodecopypath)\n  #\n  branchfrom = getBranchOfNodePath(nodecopypath)\n  branchto = getBranchOfNodePath(nodepath)\n  #\n  if (branchfrom != branchto) {\n    cross_branch_copies[revision][branchfrom][branchto][nodepath][\"nodecopypath\"] = nodecopypath\n    cross_branch_copies[revision][branchfrom][branchto][nodepath][\"nodecopyrev\"] = nodecopyrev\n    if (!((branchfrom, branchto) in cross_branch_copies_first)) {\n      cross_branch_copies_first[branchfrom, branchto] = revision\n    }\n  }\n}\n\nENDFILE {\n  foundrevs = length(cross_branch_copies)\n  if (foundrevs == 0) {\n    printf(\"=== %s: No revisions found with cross-branch svn copies\\n\", FILENAME)\n  } else {\n    if (csv) {\n      backupofs=OFS\n    }\n    printf(\"=== %s: Found %i revisions with cross-branch svn copies\\n\", FILENAME, foundrevs)\n    if (csv) {\n      OFS=csv\n      print(\"\\\"Revision\\\"\", \"\\\"Branch from\\\"\", \"\\\"Branch to\\\"\")\n      OFS=backupofs\n    }\n    PROCINFO[\"sorted_in\"] = \"@ind_num_asc\"\n    for (revision in cross_branch_copies) {\n      if (!(csv)) {\n        print(\">>> Revision:\", revision)\n      }\n      count = 0\n      PROCINFO[\"sorted_in\"] = \"@ind_str_asc\"\n      for (branchfrom in cross_branch_copies[revision]) {\n        for (branchto in cross_branch_copies[revision][branchfrom]) {\n          if (csv) {\n            csvrevision = revision\n            csvbranchfrom = \"\\\"\" gensub(/\"/, \"\\\"\\\"\", \"g\", branchfrom) \"\\\"\"\n            csvbranchto = \"\\\"\" gensub(/\"/, \"\\\"\\\"\", \"g\", branchto) \"\\\"\"\n            OFS=csv\n            print(csvrevision, csvbranchfrom, csvbranchto)\n            OFS=backupofs\n          } else {\n            printf(\" svn copy from \\\"%s\\\" to \\\"%s\\\"\\n\", branchfrom, branchto)\n            if (details) {\n              for (nodepath in cross_branch_copies[revision][branchfrom][branchto]) {\n                count++\n                printf(\"  %4i. \\\"%s\\\" (Revision %i) to \\\"%s\\\"\\n\", count, cross_branch_copies[revision][branchfrom][branchto][nodepath][\"nodecopypath\"], cross_branch_copies[revision][branchfrom][branchto][nodepath][\"nodecopyrev\"], nodepath)\n              } ## nodepath\n            } ## details\n          } ## csv\n        } ## branchto\n      } ## branchfrom\n    } ## revision\n    #\n    printf(\"--- %s: List of first revision of each cross-branch copy\\n\", FILENAME)\n    PROCINFO[\"sorted_in\"] = \"@val_num_asc\"\n    if (csv) {\n      OFS=csv\n      print(\"\\\"Revision\\\"\", \"\\\"Branch from\\\"\", \"\\\"Branch to\\\"\")\n      OFS=backupofs\n    }\n    for (combined in cross_branch_copies_first) { ## combined: branchfrom, branchto\n      split(combined, separate, SUBSEP)\n      if (csv) {\n        csvrevision = cross_branch_copies_first[combined]\n        csvbranchfrom = \"\\\"\" gensub(/\"/, \"\\\"\\\"\", \"g\", separate[1]) \"\\\"\"\n        csvbranchto = \"\\\"\" gensub(/\"/, \"\\\"\\\"\", \"g\", separate[2]) \"\\\"\"\n        OFS=csv\n        print(csvrevision, csvbranchfrom, csvbranchto)\n        OFS=backupofs\n      } else {\n        printf(\" svn copy from \\\"%s\\\" to \\\"%s\\\" first in revision %i\\n\", separate[1], separate[2], cross_branch_copies_first[combined])\n      } ## csv\n    } ## combined\n    #\n    count = length(cross_branch_copies_first)\n    printf(\"^^^ %s: Found %i revisions (unique %i) with cross-branch svn copies\\n\", FILENAME, foundrevs, count)\n  } ## foundrevs\n}\n"},{"id":"416384","messageId":"483432d14bc272cf362fd8b722a09ede@mailbox.org","threadId":"54883","inReplyTo":"84b991e2c08c8d0d2154d2f0a2b1b3c5@mailbox.org","subject":"Re: [bug] git svn fetch: defect history - missing merges and wrong tag ancestors - third-party tool found","fromName":"M. Buecher","fromEmail":"maddes+git@maddes.net","sentAt":"2021-02-07T20:24:31Z","receivedAt":"2021-02-07T20:26:04Z","isPatch":false,"sender":{"key":"maddes+git@maddes.net","avatar":null},"body":"\n\nOn 2021-01-03 19:12, M. Buecher wrote:\n> On 2020-12-25 23:24, M. Buecher wrote:\n>> Dear all,\n>> \n>> I finally had the time to start converting some older Subversion\n>> repositories to git repositiers and run into issues with repos using\n>> \"parallel\" branches, so-called vendor branches [1] in Subversion to\n>> track upstream changes via snapshots in a separate branch and merge\n>> them into the custom build on trunk.\n>> \n>> Just wanting to convert the Subversion history as-is to git.\n>> I studied the git-svn reference docs [2] plus the related chapter of\n>> the ProGit book [3] and assume that I understood how git-svn works.\n>> Still I'm not a git expert, just a sporadic user.\n>> \n>> Somehow `git svn fetch` (2.29.2.windows.3) looses merge information\n>> between vendor branch and trunk plus tags are referencing the\n>> predecessors instead of the original ancestor.\n>> Maybe there is a manual way to fix this for that small repository, but\n>> it wouldn't be feasible for larger repositories, that's why I deceided\n>> to write this bug report.\n>> Is there anything I missed? (see my procedure below)\n>> \n>> Fortunately I ran quite early into these issues and also with a very\n>> small repository of just 11 commits, so I can provide a small\n>> reproduction case (see below after the links).\n>> Hoping you can enhance `git svn fetch`.\n> \n> Tested further with re-created Subversion repositories, that either\n> looked the same but made sure that svn:mergeinfo is present\n> (Subversion >=1.5 via \"cherry pick merge\", no \"2-URL merge\"), or that\n> has the vendor branch being copied from trunk (both attached).\n> Only when the vendor branch was a copy from trunk, then svn-git got\n> the merges correct. Otherwise - even with svn:mergeinfo - it does not\n> get the merges.\n> \n> Assumption:\n> It seems that git svn handles trunk and branches in a special way, but\n> Subversion actually does not have branches.\n> In Subversion there are just directories and files, and a branch/tag\n> is just a copy of another directory+revision and merges can happen\n> between any directories independent if they have related ancestry or\n> not.\n> \n> Workaround:\n> As git svn does not recognize all merges correctly (especially\n> cross-branch copies) those lost links must be added manually.\n> I wrote a small GNU awk script (attached) to determine all\n> cross-branch copies from an `svnadmin dump`. This way the first\n> revision when something got copied is known.\n> Running git svn just to that revision, then fixing the parents and\n> continuing with git svn up the next revision.\n> This helps git svn to find the correct ancestors and correctly build\n> the follow merges.\n> The parents can be changed with `git replace -f --graft <commit>\n> <existing correct parents> <additional correct parents>`.\n> Additionally before continuing with git svn this `git replace` change\n> can be made permanent with `git-filter-repo --force --replace-refs\n> delete-no-add`.\n> \n> \n>> Any help is appreciated, thanks in advance\n>> Matthias Bücher\n\nFound a nice tool called reposurgeon [4] that helps a lot to manage \nconverting a repository from Subversion to git, even in a scriptable \nway.\nThe authors also helped out to determine that my repository has some \nawkward commits due to older Subversion versions.\n\n[4] https://gitlab.com/esr/reposurgeon\n\n>> [Links]\n>> [1]\n>> http://svnbook.red-bean.com/en/1.8/svn.advanced.vendorbr.html#svn.advanced.vendorbr.mirrored-sources\n>> [2] https://git-scm.com/docs/git-svn\n>> [3] \n>> https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git\n>> \n>> \n>> [System Info]\n>> git version:\n>> git version 2.29.2.windows.3\n>> cpu: x86_64\n>> built from commit: d054eb1fc46ff23e7c95756a7c747e2f2864b478\n>> sizeof-long: 4\n>> sizeof-size_t: 8\n>> shell-path: /bin/sh\n>> uname: Windows 10.0 19042\n>> compiler info: gnuc: 10.2\n>> libc info: no libc information available\n>> $SHELL (typically, interactive shell): C:\\Program \n>> Files\\Git\\usr\\bin\\bash.exe\n>> \n>> [Enabled Hooks]\n>> none\n>> \n>> \n>> [Commits in Subversion]\n>> A Subversion repository dump is attached, plus a test where I\n>> recreated the same history directly in a git repository without an\n>> issue.\n>> \n>> * trunk:  a------------d--e--h--i--j--k\n>> *                     /     /\n>> * vendor: a (empty)--b-----f\n>> *                    ^     ^\n>> * tags:              c     g\n>> \n>> * Vendor releases: b, f\n>> * Custom modifications: e, i, j, k\n>> * Tags: really just used as tags, although Subversion internally they\n>> are branches. Therefore wanting to create lightweight git tags,\n>> although annotated git tags would be fine too.\n>> \n>> \n>> [Expected Subversion to git repo conversion]\n>> * trunk => branch \"main\"\n>> * branches/* => branch \"*\"\n>> * tags/* => tag \"*\"\n>> * vendor/current => branch \"vendor/current\" (can be renamed later to\n>> just \"vendor\")\n>> * vendor/* => tag \"vendor/*\" (except for vendor/current)\n>> \n>> Expected \"tags\":\n>> vendor/5.4 = rev b (maybe c when annotated)\n>> vendor/5.8 = rev f (maybe g when annotated)\n>> \n>> \n>> [Wrong Results]\n>> Merges from \"vendor/current\" branch to trunk get lost.\n>> Tags are referencing the predecessors of the expected commit.\n>> \n>> \n>> [Procedure]\n>> ```\n>> ### a) preparation\n>> cd /d/Coding\n>> #\n>> cd dd-formmailer\n>> svn log --xml --quiet | grep author | sort -u | perl -pe\n>> 's/.*>(.*?)<.*/$1 = /' > authors-transform.txt\n>> ## edit authors-transform.txt accordingly\n>> \n>> ### b) git-svn adapted from ProGit book, but with \"svn/\" prefix\n>> cd /d/Coding\n>> git svn init --stdlayout --no-metadata --prefix=\"svn/\" --\n>> 'svn+ssh://svn@vcs/dd-formmailer' dd-formmailer-git\n>> cd dd-formmailer-git\n>> ## edit .git/config for additional vendor branches and tags\n>> << __EOF\n>> ...\n>> [svn-remote \"svn\"]\n>> \t...\n>> \tfetch = trunk:refs/remotes/svn/trunk\n>> #\tbranches = vendor/current:refs/remotes/svn/vendor/current ##\n>> non-glob definition not working for branches\n>> \tbranches = vendor/{current}:refs/remotes/svn/vendor/*\n>> \tbranches = branches/*:refs/remotes/svn/*\n>> \ttags = vendor/*:refs/remotes/svn/tags/vendor/*\n>> \ttags = tags/*:refs/remotes/svn/tags/*\n>> __EOF\n>> ##\n>> cat .git/config\n>> git svn fetch --authors-file ../dd-formmailer/authors-transform.txt\n>> #\n>> git branch -vv --list ; git for-each-ref\n>> gitk --all &\n>> ```\n>> \n>> [Log]\n>> $ cat .git/config\n>> [core]\n>>         repositoryformatversion = 0\n>>         filemode = false\n>>         bare = false\n>>         logallrefupdates = true\n>>         symlinks = false\n>>         ignorecase = true\n>> [svn-remote \"svn\"]\n>>         noMetadata = 1\n>>         url = svn+ssh://svn@vcs/dd-formmailer\n>>         fetch = trunk:refs/remotes/svn/trunk\n>>         branches = vendor/{current}:refs/remotes/svn/vendor/*\n>>         branches = branches/*:refs/remotes/svn/*\n>>         tags = vendor/*:refs/remotes/svn/tags/vendor/*\n>>         tags = tags/*:refs/remotes/svn/tags/*\n>> \n>> $ git svn fetch --authors-file ../dd-formmailer/authors-transform.txt\n>> r1 = 158d53044a5628897379403647a19ea13594b532 \n>> (refs/remotes/svn/vendor/current)\n>>         A       _svn__guideline.txt\n>>         A       _svn_client_config.txt\n>>         A       _svn_dir_ignore_list.txt\n>> r1 = a795b654edbc296e6f38da398f032a4851fd0a9e (refs/remotes/svn/trunk)\n>>         A       dd-formmailer.css\n>>         A       dd-formmailer.php\n>>         A       lang/BrazilianPortuguese.php\n>>         A       lang/Catalan.php\n>>         A       lang/Danish.php\n>>         A       lang/Deutsch.php\n>>         A       lang/Dutch.php\n>>         A       lang/English.php\n>>         A       lang/Finnish.php\n>>         A       lang/French.php\n>>         A       lang/Greek.php\n>>         A       lang/Italian.php\n>>         A       lang/NorwegianBokmaal.php\n>>         A       lang/Polish.php\n>>         A       lang/Portuguese.php\n>>         A       lang/Romanian.php\n>>         A       lang/Russian.php\n>>         A       lang/Slovak.php\n>>         A       lang/Slovene.php\n>>         A       lang/Spanish.php\n>>         A       lang/Swedish.php\n>>         A       lang/Turkish.php\n>>         A       recaptchalib.php\n>> r2 = 8fd8668dbed2dde6b55306c71b3b629f5ed794ec \n>> (refs/remotes/svn/vendor/current)\n>> Found possible branch point:\n>> svn+ssh://svn@vcs/dd-formmailer/vendor/current =>\n>> svn+ssh://svn@vcs/dd-formmailer/vendor/5.4, 1\n>> Found branch parent: (refs/remotes/svn/tags/vendor/5.4)\n>> 158d53044a5628897379403647a19ea13594b532\n>> Following parent with do_switch\n>>         A       dd-formmailer.css\n>>         A       dd-formmailer.php\n>>         A       lang/BrazilianPortuguese.php\n>>         A       lang/Catalan.php\n>>         A       lang/Danish.php\n>>         A       lang/Deutsch.php\n>>         A       lang/Dutch.php\n>>         A       lang/English.php\n>>         A       lang/Finnish.php\n>>         A       lang/French.php\n>>         A       lang/Greek.php\n>>         A       lang/Italian.php\n>>         A       lang/NorwegianBokmaal.php\n>>         A       lang/Polish.php\n>>         A       lang/Portuguese.php\n>>         A       lang/Romanian.php\n>>         A       lang/Russian.php\n>>         A       lang/Slovak.php\n>>         A       lang/Slovene.php\n>>         A       lang/Spanish.php\n>>         A       lang/Swedish.php\n>>         A       lang/Turkish.php\n>>         A       recaptchalib.php\n>> Successfully followed parent\n>> r3 = 7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f \n>> (refs/remotes/svn/tags/vendor/5.4)\n>>         A       dd-formmailer.css\n>>         A       dd-formmailer.php\n>>         A       lang/BrazilianPortuguese.php\n>>         A       lang/Catalan.php\n>>         A       lang/Danish.php\n>>         A       lang/Deutsch.php\n>>         A       lang/Dutch.php\n>>         A       lang/English.php\n>>         A       lang/Finnish.php\n>>         A       lang/French.php\n>>         A       lang/Greek.php\n>>         A       lang/Italian.php\n>>         A       lang/NorwegianBokmaal.php\n>>         A       lang/Polish.php\n>>         A       lang/Portuguese.php\n>>         A       lang/Romanian.php\n>>         A       lang/Russian.php\n>>         A       lang/Slovak.php\n>>         A       lang/Slovene.php\n>>         A       lang/Spanish.php\n>>         A       lang/Swedish.php\n>>         A       lang/Turkish.php\n>>         A       recaptchalib.php\n>> r4 = 7ec3663fd8e7c9fcfeb2742968a948d6978776d4 (refs/remotes/svn/trunk)\n>>         M       dd-formmailer.css\n>>         M       dd-formmailer.php\n>>         A       dd-verify.php\n>> r5 = e65ba2bdcd12a1935c1a327507dad6b7117f452b (refs/remotes/svn/trunk)\n>>         A       calendar.gif\n>>         A       date_chooser.js\n>>         M       dd-formmailer.css\n>>         M       dd-formmailer.php\n>>         A       lang/Belarussian.php\n>>         A       lang/Czech.php\n>>         A       lang/Estonian.php\n>>         A       lang/Japanese.php\n>>         A       lang/Vietnamese.php\n>>         M       recaptchalib.php\n>> r6 = 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc \n>> (refs/remotes/svn/vendor/current)\n>> Found possible branch point:\n>> svn+ssh://svn@vcs/dd-formmailer/vendor/current =>\n>> svn+ssh://svn@vcs/dd-formmailer/vendor/5.8, 3\n>> Found branch parent: (refs/remotes/svn/tags/vendor/5.8)\n>> 8fd8668dbed2dde6b55306c71b3b629f5ed794ec\n>> Following parent with do_switch\n>>         A       calendar.gif\n>>         A       date_chooser.js\n>>         M       dd-formmailer.css\n>>         M       dd-formmailer.php\n>>         A       lang/Belarussian.php\n>>         A       lang/Czech.php\n>>         A       lang/Estonian.php\n>>         A       lang/Japanese.php\n>>         A       lang/Vietnamese.php\n>>         M       recaptchalib.php\n>> Successfully followed parent\n>> r7 = cc00cb187386298cf974dda69f151d2ad4795917 \n>> (refs/remotes/svn/tags/vendor/5.8)\n>>         A       calendar.gif\n>>         A       date_chooser.js\n>>         M       dd-formmailer.css\n>>         M       dd-formmailer.php\n>>         M       dd-verify.php\n>>         A       lang/Belarussian.php\n>>         A       lang/Czech.php\n>>         A       lang/Estonian.php\n>>         A       lang/Japanese.php\n>>         A       lang/Vietnamese.php\n>>         M       recaptchalib.php\n>> Checking svn:mergeinfo changes since r5: 1 sources, 1 changed\n>> W: Cannot find common ancestor between\n>> e65ba2bdcd12a1935c1a327507dad6b7117f452b and\n>> 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc. Ignoring merge info.\n>> r8 = 9a5cd8f55f377f469280171cd87219b8f528c693 (refs/remotes/svn/trunk)\n>>         M       dd-formmailer.php\n>> r9 = 8143782376d9fbc91a9181b367b72701205b017f (refs/remotes/svn/trunk)\n>>         M       dd-formmailer.php\n>> r10 = 6f563fc4c511ddcc53c2ffc5d26c1e116725bc6b \n>> (refs/remotes/svn/trunk)\n>>         M       _svn_client_config.txt\n>> r11 = e9130854178d2c2743a981f303cdd7f34e54b052 \n>> (refs/remotes/svn/trunk)\n>> svnserve: E210002: Network connection closed unexpectedly\n>> Checked out HEAD:\n>>   svn+ssh://svn@vcs/dd-formmailer/trunk r11\n>> \n>> $ git branch -vv --list ; git for-each-ref\n>> * main e913085 Updated client config for Windows Scripts\n>> e9130854178d2c2743a981f303cdd7f34e54b052 commit refs/heads/main\n>> 7ab4f436cafc8af3ed2e727a6d8cbef1a8f8b39f commit \n>> refs/remotes/svn/tags/vendor/5.4\n>> cc00cb187386298cf974dda69f151d2ad4795917 commit \n>> refs/remotes/svn/tags/vendor/5.8\n>> e9130854178d2c2743a981f303cdd7f34e54b052 commit refs/remotes/svn/trunk\n>> 9f95df7ce49c5d1cb4715017d223a8bd1c8dcffc commit \n>> refs/remotes/svn/vendor/current\n"}]}