From: Stefano Lattarini <stefano.lattarini@gmail.com>
To: Tim Chase <git@tim.thechases.com>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
git@vger.kernel.org
Subject: Re: misleading diff-hunk header
Date: Sun, 26 Aug 2012 12:43:35 +0200 [thread overview]
Message-ID: <5039FDD7.2090800@gmail.com> (raw)
In-Reply-To: <5038CB66.1040006@tim.thechases.com>
On 08/25/2012 02:56 PM, Tim Chase wrote:
> On 08/24/12 23:29, Junio C Hamano wrote:
>> Tim Chase <git@tim.thechases.com> writes:
>>> If the documented purpose of "diff -p" (and by proxy
>>> diff.{type}.xfuncname) is to show the name of the *function*
>>> containing the changed lines,....
>>
>> Yeah, the documentation is misleading, but I do not offhand think of
>> a better phrasing. Perhaps you could send in a patch to improve it.
>>
>> How does GNU manual explain the option?
>
> Tersely. :-)
>
> -p --show-c-function
> Show which C function each change is in.
>
That's in the manpage, which is basically just a copy of the output from
"diff --help". In the texinfo manual (which is the real documentation),
there are additional explanations, saying, among other things:
To show in which functions differences occur for C and similar languages,
you can use the --show-c-function (-p) option. This option automatically
defaults to the context output format (see Context Format), with the
default number of lines of context. You can override that number with
-C lines elsewhere in the command line. You can override both the format
and the number with -U lines elsewhere in the command line.
The -p option is equivalent to -F '^[[:alpha:]$_]' if the unified format
is specified, otherwise -c -F '^[[:alpha:]$_]' (see Specified Headings).
GNU diff provides this option for the sake of convenience.
...
The --show-function-line (-F) option finds the nearest unchanged line
that precedes each hunk of differences and matches the given regular
expression.
You can find more information in the on-line documentation:
<http://www.gnu.org/software/diffutils/manual/diffutils.html>
HTH,
Stefano
next prev parent reply other threads:[~2012-08-26 10:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 12:57 misleading diff-hunk header Tim Chase
2012-08-21 15:22 ` Thomas Rast
2012-08-21 15:42 ` Tim Chase
2012-08-21 17:39 ` Johannes Sixt
2012-08-21 22:29 ` Junio C Hamano
2012-08-21 17:52 ` Junio C Hamano
2012-08-24 14:29 ` Jeff King
2012-08-24 15:05 ` Tim Chase
2012-08-24 16:44 ` Jeff King
2012-08-25 0:41 ` Tim Chase
2012-08-25 4:29 ` Junio C Hamano
2012-08-25 12:56 ` Tim Chase
2012-08-26 10:43 ` Stefano Lattarini [this message]
2012-08-26 18:53 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2012-08-21 13:21 Tim Chase
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5039FDD7.2090800@gmail.com \
--to=stefano.lattarini@gmail.com \
--cc=git@tim.thechases.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.