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

Re: [PATCH] dir.c: literal match with wildcard in pathspec should still glob

From
Junio C Hamano <gitster@pobox.com>
Date
May 5, 2025, 14:41 UTC
Message-ID
<xmqqwmavqfvp.fsf@gitster.g>
In-Reply-To
<CA+rGoLfFCi-q52ABUr=0O=pu+qSikcomSk1akHWUkfAfSf=pZg@mail.gmail.com>
JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:
Show 7 quoted lines
>> +               if (seen && seen[i] == MATCHED_EXACTLY &&
>> +                       ps->items[i].nowildcard_len == ps->items[i].len)
>>                         continue;
>
> For some reason on my computer when I check the formatted patch the
> ps-> line
> align with the (seen && ...) line perfectly

Because the quoted patch in the message I am responding to has tabs expanded already, probably by your mailer, I looked at what you originally posted, and it has these lines:

-		if (seen && seen[i] == MATCHED_EXACTLY)
+		if (seen && seen[i] == MATCHED_EXACTLY &&
+			ps->items[i].nowildcard_len == ps->items[i].len)
 			continue;

Removing the prefix '+'/'-'/' ', and replacing HT with ^I for visibility, the above looks like this:

^I^Iif (seen && seen[i] == MATCHED_EXACTLY) ^I^Iif (seen && seen[i] == MATCHED_EXACTLY && ^I^I^Ips->items[i].nowildcard_len == ps->items[i].len) ^I^I^Icontinue;

As the display width in monospace for "if (" is 4 spaces, "seen" and "ps->" would align only if the third HT expands to 4 spaces on your system.

Perhaps because you are telling your editor or terminal that your tab, unlike everybody else's, is 4-space wide or something?

Previous: JAYATHEERTH KNext: K Jayatheerth
Message 5 of 7 in “Dir: Fix and test wildcard pathspec handling”
  1. Dir: Fix and test wildcard pathspec handlingK Jayatheerth, Apr 22, 2025
  2. Junio C HamanoApr 22, 2025
  3. dir.c: literal match with wildcard in pathspec should still globK Jayatheerth, May 3, 2025
  4. JAYATHEERTH KMay 3, 2025
  5. Junio C HamanoMay 5, 2025
  6. dir.c: literal match with wildcard in pathspec should still globK Jayatheerth, May 5, 2025
  7. JAYATHEERTH KMay 5, 2025

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.