git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Andreas Ericsson <ae@op5.se>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git diff woes
Date: Mon, 12 Nov 2007 10:01:51 +0000 (GMT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0711120958500.4362@racer.site> (raw)
In-Reply-To: <4738208D.1080003@op5.se>

Hi,

On Mon, 12 Nov 2007, Andreas Ericsson wrote:

> I recently ran into an oddity with the excellent git diff output
> format. When a function declaration changes in the same patch as
> something else in a function, the old declaration is used with the
> diff hunk-headers.
> 
> [...]
> 
> It definitely looks like a bug, but really isn't, since an earlier hunk
> (pasted below) changes the declaration.
>
> [...]
>
> This makes it impossible to trust the hunk-header info if the declaration
> changes.

Huh?  You admit yourself that it is not a bug.  And sure you can trust the 
hunk header.  Like most of the things, the relate to the _original_ 
version, since the diff is meant to be applied as a forward patch.

So for all practical matters, the diff shows the correct thing: "in this 
hunk, which (still) belongs to that function, change this and this."

Of course, that is only the case if you accept that the diff should be 
applied _in total_, not piecewise.  IOW if you are a fan of GNU patch 
which happily clobbers your file until it fails with the last hunk, you 
will not be happy.

Ciao,
Dscho

  reply	other threads:[~2007-11-12 10:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12  9:44 git diff woes Andreas Ericsson
2007-11-12 10:01 ` Johannes Schindelin [this message]
2007-11-12 10:35   ` Andreas Ericsson
2007-11-12 10:50     ` Johannes Schindelin
2007-11-12 11:19       ` Andreas Ericsson
2007-11-12 21:30     ` Junio C Hamano
2007-11-13  0:03       ` Andreas Ericsson
2007-11-13  0:59         ` Johannes Schindelin
2007-11-13  2:53         ` Miles Bader
2007-11-13  7:40           ` Andreas Ericsson
2007-11-13  9:15             ` [PATCH] diffcore: Allow users to decide what funcname to use Andreas Ericsson
2007-11-13 10:03               ` Jakub Narebski
2007-11-13 10:07                 ` Andreas Ericsson

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=Pine.LNX.4.64.0711120958500.4362@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=ae@op5.se \
    --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).