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

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

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

Possibly related (same subject, not in this thread)

Mark Wooding [off-list ref] writes:
The function names are parsed by a particularly stupid algorithm at the
moment: it just tries to find a line in the `old' file, from before the
start of the hunk, whose first character looks plausible.  Still, it's
most definitely a start.
+		    (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.  In either
way, your patch is good.  Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help