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

Re: [PATCH] userdiff: two simplifications of patterns for rust

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
May 30, 2019, 18:59 UTC
Message-ID
<875zprn4zr.fsf@evledraar.gmail.com>
In-Reply-To
<2d32b107-9278-faa0-4fea-afe662031272@kdbg.org>
On Thu, May 30 2019, Johannes Sixt wrote:
Show 8 quoted lines
> - Do not enforce (but assume) syntactic correctness of language
>   constructs that go into hunk headers: we only want to ensure that
>   the keywords actually are words and not just the initial part of
>   some identifier.
>
> - In the word regex, match numbers only when they begin with a digit,
>   but then be liberal in what follows, assuming that the text that is
>   matched is syntactially correct.

I don't know if this is possible for Rust (but very much suspect so...), but I think that in general we should aim to be more forgiving than not with these patterns.

Because, as the history of userdiff.c shows, new keywords get introduced into these languages, and old git versions survive for a long time. If the syntax is otherwise fairly regular perhaps we don't need to hardcode the list of existing keywords?

Previous: Johannes SixtNext: Johannes Sixt
Message 8 of 9 in “userdiff: add built-in pattern for rust”
  1. userdiff: add built-in pattern for rustmarcandre.lureau@redhat.com, May 20, 2019
  2. Johannes SixtMay 20, 2019
  3. Marc-André LureauMay 21, 2019
  4. Junio C HamanoMay 28, 2019
  5. Johannes SixtMay 28, 2019
  6. Marc-André LureauMay 28, 2019
  7. userdiff: two simplifications of patterns for rustJohannes Sixt, May 30, 2019
  8. Ævar Arnfjörð BjarmasonMay 30, 2019
  9. Johannes SixtMay 30, 2019

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.