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

Re: grep: fix multibyte regex handling under macOS (1819ad327b7a1f19540a819813b70a0e8a7f798f)

From
Jeff King <peff@peff.net>
Date
Feb 7, 2023, 18:23 UTC
Message-ID
<Y+KXC5b0qUg2/nxt@coredump.intra.peff.net>
In-Reply-To
<CALnO6CC2w5LUAjXVw7CWKAVobjFMc7M7jm7HuuGT1SO0q5cYbA@mail.gmail.com>
On Sun, Feb 05, 2023 at 02:51:05PM -0500, D. Ben Knoble wrote:
> Any thoughts on some sort of stop-gap measure to fix --word-diff while
> Git decides how to handle the regex engine incompatibilities? How
> important is the sequence of bytes at the end of --word-diff regexes
> in userdiff.c?

It comes from 664d44ee7f (userdiff: simplify word-diff safeguard, 2011-01-11). So presumably we'd want to figure out a way to accomplish the same thing in a portable way. I'm not sure that's possible, though, without making assumptions about the regex engine.

There's a little more discussion in the original thread:
  https://lore.kernel.org/git/561247.22837.qm@web110707.mail.gq1.yahoo.com/
but I didn't read it very carefully.

It may also be possible to play tricks with LC_CTYPE (either not setting it, or resetting before/after a regex), but that feels pretty hacky.

-Peff
Previous: D. Ben KnobleNext: D. Ben Knoble
Message 17 of 22 in “RE: grep: fix multibyte regex handling under macOS (1819ad327b7a1f19540a819813b70a0e8a7f798f)”
  1. D. Ben KnobleFeb 1, 2023
  2. demerphqFeb 1, 2023
  3. D. Ben KnobleFeb 1, 2023
  4. demerphqFeb 1, 2023
  5. Junio C HamanoFeb 1, 2023
  6. D. Ben KnobleFeb 1, 2023
  7. D. Ben KnobleFeb 1, 2023
  8. Junio C HamanoFeb 1, 2023
  9. Jeff KingFeb 1, 2023
  10. demerphqFeb 2, 2023
  11. D. Ben KnobleFeb 2, 2023
  12. Jeff KingFeb 3, 2023
  13. Ævar Arnfjörð BjarmasonFeb 3, 2023
  14. Jeff KingFeb 4, 2023
  15. demerphqFeb 4, 2023
  16. D. Ben KnobleFeb 5, 2023
  17. Jeff KingFeb 7, 2023
  18. D. Ben KnobleFeb 7, 2023
  19. Jeff KingFeb 7, 2023
  20. D. Ben KnobleFeb 2, 2023
  21. Jeff KingFeb 3, 2023
  22. D. Ben KnobleFeb 3, 2023

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.