{"thread":{"id":"16624","subject":"[PATCH] git-svn: Make following parents atomic","startedAt":"2008-12-07T16:06:10Z","lastAt":"2008-12-22T08:41:35Z","messageCount":9,"participants":["Deskin Miller","Junio C Hamano","Eric Wong","Thomas Jarosch"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"97303","messageId":"1228665970-21204-1-git-send-email-deskinm@umich.edu","threadId":"16624","inReplyTo":null,"subject":"[PATCH] git-svn: Make following parents atomic","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-12-07T16:06:10Z","receivedAt":"2008-12-07T16:06:10Z","isPatch":true,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"find_parent_branch generates branch@rev type branches when one has to\nlook back through SVN history to properly get the history for a branch\ncopied from somewhere not already being tracked by git-svn.  If in the\nprocess of fetching this history, git-svn is interrupted, then when one\nfetches again, it will use whatever was last fetched as the parent\ncommit and fail to fetch any more history which it didn't get to before\nbeing terminated.  This is especially troubling in that different\ngit-svn copies of the same SVN repository can end up with different\ncommit sha1s, incorrectly showing the history as divergent and\nprecluding easy collaboration using git push and fetch.\n\nTo fix this, when we initialise the Git::SVN object $gs to search for\nand perhaps fetch history, we check if there are any commits in SVN in\nthe range between the current revision $gs is at, and the top revision\nfor which we were asked to fill history.  If there are commits we're\nmissing in that range, we continue the fetch from the current revision\nto the top, properly getting all history before using it as the parent\nfor the branch we're trying to create.\n\nSigned-off-by: Deskin Miller <deskinm@umich.edu>\n---\nPatch is based on maint.\n\nThis was a nasty bug that took some work to figure out; I knew two\ngit-svn copies had diverged, but though I could look at the commits\nwhere they diverged there was no good way to figure out what git-svn had\nbeen doing at that point.  I ended up writing a script to automate the\nprocess and save information for me to analyse later; I'll be posting an\nannouncement with further explanation, but the repository is available\nat\n\ngit://git.deskinm.fdns.net/git-svn-bugfix.git\n\nDeskin Miller\n\n git-svn.perl                     |   14 +++++++++++---\n t/t9104-git-svn-follow-parent.sh |   33 +++++++++++++++++++++++++++++++++\n 2 files changed, 44 insertions(+), 3 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 56238da..c53d864 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2318,9 +2318,17 @@ sub find_parent_branch {\n \t\t$gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);\n \t}\n \tmy ($r0, $parent) = $gs->find_rev_before($r, 1);\n-\tif (!defined $r0 || !defined $parent) {\n-\t\tmy ($base, $head) = parse_revision_argument(0, $r);\n-\t\tif ($base <= $r) {\n+\t{\n+\t\tmy ($base, $head);\n+\t\tif (!defined $r0 || !defined $parent) {\n+\t\t\t($base, $head) = parse_revision_argument(0, $r);\n+\t\t} else {\n+\t\t\tif ($r0 < $r) {\n+\t\t\t\t$gs->ra->get_log([$gs->{path}], $r0 + 1, $r, 1,\n+\t\t\t\t\t0, 1, sub { $base = $_[1] - 1 });\n+\t\t\t}\n+\t\t}\n+\t\tif (defined $base && $base <= $r) {\n \t\t\t$gs->fetch($base, $r);\n \t\t}\n \t\t($r0, $parent) = $gs->last_rev_commit;\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 4d964e2..8e7b95b 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -149,6 +149,39 @@ test_expect_success \"track initial change if it was only made to parent\" '\n \t     \"`git rev-parse r9270-d~1`\"\n \t'\n \n+test_expect_success \"follow-parent is atomic\" '\n+\tcd wc &&\n+\tsvn up &&\n+\tsvn mkdir stunk &&\n+\tcd stunk &&\n+\techo \"trunk stunk\" > readme &&\n+\tsvn add readme &&\n+\tcd .. &&\n+\tsvn ci -m \"trunk stunk\" &&\n+\techo \"stunk like junk\" >> stunk/readme &&\n+\tsvn ci -m \"really stunk\" &&\n+\tcd .. &&\n+\tsvn copy -m \"stunk flunked\" \"$svnrepo\"/stunk \"$svnrepo\"/flunk &&\n+\tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n+\tgit svn fetch -i stunk &&\n+\tgit update-ref refs/remotes/flunk@17 refs/remotes/stunk~1 &&\n+\tgit update-ref -d refs/remotes/stunk &&\n+\tgit config --unset svn-remote.svn.fetch stunk &&\n+\tmkdir -p \"$GIT_DIR\"/svn/flunk@17 &&\n+\trev_map=$(cd \"$GIT_DIR\"/svn/stunk && ls .rev_map*) &&\n+\tdd if=\"$GIT_DIR\"/svn/stunk/$rev_map \\\n+           of=\"$GIT_DIR\"/svn/flunk@17/$rev_map bs=24 count=1 &&\n+\trm -rf \"$GIT_DIR\"/svn/stunk &&\n+\tgit svn init --minimize-url -i flunk \"$svnrepo\"/flunk &&\n+\tgit svn fetch -i flunk &&\n+\tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n+\tgit svn fetch -i stunk &&\n+\ttest \"`git rev-parse --verify refs/remotes/flunk@17`\" \\\n+           = \"`git rev-parse --verify refs/remotes/stunk`\" &&\n+\ttest \"`git rev-parse --verify refs/remotes/flunk~1`\" \\\n+           = \"`git rev-parse --verify refs/remotes/stunk`\"\n+\t'\n+\n test_expect_success \"track multi-parent paths\" '\n \tsvn cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit-svn multi-fetch &&\n-- \n1.6.1.rc1.45.g123ed\n"},{"id":"97304","messageId":"20081207161039.GA21319@euler","threadId":"16624","inReplyTo":"1228665970-21204-1-git-send-email-deskinm@umich.edu","subject":"[ANNOUNCE] git-svn-bugfix script (Re: [PATCH] git-svn: Make following parents atomic)","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-12-07T16:10:39Z","receivedAt":"2008-12-07T16:10:39Z","isPatch":true,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"git-svn has some bugs where it won't create identical commits in\ndifferent git-svn copies of the same svn history, despite all relevant\nconfiguration being identical; oftentimes, the copies will diverge from\neach other at some point.  My theory for a long time was that\ninterrupting git svn fetch could cause this, and it turns out I was\nright in one case, but since it's not something I could easily interrupt\nmy normal workflow with to do forensics when it occurred, I ended up\nwriting a script to repeatedly fetch from a certain svn repository, and\ncompare refs to a supposedly pristine fetch until the refs diverged or\none fetched all the svn history; then, rinse and repeat the process from\nthe beginning.  It's available at\n\ngit://git.deskinm.fdns.net/git-svn-bugfix.git\n\nUsing this script, r3924 of SVN's svn repository flagged one bug\nrepeatedly, for which I've posted a patch.  I'm posting the repo because\nthere are other places where history diverges that I've not had a chance\nto debug yet, so others should feel free to use the script to find and\nfix them.  If anyone feels inclined, I'll gladly take patches to the\nscript, but I don't really care to handle data or bug reports you\ngenerate with it (at least not at this point); I can generate plenty of\ndata myself.\n\nDeskin Miller\n"},{"id":"97314","messageId":"20081207222444.GA10881@euler","threadId":"16624","inReplyTo":"1228665970-21204-1-git-send-email-deskinm@umich.edu","subject":"Re: [PATCH] git-svn: Make following parents atomic","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-12-07T22:24:44Z","receivedAt":"2008-12-07T22:24:44Z","isPatch":true,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"On Sun, Dec 07, 2008 at 11:06:10AM -0500, Deskin Miller wrote:\n> [...]\n>\n> To fix this, when we initialise the Git::SVN object $gs to search for\n> and perhaps fetch history, we check if there are any commits in SVN in\n> the range between the current revision $gs is at, and the top revision\n> for which we were asked to fill history.  If there are commits we're\n> missing in that range, we continue the fetch from the current revision\n> to the top, properly getting all history before using it as the parent\n> for the branch we're trying to create.\n\nOn looking at the patch again, I think I might have introduced a bug:\nit'll take the most commit on the parent branch, even if it was branched\nfrom an earlier point.  I'll spend more time looking at it and should\nhave a v2 in a day at most if I'm rigth, hopefully more like a few\nhours.\n\nDeskin Miller\n"},{"id":"97333","messageId":"1228717252-1016-1-git-send-email-deskinm@umich.edu","threadId":"16624","inReplyTo":"20081207222444.GA10881@euler","subject":"[PATCH v2] git-svn: Make following parents atomic","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-12-08T06:20:52Z","receivedAt":"2008-12-08T06:20:52Z","isPatch":true,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"find_parent_branch generates branch@rev type branches when one has to\nlook back through SVN history to properly get the history for a branch\ncopied from somewhere not already being tracked by git-svn.  If in the\nprocess of fetching this history, git-svn is interrupted, then when one\nfetches again, it will use whatever was last fetched as the parent\ncommit and fail to fetch any more history which it didn't get to before\nbeing terminated.  This is especially troubling in that different\ngit-svn copies of the same SVN repository can end up with different\ncommit sha1s, incorrectly showing the history as divergent and\nprecluding easy collaboration using git push and fetch.\n\nTo fix this, when we initialise the Git::SVN object $gs to search for\nand perhaps fetch history, we check if there are any commits in SVN in\nthe range between the current revision $gs is at, and the top revision\nfor which we were asked to fill history.  If there are commits we're\nmissing in that range, we continue the fetch from the current revision\nto the top, properly getting all history before using it as the parent\nfor the branch we're trying to create.\n\nSigned-off-by: Deskin Miller <deskinm@umich.edu>\n---\nFixes the bug I found after sending v1.  I squashed in a check for it\ninto the testcase; if it's preferable I can split it into its own\ntestcase (this one runs quite long as-is).\n\nDeskin Miller\n\n git-svn.perl                     |   16 ++++++++++---\n t/t9104-git-svn-follow-parent.sh |   43 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 55 insertions(+), 4 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 56238da..25ed2f4 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2318,12 +2318,20 @@ sub find_parent_branch {\n \t\t$gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);\n \t}\n \tmy ($r0, $parent) = $gs->find_rev_before($r, 1);\n-\tif (!defined $r0 || !defined $parent) {\n-\t\tmy ($base, $head) = parse_revision_argument(0, $r);\n-\t\tif ($base <= $r) {\n+\t{\n+\t\tmy ($base, $head);\n+\t\tif (!defined $r0 || !defined $parent) {\n+\t\t\t($base, $head) = parse_revision_argument(0, $r);\n+\t\t} else {\n+\t\t\tif ($r0 < $r) {\n+\t\t\t\t$gs->ra->get_log([$gs->{path}], $r0 + 1, $r, 1,\n+\t\t\t\t\t0, 1, sub { $base = $_[1] - 1 });\n+\t\t\t}\n+\t\t}\n+\t\tif (defined $base && $base <= $r) {\n \t\t\t$gs->fetch($base, $r);\n \t\t}\n-\t\t($r0, $parent) = $gs->last_rev_commit;\n+\t\t($r0, $parent) = $gs->find_rev_before($r, 1);\n \t}\n \tif (defined $r0 && defined $parent) {\n \t\tprint STDERR \"Found branch parent: ($self->{ref_id}) $parent\\n\";\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 4d964e2..45138a2 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -149,6 +149,49 @@ test_expect_success \"track initial change if it was only made to parent\" '\n \t     \"`git rev-parse r9270-d~1`\"\n \t'\n \n+test_expect_success \"follow-parent is atomic\" '\n+\tcd wc &&\n+\tsvn up &&\n+\tsvn mkdir stunk &&\n+\tcd stunk &&\n+\techo \"trunk stunk\" > readme &&\n+\tsvn add readme &&\n+\tcd .. &&\n+\tsvn ci -m \"trunk stunk\" &&\n+\techo \"stunk like junk\" >> stunk/readme &&\n+\tsvn ci -m \"really stunk\" &&\n+\techo \"stink stank stunk\" >> stunk/readme &&\n+\tsvn ci -m \"even the grinch agrees\" &&\n+\tcd .. &&\n+\tsvn copy -m \"stunk flunked\" \"$svnrepo\"/stunk \"$svnrepo\"/flunk &&\n+\t(svn cp -m \"early stunk flunked too\" \\\n+\t\t\"$svnrepo\"/stunk@17 \"$svnrepo\"/flunked ||\n+\tsvn cp -m \"early stunk flunked too\" \\\n+\t\t-r17 \"$svnrepo\"/stunk \"$svnrepo\"/flunked) &&\n+\tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n+\tgit svn fetch -i stunk &&\n+\tgit update-ref refs/remotes/flunk@18 refs/remotes/stunk~2 &&\n+\tgit update-ref -d refs/remotes/stunk &&\n+\tgit config --unset svn-remote.svn.fetch stunk &&\n+\tmkdir -p \"$GIT_DIR\"/svn/flunk@18 &&\n+\trev_map=$(cd \"$GIT_DIR\"/svn/stunk && ls .rev_map*) &&\n+\tdd if=\"$GIT_DIR\"/svn/stunk/$rev_map \\\n+           of=\"$GIT_DIR\"/svn/flunk@18/$rev_map bs=24 count=1 &&\n+\trm -rf \"$GIT_DIR\"/svn/stunk &&\n+\tgit svn init --minimize-url -i flunk \"$svnrepo\"/flunk &&\n+\tgit svn fetch -i flunk &&\n+\tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n+\tgit svn fetch -i stunk &&\n+\tgit svn init --minimize-url -i flunked \"$svnrepo\"/flunked &&\n+\tgit svn fetch -i flunked\n+\ttest \"`git rev-parse --verify refs/remotes/flunk@18`\" \\\n+           = \"`git rev-parse --verify refs/remotes/stunk`\" &&\n+\ttest \"`git rev-parse --verify refs/remotes/flunk~1`\" \\\n+           = \"`git rev-parse --verify refs/remotes/stunk`\" &&\n+\ttest \"`git rev-parse --verify refs/remotes/flunked~1`\" \\\n+           = \"`git rev-parse --verify refs/remotes/stunk~1`\"\n+\t'\n+\n test_expect_success \"track multi-parent paths\" '\n \tsvn cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit-svn multi-fetch &&\n-- \n1.6.1.rc1.45.g123ed\n"},{"id":"97340","messageId":"7v1vwj83sd.fsf@gitster.siamese.dyndns.org","threadId":"16624","inReplyTo":"1228717252-1016-1-git-send-email-deskinm@umich.edu","subject":"Re: [PATCH v2] git-svn: Make following parents atomic","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-08T08:33:22Z","receivedAt":"2008-12-08T08:33:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Deskin Miller <deskinm@umich.edu> writes:\n\n> +test_expect_success \"follow-parent is atomic\" '\n> +\tcd wc &&\n> +\tsvn up &&\n> +\tsvn mkdir stunk &&\n> +\tcd stunk &&\n> +\techo \"trunk stunk\" > readme &&\n> +\tsvn add readme &&\n> +\tcd .. &&\n\nIf you need to chdir around inside a test, please do that in a subshell,\nso that after failing any command in between, the next test will not start\nin an unexpected directory.\n\n> +\tsvn ci -m \"trunk stunk\" &&\n> +\techo \"stunk like junk\" >> stunk/readme &&\n> +\tsvn ci -m \"really stunk\" &&\n> +\techo \"stink stank stunk\" >> stunk/readme &&\n> +\tsvn ci -m \"even the grinch agrees\" &&\n> +\tcd .. &&\n> +\tsvn copy -m \"stunk flunked\" \"$svnrepo\"/stunk \"$svnrepo\"/flunk &&\n\n> +\t(svn cp -m \"early stunk flunked too\" \\\n> +\t\t\"$svnrepo\"/stunk@17 \"$svnrepo\"/flunked ||\n> +\tsvn cp -m \"early stunk flunked too\" \\\n> +\t\t-r17 \"$svnrepo\"/stunk \"$svnrepo\"/flunked) &&\n\nOn the other hand, I do not see a need for this portion to be in a\nsubshell.  Wouldn't a normal statement grouping with {} work just as well?\n"},{"id":"97346","messageId":"20081208133131.GA9190@euler","threadId":"16624","inReplyTo":"7v1vwj83sd.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v3] git-svn: Make following parents atomic","fromName":"Deskin Miller","fromEmail":"deskinm@umich.edu","sentAt":"2008-12-08T13:31:31Z","receivedAt":"2008-12-08T13:31:31Z","isPatch":true,"sender":{"key":"deskinm@umich.edu","avatar":"https://gravatar.com/avatar/d340a0e612cdf0a79535c71863c0b4c535e9aba63b42032226ae903e638b64f9?d=mp&s=160"},"body":"find_parent_branch generates branch@rev type branches when one has to\nlook back through SVN history to properly get the history for a branch\ncopied from somewhere not already being tracked by git-svn.  If in the\nprocess of fetching this history, git-svn is interrupted, then when one\nfetches again, it will use whatever was last fetched as the parent\ncommit and fail to fetch any more history which it didn't get to before\nbeing terminated.  This is especially troubling in that different\ngit-svn copies of the same SVN repository can end up with different\ncommit sha1s, incorrectly showing the history as divergent and\nprecluding easy collaboration using git push and fetch.\n\nTo fix this, when we initialise the Git::SVN object $gs to search for\nand perhaps fetch history, we check if there are any commits in SVN in\nthe range between the current revision $gs is at, and the top revision\nfor which we were asked to fill history.  If there are commits we're\nmissing in that range, we continue the fetch from the current revision\nto the top, properly getting all history before using it as the parent\nfor the branch we're trying to create.\n\nSigned-off-by: Deskin Miller <deskinm@umich.edu>\n---\nRe-roll based on Junio's comments on the testcase, plus fix some minor\nwhitespace lunacy I left in the testcase.\n\nOn Mon, Dec 08, 2008 at 12:33:22AM -0800, Junio C Hamano wrote:\n> Deskin Miller <deskinm@umich.edu> writes:\n> \n> > +test_expect_success \"follow-parent is atomic\" '\n> > +\tcd wc &&\n> > +\t[...]\n> > +\tcd .. &&\n> \n> If you need to chdir around inside a test, please do that in a subshell,\n> so that after failing any command in between, the next test will not start\n> in an unexpected directory.\n\nGood point; this even bit me once while I worked on this testcase, and I\nstill didn't take the hint (yikes!)\n \n> > +\t(svn cp -m \"early stunk flunked too\" \\\n> > +\t\t\"$svnrepo\"/stunk@17 \"$svnrepo\"/flunked ||\n> > +\tsvn cp -m \"early stunk flunked too\" \\\n> > +\t\t-r17 \"$svnrepo\"/stunk \"$svnrepo\"/flunked) &&\n> \n> On the other hand, I do not see a need for this portion to be in a\n> subshell.  Wouldn't a normal statement grouping with {} work just as well?\n\nIt does work as well; I just didn't know about the { cmd-list; }\nconstruction.\n\nThanks for the comments,\n\nDeskin Miller\n\n git-svn.perl                     |   16 ++++++++++---\n t/t9104-git-svn-follow-parent.sh |   42 ++++++++++++++++++++++++++++++++++++++\n 2 files changed, 54 insertions(+), 4 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 56238da..25ed2f4 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2318,12 +2318,20 @@ sub find_parent_branch {\n \t\t$gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);\n \t}\n \tmy ($r0, $parent) = $gs->find_rev_before($r, 1);\n-\tif (!defined $r0 || !defined $parent) {\n-\t\tmy ($base, $head) = parse_revision_argument(0, $r);\n-\t\tif ($base <= $r) {\n+\t{\n+\t\tmy ($base, $head);\n+\t\tif (!defined $r0 || !defined $parent) {\n+\t\t\t($base, $head) = parse_revision_argument(0, $r);\n+\t\t} else {\n+\t\t\tif ($r0 < $r) {\n+\t\t\t\t$gs->ra->get_log([$gs->{path}], $r0 + 1, $r, 1,\n+\t\t\t\t\t0, 1, sub { $base = $_[1] - 1 });\n+\t\t\t}\n+\t\t}\n+\t\tif (defined $base && $base <= $r) {\n \t\t\t$gs->fetch($base, $r);\n \t\t}\n-\t\t($r0, $parent) = $gs->last_rev_commit;\n+\t\t($r0, $parent) = $gs->find_rev_before($r, 1);\n \t}\n \tif (defined $r0 && defined $parent) {\n \t\tprint STDERR \"Found branch parent: ($self->{ref_id}) $parent\\n\";\ndiff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh\nindex 4d964e2..d80ea64 100755\n--- a/t/t9104-git-svn-follow-parent.sh\n+++ b/t/t9104-git-svn-follow-parent.sh\n@@ -149,6 +149,48 @@ test_expect_success \"track initial change if it was only made to parent\" '\n \t     \"`git rev-parse r9270-d~1`\"\n \t'\n \n+test_expect_success \"follow-parent is atomic\" '\n+\t(\n+\t\tcd wc &&\n+\t\tsvn up &&\n+\t\tsvn mkdir stunk &&\n+\t\techo \"trunk stunk\" > stunk/readme &&\n+\t\tsvn add stunk/readme &&\n+\t\tsvn ci -m \"trunk stunk\" &&\n+\t\techo \"stunk like junk\" >> stunk/readme &&\n+\t\tsvn ci -m \"really stunk\" &&\n+\t\techo \"stink stank stunk\" >> stunk/readme &&\n+\t\tsvn ci -m \"even the grinch agrees\"\n+\t) &&\n+\tsvn copy -m \"stunk flunked\" \"$svnrepo\"/stunk \"$svnrepo\"/flunk &&\n+\t{ svn cp -m \"early stunk flunked too\" \\\n+\t\t\"$svnrepo\"/stunk@17 \"$svnrepo\"/flunked ||\n+\tsvn cp -m \"early stunk flunked too\" \\\n+\t\t-r17 \"$svnrepo\"/stunk \"$svnrepo\"/flunked; } &&\n+\tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n+\tgit svn fetch -i stunk &&\n+\tgit update-ref refs/remotes/flunk@18 refs/remotes/stunk~2 &&\n+\tgit update-ref -d refs/remotes/stunk &&\n+\tgit config --unset svn-remote.svn.fetch stunk &&\n+\tmkdir -p \"$GIT_DIR\"/svn/flunk@18 &&\n+\trev_map=$(cd \"$GIT_DIR\"/svn/stunk && ls .rev_map*) &&\n+\tdd if=\"$GIT_DIR\"/svn/stunk/$rev_map \\\n+\t   of=\"$GIT_DIR\"/svn/flunk@18/$rev_map bs=24 count=1 &&\n+\trm -rf \"$GIT_DIR\"/svn/stunk &&\n+\tgit svn init --minimize-url -i flunk \"$svnrepo\"/flunk &&\n+\tgit svn fetch -i flunk &&\n+\tgit svn init --minimize-url -i stunk \"$svnrepo\"/stunk &&\n+\tgit svn fetch -i stunk &&\n+\tgit svn init --minimize-url -i flunked \"$svnrepo\"/flunked &&\n+\tgit svn fetch -i flunked\n+\ttest \"`git rev-parse --verify refs/remotes/flunk@18`\" \\\n+\t   = \"`git rev-parse --verify refs/remotes/stunk`\" &&\n+\ttest \"`git rev-parse --verify refs/remotes/flunk~1`\" \\\n+\t   = \"`git rev-parse --verify refs/remotes/stunk`\" &&\n+\ttest \"`git rev-parse --verify refs/remotes/flunked~1`\" \\\n+\t   = \"`git rev-parse --verify refs/remotes/stunk~1`\"\n+\t'\n+\n test_expect_success \"track multi-parent paths\" '\n \tsvn cp -m \"resurrect /glob\" \"$svnrepo\"/r9270 \"$svnrepo\"/glob &&\n \tgit-svn multi-fetch &&\n-- \n1.6.1.rc2\n"},{"id":"97392","messageId":"20081208233523.GB21675@hand.yhbt.net","threadId":"16624","inReplyTo":"20081208133131.GA9190@euler","subject":"Re: [PATCH v3] git-svn: Make following parents atomic","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-12-08T23:35:23Z","receivedAt":"2008-12-08T23:35:23Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Deskin Miller <deskinm@umich.edu> wrote:\n> find_parent_branch generates branch@rev type branches when one has to\n> look back through SVN history to properly get the history for a branch\n> copied from somewhere not already being tracked by git-svn.  If in the\n> process of fetching this history, git-svn is interrupted, then when one\n> fetches again, it will use whatever was last fetched as the parent\n> commit and fail to fetch any more history which it didn't get to before\n> being terminated.  This is especially troubling in that different\n> git-svn copies of the same SVN repository can end up with different\n> commit sha1s, incorrectly showing the history as divergent and\n> precluding easy collaboration using git push and fetch.\n> \n> To fix this, when we initialise the Git::SVN object $gs to search for\n> and perhaps fetch history, we check if there are any commits in SVN in\n> the range between the current revision $gs is at, and the top revision\n> for which we were asked to fill history.  If there are commits we're\n> missing in that range, we continue the fetch from the current revision\n> to the top, properly getting all history before using it as the parent\n> for the branch we're trying to create.\n> \n> Signed-off-by: Deskin Miller <deskinm@umich.edu>\n\nLooks good Deskin, thanks\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n"},{"id":"98073","messageId":"200812161422.58814.thomas.jarosch@intra2net.com","threadId":"16624","inReplyTo":"20081208233523.GB21675@hand.yhbt.net","subject":"Re: [PATCH v3] git-svn: Make following parents atomic","fromName":"Thomas Jarosch","fromEmail":"thomas.jarosch@intra2net.com","sentAt":"2008-12-16T13:22:44Z","receivedAt":"2008-12-16T13:22:44Z","isPatch":true,"sender":{"key":"thomas.jarosch@intra2net.com","avatar":"https://avatars.githubusercontent.com/u/1146758?v=4"},"body":"On Tuesday, 9. December 2008 00:35:23 you wrote:\n> > To fix this, when we initialise the Git::SVN object $gs to search for\n> > and perhaps fetch history, we check if there are any commits in SVN in\n> > the range between the current revision $gs is at, and the top revision\n> > for which we were asked to fill history.  If there are commits we're\n> > missing in that range, we continue the fetch from the current revision\n> > to the top, properly getting all history before using it as the parent\n> > for the branch we're trying to create.\n> >\n> > Signed-off-by: Deskin Miller <deskinm@umich.edu>\n>\n> Looks good Deskin, thanks\n\nThis patch has a very nice side effect, it seems to fix a long standing \nproblem with subversion imports. Here's the original report:\nhttps://kerneltrap.org/mailarchive/git/2008/4/8/1377514/thread\n\nMany of the 121 tags in my SVN tree were created by cvs2svn,\nwhich often created tags by copying older revisions\nof sub paths into the current tree. \n\nI've written a small script that checks out the same tag via git and SVN.\nIt runs a diff against those two trees and saves the result to a file\nso I can manually check it. With git-svn from 1.6.0.5, the results are \nhorrible: Over 30% of the tags didn't match the code in SVN.\n\nWith git-svn from 1.6.1rc3, my first two manual probes look very good.\nRight now I'm reimporting the svn tree and will have the results\nof the complete \"checkout comparison\" tomorrow.\n\nCheers,\nThomas\n"},{"id":"98538","messageId":"200812220942.05001.thomas.jarosch@intra2net.com","threadId":"16624","inReplyTo":"200812161422.58814.thomas.jarosch@intra2net.com","subject":"Re: [PATCH v3] git-svn: Make following parents atomic","fromName":"Thomas Jarosch","fromEmail":"thomas.jarosch@intra2net.com","sentAt":"2008-12-22T08:41:35Z","receivedAt":"2008-12-22T08:41:35Z","isPatch":true,"sender":{"key":"thomas.jarosch@intra2net.com","avatar":"https://avatars.githubusercontent.com/u/1146758?v=4"},"body":"On Tuesday, 16. December 2008 14:22:44 Thomas Jarosch wrote:\n> This patch has a very nice side effect, it seems to fix a long standing\n> problem with subversion imports. Here's the original report:\n> https://kerneltrap.org/mailarchive/git/2008/4/8/1377514/thread\n>\n> Many of the 121 tags in my SVN tree were created by cvs2svn,\n> which often created tags by copying older revisions\n> of sub paths into the current tree.\n>\n> I've written a small script that checks out the same tag via git and SVN.\n> It runs a diff against those two trees and saves the result to a file\n> so I can manually check it. With git-svn from 1.6.0.5, the results are\n> horrible: Over 30% of the tags didn't match the code in SVN.\n>\n> With git-svn from 1.6.1rc3, my first two manual probes look very good.\n> Right now I'm reimporting the svn tree and will have the results\n> of the complete \"checkout comparison\" tomorrow.\n\nYipeee, our SVN repository is fully migrated to git and split into handy 3-5GB \nrepositories. All the git tags match the code from the SVN tags,\nso I guess this was a good stress test for git-svn 1.6.0.6 :-)\n\nCheers,\nThomas\n"}]}