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

Re: [PATCH 1/2] Diff patterns for POSIX shells

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Aug 2, 2011, 18:52 UTC
Message-ID
<CAOxFTcy-AXtCW7-BCLgYnNTGd+unkiSaWAGPO+k+fcKr5VK-mw@mail.gmail.com>
In-Reply-To
<7vzkjrem6b.fsf@alter.siamese.dyndns.org>
On Tue, Aug 2, 2011 at 7:51 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
>
>> All diffs following a function definition will have that function name
>> as chunck header, but this is the best we can do with the current
>> userdiff capabilities.
>>
>> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
>> ---
>>  userdiff.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/userdiff.c b/userdiff.c
>> index 01d3a8b..70120c3 100644
>> --- a/userdiff.c
>> +++ b/userdiff.c
>> @@ -107,6 +107,9 @@
>>        "(@|@@|\\$)?[a-zA-Z_][a-zA-Z0-9_]*"
>>        "|[-+0-9.e]+|0[xXbB]?[0-9a-fA-F]+|\\?(\\\\C-)?(\\\\M-)?."
>>        "|//=?|[-+*/<>%&^|=!]=|<<=?|>>=?|===|\\.{1,3}|::|[!=]~"),
>> +PATTERNS("shell", "^[ \t]*([a-zA-Z_0-9]+)[ \t]*\\(\\).*",
>> +      /* -- */
>> +      "(--|\\$)?[a-zA-Z_0-9]+|&&|\\|\\|"),
>
> Hmm, what is this "double-dash -- might be present before a name" about?
>

Now that's a good question. I think it was a brainfart while testing the regexp; came across a case switch where the candidate were options, and somehow decided that it was better to include the --. I'll prepare a patch without this stupidity.

-- 
Giuseppe "Oblomov" Bilotta
Previous: Junio C HamanoNext: Giuseppe Bilotta
Message 4 of 9 in “Minor userdiff stuff”
  1. 0/2 Minor userdiff stuffGiuseppe Bilotta, Aug 1, 2011
  2. 1/2 Diff patterns for POSIX shellsGiuseppe Bilotta, Aug 1, 2011
  3. Junio C HamanoAug 2, 2011
  4. Giuseppe BilottaAug 2, 2011
  5. Diff patterns for POSIX shellsGiuseppe Bilotta, Aug 3, 2011
  6. Jeff KingAug 3, 2011
  7. Giuseppe BilottaAug 3, 2011
  8. Junio C HamanoAug 3, 2011
  9. 2/2 Use specific diff rules for repo filesGiuseppe Bilotta, Aug 1, 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.