From: Davide Libenzi <davidel@xmailserver.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [RFH] shifting xdiff hunks?
Date: Wed, 12 Apr 2006 23:52:34 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0604122348010.7104@alien.or.mcafeemobile.com> (raw)
In-Reply-To: <7vmzeqyolw.fsf@assigned-by-dhcp.cox.net>
On Wed, 12 Apr 2006, Junio C Hamano wrote:
> The first hunk begins by an addition of a couple of non-blank
> line followed by an addition of a blank line. The second hunk,
> while it does the same thing, is shown differently.
>
> Now, from correctness point of view, this is not a problem at
> all, but I am wondering if xdiff can help to always shift the
> hunk down or up to consistently produce one way or another
> (personally I feel the former is easier to read).
Next on your screens, Junio and Linus in the new commedy "Pickier and Pickiest" :)
> Here is a rough sketch of what I think I want. When we have
> additions, as long as the first line added happens to match the
> first line that is common between the versions that comes after
> the added hunk (that is, in the case of the second hunk above,
> the empty line before "gitlink:git-rm[1]" happens to match the
> empty line after the added three lines), roll the hunk down by
> one, until you cannot roll it down anymore.
>
> Just in case I get misinterpreted, I am not talking about
> treating empty lines in any special way. It is more about
> "starting the hunk with actually changed line". The first hunk
> above clearly begins with something added, while the second one
> does not.
>
> Is this something easy to do with the xdiff code?
Yes, this is what GNU diff does. It's a post-process of the edit script.
Not a problem at all. Till this weekend (included) I'm pretty booked, but
I'll do that in the following days.
- Davide
next prev parent reply other threads:[~2006-04-13 6:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-13 6:30 [RFH] shifting xdiff hunks? Junio C Hamano
2006-04-13 6:52 ` Davide Libenzi [this message]
2006-04-13 21:55 ` Davide Libenzi
2006-04-13 23:31 ` Junio C Hamano
2006-04-13 7:44 ` Jakub Narebski
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.0604122348010.7104@alien.or.mcafeemobile.com \
--to=davidel@xmailserver.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox