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

Re: [PATCH] Teach git diff about Objective-C syntax

From
Andreas Ericsson <ae@op5.se>
Date
Sep 17, 2008, 15:03 UTC
Message-ID
<48D11C3C.5070707@op5.se>
In-Reply-To
<1221658141-75698-1-git-send-email-jon.delStrother@bestbefore.tv>
Jonathan del Strother wrote:
Show 6 quoted lines
> Add support for recognition of Objective-C class & instance methods, C functions, and class implementation/interfaces.
> 
> Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
> ---
> This version anchors the negated match to the beginning of the line, and shuffles the comments around to avoid the excessively long lines.  Better?
> 

Why do you insist on touching surrounding patterns? I've left them in from your patch below so you can see where you're going wrong. Those changes provide no value and make your patch harder to read. If you want to make that cleanup, submit it separately, as it has nothing to do with teaching git diff about objective C methods.

Show 18 quoted lines
> diff --git a/diff.c b/diff.c
> index 998dcaa..e5ec503 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -1398,17 +1398,31 @@ static struct builtin_funcname_pattern {
>  } builtin_funcname_pattern[] = {
>  	{ "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
>  	{ "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$" },
> -	{ "java", "!^[ 	]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
> +
> +	{ "java", "!^[ \t]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
>  			"new\\|return\\|switch\\|throw\\|while\\)\n"
> -			"^[ 	]*\\(\\([ 	]*"
> +			"^[ \t]*\\(\\([ \t]*"
>  			"[A-Za-z_][A-Za-z_0-9]*\\)\\{2,\\}"
> -			"[ 	]*([^;]*\\)$" },
> +			"[ \t]*([^;]*\\)$" },
> +
The above should be in a separate patch.
Show 8 quoted lines
>  	{ "pascal", "^\\(\\(procedure\\|function\\|constructor\\|"
>  			"destructor\\|interface\\|implementation\\|"
>  			"initialization\\|finalization\\)[ \t]*.*\\)$"
>  			"\\|"
> -			"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
> -			},
> +			"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"},
> +
This last change is just pure nonsense. Please remove it altogether.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Jonathan del StrotherNext: Jonathan del Strother
Message 8 of 23 in “Teach git diff about Objective-C syntax”
  1. Teach git diff about Objective-C syntaxJonathan del Strother, Sep 16, 2008
  2. Miklos VajnaSep 16, 2008
  3. Teach git diff about Objective-C syntaxJonathan del Strother, Sep 17, 2008
  4. Teach git diff about Objective-C syntaxJonathan del Strother, Sep 17, 2008
  5. Johannes SchindelinSep 17, 2008
  6. Jonathan del StrotherSep 17, 2008
  7. Teach git diff about Objective-C syntaxJonathan del Strother, Sep 17, 2008
  8. Andreas EricssonSep 17, 2008
  9. Jonathan del StrotherSep 17, 2008
  10. Miklos VajnaSep 17, 2008
  11. Jonathan del StrotherSep 17, 2008
  12. Junio C HamanoSep 17, 2008
  13. Jonathan del StrotherSep 17, 2008
  14. Teach git diff about Objective-C syntaxJonathan del Strother, Sep 30, 2008
  15. Brandon CaseyOct 1, 2008
  16. xdiff-interface.c: strip newline (and cr) from line before pattern matchingBrandon Casey, Oct 1, 2008
  17. Johannes SchindelinOct 1, 2008
  18. Jonathan del StrotherOct 2, 2008
  19. Jonathan del StrotherOct 2, 2008
  20. Andreas EricssonSep 18, 2008
  21. Jonathan del StrotherSep 17, 2008
  22. Johannes SchindelinSep 17, 2008
  23. Jonathan del StrotherSep 17, 2008

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.