{"thread":{"id":"66161","subject":"[PATCH] diff: avoid misleading statement about -l option","startedAt":"2026-08-12T06:42:40Z","lastAt":"2026-08-14T14:26:46Z","messageCount":5,"participants":["Elijah Newren via GitGitGadget","Junio C Hamano","Elijah Newren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"550348","messageId":"pull.2035.git.1786516958048.gitgitgadget@gmail.com","threadId":"66161","inReplyTo":null,"subject":"[PATCH] diff: avoid misleading statement about -l option","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-08-12T06:42:37Z","receivedAt":"2026-08-12T06:42:40Z","isPatch":true,"body":"From: Elijah Newren <newren@github.com>\n\nIn commit 6623a528e00b (doc: clarify documentation for rename/copy\nlimits, 2021-07-15), the wording around rename limit options and config\nvariables were updated to point out that only the quadratic portion of\nrename detection (or \"exhaustive portion of rename/copy detection\" as\nused in that commit) was limited by these options, because exact rename\ndetection and basename-guided rename detection (which both run in time\nlinear in the number of files) still run before this limit is checked.\n\nHowever, the short help message wasn't updated at the time; update it\ntoo.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    diff: avoid misleading statement about -l option\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2035%2Fnewren%2Fdiff-l-option-doc-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2035/newren/diff-l-option-doc-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2035\n\n diff.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/diff.c b/diff.c\nindex a68ddd2168..0aa910a2c0 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -5871,7 +5871,7 @@ struct option *add_diff_options(const struct option *opts,\n \t\t\t       N_(\"continue listing the history of a file beyond renames\"),\n \t\t\t       PARSE_OPT_NOARG, diff_opt_follow),\n \t\tOPT_INTEGER('l', NULL, &options->rename_limit,\n-\t\t\t    N_(\"prevent rename/copy detection if the number of rename/copy targets exceeds given limit\")),\n+\t\t\t    N_(\"prevent exhaustive portion of rename/copy detection if the number of rename/copy targets exceeds given limit\")),\n \n \t\tOPT_GROUP(N_(\"Diff algorithm options\")),\n \t\tOPT_CALLBACK_F(0, \"minimal\", options, NULL,\n\nbase-commit: 7264e61d87e58b9d0f5e6424c47c11e9657dfb75\n-- \ngitgitgadget\n"},{"id":"550410","messageId":"xmqqh5kzzadm.fsf@gitster.g","threadId":"66161","inReplyTo":"pull.2035.git.1786516958048.gitgitgadget@gmail.com","subject":"Re: [PATCH] diff: avoid misleading statement about -l option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-12T14:22:45Z","receivedAt":"2026-08-12T14:22:47Z","isPatch":true,"body":"\"Elijah Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Elijah Newren <newren@github.com>\n>\n> In commit 6623a528e00b (doc: clarify documentation for rename/copy\n> limits, 2021-07-15), the wording around rename limit options and config\n> variables were updated to point out that only the quadratic portion of\n> rename detection (or \"exhaustive portion of rename/copy detection\" as\n> used in that commit) was limited by these options, because exact rename\n> detection and basename-guided rename detection (which both run in time\n> linear in the number of files) still run before this limit is checked.\n>\n> However, the short help message wasn't updated at the time; update it\n> too.\n\nHowever this is an end-user facing message.  Can we make it more\neasier to understnad by being less precise?  \"limit to exact\nrename/copy if ...\" or something?\n"},{"id":"550414","messageId":"CABPp-BF_iHPxc_uAZBCiOsRMqFBzJtEQU62GTyPOdut_bar7Qg@mail.gmail.com","threadId":"66161","inReplyTo":"xmqqh5kzzadm.fsf@gitster.g","subject":"Re: [PATCH] diff: avoid misleading statement about -l option","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2026-08-12T15:42:06Z","receivedAt":"2026-08-12T15:42:19Z","isPatch":true,"body":"On Wed, Aug 12, 2026 at 7:22 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Elijah Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > From: Elijah Newren <newren@github.com>\n\nOops, I had author != committer (and author != signoff).  I'll fix\nthat up and send in a .mailmap entry too.\n\n> > In commit 6623a528e00b (doc: clarify documentation for rename/copy\n> > limits, 2021-07-15), the wording around rename limit options and config\n> > variables were updated to point out that only the quadratic portion of\n> > rename detection (or \"exhaustive portion of rename/copy detection\" as\n> > used in that commit) was limited by these options, because exact rename\n> > detection and basename-guided rename detection (which both run in time\n> > linear in the number of files) still run before this limit is checked.\n> >\n> > However, the short help message wasn't updated at the time; update it\n> > too.\n>\n> However this is an end-user facing message.  Can we make it more\n> easier to understnad by being less precise?  \"limit to exact\n> rename/copy if ...\" or something?\n\nMaybe if we replace \"exact\" with either \"cheap\" or \"linear\"?\n\n   \"limit to cheap rename/copy detection if the number of rename/copy\ntargets exceeds this value\" ?\n\nThat would also tie in with the documentation for -l:\n\n`-l<num>`::\n    The `-M` and `-C` options involve some preliminary steps that\n    can detect subsets of renames/copies cheaply, followed by an\n    exhaustive fallback portion that compares all remaining\n    unpaired destinations to all relevant sources.\n\nSince there are two cheap preliminary steps -- \"exact\" and\n\"basename-guided\" rename detection -- using \"cheap\" correctly covers\nboth.  Does that sound reasonable?\n"},{"id":"550587","messageId":"pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com","threadId":"66161","inReplyTo":"pull.2035.git.1786516958048.gitgitgadget@gmail.com","subject":"[PATCH v2] diff: avoid misleading statement about -l option","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-08-14T02:06:26Z","receivedAt":"2026-08-14T02:06:30Z","isPatch":true,"body":"From: Elijah Newren <newren@gmail.com>\n\nIn commit 6623a528e00b (doc: clarify documentation for rename/copy\nlimits, 2021-07-15), the wording around rename limit options and config\nvariables were updated to point out that only the quadratic portion of\nrename detection (or \"exhaustive portion of rename/copy detection\" as\nused in that commit) was limited by these options, because exact rename\ndetection and basename-guided rename detection (which both run in time\nlinear in the number of files) still run before this limit is checked.\n\nHowever, the short help message wasn't updated at the time; update it\ntoo.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    diff: avoid misleading statement about -l option\n    \n    Changes since v1:\n    \n     * Fixed author to match signoff\n     * Simplified the wording a bit, along the lines of Junio's suggestion\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2035%2Fnewren%2Fdiff-l-option-doc-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2035/newren/diff-l-option-doc-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2035\n\nRange-diff vs v1:\n\n 1:  6253e1dc96 ! 1:  58729a71ce diff: avoid misleading statement about -l option\n     @@\n       ## Metadata ##\n     -Author: Elijah Newren <newren@github.com>\n     +Author: Elijah Newren <newren@gmail.com>\n      \n       ## Commit message ##\n          diff: avoid misleading statement about -l option\n     @@ diff.c: struct option *add_diff_options(const struct option *opts,\n       \t\t\t       PARSE_OPT_NOARG, diff_opt_follow),\n       \t\tOPT_INTEGER('l', NULL, &options->rename_limit,\n      -\t\t\t    N_(\"prevent rename/copy detection if the number of rename/copy targets exceeds given limit\")),\n     -+\t\t\t    N_(\"prevent exhaustive portion of rename/copy detection if the number of rename/copy targets exceeds given limit\")),\n     ++\t\t\t    N_(\"limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value\")),\n       \n       \t\tOPT_GROUP(N_(\"Diff algorithm options\")),\n       \t\tOPT_CALLBACK_F(0, \"minimal\", options, NULL,\n\n\n diff.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/diff.c b/diff.c\nindex 589c1969e4..c593066592 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -6186,7 +6186,7 @@ struct option *add_diff_options(const struct option *opts,\n \t\t\t       N_(\"continue listing the history of a file beyond renames\"),\n \t\t\t       PARSE_OPT_NOARG, diff_opt_follow),\n \t\tOPT_INTEGER('l', NULL, &options->rename_limit,\n-\t\t\t    N_(\"prevent rename/copy detection if the number of rename/copy targets exceeds given limit\")),\n+\t\t\t    N_(\"limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value\")),\n \n \t\tOPT_GROUP(N_(\"Diff algorithm options\")),\n \t\tOPT_CALLBACK_F(0, \"minimal\", options, NULL,\n\nbase-commit: 2c78326f810173a4f3aefd8021f1e07575412481\n-- \ngitgitgadget\n"},{"id":"550615","messageId":"xmqqbjb4rd5q.fsf@gitster.g","threadId":"66161","inReplyTo":"pull.2035.v2.git.1786673186855.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] diff: avoid misleading statement about -l option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-14T14:26:41Z","receivedAt":"2026-08-14T14:26:46Z","isPatch":true,"body":"\"Elijah Newren via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> diff --git a/diff.c b/diff.c\n> index 589c1969e4..c593066592 100644\n> --- a/diff.c\n> +++ b/diff.c\n> @@ -6186,7 +6186,7 @@ struct option *add_diff_options(const struct option *opts,\n>  \t\t\t       N_(\"continue listing the history of a file beyond renames\"),\n>  \t\t\t       PARSE_OPT_NOARG, diff_opt_follow),\n>  \t\tOPT_INTEGER('l', NULL, &options->rename_limit,\n> -\t\t\t    N_(\"prevent rename/copy detection if the number of rename/copy targets exceeds given limit\")),\n> +\t\t\t    N_(\"limit to cheap rename/copy detection if the number of rename/copy targets exceeds this value\")),\n\nThat is still a mouthful and it does not help that rename/copy\nappears twice, but that trait is shared with the original, so let's\nleave it outside the topic to improve it.  If somebody is inclined\nto, he or she can do so later.\n\nWill mark it for 'next'.  Thanks.\n\n>  \n>  \t\tOPT_GROUP(N_(\"Diff algorithm options\")),\n>  \t\tOPT_CALLBACK_F(0, \"minimal\", options, NULL,\n>\n> base-commit: 2c78326f810173a4f3aefd8021f1e07575412481\n"}]}