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

Re: [PATCH] userdiff.c: Add C# async keyword in diff pattern

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 8, 2018, 10:22 UTC
Message-ID
<CAPig+cTPMqf1hN-fsaAkdZwCEH94ZPYJbfSE_rcjFCoSobxK5Q@mail.gmail.com>
In-Reply-To
<0102016205115067-f3cdd5f1-2d69-4464-a665-db3a28360260-000000@eu-west-1.amazonses.com>

On Thu, Mar 8, 2018 at 5:04 AM, Thomas Levesque <thomas.levesque@gmail.com> wrote:

> Currently C# async methods are not shown in diff hunk headers. I just
> added the async keyword to the csharp method pattern so that they are
> properly detected.

Thanks for the contribution. Please sign-off your patch (see SubmittingPatches[1]).

[1]: https://github.com/git/git/blob/master/Documentation/SubmittingPatches#L278
Show 14 quoted lines
> ---
> diff --git a/userdiff.c b/userdiff.c
> index dbfb4e13cddce..b92caf42b27be 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -138,7 +138,7 @@ PATTERNS("csharp",
>          /* Keywords */
>          "!^[ \t]*(do|while|for|if|else|instanceof|new|return|switch|case|throw|catch|using)\n"
>          /* Methods and constructors */
> -        "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
> +        "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe|async)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[<>@._[:alnum:]]+[ \t]*\\(.*\\))[ \t]*$\n"
>          /* Properties */
>          "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
>          /* Type definitions */
Previous: Thomas LevesqueNext: Thomas Levesque
Message 2 of 3 in “userdiff.c: Add C# async keyword in diff pattern”
  1. userdiff.c: Add C# async keyword in diff patternThomas Levesque, Mar 8, 2018
  2. Eric SunshineMar 8, 2018
  3. userdiff.c: Add C# async keyword in diff patternThomas Levesque, Mar 8, 2018

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.