git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Fix path duplication in git svn commit-diff
@ 2008-05-17 15:07 Karl Hasselström
  2008-06-01  9:48 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Karl Hasselström @ 2008-05-17 15:07 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix path duplication in git svn commit-diff
  2008-05-17 15:07 [PATCH] Fix path duplication in git svn commit-diff Karl Hasselström
@ 2008-06-01  9:48 ` Eric Wong
  2008-06-02 11:53   ` Karl Hasselström
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2008-06-01  9:48 UTC (permalink / raw)
  To: Karl Hasselström; +Cc: git

Karl Hasselström <kha@treskal.com> wrote:
> 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>

Thanks Karl,

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
> 
> 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.

Hardly anybody uses commit-diff directly :)

It was a low-level plumbing command that I used to implement the
original version of dcommit in.

>  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;
> 

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix path duplication in git svn commit-diff
  2008-06-01  9:48 ` Eric Wong
@ 2008-06-02 11:53   ` Karl Hasselström
  0 siblings, 0 replies; 3+ messages in thread
From: Karl Hasselström @ 2008-06-02 11:53 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

On 2008-06-01 02:48:40 -0700, Eric Wong wrote:

> Karl Hasselström <kha@treskal.com> wrote:
>
> > 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.
>
> Hardly anybody uses commit-diff directly :)
>
> It was a low-level plumbing command that I used to implement the
> original version of dcommit in.

Yes. I was looking into how to call git-svn from StGit, and dcommit is
a bit too smart to be easily scriptable.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-02 11:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-17 15:07 [PATCH] Fix path duplication in git svn commit-diff Karl Hasselström
2008-06-01  9:48 ` Eric Wong
2008-06-02 11:53   ` Karl Hasselström

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).