Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

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

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:09
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Junio C Hamano wrote:
Jonathan Nieder [off-list ref] writes:
quoted
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 <redacted>
---
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help