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

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

From
TLThomas Levesque <thomas.levesque@gmail.com>
Date
Mar 8, 2018, 11:05 UTC
Message-ID
<0102016205499aff-6779e882-12d1-481e-8594-c02d72aa7165-000000@eu-west-1.amazonses.com>
In-Reply-To
<CAPig+cTPMqf1hN-fsaAkdZwCEH94ZPYJbfSE_rcjFCoSobxK5Q@mail.gmail.com>

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.

Signed-off-by: Thomas Levesque <thomas.levesque@gmail.com>
---
 userdiff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
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 */

--
https://github.com/git/git/pull/464
Previous: Eric Sunshine
Message 3 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.