git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: git@vger.kernel.org
Subject: [PATCH 06/13] status: mark --find-renames option with NONEG
Date: Mon, 5 Nov 2018 01:40:53 -0500	[thread overview]
Message-ID: <20181105064053.GF25864@sigill.intra.peff.net> (raw)
In-Reply-To: <20181105063718.GA24877@sigill.intra.peff.net>

If you run "git status --no-find-renames", it will behave the same as
"--find-renames", because we ignore the "unset" parameter (we see a NULL
"arg", but since the score argument is optional, we just think that the
user did not provide a score).

We already have a separate "--no-renames" to disable renames, so there's
not much point in supporting "--no-find-renames". Let's just flag it as
an error.

Signed-off-by: Jeff King <peff@peff.net>
---
 builtin/commit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 074bd9a551..4d7754ca43 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1335,7 +1335,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
 		OPT_BOOL(0, "no-renames", &no_renames, N_("do not detect renames")),
 		{ OPTION_CALLBACK, 'M', "find-renames", &rename_score_arg,
 		  N_("n"), N_("detect renames, optionally set similarity index"),
-		  PARSE_OPT_OPTARG, opt_parse_rename_score },
+		  PARSE_OPT_OPTARG | PARSE_OPT_NONEG, opt_parse_rename_score },
 		OPT_END(),
 	};
 
-- 
2.19.1.1505.g9cd28186cf


  parent reply	other threads:[~2018-11-05  6:40 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  6:37 [PATCH 0/13] parseopt fixes from -Wunused-parameters Jeff King
2018-11-05  6:38 ` [PATCH 01/13] apply: mark include/exclude options as NONEG Jeff King
2018-11-05  7:07   ` Junio C Hamano
2018-11-05  6:38 ` [PATCH 02/13] am: handle --no-patch-format option Jeff King
2018-11-05  7:08   ` Junio C Hamano
2018-11-05  6:39 ` [PATCH 03/13] ls-files: mark exclude options as NONEG Jeff King
2018-11-05  6:39 ` [PATCH 04/13] pack-objects: mark index-version option " Jeff King
2018-11-05  6:40 ` [PATCH 05/13] cat-file: mark batch options with NONEG Jeff King
2018-11-05  6:40 ` Jeff King [this message]
2018-11-05  6:41 ` [PATCH 07/13] format-patch: mark "--no-numbered" option " Jeff King
2018-11-05  6:42 ` [PATCH 08/13] show-branch: mark --reflog option as NONEG Jeff King
2018-11-05  6:43 ` [PATCH 09/13] tag: mark "--message" option with NONEG Jeff King
2018-11-05  6:43 ` [PATCH 10/13] cat-file: report an error on multiple --batch options Jeff King
2018-11-05  6:43 ` [PATCH 11/13] apply: return -1 from option callback instead of calling exit(1) Jeff King
2018-11-05  6:44 ` [PATCH 12/13] parse-options: drop OPT_DATE() Jeff King
2018-11-05 18:34   ` [PATCH] parse-options: deprecate OPT_DATE Carlo Marcelo Arenas Belón
2018-11-05 18:49     ` Jeff King
2018-11-05  6:45 ` [PATCH 13/13] assert NOARG/NONEG behavior of parse-options callbacks Jeff King
2018-11-05 16:51 ` [PATCH 0/13] parseopt fixes from -Wunused-parameters Duy Nguyen
2018-11-05 18:49   ` Jeff King
2018-11-05 18:51     ` Duy Nguyen

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=20181105064053.GF25864@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    /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).