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

Re: [PATCH] userdiff: add built-in pattern for CSS

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2016, 22:18 UTC
Message-ID
<xmqq37p73xrg.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<925654601.13199.1464127975010.JavaMail.zimbra@ensimag.grenoble-inp.fr>
William Duclot <william.duclot@ensimag.grenoble-inp.fr> writes:
> I did have considered IPATTERN(), but assumed that case-sensitive was
> default and case-insensitive was the exception.
Don't assume, but ask ;-)
> As the CSS pattern
> does not deal with letters at all it seemed sensible to me to follow
> the example of the HTML pattern, which use PATTERNS().

Did you notice that HTML pattern has to do an [Hh] that would be unnecessary if it chose to use IPATTTERN()?

You do not have to ask a person, but instead ask the history. IPATTERN() was added at 909a5494 (userdiff.c: add builtin fortran regex patterns, 2010-09-10) when adding fortran support. Anything that existed before, including HTML, did [A-Za-z] when they could have done [a-z] if IPATTERN() existed back then.

Show 11 quoted lines
>>  - In our codebase, we format multi-line comments in a particular
>>    way, namely
>> 
>> 	   /*
>>          * A multi-line comment begins with slash asterisk
>>          * on its own line, and its closing asterisk slash
>>          * also is on its own line.
>>          */
>
> I take good note of that. I took example on the fortran pattern
> comment, should I fix it too while I'm at it?
Not "while you are at it".

Making existing things better is welcome but such a change shouldn't be mixed with addition of new things. You can do it as a separate patch, probably as a preliminary clean-up before your change, if you want to.

Show 8 quoted lines
>>  - Try not to write overlong lines.  If your expression needs to
>>    become long and there is no good place to fold lines, that is one
>>    thing, but an overlong comment is unexcuable, as you can fold
>>    lines anywhere between words.
>
> Again, I take good note of that.
>
> Thank you for your time!
Thank you for working on this.
Previous: William DuclotNext: Johannes Sixt
Message 6 of 21 in “userdiff: add built-in pattern for CSS”
  1. userdiff: add built-in pattern for CSSWilliam Duclot, May 20, 2016
  2. Junio C HamanoMay 20, 2016
  3. userdiff: add built-in pattern for CSSWilliam Duclot, May 24, 2016
  4. Junio C HamanoMay 24, 2016
  5. William DuclotMay 24, 2016
  6. Junio C HamanoMay 24, 2016
  7. Johannes SixtMay 26, 2016
  8. William DuclotMay 27, 2016
  9. userdiff: add built-in pattern for CSSWilliam Duclot, Jun 2, 2016
  10. Junio C HamanoJun 2, 2016
  11. Johannes SixtJun 3, 2016
  12. Matthieu MoyJun 3, 2016
  13. Johannes SixtJun 3, 2016
  14. William DuclotJun 3, 2016
  15. Junio C HamanoJun 3, 2016
  16. William DuclotJun 6, 2016
  17. Junio C HamanoJun 6, 2016
  18. William DuclotJun 6, 2016
  19. Junio C HamanoJun 6, 2016
  20. userdiff: add built-in pattern for CSSWilliam Duclot, Jun 3, 2016
  21. Johannes SixtJun 3, 2016

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.