Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Eric Wong wrote: > Ideally, yes. Is there an easy way to access that from Perl? (and > for the older versions of SVN folks people are running). Subversion's swig bindings only wrap a few apr functions and do not depend on fuller apr bindings. Something like svn_dirent_is_under_root() could be u

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Eric Wong
Jonathan Nieder wrote: > Maybe we can use apr_filepath_merge() to avoid reinventing the wheel? Ideally, yes. Is there an easy way to access that from Perl? (and for the older versions of SVN folks people are running). Perhaps we can expose equivalent functionality in git via git-rev-parse inste

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Eric Wong wrote: > It should probably just return the root path ("c:/" and > "http://www.example.com/"; respectively). That means recognizing drive letters and URLs. Hm. Subversion commands seem to use svn_client_args_to_target_array2 to canonicalize arguments. It does something like the follo

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Eric Wong
Jonathan Nieder wrote: > Eric Wong wrote: > > That said, I'd favor an implementation that split on m{/+} and > > collapsed as Michael mentioned. > > Sounds sensible. Is canonicalize_path responsible for collapsing > runs of slashes? What should _collapse_dotdot do to > "c:/.." or "http://www.ex

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Eric Wong wrote: > That said, I'd favor an implementation that split on m{/+} and > collapsed as Michael mentioned. Sounds sensible. Is canonicalize_path responsible for collapsing runs of slashes? What should _collapse_dotdot do to "c:/.." or "http://www.example.com/..";? -- To unsubscribe fro

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Eric Wong
Jonathan Nieder wrote: > Hi, > > Michael G Schwern wrote: > > On 2012.7.30 12:51 PM, Eric Wong wrote: > >> Michael G Schwern wrote: > > >>> _collapse_dotdot() works better than the existing regex did. > >> > >> I don't dispute it's better, but it's worth explaining in the commit > >> message to

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-09-26 Thread Jonathan Nieder
Hi, Michael G Schwern wrote: > On 2012.7.30 12:51 PM, Eric Wong wrote: >> Michael G Schwern wrote: >>> _collapse_dotdot() works better than the existing regex did. >> >> I don't dispute it's better, but it's worth explaining in the commit >> message to reviewers why something is "better". > > Yea

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-07-30 Thread Michael G Schwern
On 2012.7.30 12:51 PM, Eric Wong wrote: >> The SVN API functions will not accept ../foo but their canonicalization >> functions will not collapse it. So we'll have to do it ourselves. >> >> _collapse_dotdot() works better than the existing regex did. > > I don't dispute it's better, but it's wort

Re: [PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-07-30 Thread Eric Wong
"Michael G. Schwern" wrote: > From: "Michael G. Schwern" > > The SVN API functions will not accept ../foo but their canonicalization > functions will not collapse it. So we'll have to do it ourselves. > > _collapse_dotdot() works better than the existing regex did. I don't dispute it's better

[PATCH 3/7] Extract, test and enhance the logic to collapse ../foo paths.

2012-07-28 Thread Michael G. Schwern
From: "Michael G. Schwern" The SVN API functions will not accept ../foo but their canonicalization functions will not collapse it. So we'll have to do it ourselves. _collapse_dotdot() works better than the existing regex did. This will be used shortly when canonicalize_path() starts using the