git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-svn fails in prop_walk if $self->{path} is not empty
@ 2008-05-27  8:46 ` Gerrit Pape
  2008-05-27 22:54   ` Nikolaus Schulz
  0 siblings, 1 reply; 5+ messages in thread
From: Gerrit Pape @ 2008-05-27  8:46 UTC (permalink / raw)
  To: git, Junio C Hamano

From: Christian Engwer <christi@uni-hd.de>

If url://repo/trunk is the current Git branch, prop_walk strips trunk
from the path name. That is useful as, for example "git svn show-ignore"
should not return results like

trunk/foo

but

foo

if svn:ignore for trunk includes foo.

The problem now is that prop_walk strips trunk from the path and then
calls itself recursively. But now trunk is missing in the path and
get_dir fails, because it is called for a non existing path.

The attached patch fixed the problem, by adding the priviously stipped
$self->{path} in the recursive call. I tested it with my current
git-svn repository for the commands show-ignore and show-external.

Patch was submitted through
 http://bugs.debian.org/477393

Signed-off-by: Gerrit Pape <pape@smarden.org>
---

I'm not that much a git-svn user, and didn't test this thoroughly.  I'd
be happy if anyone could crossread/test this, and maybe add a Acked-By.

Thanks, Gerrit.


 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 37976f2..72fef16 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1918,7 +1918,7 @@ sub prop_walk {
 
 	foreach (sort keys %$dirent) {
 		next if $dirent->{$_}->{kind} != $SVN::Node::dir;
-		$self->prop_walk($p . $_, $rev, $sub);
+		$self->prop_walk($self->{path} . $p . $_, $rev, $sub);
 	}
 }
 
-- 
1.5.5.1

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

* git-svn {show,create}-ignore chokes upon subdirs
@ 2008-05-27 16:20 Nikolaus Schulz
  2008-05-27  8:46 ` [PATCH] git-svn fails in prop_walk if $self->{path} is not empty Gerrit Pape
  2008-05-28  8:34 ` git-svn {show,create}-ignore chokes upon subdirs Sam Vilain
  0 siblings, 2 replies; 5+ messages in thread
From: Nikolaus Schulz @ 2008-05-27 16:20 UTC (permalink / raw)
  To: git

Hi, 

when importing subversion repositories into git, git-svn show-ignore and
create-ignore choke when scanning project subdirectories.  For example,
with the sequence

 git-svn init -s http://svn.red-bean.com/repos/producingoss producingoss-git-svn
 cd producingoss-git-svn
 git-svn fetch
 git-svn create-ignore 

the last command prints this: 

 HTTP Path Not Found: PROPFIND request failed on '/repos/producingoss/!svn/bc/1465/ca': '/repos/producingoss/!svn/bc/1465/ca' path not found at /home/nikolaus/nfs/nsbp/git/git/git-svn line 1897

Revision 1465 is the latest subversion revision of the project.  git-svn
create-ignore stages a correct .gitignore in the top level directory, then
aborts with the same error.  I have tested this with two svn projects, the
result is identical.  Bisecting suggested that this is broken since commit
01bdab84e31763a98206c31cf99b9dc3cb221356.

Nikolaus

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

* Re: [PATCH] git-svn fails in prop_walk if $self->{path} is not empty
  2008-05-27  8:46 ` [PATCH] git-svn fails in prop_walk if $self->{path} is not empty Gerrit Pape
@ 2008-05-27 22:54   ` Nikolaus Schulz
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolaus Schulz @ 2008-05-27 22:54 UTC (permalink / raw)
  To: git

Happy coincidence!

This patch happens to fix my problem posted in "git-svn
{show,create}-ignore chokes upon subdirs" today. 

Nikolaus

On Tue, May 27, 2008 at 08:46:55AM +0000, Gerrit Pape wrote:
> From: Christian Engwer <christi@uni-hd.de>
> 
> The problem now is that prop_walk strips trunk from the path and then
> calls itself recursively. But now trunk is missing in the path and
> get_dir fails, because it is called for a non existing path.
> 
> The attached patch fixed the problem, by adding the priviously stipped
> $self->{path} in the recursive call. 
> git-svn repository for the commands show-ignore and show-external.
> 
> Patch was submitted through
>  http://bugs.debian.org/477393
> 
> Signed-off-by: Gerrit Pape <pape@smarden.org>
> ---
> 
> I'm not that much a git-svn user, and didn't test this thoroughly.  I'd
> be happy if anyone could crossread/test this, and maybe add a Acked-By.
> 
> Thanks, Gerrit.
> 
> 
>  git-svn.perl |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 37976f2..72fef16 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1918,7 +1918,7 @@ sub prop_walk {
>  
>  	foreach (sort keys %$dirent) {
>  		next if $dirent->{$_}->{kind} != $SVN::Node::dir;
> -		$self->prop_walk($p . $_, $rev, $sub);
> +		$self->prop_walk($self->{path} . $p . $_, $rev, $sub);
>  	}
>  }

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

* Re: git-svn {show,create}-ignore chokes upon subdirs
  2008-05-27 16:20 git-svn {show,create}-ignore chokes upon subdirs Nikolaus Schulz
  2008-05-27  8:46 ` [PATCH] git-svn fails in prop_walk if $self->{path} is not empty Gerrit Pape
@ 2008-05-28  8:34 ` Sam Vilain
  2008-05-28  9:16   ` Nikolaus Schulz
  1 sibling, 1 reply; 5+ messages in thread
From: Sam Vilain @ 2008-05-28  8:34 UTC (permalink / raw)
  To: git, microschulz; +Cc: Benoit Sigoure, Eric Wong, Shawn O. Pearce

Nikolaus Schulz wrote:
> Hi, 
> 
> when importing subversion repositories into git, git-svn show-ignore and
> create-ignore choke when scanning project subdirectories.  For example,
> with the sequence
> 
>  git-svn init -s http://svn.red-bean.com/repos/producingoss producingoss-git-svn
>  cd producingoss-git-svn
>  git-svn fetch
>  git-svn create-ignore 
> 
> the last command prints this: 
> 
>  HTTP Path Not Found: PROPFIND request failed on '/repos/producingoss/!svn/bc/1465/ca': '/repos/producingoss/!svn/bc/1465/ca' path not found at /home/nikolaus/nfs/nsbp/git/git/git-svn line 1897
> 
> Revision 1465 is the latest subversion revision of the project.  git-svn
> create-ignore stages a correct .gitignore in the top level directory, then
> aborts with the same error.  I have tested this with two svn projects, the
> result is identical.  Bisecting suggested that this is broken since commit
> 01bdab84e31763a98206c31cf99b9dc3cb221356.

It helps to include the breaking change's details in the message in
reports like this.  Here it is:

From: Benoit Sigoure <tsuna@lrde.epita.fr>
Subject: git-svn: add a generic tree traversal to fetch SVN properties

    * git-svn.perl (&traverse_ignore): Remove.
    (&prop_walk): New.
    (&cmd_show_ignore): Use prop_walk.

[ew: This will ease the implementation of the `create-ignore',
     `propget', and `proplist' commands]

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

As a side note, "svn:mergeinfo" is rapidly becoming an 'interesting'
property and should probably be added to the list.  However, I think it
probably needs to go somewhere like do_fetch; I'll follow-up separately
about that.

Sam.

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

* Re: git-svn {show,create}-ignore chokes upon subdirs
  2008-05-28  8:34 ` git-svn {show,create}-ignore chokes upon subdirs Sam Vilain
@ 2008-05-28  9:16   ` Nikolaus Schulz
  0 siblings, 0 replies; 5+ messages in thread
From: Nikolaus Schulz @ 2008-05-28  9:16 UTC (permalink / raw)
  To: git

On Wed, May 28, 2008 at 08:34:23PM +1200, Sam Vilain wrote:
> >  git-svn init -s http://svn.red-bean.com/repos/producingoss producingoss-git-svn
> >  cd producingoss-git-svn
> >  git-svn fetch
> >  git-svn create-ignore 
> > 
> > the last command prints this: 
> > 
> >  HTTP Path Not Found: PROPFIND request failed on '/repos/producingoss/!svn/bc/1465/ca': '/repos/producingoss/!svn/bc/1465/ca' path not found at /home/nikolaus/nfs/nsbp/git/git/git-svn line 1897

[...]

> It helps to include the breaking change's details in the message in
> reports like this.  Here it is:
> 
> From: Benoit Sigoure <tsuna@lrde.epita.fr>
> Subject: git-svn: add a generic tree traversal to fetch SVN properties
> 
>     * git-svn.perl (&traverse_ignore): Remove.
>     (&prop_walk): New.
>     (&cmd_show_ignore): Use prop_walk.
> 
> [ew: This will ease the implementation of the `create-ignore',
>      `propget', and `proplist' commands]
> 
> Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
> Acked-by: Eric Wong <normalperson@yhbt.net>
> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Thanks, I thought it could be considered chatter. :-)

It looks like the patch from Christian Engwer posted here yesterday[1] is a fix
for the described problem. 

> As a side note, "svn:mergeinfo" is rapidly becoming an 'interesting'
> property and should probably be added to the list.  

That's interesting, I wasn't aware they're finally tackling merge
tracking. 

Nikolaus

[1] see Gerrit Pape's message "[PATCH] git-svn fails in prop_walk if
    $self->{path} is not empty"
                                                                                   

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

end of thread, other threads:[~2008-05-29 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-27 16:20 git-svn {show,create}-ignore chokes upon subdirs Nikolaus Schulz
2008-05-27  8:46 ` [PATCH] git-svn fails in prop_walk if $self->{path} is not empty Gerrit Pape
2008-05-27 22:54   ` Nikolaus Schulz
2008-05-28  8:34 ` git-svn {show,create}-ignore chokes upon subdirs Sam Vilain
2008-05-28  9:16   ` Nikolaus Schulz

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