{"thread":{"id":"22008","subject":"Regression: git-svn clone failure","startedAt":"2009-12-22T18:43:20Z","lastAt":"2009-12-23T00:09:14Z","messageCount":10,"participants":["Andrew Myrick","Eric Wong","Sam Vilain","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130252","messageId":"8BD646EB-3F47-41F8-918C-19133CCCA89C@apple.com","threadId":"22008","inReplyTo":null,"subject":"Regression: git-svn clone failure","fromName":"Andrew Myrick","fromEmail":"amyrick@apple.com","sentAt":"2009-12-22T18:43:20Z","receivedAt":"2009-12-22T18:43:20Z","isPatch":false,"sender":{"key":"amyrick@apple.com","avatar":"https://avatars.githubusercontent.com/u/303045?v=4"},"body":"[Resending because I forgot to make the message plain text]\n\nI was testing the latest changes to git-svn pushed to Eric's repo (git://git.bogomips.org/git-svn) by cloning a few other projects that I work on, and one of those clones failed where it had succeeded with git 1.6.5.  The error message I received is:\n\nW:svn cherry-pick ignored (/branches/BranchA:3933-3950) - missing 1 commit(s) (eg 3fc50d3a7e0f555547ab34bb570db47ce71e1abb)\nW:svn cherry-pick ignored (/branches/BranchB:3951-3970) - missing 1 commit(s) (eg 3beb9f2fde0a91aa0e8097e05f9054b23b221daf)\nW:svn cherry-pick ignored (/branches/BranchC:3971-3985) - missing 1 commit(s) (eg a7ae202254604f8a78cca391be36c58efc79eb20)\nFound merge parent (svn:mergeinfo prop): 8b2cf9e9250b5ff1fe47c68215d0a178cfe35a3b\nFound merge parent (svn:mergeinfo prop): 59f8c571ae77885469bb31f007b0048ee7812e07\nfatal: ambiguous argument '0..1': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\nrev-list -1 0..1: command returned error: 128\n\nAt this point, the clone got stuck in a loop and I had to kill it.\n\nNote that all of the projects I cloned had \"svn cherry-pick ignored\" warnings sprinkled throughout the fetch logs; I'm not sure how much they matter.  It comes from find_extra_svn_parents(), which I would guess is a best-effort algorithm, and any failures to detect extra parents aren't anything to worry about.\n\nDoes anyone have suggestions on how I can debug this?  If you want to poke around, I can't provide access to the repository, but I can run commands and relay (sanitized) output if it will aid in debugging.\n\n-Andrew"},{"id":"130254","messageId":"20091222192115.GA10313@dcvr.yhbt.net","threadId":"22008","inReplyTo":"8BD646EB-3F47-41F8-918C-19133CCCA89C@apple.com","subject":"Re: Regression: git-svn clone failure","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-12-22T19:21:15Z","receivedAt":"2009-12-22T19:21:15Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Andrew Myrick <amyrick@apple.com> wrote:\n> [Resending because I forgot to make the message plain text]\n> \n> I was testing the latest changes to git-svn pushed to Eric's repo\n> (git://git.bogomips.org/git-svn) by cloning a few other projects that\n> I work on, and one of those clones failed where it had succeeded with\n> git 1.6.5.  The error message I received is:\n> \n> W:svn cherry-pick ignored (/branches/BranchA:3933-3950) - missing 1 commit(s) (eg 3fc50d3a7e0f555547ab34bb570db47ce71e1abb)\n> W:svn cherry-pick ignored (/branches/BranchB:3951-3970) - missing 1 commit(s) (eg 3beb9f2fde0a91aa0e8097e05f9054b23b221daf)\n> W:svn cherry-pick ignored (/branches/BranchC:3971-3985) - missing 1 commit(s) (eg a7ae202254604f8a78cca391be36c58efc79eb20)\n> Found merge parent (svn:mergeinfo prop): 8b2cf9e9250b5ff1fe47c68215d0a178cfe35a3b\n> Found merge parent (svn:mergeinfo prop): 59f8c571ae77885469bb31f007b0048ee7812e07\n> fatal: ambiguous argument '0..1': unknown revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> rev-list -1 0..1: command returned error: 128\n\nHi Andrew,\n\nThat looks like a simple error, does the following patch help?\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 3670960..dba0d12 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -3163,7 +3163,8 @@ sub find_extra_svn_parents {\n \t\t\t\tnext unless $new_parents[$i];\n \t\t\t\tnext unless $new_parents[$j];\n \t\t\t\tmy $revs = command_oneline(\n-\t\t\t\t\t\"rev-list\", \"-1\", \"$i..$j\",\n+\t\t\t\t\t\"rev-list\", \"-1\",\n+\t\t\t\t\t\"$new_parents[$i]..$new_parents[$j]\",\n \t\t\t\t       );\n \t\t\t\tif ( !$revs ) {\n \t\t\t\t\tundef($new_parents[$i]);\n\n\nUnfortunately I don't know my way around the rest of this code well\nso I shall defer to Sam if it's something else...\n-- \nEric Wong\n"},{"id":"130255","messageId":"B82A784D-C8D7-4DDF-AE63-390C7AE1CC2D@apple.com","threadId":"22008","inReplyTo":"20091222192115.GA10313@dcvr.yhbt.net","subject":"Re: Regression: git-svn clone failure","fromName":"Andrew Myrick","fromEmail":"amyrick@apple.com","sentAt":"2009-12-22T19:38:08Z","receivedAt":"2009-12-22T19:38:08Z","isPatch":false,"sender":{"key":"amyrick@apple.com","avatar":"https://avatars.githubusercontent.com/u/303045?v=4"},"body":"\nOn Dec 22, 2009, at 11:21 AM, Eric Wong wrote:\n> That looks like a simple error, does the following patch help?\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index 3670960..dba0d12 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -3163,7 +3163,8 @@ sub find_extra_svn_parents {\n> \t\t\t\tnext unless $new_parents[$i];\n> \t\t\t\tnext unless $new_parents[$j];\n> \t\t\t\tmy $revs = command_oneline(\n> -\t\t\t\t\t\"rev-list\", \"-1\", \"$i..$j\",\n> +\t\t\t\t\t\"rev-list\", \"-1\",\n> +\t\t\t\t\t\"$new_parents[$i]..$new_parents[$j]\",\n> \t\t\t\t       );\n> \t\t\t\tif ( !$revs ) {\n> \t\t\t\t\tundef($new_parents[$i]);\n> \n> \n\nWorked like a charm; the fetch is proceeding now.  Thanks, Eric!\n\nDo you know what the \"svn cherry-pick ignored\" warnings mean, and if it's something I should be concerned about?  This particular project is missing up to 65 commits at some revisions.\n\n-Andrew"},{"id":"130256","messageId":"20091222202617.GA20668@dcvr.yhbt.net","threadId":"22008","inReplyTo":"B82A784D-C8D7-4DDF-AE63-390C7AE1CC2D@apple.com","subject":"Re: Regression: git-svn clone failure","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-12-22T20:26:17Z","receivedAt":"2009-12-22T20:26:17Z","isPatch":false,"sender":{"key":"e@80x24.org","avatar":null},"body":"Andrew Myrick <amyrick@apple.com> wrote:\n> On Dec 22, 2009, at 11:21 AM, Eric Wong wrote:\n> > That looks like a simple error, does the following patch help?\n\n<snip>\n\n> Worked like a charm; the fetch is proceeding now.  Thanks, Eric!\n\nAwesome, tanks for the feedback, Andrew.\n\nI've pushed out a proper commit to git://git.bogomips.org/git-svn\nfor Junio (which also contains the previous pull request).\n\nAndrew Myrick (1):\n      git-svn: Remove obsolete MAXPARENT check\n\nEric Wong (3):\n      git svn: fix --revision when fetching deleted paths\n      update release notes for git svn in 1.6.6\n      git svn: lookup new parents correctly from svn:mergeinfo\n\nSam Vilain (5):\n      git-svn: expand the svn mergeinfo test suite, highlighting some failures\n      git-svn: memoize conversion of SVN merge ticket info to git commit ranges\n      git-svn: fix some mistakes with interpreting SVN mergeinfo commit ranges\n      git-svn: exclude already merged tips using one rev-list call\n      git-svn: detect cherry-picks correctly.\n\n> Do you know what the \"svn cherry-pick ignored\" warnings mean, and if\n> it's something I should be concerned about?  This particular project\n> is missing up to 65 commits at some revisions.\n\nDefinitely a question for Sam :)\n\n-- \nEric Wong\n"},{"id":"130257","messageId":"1261514132.23944.6.camel@denix","threadId":"22008","inReplyTo":"20091222192115.GA10313@dcvr.yhbt.net","subject":"Re: [spf:guess] Re: Regression: git-svn clone failure","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-12-22T20:35:32Z","receivedAt":"2009-12-22T20:35:32Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"On Tue, 2009-12-22 at 11:21 -0800, Eric Wong wrote:\n> That looks like a simple error, does the following patch help?\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index 3670960..dba0d12 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -3163,7 +3163,8 @@ sub find_extra_svn_parents {\n>  \t\t\t\tnext unless $new_parents[$i];\n>  \t\t\t\tnext unless $new_parents[$j];\n>  \t\t\t\tmy $revs = command_oneline(\n> -\t\t\t\t\t\"rev-list\", \"-1\", \"$i..$j\",\n> +\t\t\t\t\t\"rev-list\", \"-1\",\n> +\t\t\t\t\t\"$new_parents[$i]..$new_parents[$j]\",\n>  \t\t\t\t       );\n\nYes, that is the intent.\n\nHrm, I'd have thought my test would have stepped over that code when it\nmerged in a branch which merged two an svn branch which included a merge\nof another svn branch.  Obviously not!  I'll cook something up to cover\nthat..\n\nSam.\n"},{"id":"130258","messageId":"1261516416.23944.44.camel@denix","threadId":"22008","inReplyTo":"B82A784D-C8D7-4DDF-AE63-390C7AE1CC2D@apple.com","subject":"Re: Regression: git-svn clone failure","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-12-22T21:13:36Z","receivedAt":"2009-12-22T21:13:36Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"On Tue, 2009-12-22 at 11:38 -0800, Andrew Myrick wrote:\n> Worked like a charm; the fetch is proceeding now.  Thanks, Eric!\n> \n> Do you know what the \"svn cherry-pick ignored\" warnings mean, and if it's\n>  something I should be concerned about?  This particular project is missing\n>  up to 65 commits at some revisions.\n\nWith git, merge parent relationships imply (conceptually, anyway) that\nall of the changes reachable from that branch are included in the\ncommit.  If someone is doing cherry-picking, then they are specifically\nexcluding some commits, so adding a merge parent to that branch isn't\nright.  This is what the warning is saying.  It's happening every commit\nbecause that section of code doesn't know whether a mergeinfo record is\nnew or not.\n\nThis wasn't happening with the old code, because it was simply not\ndetecting them correctly and adding merge parents anyway.\n\nHowever in the case that someone is merging from another branch, merging\nmost commits, and only skipping a few, then it may make sense to record\nit as a real merge.  Here we start getting into non-deterministic\nconversion; I had to do this for perl.git, because the merge records\nweren't reliable.  Basically I had the script, when the amount of merged\nrecords was within a certain window, prompt me to ask me whether - based\non the change comment and outstanding files to merge - whether it should\nbe recorded as a real merge or not.  Then, depending on which option I\npicked, it would write out to the commit message a note of which files\nwere not *actually* merged in that commit.\n\nSomething like the below change might be the right thing for you, it\nmight not - before using it, make sure you keep a complete copy of your\ngit-svn clone so you can restart if required.  Run it for a bit and\ninspect the results.  Basically considers a 90% merge \"good enough\" and\nrecords the differences in the log.  It could be possible to record the\ncherry-pick information in the commit message, too - but we'd need to\nalso know which merge records were *added* in the current commit.\nActually, knowing that would make the whole thing much faster anyway, so\nperhaps we need to bite the bullet and record it somewhere in the\nmetadata.\n\nAnyway, this change may work - it doesn't break the test suite so that's\na good sign.  But hopefully it should give you an idea of the direction\nthings could have to take.  Perhaps you can see why I built a\nhigh-performance fastimport importer for perl.git...\n\nSubject: [PATCH] git-svn: consider 90% of a branch cherry picked to be a merge\n\nBe slightly fuzzy when deciding if a branch is a merge or a cherry pick; in\nsome instances this might indicate intentionally skipping changes as not\nrequired, as if they had performed a real merge and then skipped those\nfiles.\n\nSigned-off-by: Sam Vilain <sam@vilain.net>\n---\n git-svn.perl |   31 ++++++++++++++++++++++++++-----\n 1 files changed, 26 insertions(+), 5 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex f06e535..3064504 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -2562,6 +2562,10 @@ sub do_git_commit {\n \tunless ($self->no_metadata) {\n \t\tprint $msg_fh \"\\ngit-svn-id: $log_entry->{metadata}\\n\"\n \t\t              or croak $!;\n+\t\tif ($log_entry->{merge_notes}) {\n+\t\t\tprint $msg_fh \"\\ngit-svn-merge: $log_entry->{merge_notes}\\n\"\n+\t\t              or croak $!;\n+\t\t}\n \t}\n \t$msg_fh->flush == 0 or croak $!;\n \tclose $msg_fh or croak $!;\n@@ -3027,10 +3031,11 @@ sub check_cherry_pick {\n \tmy @ranges = @_;\n \tmy %commits = map { $_ => 1 }\n \t\t_rev_list(\"--no-merges\", $tip, \"--not\", $base);\n+\tmy $before = keys %commits;\n \tfor my $range ( @ranges ) {\n \t\tdelete @commits{_rev_list($range)};\n \t}\n-\treturn (keys %commits);\n+\treturn ($before, keys %commits);\n }\n \n BEGIN {\n@@ -3103,6 +3108,8 @@ sub find_extra_svn_parents {\n \tmy %excluded = map { $_ => 1 }\n \t\tparents_exclude($parents, grep { defined } @merge_tips);\n \n+\tmy @merge_warnings;\n+\n \t# check merge tips for new parents\n \tmy @new_parents;\n \tfor my $merge_tip ( @merge_tips ) {\n@@ -3118,14 +3125,25 @@ sub find_extra_svn_parents {\n \t\t       );\n \n \t\t# double check that there are no missing non-merge commits\n-\t\tmy (@incomplete) = check_cherry_pick(\n+\t\tmy ($total, @incomplete) = check_cherry_pick(\n \t\t\t$merge_base, $merge_tip,\n \t\t\t@$ranges,\n \t\t       );\n \n-\t\tif ( @incomplete ) {\n+\t\tif ( @incomplete and @incomplete > ($total*0.10) ) {\n \t\t\twarn \"W:svn cherry-pick ignored ($spec) - missing \"\n-\t\t\t\t.@incomplete.\" commit(s) (eg $incomplete[0])\\n\";\n+\t\t\t\t.@incomplete.\"/$total commit(s) (eg $incomplete[0])\\n\";\n+\t\t\t# XXX - can't do this, it will appear every time;\n+\t\t\t# we need to know this record was added this commit\n+\t\t\t#push @merge_warnings, \"picked: \". join(\" \",\n+\t\t\t#     map { my $x=$_; $x=~\n+\t\t\t#\ts{([a-f0-9]{12})[a-f0-9]+}{$1}g } @$ranges)\n+\t\t} elsif ( @incomplete ) {\n+\t\t\twarn \"W:treating svn cherry-pick as merge \"\n+\t\t\t\t.@incomplete.\"/$total commit(s) included\\n\";\n+\t\t\tpush @merge_warnings, \"skipped: \".\n+\t\t\t\tjoin(\" \", map { substr $_, 0, 12 } @incomplete)\n+\t\t\t\t.\")\";\n \t\t} else {\n \t\t\twarn\n \t\t\t\t\"Found merge parent (svn:mergeinfo prop): \",\n@@ -3151,6 +3169,7 @@ sub find_extra_svn_parents {\n \t\t}\n \t}\n \tpush @$parents, grep { defined } @new_parents;\n+\treturn ( @merge_warnings ? join(\"; \", @merge_warnings) : undef );\n }\n \n sub make_log_entry {\n@@ -3159,6 +3178,7 @@ sub make_log_entry {\n \n \tmy @parents = @$parents;\n \tmy $ps = $ed->{path_strip} || \"\";\n+\tmy $merge_notes;\n \tfor my $path ( grep { m/$ps/ } %{$ed->{dir_prop}} ) {\n \t\tmy $props = $ed->{dir_prop}{$path};\n \t\tif ( $props->{\"svk:merge\"} ) {\n@@ -3166,7 +3186,7 @@ sub make_log_entry {\n \t\t\t\t($ed, $props->{\"svk:merge\"}, \\@parents);\n \t\t}\n \t\tif ( $props->{\"svn:mergeinfo\"} ) {\n-\t\t\t$self->find_extra_svn_parents\n+\t\t\t$merge_notes = $self->find_extra_svn_parents\n \t\t\t\t($ed,\n \t\t\t\t $props->{\"svn:mergeinfo\"},\n \t\t\t\t \\@parents);\n@@ -3269,6 +3289,7 @@ sub make_log_entry {\n \t$log_entry{email} = $email;\n \t$log_entry{commit_name} = $commit_name;\n \t$log_entry{commit_email} = $commit_email;\n+\t$log_entry{merge_notes} = $merge_notes;\n \t\\%log_entry;\n }\n \n-- \n1.6.3.3\n"},{"id":"130259","messageId":"7vbphqzo2y.fsf@alter.siamese.dyndns.org","threadId":"22008","inReplyTo":"1261516416.23944.44.camel@denix","subject":"Re: Regression: git-svn clone failure","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-22T21:38:29Z","receivedAt":"2009-12-22T21:38:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Vilain <sam@vilain.net> writes:\n\n> With git, merge parent relationships imply (conceptually, anyway) that\n> all of the changes reachable from that branch are included in the\n> commit.  If someone is doing cherry-picking, then they are specifically\n> excluding some commits, so adding a merge parent to that branch isn't\n> right.  This is what the warning is saying.  It's happening every commit\n> because that section of code doesn't know whether a mergeinfo record is\n> new or not.\n> ...\n> Subject: [PATCH] git-svn: consider 90% of a branch cherry picked to be a merge\n>\n> Be slightly fuzzy when deciding if a branch is a merge or a cherry pick; in\n> some instances this might indicate intentionally skipping changes as not\n> required, as if they had performed a real merge and then skipped those\n> files.\n>\n> Signed-off-by: Sam Vilain <sam@vilain.net>\n\nIf I were _using_ git-svn (or any other tool), I would rather be forced to\nsee overlapping changes from both branches to sort out the conflict myself\nwhen I merge such a cherry-picked history, rather than an automated but\nunreliable operation that drops changes randomly, still records that\neverything from the branch is now merged, and reports \"everything is\npeachy\".\n\nThat sounds horrible, as you cannot trust your merges anymore.  I hope I\nam mis-interpreting what you wrote above.\n"},{"id":"130266","messageId":"B39991E2-D632-4FD5-B5DA-0B6B502BBFC8@apple.com","threadId":"22008","inReplyTo":"1261516416.23944.44.camel@denix","subject":"Re: Regression: git-svn clone failure","fromName":"Andrew Myrick","fromEmail":"amyrick@apple.com","sentAt":"2009-12-22T23:50:12Z","receivedAt":"2009-12-22T23:50:12Z","isPatch":false,"sender":{"key":"amyrick@apple.com","avatar":"https://avatars.githubusercontent.com/u/303045?v=4"},"body":"\nOn Dec 22, 2009, at 1:13 PM, Sam Vilain wrote:\n\n> On Tue, 2009-12-22 at 11:38 -0800, Andrew Myrick wrote:\n>> Worked like a charm; the fetch is proceeding now.  Thanks, Eric!\n>> \n>> Do you know what the \"svn cherry-pick ignored\" warnings mean, and if it's\n>> something I should be concerned about?  This particular project is missing\n>> up to 65 commits at some revisions.\n> \n> With git, merge parent relationships imply (conceptually, anyway) that\n> all of the changes reachable from that branch are included in the\n> commit.  If someone is doing cherry-picking, then they are specifically\n> excluding some commits, so adding a merge parent to that branch isn't\n> right.  This is what the warning is saying.  It's happening every commit\n> because that section of code doesn't know whether a mergeinfo record is\n> new or not.\n> \n> This wasn't happening with the old code, because it was simply not\n> detecting them correctly and adding merge parents anyway.\n\nThis makes perfect sense now.  Thank you for clarifying.  Unfortunately, I don't think the patch you provided will help my particular problem.  Allow me to elaborate.\n\nAs I mentioned before, my project's integration model is to create a separate branch for every change.  Specifically, we create a branch from a recent internal tag.  So, the model for a simple bug fix looks something like this:\n\n            F---G  branch1\n          /           \\\n        D  tag1  \\    E  tag2\n       /                 \\  /\nA---B                 C  trunk\n\nRevision B on trunk was tagged with tag1.  A bug was found in that version, so a branch was created from tag1, a fix was committed to the branch, and then the branch was merged back to trunk.  Finally, trunk is tagged with tag2.\n\nThe \"missing commit\" messages show up when git svn fetch is fetching revision C.  It warns the there is a cherry-pick from branch1, and states that commits D and F are missing.  These commits are just copies, however; there is no code change.  The svn:mergeinfo property on trunk also only points at commit G.  Should git-svn be ignoring commits D and F, which are copy operations, not code changes?\n\nAlso of note is that we very, very rarely cherry-pick commits, and never directly from a branch to trunk.  Branches are always integrated back to trunk in their entirety.\n\n-Andrew"},{"id":"130267","messageId":"4B315FA1.1060902@vilain.net","threadId":"22008","inReplyTo":"B39991E2-D632-4FD5-B5DA-0B6B502BBFC8@apple.com","subject":"Re: Regression: git-svn clone failure","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-12-23T00:09:05Z","receivedAt":"2009-12-23T00:09:05Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Andrew Myrick wrote:\n> This makes perfect sense now.  Thank you for clarifying.  Unfortunately, I don't think the patch you provided will help my particular problem.  Allow me to elaborate.\n>\n> As I mentioned before, my project's integration model is to create a separate branch for every change.  Specifically, we create a branch from a recent internal tag.  So, the model for a simple bug fix looks something like this:\n>\n>             F---G  branch1\n>           /           \\\n>         D  tag1  \\    E  tag2\n>        /                 \\  /\n> A---B                 C  trunk\n>\n> Revision B on trunk was tagged with tag1.  A bug was found in that version, so a branch was created from tag1, a fix was committed to the branch, and then the branch was merged back to trunk.  Finally, trunk is tagged with tag2.\n>\n> The \"missing commit\" messages show up when git svn fetch is fetching revision C.  It warns the there is a cherry-pick from branch1, and states that commits D and F are missing.  These commits are just copies, however; there is no code change.  The svn:mergeinfo property on trunk also only points at commit G.  Should git-svn be ignoring commits D and F, which are copy operations, not code changes?\n>\n> Also of note is that we very, very rarely cherry-pick commits, and never directly from a branch to trunk.  Branches are always integrated back to trunk in their entirety.\n>   \n\nOk. Yes, I can see that. I guess what the code needs to do then is\nfigure out if the missing changes didn't touch the tree, and exclude\nthem if that happens.\n\nin the check_cherry_pick function, try putting at the end something like;\n\nfor my $commit (keys %commits) {\nif (has_no_changes($commit)) {\ndelete $commits{$commit};\n}\n}\n\nBefore the return. has_no_changes should be:\n\nsub has_no_changes {\nmy $commit = shift;\n# merges should always have no changes, but more\n# importantly $commit~1 won't be defined for them, so\n# don't proceed if that is the case.\nmy $num_parents = split / /, command_oneline(\nqw(rev-list --parents -1 -m), $commit,\n);\nreturn 0 if $num_parents > 1;\nreturn (command_oneline(\"rev-parse\", \"$commit^{tree}\")\neq command_oneline(\"rev-parse\", \"$commit~1^{tree}\"));\n}\n\nhas_no_changes should also be memoized. Cherry picking a single commit\nfrom a large unrelated branch will be slow (using cat-file --batch could\nhelp here, but that's not something I can hack out off the cuff like\nthis), the first time, then it will remember whether particular commits\nhave changes or not.\n\nGood luck,\nSam\n"},{"id":"130268","messageId":"4B315FAA.2090708@vilain.net","threadId":"22008","inReplyTo":"7vbphqzo2y.fsf@alter.siamese.dyndns.org","subject":"Re: Regression: git-svn clone failure","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2009-12-23T00:09:14Z","receivedAt":"2009-12-23T00:09:14Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Sam Vilain <sam@vilain.net> writes:\n>   \n>> With git, merge parent relationships imply (conceptually, anyway) that all of the changes reachable from that branch are included in the commit.  If someone is doing cherry-picking, then they are specifically excluding some commits, so adding a merge parent to that branch isn't right.\n>> ...\n>> Subject: [PATCH] git-svn: consider 90% of a branch cherry picked to be a merge\n>>\n>> Be slightly fuzzy when deciding if a branch is a merge or a cherry pick; ... might ... if ...\n>>\n>> Signed-off-by: Sam Vilain <sam@vilain.net>\n>>     \n>\n> If I were _using_ git-svn (or any other tool), I would rather be forced to ... sort out the conflict myself ... rather than an automated but unreliable operation that drops changes randomly, ... and reports \"everything is peachy\".\n>\n> That sounds horrible, as you cannot trust your merges anymore.  I hope I\n> am mis-interpreting what you wrote above.\n>   \n\nWelcome to the world of SVN, Junio. It's a world of sunshine and\nhappiness, pain and despair.\n\nSam.\n"}]}