From: Tim Chase <git@tim•thechases.com>
To: Thomas Rast <trast@student•ethz.ch>
Cc: git@vger•kernel.org
Subject: Re: misleading diff-hunk header
Date: Tue, 21 Aug 2012 10:42:13 -0500 [thread overview]
Message-ID: <5033AC55.8080405@tim.thechases.com> (raw)
In-Reply-To: <87a9xoi82i.fsf@thomas.inf.ethz.ch>
On 08/21/12 10:22, Thomas Rast wrote:
> Tim Chase <git@tim•thechases.com> writes:
>
>> diff.{type}.xfuncname seems to start searching backwards in
>> from the beginning of the hunk, not the first differing line.
> [...]
>> @@ -4,4 +4,5 @@ int call_me(int maybe)
>>
>> int main()
>> {
>> + return 0;
>> }
>>
>> misleadingly suggesting that the change occurred in the call_me()
>> function, rather than in main()
>
> I think that's intentional, and matches what 'diff -p' does. It gives
> you the context before the hunk. After all, if a new function starts in
> the leading context lines, you can see that in the usual diff data.
Okay...I tested "diff -p" and can't argue (much) with historical
adherence. It just makes it hard for me to gather some stats on the
functions that changed, and requires that I look in more than one
place (both in the header, and in the leading context) rather than
having a single authoritative place to grep.
Then again, "diff -p" only seems to support C functions, while git
supports bibtex, cpp, html, java, objc, pascal, php, python, ruby,
and tex out-of-the-box, with the option to build your own
function-finder, so pure adherence to history gets a little muddied.
Thanks for your thoughts,
-tkc
next prev parent reply other threads:[~2012-08-21 15:41 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 [this message]
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
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=5033AC55.8080405@tim.thechases.com \
--to=git@tim$(echo .)thechases.com \
--cc=git@vger$(echo .)kernel.org \
--cc=trast@student$(echo .)ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox