git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Add support for C# record types
@ 2021-03-02  0:58 Julian Verdurmen via GitGitGadget
  2021-06-15 21:04 ` Johannes Schindelin
  0 siblings, 1 reply; 2+ messages in thread
From: Julian Verdurmen via GitGitGadget @ 2021-03-02  0:58 UTC (permalink / raw)
  To: git; +Cc: Julian Verdurmen

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>
---
    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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add support for C# record types
  2021-03-02  0:58 [PATCH] Add support for C# record types Julian Verdurmen via GitGitGadget
@ 2021-06-15 21:04 ` Johannes Schindelin
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Schindelin @ 2021-06-15 21:04 UTC (permalink / raw)
  To: Julian Verdurmen via GitGitGadget; +Cc: git, Julian Verdurmen, Junio C Hamano

Hi Julian,

On Tue, 2 Mar 2021, Julian Verdurmen via GitGitGadget wrote:

> 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

> ---
>     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
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-15 21:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02  0:58 [PATCH] Add support for C# record types Julian Verdurmen via GitGitGadget
2021-06-15 21:04 ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).