{"thread":{"id":"15924","subject":"git-svn and svnsync","startedAt":"2008-10-16T08:07:13Z","lastAt":"2008-11-24T17:33:43Z","messageCount":4,"participants":["Andriy Gapon","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"93172","messageId":"48F6F631.90709@icyb.net.ua","threadId":"15924","inReplyTo":null,"subject":"git-svn and svnsync","fromName":"Andriy Gapon","fromEmail":"avg@icyb.net.ua","sentAt":"2008-10-16T08:07:13Z","receivedAt":"2008-10-16T08:07:13Z","isPatch":false,"sender":{"key":"avg@icyb.net.ua","avatar":null},"body":"\nI did the following:\n1. mirror svn repository using svnsync\n2. clone the mirror with git-svn --use-svnsync-props and some tweaking[*]\n3. run git svn info in the clone\n4. get error \"Unable to determine upstream SVN information from working \ntree history\"\n\ngit svn log and git svn rebase do not work either.\ngit log does work.\n\nI have git version 1.6.0.2 (from FreeBSD ports).\n[*] About the tweaking - I manually massaged config file to get the \nbranches I was interested in, so .git/config is this:\n[core]\n         repositoryformatversion = 0\n         filemode = true\n         bare = false\n         logallrefupdates = true\n[svn-remote \"svn\"]\n         useSvnsyncProps = 1\n         url = file:///system/devel/svn/base\n         fetch = head:refs/remotes/trunk\n         fetch = stable/6:refs/remotes/stable_6\n         fetch = stable/7:refs/remotes/stable_7\n         fetch = releng/6.3:refs/remotes/releng_6_3\n         fetch = releng/6.4:refs/remotes/releng_6_4\n         fetch = releng/7.0:refs/remotes/releng_7_0\n         fetch = release/6.3.0:refs/remotes/release_6_3_0\n         fetch = release/7.0.0:refs/remotes/release_7_0_0\n\nThis is .git/svn/.metadata:\n; This file is used internally by git-svn\n; You should not have to edit it\n[svn-remote \"svn\"]\n         reposRoot = file:///system/devel/svn/base\n         uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n         svnsync-uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n         svnsync-url = svn://svn.freebsd.org/base\n\nSo you can see the original svn repository URL.\n\ngit log reports svn info like the following:\ngit-svn-id: svn://svn.freebsd.org/base/stable/7@183898 \nccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n\nIt seems that the problem is that the code in find_by_url() and/or \nread_all_remotes() subroutines (in git-svn.perl) are not aware of \nsvnsync and do not realize an URL in logs and URL in svn-remote are \ndifferent.\nBTW, I see that there is some special svm logic in read_all_remotes.\n\nThank you very much for any help in advance.\n\n-- \nAndriy Gapon\n"},{"id":"96415","messageId":"492AA464.5070404@icyb.net.ua","threadId":"15924","inReplyTo":"48F6F631.90709@icyb.net.ua","subject":"Re: git-svn and svnsync","fromName":"Andriy Gapon","fromEmail":"avg@icyb.net.ua","sentAt":"2008-11-24T12:56:04Z","receivedAt":"2008-11-24T12:56:04Z","isPatch":false,"sender":{"key":"avg@icyb.net.ua","avatar":null},"body":"on 16/10/2008 11:07 Andriy Gapon said the following:\n> \n> I did the following:\n> 1. mirror svn repository using svnsync\n> 2. clone the mirror with git-svn --use-svnsync-props and some tweaking[*]\n> 3. run git svn info in the clone\n> 4. get error \"Unable to determine upstream SVN information from working\n> tree history\"\n> \n> git svn log and git svn rebase do not work either.\n> git log does work.\n> \n> I have git version 1.6.0.2 (from FreeBSD ports).\n> [*] About the tweaking - I manually massaged config file to get the\n> branches I was interested in, so .git/config is this:\n> [core]\n>         repositoryformatversion = 0\n>         filemode = true\n>         bare = false\n>         logallrefupdates = true\n> [svn-remote \"svn\"]\n>         useSvnsyncProps = 1\n>         url = file:///system/devel/svn/base\n>         fetch = head:refs/remotes/trunk\n>         fetch = stable/6:refs/remotes/stable_6\n>         fetch = stable/7:refs/remotes/stable_7\n>         fetch = releng/6.3:refs/remotes/releng_6_3\n>         fetch = releng/6.4:refs/remotes/releng_6_4\n>         fetch = releng/7.0:refs/remotes/releng_7_0\n>         fetch = release/6.3.0:refs/remotes/release_6_3_0\n>         fetch = release/7.0.0:refs/remotes/release_7_0_0\n> \n> This is .git/svn/.metadata:\n> ; This file is used internally by git-svn\n> ; You should not have to edit it\n> [svn-remote \"svn\"]\n>         reposRoot = file:///system/devel/svn/base\n>         uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>         svnsync-uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>         svnsync-url = svn://svn.freebsd.org/base\n> \n> So you can see the original svn repository URL.\n> \n> git log reports svn info like the following:\n> git-svn-id: svn://svn.freebsd.org/base/stable/7@183898\n> ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n> \n> It seems that the problem is that the code in find_by_url() and/or\n> read_all_remotes() subroutines (in git-svn.perl) are not aware of\n> svnsync and do not realize an URL in logs and URL in svn-remote are\n> different.\n> BTW, I see that there is some special svm logic in read_all_remotes.\n> \n> Thank you very much for any help in advance.\n> \n\nAnyone?\nI wonder if this is my local problem/misconfiguration or an issue with\ngit-svn.\n\n\n-- \nAndriy Gapon\n"},{"id":"96428","messageId":"492AE13D.5070102@drmicha.warpmail.net","threadId":"15924","inReplyTo":"492AA464.5070404@icyb.net.ua","subject":"Re: git-svn and svnsync","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2008-11-24T17:15:41Z","receivedAt":"2008-11-24T17:15:41Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Andriy Gapon venit, vidit, dixit 24.11.2008 13:56:\n> on 16/10/2008 11:07 Andriy Gapon said the following:\n>> I did the following:\n>> 1. mirror svn repository using svnsync\n>> 2. clone the mirror with git-svn --use-svnsync-props and some tweaking[*]\n>> 3. run git svn info in the clone\n>> 4. get error \"Unable to determine upstream SVN information from working\n>> tree history\"\n>>\n>> git svn log and git svn rebase do not work either.\n>> git log does work.\n>>\n>> I have git version 1.6.0.2 (from FreeBSD ports).\n>> [*] About the tweaking - I manually massaged config file to get the\n>> branches I was interested in, so .git/config is this:\n>> [core]\n>>         repositoryformatversion = 0\n>>         filemode = true\n>>         bare = false\n>>         logallrefupdates = true\n>> [svn-remote \"svn\"]\n>>         useSvnsyncProps = 1\n>>         url = file:///system/devel/svn/base\n>>         fetch = head:refs/remotes/trunk\n>>         fetch = stable/6:refs/remotes/stable_6\n>>         fetch = stable/7:refs/remotes/stable_7\n>>         fetch = releng/6.3:refs/remotes/releng_6_3\n>>         fetch = releng/6.4:refs/remotes/releng_6_4\n>>         fetch = releng/7.0:refs/remotes/releng_7_0\n>>         fetch = release/6.3.0:refs/remotes/release_6_3_0\n>>         fetch = release/7.0.0:refs/remotes/release_7_0_0\n>>\n>> This is .git/svn/.metadata:\n>> ; This file is used internally by git-svn\n>> ; You should not have to edit it\n>> [svn-remote \"svn\"]\n>>         reposRoot = file:///system/devel/svn/base\n>>         uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>>         svnsync-uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>>         svnsync-url = svn://svn.freebsd.org/base\n>>\n>> So you can see the original svn repository URL.\n>>\n>> git log reports svn info like the following:\n>> git-svn-id: svn://svn.freebsd.org/base/stable/7@183898\n>> ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>>\n>> It seems that the problem is that the code in find_by_url() and/or\n>> read_all_remotes() subroutines (in git-svn.perl) are not aware of\n>> svnsync and do not realize an URL in logs and URL in svn-remote are\n>> different.\n>> BTW, I see that there is some special svm logic in read_all_remotes.\n>>\n>> Thank you very much for any help in advance.\n>>\n> \n> Anyone?\n> I wonder if this is my local problem/misconfiguration or an issue with\n> git-svn.\n\nSame happens here, so it's a general issue ;)\n\nI think I encountered that before and ended up experimenting with\ngit-svn cloning from a svnsync source until I found the final config,\nwith which I git-svn cloned directly from upstream, so that I had to\nwait only twice.\n\nMichael\n"},{"id":"96430","messageId":"492AE577.30308@icyb.net.ua","threadId":"15924","inReplyTo":"492AE13D.5070102@drmicha.warpmail.net","subject":"Re: git-svn and svnsync","fromName":"Andriy Gapon","fromEmail":"avg@icyb.net.ua","sentAt":"2008-11-24T17:33:43Z","receivedAt":"2008-11-24T17:33:43Z","isPatch":false,"sender":{"key":"avg@icyb.net.ua","avatar":null},"body":"on 24/11/2008 19:15 Michael J Gruber said the following:\n> Andriy Gapon venit, vidit, dixit 24.11.2008 13:56:\n>> on 16/10/2008 11:07 Andriy Gapon said the following:\n>>> I did the following:\n>>> 1. mirror svn repository using svnsync\n>>> 2. clone the mirror with git-svn --use-svnsync-props and some tweaking[*]\n>>> 3. run git svn info in the clone\n>>> 4. get error \"Unable to determine upstream SVN information from working\n>>> tree history\"\n>>>\n>>> git svn log and git svn rebase do not work either.\n>>> git log does work.\n>>>\n>>> I have git version 1.6.0.2 (from FreeBSD ports).\n>>> [*] About the tweaking - I manually massaged config file to get the\n>>> branches I was interested in, so .git/config is this:\n>>> [core]\n>>>         repositoryformatversion = 0\n>>>         filemode = true\n>>>         bare = false\n>>>         logallrefupdates = true\n>>> [svn-remote \"svn\"]\n>>>         useSvnsyncProps = 1\n>>>         url = file:///system/devel/svn/base\n>>>         fetch = head:refs/remotes/trunk\n>>>         fetch = stable/6:refs/remotes/stable_6\n>>>         fetch = stable/7:refs/remotes/stable_7\n>>>         fetch = releng/6.3:refs/remotes/releng_6_3\n>>>         fetch = releng/6.4:refs/remotes/releng_6_4\n>>>         fetch = releng/7.0:refs/remotes/releng_7_0\n>>>         fetch = release/6.3.0:refs/remotes/release_6_3_0\n>>>         fetch = release/7.0.0:refs/remotes/release_7_0_0\n>>>\n>>> This is .git/svn/.metadata:\n>>> ; This file is used internally by git-svn\n>>> ; You should not have to edit it\n>>> [svn-remote \"svn\"]\n>>>         reposRoot = file:///system/devel/svn/base\n>>>         uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>>>         svnsync-uuid = ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>>>         svnsync-url = svn://svn.freebsd.org/base\n>>>\n>>> So you can see the original svn repository URL.\n>>>\n>>> git log reports svn info like the following:\n>>> git-svn-id: svn://svn.freebsd.org/base/stable/7@183898\n>>> ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f\n>>>\n>>> It seems that the problem is that the code in find_by_url() and/or\n>>> read_all_remotes() subroutines (in git-svn.perl) are not aware of\n>>> svnsync and do not realize an URL in logs and URL in svn-remote are\n>>> different.\n>>> BTW, I see that there is some special svm logic in read_all_remotes.\n>>>\n>>> Thank you very much for any help in advance.\n>>>\n>> Anyone?\n>> I wonder if this is my local problem/misconfiguration or an issue with\n>> git-svn.\n> \n> Same happens here, so it's a general issue ;)\n> \n> I think I encountered that before and ended up experimenting with\n> git-svn cloning from a svnsync source until I found the final config,\n> with which I git-svn cloned directly from upstream, so that I had to\n> wait only twice.\n\nI hacked together an ugly patch that replaces svm support with snvsync\nsupport. This works for me, not sure if it will be useful in general.\n\n\n-- \nAndriy Gapon\n\n\n--- git-svn\t2008-11-11 10:20:38.714620442 +0200\n+++ git-svn\t2008-11-07 17:10:49.245681213 +0200\n@@ -1433,7 +1433,7 @@\n sub read_all_remotes {\n \tmy $r = {};\n \tmy $use_svm_props = eval { command_oneline(qw/config --bool\n-\t    svn.useSvmProps/) };\n+\t    svn.useSvnsyncProps/) };\n \t$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;\n \tforeach (grep { s/^svn-remote\\.// } command(qw/config -l/)) {\n \t\tif (m!^(.+)\\.fetch=\\s*(.*)\\s*:\\s*(.+)\\s*$!) {\n@@ -1445,7 +1445,7 @@\n \t\t\t$local_ref =~ s{^/}{};\n \t\t\t$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n \t\t\t$r->{$remote}->{svm} = {} if $use_svm_props;\n-\t\t} elsif (m!^(.+)\\.usesvmprops=\\s*(.*)\\s*$!) {\n+\t\t} elsif (m!^(.+)\\.usesvnsyncprops=\\s*(.*)\\s*$!) {\n \t\t\t$r->{$1}->{svm} = {};\n \t\t} elsif (m!^(.+)\\.url=\\s*(.*)\\s*$!) {\n \t\t\t$r->{$1}->{url} = $2;\n@@ -1471,9 +1471,8 @@\n \t\t\t\tmy $section = \"svn-remote.$_\";\n \t\t\t\t$svm = {\n \t\t\t\t\tsource => tmp_config('--get',\n-\t\t\t\t\t    \"$section.svm-source\"),\n-\t\t\t\t\treplace => tmp_config('--get',\n-\t\t\t\t\t    \"$section.svm-replace\"),\n+\t\t\t\t\t    \"$section.svnsync-url\"),\n+\t\t\t\t\treplace => '',\n \t\t\t\t}\n \t\t\t};\n \t\t\t$r->{$_}->{svm} = $svm;\n"}]}