Re: [PATCH] xdiff: Show function names in hunk headers.

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] xdiff: Show function names in hunk headers.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:22

Junio C Hamano [off-list ref] writes:
Mark Wooding [off-list ref] writes:
...
quoted
+		    (isalpha((unsigned char)*rec) || /* identifier? */
+		     *rec == '_' ||	/* also identifier? */
+		     *rec == '(' ||	/* lisp defun? */
+		     *rec == '#')) {	/* #define? */
GNU diff -p does "^[[:alpha:]$_]"; personally I think any line
that does not begin with a whitespace is good enough.
Obviously I was not thinking.  That should at least be "any line
that begins with a non-whitespace and has a few characters", to
omit "{\n" and catch "int main()\n" in:

	int main()
        {
        	printf("Hello, world.\n");
        }

;-).

Re: [PATCH] xdiff: Show function names in hunk headers.

From: Mark Wooding <hidden>
Date: 2016-06-15 22:42:22

Junio C Hamano [off-list ref] wrote:
Obviously I was not thinking.  That should at least be "any line
that begins with a non-whitespace and has a few characters", to
omit "{\n" and catch "int main()\n" in:
Heh!  I already got that one wrong last night.  Hence my more
complicated version. ;-)

-- [mdw]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help