git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix path duplication in git svn commit-diff

From
Karl Hasselström <kha@treskal.com>
Date
May 17, 2008, 15:07 UTC
Message-ID
<20080517150330.31899.12398.stgit@yoghurt>

Given an SVN repo file:///tmp/svntest/repo, trying to commit changes to a file proj/trunk/foo.txt in that repo with this command line

  git svn commit-diff -r2 HEAD^ HEAD file:///tmp/svntest/repo/proj/trunk
gave the error message
  Filesystem has no item: File not found: transaction '2-6', path
  '/proj/trunk/proj/trunk/foo.txt'
This fixes the duplication.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---

I really don't have a clue as to why this was broken, but the patch fixes the problem for me, and doesn't break the tests. I got the idea from dcommit, which is setting svn_path to '' unconditionally.

 git-svn.perl |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 2c53f39..1c2a10a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -741,7 +741,7 @@ sub cmd_commit_diff {
 	my $usage = "Usage: $0 commit-diff -r<revision> ".
 	            "<tree-ish> <tree-ish> [<URL>]";
 	fatal($usage) if (!defined $ta || !defined $tb);
-	my $svn_path;
+	my $svn_path = '';
 	if (!defined $url) {
 		my $gs = eval { Git::SVN->new };
 		if (!$gs) {
@@ -765,7 +765,6 @@ sub cmd_commit_diff {
 		$_message ||= get_commit_entry($tb)->{log};
 	}
 	my $ra ||= Git::SVN::Ra->new($url);
-	$svn_path ||= $ra->{svn_path};
 	my $r = $_revision;
 	if ($r eq 'HEAD') {
 		$r = $ra->get_latest_revnum;
Next: Eric Wong
Message 1 of 3 in “Fix path duplication in git svn commit-diff”
  1. Fix path duplication in git svn commit-diffKarl Hasselström, May 17, 2008
  2. Eric WongJun 1, 2008
  3. Karl HasselströmJun 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.