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

Re: [PATCH] commit: Remove backward goto in read_craft_line()

From
Ralf Thielow <ralf.thielow@googlemail.com>
Date
Dec 1, 2010, 20:44 UTC
Message-ID
<AANLkTinLuF74UKaTMNX84FJt+PNoKkkOr3LaXDSCFqdz@mail.gmail.com>
In-Reply-To
<20101201203132.GB27845@burratino>
> If "--show-c-function" output is the problem, perhaps we should know a bit
> better about what C function header looks like?

In fact the "--show-c-function" output is the problem. But I think that a change can't be rejected because of another issue. The style of placing "goto"-statements, which leave a function to the end of that is used in many other projects. And I think it's very usefull.

2010/12/1 Jonathan Nieder <jrnieder@gmail.com>:
Show 40 quoted lines
> Junio C Hamano wrote:
>> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>>> A space before the "bad_graft_data:" label would improve future
>>> diff --show-c-function output.
>>
>> Hmm, I actually do not think we encourage that (nor we should).
>>
>>     $ git grep -e '^ [a-z0-9]*:' -- '*.c' | wc -l
>>     23
>>     $ git grep -e '^[a-z0-9]*:' -- '*.c' | wc -l
>>     42
>>
>> If "--show-c-function" output is the problem, perhaps we should know a bit
>> better about what C function header looks like?
>
> Thanks for checking.  Yes, I think so.
>
>        $ git grep --show-function strbuf_release -- http.c
>        http.c=static int http_request(const char *url, void *result, int target, int options)
>        http.c: strbuf_release(&buf);
>        http.c=cleanup:
>        http.c: strbuf_release(&tmpfile);
>        http.c=int http_fetch_ref(const char *base, struct ref *ref)
>        http.c: strbuf_release(&buffer);
>
> The following gives me some joy.
>
> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
> ---
> diff --git a/.gitattributes b/.gitattributes
> index 5e98806..5888a53 100644
> --- a/.gitattributes
> +++ b/.gitattributes
> @@ -1,3 +1,4 @@
>  * whitespace=!indent,trail,space
>  *.[ch] whitespace=indent,trail,space
> +*.[ch] diff=cpp
>  *.sh whitespace=indent,trail,space
>
Previous: Jonathan NiederNext: Jonathan Nieder
Message 5 of 8 in “commit: Remove backward goto in read_craft_line()”
  1. commit: Remove backward goto in read_craft_line()Ralf Thielow, Dec 1, 2010
  2. Jonathan NiederDec 1, 2010
  3. Junio C HamanoDec 1, 2010
  4. Jonathan NiederDec 1, 2010
  5. Ralf ThielowDec 1, 2010
  6. Trivial patches (Re: [PATCH] commit: Remove backward goto in read_craft_line())Jonathan Nieder, Dec 1, 2010
  7. Junio C HamanoDec 1, 2010
  8. Ralf ThielowDec 1, 2010

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.