{"thread":{"id":"13554","subject":"[PATCH] Fix path duplication in git svn commit-diff","startedAt":"2008-05-17T15:07:09Z","lastAt":"2008-06-02T11:53:03Z","messageCount":3,"participants":["Karl Hasselström","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"77191","messageId":"20080517150330.31899.12398.stgit@yoghurt","threadId":"13554","inReplyTo":null,"subject":"[PATCH] Fix path duplication in git svn commit-diff","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-05-17T15:07:09Z","receivedAt":"2008-05-17T15:07:09Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Given an SVN repo file:///tmp/svntest/repo, trying to commit changes\nto a file proj/trunk/foo.txt in that repo with this command line\n\n  git svn commit-diff -r2 HEAD^ HEAD file:///tmp/svntest/repo/proj/trunk\n\ngave the error message\n\n  Filesystem has no item: File not found: transaction '2-6', path\n  '/proj/trunk/proj/trunk/foo.txt'\n\nThis fixes the duplication.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\nI really don't have a clue as to why this was broken, but the patch\nfixes the problem for me, and doesn't break the tests. I got the idea\nfrom dcommit, which is setting svn_path to '' unconditionally.\n\n git-svn.perl |    3 +--\n 1 files changed, 1 insertions(+), 2 deletions(-)\n\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 2c53f39..1c2a10a 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -741,7 +741,7 @@ sub cmd_commit_diff {\n \tmy $usage = \"Usage: $0 commit-diff -r<revision> \".\n \t            \"<tree-ish> <tree-ish> [<URL>]\";\n \tfatal($usage) if (!defined $ta || !defined $tb);\n-\tmy $svn_path;\n+\tmy $svn_path = '';\n \tif (!defined $url) {\n \t\tmy $gs = eval { Git::SVN->new };\n \t\tif (!$gs) {\n@@ -765,7 +765,6 @@ sub cmd_commit_diff {\n \t\t$_message ||= get_commit_entry($tb)->{log};\n \t}\n \tmy $ra ||= Git::SVN::Ra->new($url);\n-\t$svn_path ||= $ra->{svn_path};\n \tmy $r = $_revision;\n \tif ($r eq 'HEAD') {\n \t\t$r = $ra->get_latest_revnum;\n"},{"id":"78284","messageId":"20080601094840.GB16064@hand.yhbt.net","threadId":"13554","inReplyTo":"20080517150330.31899.12398.stgit@yoghurt","subject":"Re: [PATCH] Fix path duplication in git svn commit-diff","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-06-01T09:48:40Z","receivedAt":"2008-06-01T09:48:40Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Karl Hasselström <kha@treskal.com> wrote:\n> Given an SVN repo file:///tmp/svntest/repo, trying to commit changes\n> to a file proj/trunk/foo.txt in that repo with this command line\n> \n>   git svn commit-diff -r2 HEAD^ HEAD file:///tmp/svntest/repo/proj/trunk\n> \n> gave the error message\n> \n>   Filesystem has no item: File not found: transaction '2-6', path\n>   '/proj/trunk/proj/trunk/foo.txt'\n> \n> This fixes the duplication.\n> \n> Signed-off-by: Karl Hasselström <kha@treskal.com>\n\nThanks Karl,\n\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> ---\n> \n> I really don't have a clue as to why this was broken, but the patch\n> fixes the problem for me, and doesn't break the tests. I got the idea\n> from dcommit, which is setting svn_path to '' unconditionally.\n\nHardly anybody uses commit-diff directly :)\n\nIt was a low-level plumbing command that I used to implement the\noriginal version of dcommit in.\n\n>  git-svn.perl |    3 +--\n>  1 files changed, 1 insertions(+), 2 deletions(-)\n> \n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index 2c53f39..1c2a10a 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -741,7 +741,7 @@ sub cmd_commit_diff {\n>  \tmy $usage = \"Usage: $0 commit-diff -r<revision> \".\n>  \t            \"<tree-ish> <tree-ish> [<URL>]\";\n>  \tfatal($usage) if (!defined $ta || !defined $tb);\n> -\tmy $svn_path;\n> +\tmy $svn_path = '';\n>  \tif (!defined $url) {\n>  \t\tmy $gs = eval { Git::SVN->new };\n>  \t\tif (!$gs) {\n> @@ -765,7 +765,6 @@ sub cmd_commit_diff {\n>  \t\t$_message ||= get_commit_entry($tb)->{log};\n>  \t}\n>  \tmy $ra ||= Git::SVN::Ra->new($url);\n> -\t$svn_path ||= $ra->{svn_path};\n>  \tmy $r = $_revision;\n>  \tif ($r eq 'HEAD') {\n>  \t\t$r = $ra->get_latest_revnum;\n> \n\n-- \nEric Wong\n"},{"id":"78357","messageId":"20080602115303.GA27924@diana.vm.bytemark.co.uk","threadId":"13554","inReplyTo":"20080601094840.GB16064@hand.yhbt.net","subject":"Re: [PATCH] Fix path duplication in git svn commit-diff","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-02T11:53:03Z","receivedAt":"2008-06-02T11:53:03Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-01 02:48:40 -0700, Eric Wong wrote:\n\n> Karl Hasselström <kha@treskal.com> wrote:\n>\n> > I really don't have a clue as to why this was broken, but the\n> > patch fixes the problem for me, and doesn't break the tests. I got\n> > the idea from dcommit, which is setting svn_path to ''\n> > unconditionally.\n>\n> Hardly anybody uses commit-diff directly :)\n>\n> It was a low-level plumbing command that I used to implement the\n> original version of dcommit in.\n\nYes. I was looking into how to call git-svn from StGit, and dcommit is\na bit too smart to be easily scriptable.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}