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

2018-03-08 Thread Thomas Levesque
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 
---
 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


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

2018-03-08 Thread Eric Sunshine
On Thu, Mar 8, 2018 at 5:04 AM, Thomas Levesque
 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

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


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

2018-03-08 Thread Thomas Levesque
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.
---
 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