git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Javier Domingo <javierdo1@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Geert Bosch <bosch@adacore.com>,
	Morten Welinder <mwelinder@gmail.com>, Kevin <ikke@ikke.info>,
	git <git@vger.kernel.org>
Subject: Re: possible Improving diff algoritm
Date: Fri, 14 Dec 2012 13:20:29 +0100	[thread overview]
Message-ID: <CALZVap=r0toqWT7aJxiKtezmR8s4QDd0x92JX-eBLWhKaJsmOw@mail.gmail.com> (raw)
In-Reply-To: <7vzk1izcv6.fsf@alter.siamese.dyndns.org>

I think the idea of being preferable to have a blank line at the end
of the added/deleted block is key in this case.

Javier Domingo


2012/12/13 Junio C Hamano <gitster@pobox.com>:
> Geert Bosch <bosch@adacore.com> writes:
>
>> It would seem that just looking at the line length (stripped) of
>> the last line, might be sufficient for cost function to minimize.
>> Here the some would be 3 vs 0. In case of ties, use the last
>> possibility with minimum cost.
>
> -- 8< --
> #ifdef A
>
> some stuff
> about A
>
> #endif
> #ifdef Z
>
> some more stuff
> about Z
>
> #endif
> -- >8 --
>
> If you insert a block for M following the existing formatting
> convention in the middle, your heuristics will pick the blank line
> after "about A" as having minimum cost, no?
>
> You inherently have to know the nature of the payload, as your eyes
> that judge the result use that knowledge when doing so, I am afraid.
> I think your "define a function that gives a good score to lines
> that are likely to be good breaking points" idea has merit, but I
> think that should be tied to the content type, most likely via the
> attribute mechanism.
>
> In any case, I consider this as a low-impact (as Michael Haggerty
> noted, it is impossible to introduce a bug that subtly break the
> output; your result is either totally borked or is correct) and
> low-hanging fruit (it can be done as a postprocessing phase after
> the xdiff machinery has done the heavy-lifting of computing LCA), if
> somebody wants to experiment and implement one.  As long as the new
> heuristics is hidden behind an explicit command line option to avoid
> other "consequences", I wouldn't discourage interested parties from
> working on it.  It is not just my itch, though.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2012-12-14 12:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAO54GHC4AXQO1MbU2qXMdcDO5mtUFhrXfXND5evc93kQhNfCrw@mail.gmail.com>
2012-12-12 15:03 ` Fwd: possible Improving diff algoritm Kevin
2012-12-12 18:29   ` Junio C Hamano
2012-12-12 18:48     ` Brian J. Murrell
2012-12-12 19:30     ` Kevin
2012-12-12 20:29     ` Junio C Hamano
2012-12-12 21:40     ` Morten Welinder
2012-12-12 21:53       ` Junio C Hamano
2012-12-12 22:34         ` Andrew Ardill
2012-12-12 23:32           ` Javier Domingo
2012-12-12 23:43             ` Junio C Hamano
2012-12-12 23:49               ` Javier Domingo
2012-12-13  0:00         ` Michael Haggerty
2012-12-13  1:55         ` Morten Welinder
2012-12-13  4:58           ` Geert Bosch
2012-12-13  6:26             ` Junio C Hamano
2012-12-14 12:20               ` Javier Domingo [this message]
2012-12-14 22:29                 ` Bernhard R. Link
2012-12-15 12:16                   ` Javier Domingo

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALZVap=r0toqWT7aJxiKtezmR8s4QDd0x92JX-eBLWhKaJsmOw@mail.gmail.com' \
    --to=javierdo1@gmail.com \
    --cc=bosch@adacore.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ikke@ikke.info \
    --cc=mwelinder@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).