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

Re: [PATCH] apply: squash consecutive slashes with p_value > 0

From
RBRobie Basak <robie.basak@canonical.com>
Date
Nov 17, 2011, 17:55 UTC
Message-ID
<20111117175544.GC17472@mal.justgohome.co.uk>
In-Reply-To
<7vr516myqh.fsf@alter.siamese.dyndns.org>
On Thu, Nov 17, 2011 at 09:43:02AM -0800, Junio C Hamano wrote:
> I didn't mention this, but I suspect the code with your patch would not
> touch redundant slashes after it finds "start", either.

What is happening to me is that b//foo with -p1 gets split at the first slash and then git apply cannot find /foo when it should be looking for foo. But in the case of b/foo//bar and -p1, without squashing extra slashes it would look for foo//bar which I presume that it would still be able to find.

So in my case, I only need duplicate slashes around the -p boundary point to be removed. I assumed that the squash_slash() later on would eliminate the rest, but I didn't look into this; if it does it'd be a different issue to the one that I'm seeing.

I'm now confused about what it will do (which is why I need to look at it again to make sure), but if it turns out to be easier to just handle that one boundary point, would you accept a patch that eliminates just that duplicate, on the basis that in Unix-land duplicate slashes are perfectly acceptable to be left lying around?

Thanks,
Robie
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 5 in “apply: squash consecutive slashes with p_value > 0”
  1. apply: squash consecutive slashes with p_value > 0Robie Basak, Nov 16, 2011
  2. Junio C HamanoNov 16, 2011
  3. Robie BasakNov 17, 2011
  4. Junio C HamanoNov 17, 2011
  5. Robie BasakNov 17, 2011

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.