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

Re: [PATCH] Add support for C# record types

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 15, 2021, 21:04 UTC
Message-ID
<nycvar.QRO.7.76.6.2106152130590.57@tvgsbejvaqbjf.bet>
In-Reply-To
<pull.971.git.git.1614646689506.gitgitgadget@gmail.com>
Hi Julian,
On Tue, 2 Mar 2021, Julian Verdurmen via GitGitGadget wrote:
Show 12 quoted lines
> From: Julian Verdurmen <julian.verdurmen@outlook.com>
>
> Records are added in C# 9
>
> Code example :
>
>     public record Person(string FirstName, string LastName);
>
> For more information, see:
> * https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9
>
> Signed-off-by: Julian Verdurmen <julian.verdurmen@outlook.com>

I am not precisely a C# _expert_, but from what I understand this patch and commit message look good to me.

Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Thanks, Dscho

Show 34 quoted lines
> ---
>     userdiff.c: Added support for record types in C#
>
>     Support for C# 9 records. See
>     https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/exploration/records
>
>     I will try to use gitgitgadget [https://gitgitgadget.github.io/]
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-971%2F304NotModified%2Fcsharp-record-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-971/304NotModified/csharp-record-v1
> Pull-Request: https://github.com/git/git/pull/971
>
>  userdiff.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/userdiff.c b/userdiff.c
> index 3f81a2261c5e..2803683c3117 100644
> --- a/userdiff.c
> +++ b/userdiff.c
> @@ -212,7 +212,7 @@ PATTERNS("csharp",
>  	 /* Properties */
>  	 "^[ \t]*(((static|public|internal|private|protected|new|virtual|sealed|override|unsafe)[ \t]+)*[][<>@.~_[:alnum:]]+[ \t]+[@._[:alnum:]]+)[ \t]*$\n"
>  	 /* Type definitions */
> -	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct)[ \t]+.*)$\n"
> +	 "^[ \t]*(((static|public|internal|private|protected|new|unsafe|sealed|abstract|partial)[ \t]+)*(class|enum|interface|struct|record)[ \t]+.*)$\n"
>  	 /* Namespace */
>  	 "^[ \t]*(namespace[ \t]+.*)$",
>  	 /* -- */
>
> base-commit: 328c10930387d301560f7cbcd3351cc485a13381
> --
> gitgitgadget
>
>
Previous: Julian Verdurmen via GitGitGadget
Message 2 of 2 in “Add support for C# record types”
  1. Add support for C# record typesJulian Verdurmen via GitGitGadget, Mar 2, 2021
  2. Johannes SchindelinJun 15, 2021

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.