git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Kagan <rkagan@mail.ru>
To: Benjamin Pabst <benjamin.pabst85@gmail.com>
Cc: git@vger.kernel.org, Roman Kagan <rkagan@mail.ru>
Subject: Re: Fwd: Error with git-svn pushing a rename
Date: Wed, 25 Dec 2013 01:11:16 +0400	[thread overview]
Message-ID: <1387919476-27921-1-git-send-email-rkagan@mail.ru> (raw)
In-Reply-To: <CAM-uYMiLpsQdN41Gs8iJOT-v0qKgod2vEeoC3C+QJ5+wKiVK-Q@mail.gmail.com>

Benjamin Pabst <benjamin.pabst85 <at> gmail.com> writes:
> is it possible to debug git-svn or get a more verbose / debug output
> from it? I already tried with the "GIT_TRACE" variable, but it does
> not include any further output on the svn methods.

I've hit this problem too, and tracked it down to what I think is a
bug in svn.  It fails in libsvn_ra_serf/commit.c:close_file() on invalid
->copy_path on the file context.

AFAICT this is do to the ra_serf version of add_file() lacking
apr_pstrdup() on the "copy_path" argument passed to it; as a result it
gets overwritten with garbage on further use:

libsvn_ra_serf/commit.c:
...
1852 static svn_error_t *
1853 add_file(const char *path,
1854          void *parent_baton,
1855          const char *copy_path,
1856          svn_revnum_t copy_revision,
1857          apr_pool_t *file_pool,
1858          void **file_baton)
1859 {
...
1875   new_file->copy_path = copy_path;
..

You can apply this workaround to get it to work:

--- a/perl/Git/SVN/Editor.pm
+++ b/perl/Git/SVN/Editor.pm
@@ -304,8 +304,9 @@ sub C {
 	my ($self, $m, $deletions) = @_;
 	my ($dir, $file) = split_path($m->{file_b});
 	my $pbat = $self->ensure_path($dir, $deletions);
+	my $upa = $self->url_path($m->{file_a});
 	my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
-				$self->url_path($m->{file_a}), $self->{r});
+				$upa, $self->{r});
 	print "\tC\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
 	$self->chg_file($fbat, $m);
 	$self->close_file($fbat,undef,$self->{pool});
@@ -323,8 +324,9 @@ sub R {
 	my ($self, $m, $deletions) = @_;
 	my ($dir, $file) = split_path($m->{file_b});
 	my $pbat = $self->ensure_path($dir, $deletions);
+	my $upa = $self->url_path($m->{file_a});
 	my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
-				$self->url_path($m->{file_a}), $self->{r});
+				$upa, $self->{r});
 	print "\tR\t$m->{file_a} => $m->{file_b}\n" unless $::_q;
 	$self->apply_autoprops($file, $fbat);
 	$self->chg_file($fbat, $m);


What it does is store the value to be passed to add_file() in a local
variable, and rely on perl to keep it alive through the end of function
scope, beyond the call to close_file() where it's actually used.

I'm going to submit a patch adding apr_pstrdup() to subversion folks.
Meanwhile if people find the above workarond a sensible thing to do in
git, I can submit a properly formed patch here too.

Roman.

  reply	other threads:[~2013-12-24 21:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAM-uYMgy8duxdGY8rbCJv9To3FFMAUDv22nnzbQ+e3QrTCLLpQ@mail.gmail.com>
     [not found] ` <CAM-uYMigCTK=j3HkyT0F=jtDoDERdtkpZiTXRvBhSHJW3edJ-w@mail.gmail.com>
2013-11-14 15:26   ` Fwd: Error with git-svn pushing a rename Benjamin Pabst
2013-11-15  7:34     ` Andreas Stricker
     [not found]       ` <CAM-uYMgn4SGqurqRG-RDiicLxpf9NfTPUvNn9FaFUUbxFRJsZw@mail.gmail.com>
2013-11-15 13:36         ` Andreas Stricker
2013-11-15 22:53           ` Jonathan Nieder
2013-11-17 22:55             ` Andreas Stricker
2013-11-20 22:10               ` Benjamin Pabst
2013-12-24 21:11                 ` Roman Kagan [this message]
2013-12-25 10:52                   ` Roman Kagan
2013-12-25 13:13                     ` Roman Kagan
2013-12-25 16:31                   ` Thomas Rast
2013-12-26 12:05                     ` [PATCH] git-svn: workaround for a bug in svn serf backend Roman Kagan
2013-12-26 20:28                       ` Jonathan Nieder
2013-12-27  6:09                         ` Roman Kagan
2013-12-27  7:52                           ` Roman Kagan
2013-12-27  8:05                         ` [PATCH v2] " Roman Kagan
2013-12-27 20:07                           ` Jonathan Nieder
2013-12-27 20:34                             ` Eric Wong
2013-12-27 22:22                               ` Junio C Hamano
2013-12-28  9:58                                 ` Roman Kagan
2013-12-30 19:44                                   ` Junio C Hamano
2013-12-31  7:20                                     ` Roman Kagan
2014-01-17 11:32                                       ` Roman Kagan
2014-01-17 19:23                                         ` Junio C Hamano
2014-01-06 15:51                                   ` Andreas Stricker
2013-12-30 12:20                       ` [PATCH] " Thomas Rast
2013-12-30 16:01                         ` Roman Kagan
2013-11-18 17:59           ` Fwd: Error with git-svn pushing a rename Benjamin Pabst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387919476-27921-1-git-send-email-rkagan@mail.ru \
    --to=rkagan@mail.ru \
    --cc=benjamin.pabst85@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).