Skip to content

diff: avoid misleading statement about -l option - #2035

Closed
newren wants to merge 1 commit into
gitgitgadget:masterfrom
newren:diff-l-option-doc
Closed

newren wants to merge 1 commit into
gitgitgadget:masterfrom
newren:diff-l-option-doc

Conversation

@newren

@newren newren commented Jan 21, 2026 •

Copy link
Copy Markdown

Changes since v1:

  • Fixed author to match signoff
  • Simplified the wording a bit, along the lines of Junio's suggestion

@newren

newren commented Aug 12, 2026

Copy link
Copy Markdown
Author

/submit

@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

Submitted as pull.2035.git.1786516958048.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2035/newren/diff-l-option-doc-v1

To fetch this version to local tag pr-2035/newren/diff-l-option-doc-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2035/newren/diff-l-option-doc-v1

@newren
newren force-pushed the diff-l-option-doc branch from 6253e1d to 80c77e0 Compare August 12, 2026 06:59
@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Elijah Newren <newren@github.com>
>
> In commit 6623a528e00b (doc: clarify documentation for rename/copy
> limits, 2021-07-15), the wording around rename limit options and config
> variables were updated to point out that only the quadratic portion of
> rename detection (or "exhaustive portion of rename/copy detection" as
> used in that commit) was limited by these options, because exact rename
> detection and basename-guided rename detection (which both run in time
> linear in the number of files) still run before this limit is checked.
>
> However, the short help message wasn't updated at the time; update it
> too.

However this is an end-user facing message.  Can we make it more
easier to understnad by being less precise?  "limit to exact
rename/copy if ..." or something?

In commit 6623a52 (doc: clarify documentation for rename/copy
limits, 2021-07-15), the wording around rename limit options and config
variables were updated to point out that only the quadratic portion of
rename detection (or "exhaustive portion of rename/copy detection" as
used in that commit) was limited by these options, because exact rename
detection and basename-guided rename detection (which both run in time
linear in the number of files) still run before this limit is checked.

However, the short help message wasn't updated at the time; update it
too.

Signed-off-by: Elijah Newren <newren@gmail.com>
@newren
newren force-pushed the diff-l-option-doc branch from 80c77e0 to 58729a7 Compare August 12, 2026 15:42
@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

Elijah Newren wrote on the Git mailing list (how to reply to this email):

On Wed, Aug 12, 2026 at 7:22 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Elijah Newren <newren@github.com>

Oops, I had author != committer (and author != signoff).  I'll fix
that up and send in a .mailmap entry too.

> > In commit 6623a528e00b (doc: clarify documentation for rename/copy
> > limits, 2021-07-15), the wording around rename limit options and config
> > variables were updated to point out that only the quadratic portion of
> > rename detection (or "exhaustive portion of rename/copy detection" as
> > used in that commit) was limited by these options, because exact rename
> > detection and basename-guided rename detection (which both run in time
> > linear in the number of files) still run before this limit is checked.
> >
> > However, the short help message wasn't updated at the time; update it
> > too.
>
> However this is an end-user facing message.  Can we make it more
> easier to understnad by being less precise?  "limit to exact
> rename/copy if ..." or something?

Maybe if we replace "exact" with either "cheap" or "linear"?

   "limit to cheap rename/copy detection if the number of rename/copy
targets exceeds this value" ?

That would also tie in with the documentation for -l:

`-l<num>`::
    The `-M` and `-C` options involve some preliminary steps that
    can detect subsets of renames/copies cheaply, followed by an
    exhaustive fallback portion that compares all remaining
    unpaired destinations to all relevant sources.

Since there are two cheap preliminary steps -- "exact" and
"basename-guided" rename detection -- using "cheap" correctly covers
both.  Does that sound reasonable?

@gitgitgadget

gitgitgadget Bot commented Aug 12, 2026

Copy link
Copy Markdown

User Elijah Newren <newren@gmail.com> has been added to the cc: list.

@newren

newren commented Aug 14, 2026

Copy link
Copy Markdown
Author

/submit

@gitgitgadget

gitgitgadget Bot commented Aug 14, 2026

Copy link
Copy Markdown

Submitted as pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-2035/newren/diff-l-option-doc-v2

To fetch this version to local tag pr-2035/newren/diff-l-option-doc-v2:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-2035/newren/diff-l-option-doc-v2

@gitgitgadget

gitgitgadget Bot commented Aug 14, 2026

Copy link
Copy Markdown

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:

> diff --git a/diff.c b/diff.c
> index 589c1969e4..c593066592 100644
> --- a/diff.c
> +++ b/diff.c
> @@ -6186,7 +6186,7 @@ struct option *add_diff_options(const struct option *opts,
>  			       N_("continue listing the history of a file beyond renames"),
>  			       PARSE_OPT_NOARG, diff_opt_follow),
>  		OPT_INTEGER('l', NULL, &options->rename_limit,
> -			    N_("prevent rename/copy detection if the number of rename/copy targets exceeds given limit")),
> +			    N_("limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value")),

That is still a mouthful and it does not help that rename/copy
appears twice, but that trait is shared with the original, so let's
leave it outside the topic to improve it.  If somebody is inclined
to, he or she can do so later.

Will mark it for 'next'.  Thanks.

>  
>  		OPT_GROUP(N_("Diff algorithm options")),
>  		OPT_CALLBACK_F(0, "minimal", options, NULL,
>
> base-commit: 2c78326f810173a4f3aefd8021f1e07575412481

@gitgitgadget

gitgitgadget Bot commented Aug 14, 2026

Copy link
Copy Markdown

This patch series was integrated into seen via git@5bcc0fe.

@gitgitgadget gitgitgadget Bot added the seen label Aug 14, 2026
@gitgitgadget

gitgitgadget Bot commented Aug 14, 2026

Copy link
Copy Markdown

This branch is now known as en/diff-l-opt-help.

@gitgitgadget

gitgitgadget Bot commented Aug 15, 2026

Copy link
Copy Markdown

There was a status update in the "New Topics" section about the branch en/diff-l-opt-help on the Git mailing list:

The help text for the '-l' option of 'git diff' has been updated.

Will merge to 'next'?
cf. <xmqqbjb4rd5q.fsf@gitster.g>
source: <pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com>

@gitgitgadget

gitgitgadget Bot commented Aug 17, 2026

Copy link
Copy Markdown

There was a status update in the "Cooking" section about the branch en/diff-l-opt-help on the Git mailing list:

The help text for the '-l' option of 'git diff' has been updated.

Will merge to 'next'?
cf. <xmqqbjb4rd5q.fsf@gitster.g>
source: <pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com>

@gitgitgadget

gitgitgadget Bot commented Aug 17, 2026

Copy link
Copy Markdown

This patch series was integrated into next via git@4b6b329.

@gitgitgadget gitgitgadget Bot added the next label Aug 17, 2026
@gitgitgadget

gitgitgadget Bot commented Aug 18, 2026

Copy link
Copy Markdown

There was a status update in the "Cooking" section about the branch en/diff-l-opt-help on the Git mailing list:

The help text for the '-l' option of 'git diff' has been updated.

Will merge to 'master'.
cf. <xmqqbjb4rd5q.fsf@gitster.g>
source: <pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com>

@gitgitgadget

gitgitgadget Bot commented Aug 21, 2026

Copy link
Copy Markdown

There was a status update in the "Cooking" section about the branch en/diff-l-opt-help on the Git mailing list:

The help text for the '-l' option of 'git diff' has been updated.

Will merge to 'master'.
cf. <xmqqbjb4rd5q.fsf@gitster.g>
source: <pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com>

@gitgitgadget

gitgitgadget Bot commented Aug 24, 2026

Copy link
Copy Markdown

There was a status update in the "Cooking" section about the branch en/diff-l-opt-help on the Git mailing list:

The help text for the '-l' option of 'git diff' has been updated.

Will merge to 'master'.
cf. <xmqqbjb4rd5q.fsf@gitster.g>
source: <pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com>

@gitgitgadget

gitgitgadget Bot commented Aug 25, 2026

Copy link
Copy Markdown

This patch series was integrated into master via git@66573db.

@gitgitgadget gitgitgadget Bot added the master label Aug 25, 2026
@gitgitgadget gitgitgadget Bot closed this Aug 25, 2026
@gitgitgadget

gitgitgadget Bot commented Aug 25, 2026

Copy link
Copy Markdown

Congratulations! 🎉 Your patch series was merged into upstream via 66573db.

Note: this pull request will show as "Closed" rather than "Merged" because the merge happened in the upstream repository, not on GitHub. This is expected — your contribution has been accepted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant