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

Re: Fwd: Error with git-svn pushing a rename

From
Roman Kagan <rkagan@mail.ru>
Date
Dec 24, 2013, 21:11 UTC
Message-ID
<1387919476-27921-1-git-send-email-rkagan@mail.ru>
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.
Previous: Benjamin PabstNext: Roman Kagan
Message 7 of 27 in “Fwd: Error with git-svn pushing a rename”
  1. Benjamin PabstNov 14, 2013
  2. Andreas StrickerNov 15, 2013
  3. Andreas StrickerNov 15, 2013
  4. Jonathan NiederNov 15, 2013
  5. Andreas StrickerNov 17, 2013
  6. Benjamin PabstNov 20, 2013
  7. Roman KaganDec 24, 2013
  8. Roman KaganDec 25, 2013
  9. Roman KaganDec 25, 2013
  10. Thomas RastDec 25, 2013
  11. git-svn: workaround for a bug in svn serf backendRoman Kagan, Dec 26, 2013
  12. Jonathan NiederDec 26, 2013
  13. Roman KaganDec 27, 2013
  14. Roman KaganDec 27, 2013
  15. git-svn: workaround for a bug in svn serf backendRoman Kagan, Dec 27, 2013
  16. Jonathan NiederDec 27, 2013
  17. Eric WongDec 27, 2013
  18. Junio C HamanoDec 27, 2013
  19. Roman KaganDec 28, 2013
  20. Junio C HamanoDec 30, 2013
  21. Roman KaganDec 31, 2013
  22. Roman KaganJan 17, 2014
  23. Junio C HamanoJan 17, 2014
  24. Andreas StrickerJan 6, 2014
  25. Thomas RastDec 30, 2013
  26. Roman KaganDec 30, 2013
  27. Benjamin PabstNov 18, 2013

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.