{"thread":{"id":"19890","subject":"[PATCH] Add matchings for csharp","startedAt":"2009-06-21T23:52:49Z","lastAt":"2009-06-22T08:12:18Z","messageCount":3,"participants":["Adam Petaccia","Johannes Sixt","Paolo Bonzini"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"116731","messageId":"1245628369.15870.1.camel@belthazor","threadId":"19890","inReplyTo":null,"subject":"[PATCH] Add matchings for csharp","fromName":"Adam Petaccia","fromEmail":"adam@tpetaccia.com","sentAt":"2009-06-21T23:52:49Z","receivedAt":"2009-06-21T23:52:49Z","isPatch":true,"sender":{"key":"adam@tpetaccia.com","avatar":null},"body":"I'm not sure if this is the correct place to send patches, please direct \nme if I've addressed the wrong list.\n---\n t/t4018-diff-funcname.sh |    2 +-\n userdiff.c               |   10 ++++++++++\n 2 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 5b10e97..704dae8 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -32,7 +32,7 @@ EOF\n \n sed 's/beer\\\\/beer,\\\\/' < Beer.java > Beer-correct.java\n \n-builtin_patterns=\"bibtex cpp html java objc pascal php python ruby tex\"\n+builtin_patterns=\"bibtex csharp cpp html java objc pascal php python ruby tex\"\n for p in $builtin_patterns\n do\n \ttest_expect_success \"builtin $p pattern compiles\" '\ndiff --git a/userdiff.c b/userdiff.c\nindex 57529ae..d4151b2 100644\n--- a/userdiff.c\n+++ b/userdiff.c\n@@ -79,6 +79,16 @@ PATTERNS(\"cpp\",\n \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"\n \t \"|[^[:space:]]|[\\x80-\\xff]+\"),\n+PATTERNS(\"csharp\",\n+\t \"!^[ \\t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\\n\"\n+\t \"^([ \\t]*(static|public|internal|private|protected|new|unsafe|readonly|volatile)[ \\t]+(class|enum|interface|struct).*)$\\n\"\n+\t \"^([ \\t]*(namespace)[ \\t]+.*)$\"\n+\t ,\n+\t /* -- */\n+\t \"[a-zA-Z_][a-zA-Z0-9_]*\"\n+\t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n+\t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"\n+\t \"|[^[:space:]]|[\\x80-\\xff]+\"),\n { \"default\", NULL, -1, { NULL, 0 } },\n };\n #undef PATTERNS\n-- \n1.6.0.4\n"},{"id":"116739","messageId":"4A3F238B.1020107@viscovery.net","threadId":"19890","inReplyTo":"1245628369.15870.1.camel@belthazor","subject":"Re: [PATCH] Add matchings for csharp","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-06-22T06:24:11Z","receivedAt":"2009-06-22T06:24:11Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Thank you for you contribution.\n\nAdam Petaccia schrieb:\n> I'm not sure if this is the correct place to send patches, please direct \n> me if I've addressed the wrong list.\n\nThis part of a patch submission should contain a description *why* this\npatch is an improvement (and must include a Signed-off-by statement; see\nDocumentation/SubmittingPatches). Perhaps you are aware of msysgit issue\n281[1], that you are addressing here, and you could mention it.\nConsidering the complaint in that issue (that hunk headers always only\nmention the containing namespace), an example in the commit message would\nbe useful.\n\nTo answer you question: This is the right place.\n\n[1] http://code.google.com/p/msysgit/issues/detail?id=281\n\n> @@ -79,6 +79,16 @@ PATTERNS(\"cpp\",\n>  \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n>  \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"\n>  \t \"|[^[:space:]]|[\\x80-\\xff]+\"),\n> +PATTERNS(\"csharp\",\n> +\t \"!^[ \\t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\\n\"\n> +\t \"^([ \\t]*(static|public|internal|private|protected|new|unsafe|readonly|volatile)[ \\t]+(class|enum|interface|struct).*)$\\n\"\n> +\t \"^([ \\t]*(namespace)[ \\t]+.*)$\"\n\nI think the placement of parentheses could be improved in these two\nexpressions (but I don't know for sure because I don't know the code well\nenough). Looking at the other examples in userdiff.c, I infer that the\n*first* opening parentheses defines which part is copied to the hunk\nheader. Since you placed everything into parentheses (unnecessarily, I\nthink), the complete line would be copied to the hunk header, including\nleading whitespace.\n\nDisclaimer: I don't have C# source code to test this.\n\n-- Hannes\n"},{"id":"116746","messageId":"4A3F3CE2.1070704@gnu.org","threadId":"19890","inReplyTo":"4A3F238B.1020107@viscovery.net","subject":"Re: [PATCH] Add matchings for csharp","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-06-22T08:12:18Z","receivedAt":"2009-06-22T08:12:18Z","isPatch":true,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"\n>> @@ -79,6 +79,16 @@ PATTERNS(\"cpp\",\n>>  \t \"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?\"\n>>  \t \"|[-+*/<>%&^|=!]=|--|\\\\+\\\\+|<<=?|>>=?|&&|\\\\|\\\\||::|->\"\n>>  \t \"|[^[:space:]]|[\\x80-\\xff]+\"),\n>> +PATTERNS(\"csharp\",\n>> +\t \"!^[ \\t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\\n\"\n>> +\t \"^([ \\t]*(static|public|internal|private|protected|new|unsafe|readonly|volatile)[ \\t]+(class|enum|interface|struct).*)$\\n\"\n>> +\t \"^([ \\t]*(namespace)[ \\t]+.*)$\"\n> \n> I think the placement of parentheses could be improved in these two\n> expressions (but I don't know for sure because I don't know the code well\n> enough). Looking at the other examples in userdiff.c, I infer that the\n> *first* opening parentheses defines which part is copied to the hunk\n> header.\n\nYes.\n\n> Since you placed everything into parentheses (unnecessarily, I\n> think),\n\nNo, not unnecessarily because otherwise only \"public\" for example would \nbe copied.  I agree though that leading whitespace should not be \nincluded in the parentheses.\n\nPaolo\n"}]}