git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Eugen Konkov <kes-kes@yandex.ru>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Re* --creation-factor=100 does not show code
Date: Thu, 28 Jul 2022 19:12:45 +0200	[thread overview]
Message-ID: <220728.86k07xjh11.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqo7x9ch7n.fsf_-_@gitster.g>


On Thu, Jul 28 2022, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> Hi Eugen,
>>
>> On Tue, 26 Jul 2022, Eugen Konkov wrote:
>>
>>> $ git range-diff --creation-factor=100 branch...origin/branch
>>> 1:  a87daecd47 < -:  ---------- Add mocked exchanges for ...::AutoRenew::General test
>>> -:  ---------- > 1:  36eaeb56a9 Add mocked exchanges for ...::AutoRenew::General test
>>> 2:  9594ccf145 = 2:  70681dd13b Remove a call to DB::state
>>> 3:  740903e01c = 3:  5745ae5702 Run cpanm without tests
>>> 4:  e8e6cac09c < -:  ---------- Do not use 'require'
>>>
>>> --creation-factor=101 does =)
>>>
>>> but maximum value for percentage is 100. So expected behaviour is to display range-diff when value 100 was provided
>>
>> Please see https://git-scm.com/docs/git-range-diff#_algorithm for an
>> explanation what the meaning of the factor is, and why 100 is not the
>> maximal sensible value.
>
> When I had to give a huge value to the option the last time, I think
> I used --creation-factor=999 or something.  The thing that bugged me
> in the output of "git range-diff --help" is that SYNOPSIS section
> has "--creation-factor=<factor>" but the OPTIONS heading says
> "--creation-factor=<percent>" and the word is used in description as
> well.
>
> ----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
> Subject: range-diff: clarify --creation-factor=<factor>
>
> The value is not a per-cent that ranges from 0 to 100.  The SYNOPSIS
> section gets it right, but the body of the documentation said "percent"
> which confused readers.
>
> While we are at it, rephrase "smaller one" that corresponds to
> "larger value" earlier in the sentence to "smaller value" to be more
> explicit, to avoid misleading eyes of the readers to an unrelated "a
> large change" nearby.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  Documentation/git-range-diff.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git c/Documentation/git-range-diff.txt w/Documentation/git-range-diff.txt
> index fe350d7f40..e49630e8ad 100644
> --- c/Documentation/git-range-diff.txt
> +++ w/Documentation/git-range-diff.txt
> @@ -61,11 +61,11 @@ This is known to `range-diff` as "dual coloring". Use `--no-dual-color`
>  to revert to color all lines according to the outer diff markers
>  (and completely ignore the inner diff when it comes to color).
>  
> ---creation-factor=<percent>::
> -	Set the creation/deletion cost fudge factor to `<percent>`.
> +--creation-factor=<factor>::
> +	Set the creation/deletion cost fudge factor to `<factor>`.
>  	Defaults to 60. Try a larger value if `git range-diff` erroneously
>  	considers a large change a total rewrite (deletion of one commit
> -	and addition of another), and a smaller one in the reverse case.
> +	and addition of another), and a smaller value in the reverse case.
>  	See the ``Algorithm`` section below for an explanation why this is
>  	needed.
>  

That algorithm section also says:

	The cost of an edge o--C is the size of C's diff, modified by a
	fudge factor that should be smaller than 100%.

Which I find quite confusing to follow, isn't that "fudge factor" the
<percent> (or <factor>) we're accepting with --creation-factor? Doesn't
that also need to be adjusted?

I still find this documentation quicke lacking, if the default is 60 and
it's not 0..100 what is it then? Are values of 200 sensible in some
cases, 1k? 10k?

  reply	other threads:[~2022-07-28 17:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 12:54 --creation-factor=100 does not show code Eugen Konkov
2022-07-28 14:59 ` Johannes Schindelin
2022-07-28 16:52   ` Re* " Junio C Hamano
2022-07-28 17:12     ` Ævar Arnfjörð Bjarmason [this message]
2022-07-28 17:44       ` Junio C Hamano
2022-07-28 19:46         ` Ævar Arnfjörð Bjarmason
2022-07-28 19:54           ` Junio C Hamano
2022-07-28 17:49     ` [PATCH] format-patch: clarify --creation-factor=<factor> Eric Sunshine
2022-07-28 20:55       ` Ævar Arnfjörð Bjarmason
2022-07-28 20:59         ` Junio C Hamano
2022-07-28 21:09           ` Eric Sunshine
2022-07-30  0:25             ` Eric Sunshine
2022-07-31 18:56               ` Junio C Hamano
2022-07-29 13:16     ` Re* --creation-factor=100 does not show code Johannes Schindelin
2022-07-29 22:19       ` Junio C Hamano
2022-08-01 23:17         ` Junio C Hamano
2023-04-02 21:55           ` Eugen Konkov

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=220728.86k07xjh11.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kes-kes@yandex.ru \
    /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).