Re: misleading diff-hunk header

2012-08-26 Thread Junio C Hamano
Stefano Lattarini writes: > On 08/25/2012 02:56 PM, Tim Chase wrote: >> On 08/24/12 23:29, Junio C Hamano wrote: >>> Tim Chase 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,...

Re: misleading diff-hunk header

2012-08-26 Thread Stefano Lattarini
On 08/25/2012 02:56 PM, Tim Chase wrote: > On 08/24/12 23:29, Junio C Hamano wrote: >> Tim Chase 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

Re: misleading diff-hunk header

2012-08-25 Thread Tim Chase
On 08/24/12 23:29, Junio C Hamano wrote: > Tim Chase 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 be

Re: misleading diff-hunk header

2012-08-24 Thread Junio C Hamano
Tim Chase 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

Re: misleading diff-hunk header

2012-08-24 Thread Tim Chase
On 08/24/12 11:44, Jeff King wrote: > With the old code, you'd get: > > diff --git a/old b/new > index f384549..1066a25 100644 > --- a/old > +++ b/new > @@ -2,3 +2,3 @@ one >two > -three > +three -- modified >four > > So the hunk header is

Re: misleading diff-hunk header

2012-08-24 Thread Jeff King
On Fri, Aug 24, 2012 at 10:29:09AM -0400, Jeff King wrote: > > Would this be sufficient? Instead of looking for the first line that > > matches the "beginning" pattern going backwards starting from one line > > before the displayed context, we start our examination at the first line > > shown in

Re: misleading diff-hunk header

2012-08-24 Thread Tim Chase
On 08/24/12 09:29, Jeff King wrote: > On Tue, Aug 21, 2012 at 10:52:03AM -0700, Junio C Hamano wrote: > > 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) >>

Re: misleading diff-hunk header

2012-08-24 Thread Jeff King
On Tue, Aug 21, 2012 at 10:52:03AM -0700, Junio C Hamano wrote: > >>> 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() > >>>{ > >>>

Re: misleading diff-hunk header

2012-08-21 Thread Junio C Hamano
Johannes Sixt writes: > Am 21.08.2012 17:42, schrieb Tim Chase: >> On 08/21/12 10:22, Thomas Rast wrote: 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... >> >> Okay..

Re: misleading diff-hunk header

2012-08-21 Thread Junio C Hamano
Tim Chase writes: > On 08/21/12 10:22, Thomas Rast wrote: >> Tim Chase 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() >>>

Re: misleading diff-hunk header

2012-08-21 Thread Johannes Sixt
Am 21.08.2012 17:42, schrieb Tim Chase: > On 08/21/12 10:22, Thomas Rast wrote: >>> 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... > > Okay...I tested "diff -p" and can't arg

Re: misleading diff-hunk header

2012-08-21 Thread Tim Chase
On 08/21/12 10:22, Thomas Rast wrote: > Tim Chase 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; >>} >>

Re: misleading diff-hunk header

2012-08-21 Thread Thomas Rast
Tim Chase 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