git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Fredi Fowler <inredikawb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] Using no- for options instead of duplication
Date: Tue, 13 Nov 2018 13:37:29 +0900	[thread overview]
Message-ID: <xmqqmuqdwq2e.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <01020167094ab871-ca8d8728-0102-4d93-a4ff-d554b4aec59f-000000@eu-west-1.amazonses.com> (Fredi Fowler's message of "Mon, 12 Nov 2018 18:59:11 +0000")

Fredi Fowler <inredikawb@gmail.com> writes:

Here is a space for you to justify the change and sign off your
patch (see Documentation/SubmittingPatches).

> ---

> Subject: Re: [RFC PATCH] Using no- for options instead of duplication

Try to see if you can format the title in "<area>: <explanation>"
form first, please.  I'll come back to it later.


>  Documentation/merge-options.txt | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)

A quick counting (which may count false positives) tells me that

    $ git grep -e '^--no-' Documentation | wc -l
    124 
    $ git grep -e '^--\[no-' Documentation | wc -l
    44

you are standardizing to the minority way.

	A tangent that somebody might want to tackle.  It would be
	nice if we had a tool that takes a grep expression (like
	'^--no' and '^\[no-' above) and shows histograms of the ages
	of lines that match.  It might tell us that all 44 combined
	ones are more recent (some of them may even have been
	updated from the separate form) than the 124 separate ones,
	in which case we can say "we started the process of
	migrating to list options singly, like '--[no-]option', in
	commit X; let's continue doing so" in the log message.  Or
	it may turn out that we have been going in the other
	direction and most of these 44 are stale ones yet to be
	split.  Without such a tool, the above numbers are the best
	measure to go by, which is not quite ideal.

As there are tons of split ones, not just in merge-options.txt, I
suspect that the <area> of the change can just be "doc", so a good
title may be

	Subject: [PATCH] doc: list negative options as --[no-]option

or something like that.

If going in the direction of this patch were a good idea, that is.

I am actually not sure if it is a good idea, especially given that
the only change is the enumeration headers and without adjustment to
the text, though.

> diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
> index 63a3fc09548ab..fc1122ded51a0 100644
> --- a/Documentation/merge-options.txt
> +++ b/Documentation/merge-options.txt
> @@ -1,5 +1,4 @@
> ---commit::
> ---no-commit::
> +--[no-]commit::
>  	Perform the merge and commit the result. This option can
>  	be used to override --no-commit.
>  +
>  ...
>  With --no-commit perform the merge but pretend the merge
>  failed and do not autocommit, to give the user a chance to
>  inspect and further tweak the merge result before committing.

For example, the original for this one gives the behaviour for --commit
and --no-commit separately, and it visually makes it easier to see two
distinct header items.

Description of some other options read OK either way, which would
justify not touching the description when combining two headings
into one.  But that still does not justify the combining in the
first place.

FWIW, "git help -m merge" begins its OPTIONS section like this:

OPTIONS
       --commit, --no-commit
           Perform the merge and commit the result. This option can be used to
           override --no-commit.

           With --no-commit perform the merge but pretend the merge failed and
           do not autocommit, to give the user a chance to inspect and further
           tweak the merge result before committing.

which is different from heading with a single "--[no-]commit", but I
do not quite see why a single squished form is preferrable.  It does
not save lines, and it forces readers to split and reassemble two
options in their head while reading.

  reply	other threads:[~2018-11-13  4:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 18:59 [RFC PATCH] Using no- for options instead of duplication Fredi Fowler
2018-11-13  4:37 ` Junio C Hamano [this message]
2018-11-13 10:18   ` Ævar Arnfjörð Bjarmason
2018-11-13 13:09     ` 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

  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=xmqqmuqdwq2e.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=inredikawb@gmail.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).