{"thread":{"id":"49811","subject":"[RFC PATCH] Using no- for options instead of duplication","startedAt":"2018-11-12T18:59:14Z","lastAt":"2018-11-13T13:09:17Z","messageCount":4,"participants":["Fredi Fowler","Junio C Hamano","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"363071","messageId":"01020167094ab871-ca8d8728-0102-4d93-a4ff-d554b4aec59f-000000@eu-west-1.amazonses.com","threadId":"49811","inReplyTo":null,"subject":"[RFC PATCH] Using no- for options instead of duplication","fromName":"Fredi Fowler","fromEmail":"inredikawb@gmail.com","sentAt":"2018-11-12T18:59:11Z","receivedAt":"2018-11-12T18:59:14Z","isPatch":true,"sender":{"key":"inredikawb@gmail.com","avatar":null},"body":"---\n Documentation/merge-options.txt | 21 +++++++--------------\n 1 file changed, 7 insertions(+), 14 deletions(-)\n\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 63a3fc09548ab..fc1122ded51a0 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -1,5 +1,4 @@\n---commit::\n---no-commit::\n+--[no-]commit::\n \tPerform the merge and commit the result. This option can\n \tbe used to override --no-commit.\n +\n@@ -7,9 +6,8 @@ With --no-commit perform the merge but pretend the merge\n failed and do not autocommit, to give the user a chance to\n inspect and further tweak the merge result before committing.\n \n---edit::\n -e::\n---no-edit::\n+--[no-]edit::\n \tInvoke an editor before committing successful mechanical merge to\n \tfurther edit the auto-generated merge message, so that the user\n \tcan explain and justify the merge. The `--no-edit` option can be\n@@ -58,8 +56,7 @@ set to `no` at the beginning of them.\n With --no-log do not list one-line descriptions from the\n actual commits being merged.\n \n---signoff::\n---no-signoff::\n+--[no-]signoff::\n \tAdd Signed-off-by line by the committer at the end of the commit\n \tlog message.  The meaning of a signoff depends on the project,\n \tbut it typically certifies that committer has\n@@ -69,17 +66,15 @@ actual commits being merged.\n +\n With --no-signoff do not add a Signed-off-by line.\n \n---stat::\n -n::\n---no-stat::\n+--[no-]stat::\n \tShow a diffstat at the end of the merge. The diffstat is also\n \tcontrolled by the configuration option merge.stat.\n +\n With -n or --no-stat do not show a diffstat at the end of the\n merge.\n \n---squash::\n---no-squash::\n+--[no-]squash::\n \tProduce the working tree and index state as if a real merge\n \thappened (except for the merge information), but do not actually\n \tmake a commit, move the `HEAD`, or record `$GIT_DIR/MERGE_HEAD`\n@@ -112,8 +107,7 @@ option can be used to override --squash.\n \ta trusted key.  If the tip commit of the side branch is not signed\n \twith a valid key, the merge is aborted.\n \n---summary::\n---no-summary::\n+--[no-]summary::\n \tSynonyms to --stat and --no-stat; these are deprecated and will be\n \tremoved in the future.\n \n@@ -126,8 +120,7 @@ ifndef::git-pull[]\n --verbose::\n \tBe verbose.\n \n---progress::\n---no-progress::\n+--[no-]progress::\n \tTurn progress on/off explicitly. If neither is specified,\n \tprogress is shown if standard error is connected to a terminal.\n \tNote that not all merge strategies may support progress\n\n--\nhttps://github.com/git/git/pull/553\n"},{"id":"363130","messageId":"xmqqmuqdwq2e.fsf@gitster-ct.c.googlers.com","threadId":"49811","inReplyTo":"01020167094ab871-ca8d8728-0102-4d93-a4ff-d554b4aec59f-000000@eu-west-1.amazonses.com","subject":"Re: [RFC PATCH] Using no- for options instead of duplication","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-13T04:37:29Z","receivedAt":"2018-11-13T04:37:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Fredi Fowler <inredikawb@gmail.com> writes:\n\nHere is a space for you to justify the change and sign off your\npatch (see Documentation/SubmittingPatches).\n\n> ---\n\n> Subject: Re: [RFC PATCH] Using no- for options instead of duplication\n\nTry to see if you can format the title in \"<area>: <explanation>\"\nform first, please.  I'll come back to it later.\n\n\n>  Documentation/merge-options.txt | 21 +++++++--------------\n>  1 file changed, 7 insertions(+), 14 deletions(-)\n\nA quick counting (which may count false positives) tells me that\n\n    $ git grep -e '^--no-' Documentation | wc -l\n    124 \n    $ git grep -e '^--\\[no-' Documentation | wc -l\n    44\n\nyou are standardizing to the minority way.\n\n\tA tangent that somebody might want to tackle.  It would be\n\tnice if we had a tool that takes a grep expression (like\n\t'^--no' and '^\\[no-' above) and shows histograms of the ages\n\tof lines that match.  It might tell us that all 44 combined\n\tones are more recent (some of them may even have been\n\tupdated from the separate form) than the 124 separate ones,\n\tin which case we can say \"we started the process of\n\tmigrating to list options singly, like '--[no-]option', in\n\tcommit X; let's continue doing so\" in the log message.  Or\n\tit may turn out that we have been going in the other\n\tdirection and most of these 44 are stale ones yet to be\n\tsplit.  Without such a tool, the above numbers are the best\n\tmeasure to go by, which is not quite ideal.\n\nAs there are tons of split ones, not just in merge-options.txt, I\nsuspect that the <area> of the change can just be \"doc\", so a good\ntitle may be\n\n\tSubject: [PATCH] doc: list negative options as --[no-]option\n\nor something like that.\n\nIf going in the direction of this patch were a good idea, that is.\n\nI am actually not sure if it is a good idea, especially given that\nthe only change is the enumeration headers and without adjustment to\nthe text, though.\n\n> diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\n> index 63a3fc09548ab..fc1122ded51a0 100644\n> --- a/Documentation/merge-options.txt\n> +++ b/Documentation/merge-options.txt\n> @@ -1,5 +1,4 @@\n> ---commit::\n> ---no-commit::\n> +--[no-]commit::\n>  \tPerform the merge and commit the result. This option can\n>  \tbe used to override --no-commit.\n>  +\n>  ...\n>  With --no-commit perform the merge but pretend the merge\n>  failed and do not autocommit, to give the user a chance to\n>  inspect and further tweak the merge result before committing.\n\nFor example, the original for this one gives the behaviour for --commit\nand --no-commit separately, and it visually makes it easier to see two\ndistinct header items.\n\nDescription of some other options read OK either way, which would\njustify not touching the description when combining two headings\ninto one.  But that still does not justify the combining in the\nfirst place.\n\nFWIW, \"git help -m merge\" begins its OPTIONS section like this:\n\nOPTIONS\n       --commit, --no-commit\n           Perform the merge and commit the result. This option can be used to\n           override --no-commit.\n\n           With --no-commit perform the merge but pretend the merge failed and\n           do not autocommit, to give the user a chance to inspect and further\n           tweak the merge result before committing.\n\nwhich is different from heading with a single \"--[no-]commit\", but I\ndo not quite see why a single squished form is preferrable.  It does\nnot save lines, and it forces readers to split and reassemble two\noptions in their head while reading.\n"},{"id":"363143","messageId":"877ehh2scg.fsf@evledraar.gmail.com","threadId":"49811","inReplyTo":"xmqqmuqdwq2e.fsf@gitster-ct.c.googlers.com","subject":"Re: [RFC PATCH] Using no- for options instead of duplication","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-11-13T10:18:39Z","receivedAt":"2018-11-13T10:18:44Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Nov 13 2018, Junio C Hamano wrote:\n\n> \tA tangetn that somebody might want to tackle.  It would be\n> \tnice if we had a tool that takes a grep expression (like\n> \t'^--no' and '^\\[no-' above) and shows histograms of the ages\n> \tof lines that match.  It might tell us that all 44 combined\n> \tones are more recent (some of them may even have been\n> \tupdated from the separate form) than the 124 separate ones,\n> \tin which case we can say \"we started the process of\n> \tmigrating to list options singly, like '--[no-]option', in\n> \tcommit X; let's continue doing so\" in the log message.  Or\n> \tit may turn out that we have been going in the other\n> \tdirection and most of these 44 are stale ones yet to be\n> \tsplit.  Without such a tool, the above numbers are the best\n> \tmeasure to go by, which is not quite ideal.\n\nThis doesn't spew out a histogram, but you can use the various \"git\ngrep/blame\" one-liners (https://www.google.nl/search?q=git+grep+blame)\nplus shell one-liner to get something useful:\n\n    git grep -e '^--no-' -e '^--\\[no-' -n | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`' | perl -pe 's/^.* (\\d{4})-.*\\) /$1 /' | sort -n\n"},{"id":"363151","messageId":"xmqqh8glunt3.fsf@gitster-ct.c.googlers.com","threadId":"49811","inReplyTo":"877ehh2scg.fsf@evledraar.gmail.com","subject":"Re: [RFC PATCH] Using no- for options instead of duplication","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-11-13T13:09:12Z","receivedAt":"2018-11-13T13:09:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> This doesn't spew out a histogram, but you can use the various \"git\n> grep/blame\" one-liners (https://www.google.nl/search?q=git+grep+blame)\n> plus shell one-liner to get something useful:\n>\n>     git grep -e '^--no-' -e '^--\\[no-' -n | perl -F':' -anpe '$_=`git blame -L$F[1],+1 $F[0]`' | perl -pe 's/^.* (\\d{4})-.*\\) /$1 /' | sort -n\n\nYikes.  I cannot easily unsee this X-<.\n\n\n"}]}