login
Header Space

 
 

Re: diffutils: C labels misdetected as functions

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Simon Arlott <simon@...>
Cc: Paul Eggert <eggert@...>, Matthew Wilcox <matthew@...>, Denis Cheng <crquan@...>, <kernel-janitors@...>, <linux-kernel@...>, <git@...>
Date: Sunday, July 22, 2007 - 5:30 pm

Simon Arlott <simon@fire.lp0.eu> writes:


I think the word "bug" is just about documentation.  Promising
"show C function" and including labels and/or not showing all
functions would be a bug, but given that diff is about showing
textual differences between two text files with arbitrary kind
of contents, I do not think it is reasonable to take that "show
C function" promise too literally.

To avoid this, the description of the feature could be reworded
to "shows lines that match pattern '^[[:alpha:]$_]' on context
lines, intent of the option being that the pattern tends to
match the beginning of function in C language and help the
reader to locate the context more easily, with a caveat that the
pattern matching is not meant to capture all functions nor only
functions --- there will be false matches."

But that would be too long.  And as Paul showed, you can narrow
or widen the set of lines that are shown with the -F option.  I
do not think this deserves to be called a "bug".

You can define your own customized "function name" pattern in
your .git/config (or $HOME/.gitconfig) file to be used by the
git-diff family with recent enough git via the attributes
mechanism, but I do not think we should change the default,
unless GNU diff changes its default.  Personally I'd rather not
see it change, though.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: diffutils: C labels misdetected as functions, Simon Arlott, (Sun Jul 22, 3:16 pm)
Re: diffutils: C labels misdetected as functions, Junio C Hamano, (Sun Jul 22, 5:30 pm)
speck-geostationary