All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Elijah Newren <newren@gmail.com>
Cc: "Mário Guimarães" <mario.luis.guimaraes@gmail.com>, git@vger.kernel.org
Subject: Re: Bug: impure renames may be reported as pure renames
Date: Wed, 21 Feb 2024 13:00:48 -0800	[thread overview]
Message-ID: <xmqqzfvtmt1b.fsf@gitster.g> (raw)
In-Reply-To: <xmqqttm1pwsv.fsf@gitster.g> (Junio C. Hamano's message of "Wed, 21 Feb 2024 09:11:12 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Alternatively, we could cap p->score to (MAX_SCORE-1) when
> similarity is _computed_ for filepair between non-identical blobs.
> That should happen in diffcore-rename.c:estimate_similarity().
> It would allow us to still _show_ "1 line changed among 1000 lines"
> case as R100 and still reject inexact renames via "-M100" from the
> command line, I think, as the "exact renames only" short-cut works
> with the finer-grained "score" values and not the coarser "percent"
> values, which might give us a better approach.

... the above may be "better" under a specific assumption: in the
future, we would correct the rounding of scaling from 0..MAX_SCORE
(or 0..MAX_SCORE-1) to 0..100 from the current "always round down"
to "below 0.5 is rounded down, 0.5 and above is rounded up".  If
that happens, we would still honor the "Give -M100 to limit the
rename detection to exact ones", and will exclude a change that
modifies a single line in 1000, but if you say -M99, we would show
such a change and it would be labelled as R100 as correctly rounded.


      reply	other threads:[~2024-02-21 21:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 20:58 Bug: impure renames may be reported as pure renames Mário Guimarães
2024-02-21  2:12 ` Elijah Newren
2024-02-21 17:11   ` Junio C Hamano
2024-02-21 21:00     ` Junio C Hamano [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=xmqqzfvtmt1b.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mario.luis.guimaraes@gmail.com \
    --cc=newren@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.