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

Re: [PATCH] Handle double slashes in make_relative_path()

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 22, 2010, 21:11 UTC
Message-ID
<201001222211.14743.trast@student.ethz.ch>
In-Reply-To
<7vpr52gbmu.fsf@alter.siamese.dyndns.org>
On Friday 22 January 2010 02:40:41 Junio C Hamano wrote:
Show 12 quoted lines
> 
> Now what is the goal of this patch?  To allow people to have duplicated
> slashes at random places in either abs or base, or is it only interested
> in a particular input that is malformed?  If the latter, what is the
> permitted non-canonical input?
> 
> If abs were "/a//b/c" and base were "/a/b", then the combination is
> rejected by prefixcmp() and full "/a//b/c" is returned.  Is it the
> intended behaviour of the patch?
> 
> I would actually have expected to see [a real fix that handles
> duplicate slashes in all instances.]

It's not about *permitted* input; the problem is simply that the current function gives back *bogus* paths, which causes git to fail. So I only went for the minimal patch to fix this.

Not handling the abs="/a//b/c" base="/a/b" case seemed ok to me since that was never turned as a relative "c", hence there would not be any speed loss (nor gain) from my patch.

Does that answer the question?

As for your patch, thanks for coming up with a real fix. I read the amended version, and it seems correct to me.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Robin RosenbergNext: Junio C Hamano
Message 19 of 20 in “Handle double slashes in make_relative_path()”
  1. Handle double slashes in make_relative_path()Thomas Rast, Jan 22, 2010
  2. Junio C HamanoJan 22, 2010
  3. Junio C HamanoJan 22, 2010
  4. Johannes SixtJan 22, 2010
  5. Robin RosenbergJan 23, 2010
  6. Johannes SixtJan 23, 2010
  7. Robin RosenbergJan 23, 2010
  8. Johannes SixtJan 23, 2010
  9. Junio C HamanoJan 23, 2010
  10. Junio C HamanoJan 23, 2010
  11. Johannes SixtJan 23, 2010
  12. Sverre RabbelierJan 23, 2010
  13. Thomas RastJan 24, 2010
  14. Bernhard R. LinkJan 24, 2010
  15. Junio C HamanoJan 24, 2010
  16. Johannes SixtJan 24, 2010
  17. Junio C HamanoJan 24, 2010
  18. Robin RosenbergJan 25, 2010
  19. Thomas RastJan 22, 2010
  20. Junio C HamanoJan 22, 2010

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.