git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>, Mike Rappazzo <rappazzo@gmail.com>
Cc: "Vanderhoof, Tzadik" <tzadik.vanderhoof@optum360.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: merge --no-ff is NOT mentioned in help
Date: Thu, 17 Nov 2016 20:18:22 +0100	[thread overview]
Message-ID: <cff54a0c-65bb-047e-b77d-916e300b66d4@web.de> (raw)
In-Reply-To: <xmqqr36anibl.fsf@gitster.mtv.corp.google.com>



On 17/11/16 18:10, Junio C Hamano wrote:
> Mike Rappazzo <rappazzo@gmail.com> writes:
>
>> (Please reply inline)
> Indeed ;-)
>
>> On Wed, Nov 16, 2016 at 10:48 AM, Vanderhoof, Tzadik
>> <tzadik.vanderhoof@optum360.com> wrote:
>>> I am running:    git version 2.10.1.windows.1
>>>
>>> I typed: git merge -h
>>>
>>> and got:
>>>
>>> usage: git merge [<options>] [<commit>...]
>>>     or: git merge [<options>] <msg> HEAD <commit>
>>>     or: git merge --abort
>>>
>>>      -n                    do not show a diffstat at the end of the merge
>>> ...
>>>      --overwrite-ignore    update ignored files (default)
>>>
>>> Notice there is NO mention of the "--no-ff" option
>> I understand.  On my system I can reproduce this by providing a bad
>> argument to `git merge`.  This is the output from the arg setup.  For
>> "boolean" arguments (like '--ff'), there is an automatic counter
>> argument with "no-" in there ('--no-ff') to disable the option.  Maybe
>> it would make sense to word the output to include both.
> I think that was a deliberate design decision to avoid cluttering
> the short help text with mention of both --option and --no-option.
>
> People interested may want to try the attached single-liner patch to
> see how the output from _ALL_ commands that use parse-options API
> looks when given "-h".  It could be that the result may not be too
> bad.
>
> I suspect that we may discover that some options that should be
> marked with NONEG are not marked along the way, which need to be
> fixed.
>
>
>   parse-options.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/parse-options.c b/parse-options.c
> index 312a85dbde..348be6b240 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -626,7 +626,9 @@ static int usage_with_options_internal(struct parse_opt_ctx_t *ctx,
>   		if (opts->long_name && opts->short_name)
>   			pos += fprintf(outfile, ", ");
>   		if (opts->long_name)
> -			pos += fprintf(outfile, "--%s", opts->long_name);
> +			pos += fprintf(outfile, "--%s%s",
> +				       (opts->flags & PARSE_OPT_NONEG) ? "" : "[no-]",
> +				       opts->long_name);
>   		if (opts->type == OPTION_NUMBER)
>   			pos += utf8_fprintf(outfile, _("-NUM"));
>   
+1 from my side
(As I once spend some time to find out that the "no--" is automatically available)


  reply	other threads:[~2016-11-17 19:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 15:16 merge --no-ff is NOT mentioned in help Vanderhoof, Tzadik
2016-11-16 15:36 ` Mike Rappazzo
2016-11-16 15:48   ` Vanderhoof, Tzadik
2016-11-16 15:57     ` Mike Rappazzo
2016-11-17 14:03       ` Vanderhoof, Tzadik
2016-11-17 17:10       ` Junio C Hamano
2016-11-17 19:18         ` Torsten Bögershausen [this message]
2016-11-17 22:21         ` Jeff King
2016-11-18 14:51           ` Vanderhoof, Tzadik

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=cff54a0c-65bb-047e-b77d-916e300b66d4@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rappazzo@gmail.com \
    --cc=tzadik.vanderhoof@optum360.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.
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).