git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "SZEDER Gábor" <szeder.dev@gmail.com>
Subject: [PATCH] builtin/blame.c: remove '--indent-heuristic' from usage string
Date: Mon, 28 Oct 2019 11:52:41 +0100	[thread overview]
Message-ID: <20191028105242.19260-1-szeder.dev@gmail.com> (raw)

The indent heuristic is our default diff heuristic since 33de716387
(diff: enable indent heuristic by default, 2017-05-08), but the usage
string of 'git blame' still mentions it as "experimental heuristic".

We could simply update the short help associated with the option, but
according to the comment above the option's declaration it was "only
included here to get included in the "-h" output".  That made sense
while the feature was still experimental and we wanted to give it more
exposure, but nowadays it's unnecessary.

So let's rather remove the '--indent-heuristic' option from 'git
blame's usage string.  Note that 'git blame' will still accept this
option, as it is parsed in parse_revision_opt().

Astute readers may notice that this patch removes a comment mentioning
"the following two options", but it only removes one option.  The
reason is that the comment is outdated: that other options was
'--compaction-heuristic', and it has already been removed in
3cde4e02ee (diff: retire "compaction" heuristics, 2016-12-23), but
that commit forgot to update this comment.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---

Looking at the places listed by 'git grep "indent[ -]\?heuristic",
this might be the last place where the indent heuristic was marked as
experimental.

In 'diff.c' we have the following option declaration:

  OPT_BIT(0, "indent-heuristic", &options->xdl_opts,
          N_("heuristic to shift diff hunk boundaries for easy reading"),

Here we could perhaps mention that it's the default; OTOH this help is
never shown anywhere (there are just too many diff options to list).

 builtin/blame.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/builtin/blame.c b/builtin/blame.c
index 6386fbf189..b184cde4b7 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -861,14 +861,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 		OPT_STRING_LIST(0, "ignore-revs-file", &ignore_revs_file_list, N_("file"), N_("Ignore revisions from <file>")),
 		OPT_BIT(0, "color-lines", &output_option, N_("color redundant metadata from previous line differently"), OUTPUT_COLOR_LINE),
 		OPT_BIT(0, "color-by-age", &output_option, N_("color lines by age"), OUTPUT_SHOW_AGE_WITH_COLOR),
-
-		/*
-		 * The following two options are parsed by parse_revision_opt()
-		 * and are only included here to get included in the "-h"
-		 * output:
-		 */
-		{ OPTION_LOWLEVEL_CALLBACK, 0, "indent-heuristic", NULL, NULL, N_("Use an experimental heuristic to improve diffs"), PARSE_OPT_NOARG, NULL, 0, parse_opt_unknown_cb },
-
 		OPT_BIT(0, "minimal", &xdl_opts, N_("Spend extra cycles to find better match"), XDF_NEED_MINIMAL),
 		OPT_STRING('S', NULL, &revs_file, N_("file"), N_("Use revisions from <file> instead of calling git-rev-list")),
 		OPT_STRING(0, "contents", &contents_from, N_("file"), N_("Use <file>'s contents as the final image")),
-- 
2.24.0.rc1.538.gfb6e1f15ab


             reply	other threads:[~2019-10-28 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28 10:52 SZEDER Gábor [this message]
2019-10-29  3:29 ` [PATCH] builtin/blame.c: remove '--indent-heuristic' from usage string Junio C Hamano

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=20191028105242.19260-1-szeder.dev@gmail.com \
    --to=szeder.dev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 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 NNTP newsgroup(s).