git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@student.ethz.ch>
To: Tim Chase <git@tim.thechases.com>
Cc: <git@vger.kernel.org>
Subject: Re: misleading diff-hunk header
Date: Tue, 21 Aug 2012 17:22:13 +0200	[thread overview]
Message-ID: <87a9xoi82i.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <503385D0.5070605@tim.thechases.com> (Tim Chase's message of "Tue, 21 Aug 2012 07:57:52 -0500")

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.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2012-08-21 15:22 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 [this message]
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
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=87a9xoi82i.fsf@thomas.inf.ethz.ch \
    --to=trast@student.ethz.ch \
    --cc=git@tim.thechases.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).