All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Dmitry Malikov <malikov.d.y@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: 'Minimal' diff-algorithm producing a different result than 'myers', 'patience' and 'histogram' ones
Date: Sun, 24 May 2015 03:33:39 -0400	[thread overview]
Message-ID: <20150524073338.GA7197@peff.net> (raw)
In-Reply-To: <CAAg4OeLuR9NY1NaEsjqd4hbuLqZuUo7j+BsVvQT37APY_QEYUQ@mail.gmail.com>

On Tue, May 12, 2015 at 03:07:46PM +0200, Dmitry Malikov wrote:

> I'm trying to compare 4 different git-diff algorithms and the
> 'minimal' one is the most vague and non-obvious. The documentation
> says "Spend extra time to make sure the smallest possible diff is
> produced." - that's all.
> 
> By any chance, is there any example of diff when 'minimal' algorithm
> produces a different result than a 'myers', 'patience' and 'histogram'
> ones?

I don't know of a simple example offhand, but you can easily generate
all of the patches for a repository with each type by doing:

  for i in myers minimal patience histogram; do
    git log --diff-algorithm=$i -p >$i
  done

In git.git, the output for each type is distinct. You might also find
this thread interesting:

  http://thread.gmane.org/gmane.comp.version-control.git/143426

It mentions 717b83117 from git.git, whose minimal diff is over 300 lines
shorter than the non-minimal one. It's not exactly a simple example, but
I suspect you won't find a short case; "minimal" only matters in the
complicated ones.

-Peff

      reply	other threads:[~2015-05-24  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 13:07 'Minimal' diff-algorithm producing a different result than 'myers', 'patience' and 'histogram' ones Dmitry Malikov
2015-05-24  7:33 ` Jeff King [this message]

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=20150524073338.GA7197@peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=malikov.d.y@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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.