git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Štěpán Němec" <stepnem@smrk.net>, git@vger.kernel.org
Subject: Re: [PATCH 3/5] git-jump: admit to passing merge mode args to ls-files
Date: Tue, 03 Oct 2023 13:46:30 -0700	[thread overview]
Message-ID: <xmqqjzs3xwm1.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cQHAK2_LEG0-6MTF52t2D8b_SRxzB51B_4N35ujtGeb6Q@mail.gmail.com> (Eric Sunshine's message of "Tue, 3 Oct 2023 14:33:39 -0400")

Eric Sunshine <sunshine@sunshineco.com> writes:

>> There's even an example of such usage in the README.
>>
>> Signed-off-by: Štěpán Němec <stepnem@smrk.net>
>> ---
>> diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
>> @@ -9,7 +9,7 @@ The <mode> parameter is one of:
>>
>>  diff: elements are diff hunks. Arguments are given to diff.
>>
>> -merge: elements are merge conflicts. Arguments are ignored.
>> +merge: elements are merge conflicts. Arguments are given to ls-files -u.
>
> Should "ls-files -u" be formatted with backticks?
>
>     Arguments are passed to `git ls-files -u`.

Probably not in this case, as this is end-user visible help message
that is not formatted but given to the terminal.

The whole preimage looks like this:

    usage: git jump [--stdout] <mode> [<args>]

    Jump to interesting elements in an editor.
    The <mode> parameter is one of:

    diff: elements are diff hunks. Arguments are given to diff.

    merge: elements are merge conflicts. Arguments are ignored.

    grep: elements are grep hits. Arguments are given to git grep or, if
          configured, to the command in `jump.grepCmd`.

    ws: elements are whitespace errors. Arguments are given to diff --check.

    If the optional argument `--stdout` is given, print the quickfix
    lines to standard output instead of feeding it to the editor.

and it is already a mixture.  "given to `git grep`" is not quoted,
neither is "given to `diff --check`" or "given to `diff`"

I think rule for help/usage messages should be that 

 - anything that the end-user may want to cut&paste should be left
   alone to make it easier to cut, 

 - but at the same time the message should make it clear which part
   of a sentence is what, 

Clicking on `--stdout` or `jump.grepCmd` does not include the
surrounding quotes, at least in my environment, so the use of
backquotes in these places satisfy the two goals, it seems.

Unlike `--stdout` and `jump.grepCmd`, all other things that are not
quoted, including the one that is added by this patch (i.e.,
"ls-files -u"), are something the end-user needs to cut and paste in
reaction to seeing this error message, so as long as they are
understandable in the sentences they appear in, I think they are
fine.

If we wanted to standardize, we may start to encourage consistent
use of quoting, but I do not think it should be part of this topic.

Thanks for being careful and thoughtful.

  parent reply	other threads:[~2023-10-03 20:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03  8:21 [PATCH 1/5] Fix some typos, grammar or wording issues in the documentation Štěpán Němec
2023-10-03  8:21 ` [PATCH 2/5] doc/diff-options: improve wording of the log.diffMerges mention Štěpán Němec
2023-10-03  8:21 ` [PATCH 3/5] git-jump: admit to passing merge mode args to ls-files Štěpán Němec
2023-10-03 18:33   ` Eric Sunshine
2023-10-03 20:15     ` Štěpán Němec
2023-10-03 20:46     ` Junio C Hamano [this message]
2023-10-03 21:01       ` Junio C Hamano
2023-10-03  8:21 ` [PATCH 4/5] doc/gitk: s/sticked/stuck/ Štěpán Němec
2023-10-03  8:21 ` [PATCH 5/5] t/README: fix multi-prerequisite example Štěpán Němec
2023-10-03 18:30 ` [PATCH 1/5] Fix some typos, grammar or wording issues in the documentation Eric Sunshine
2023-10-03 20:09   ` Štěpán Němec
2023-10-03 21:10     ` Junio C Hamano
2023-10-03 21:10     ` Eric Sunshine
2023-10-05  9:00 ` [PATCH v2 1/5] doc: fix some typos, grammar and wording issues Štěpán Němec
2023-10-05  9:00   ` [PATCH v2 2/5] doc/diff-options: improve wording of the log.diffMerges mention Štěpán Němec
2023-10-05  9:00   ` [PATCH v2 3/5] git-jump: admit to passing merge mode args to ls-files Štěpán Němec
2023-10-05  9:00   ` [PATCH v2 4/5] doc/gitk: s/sticked/stuck/ Štěpán Němec
2023-10-05  9:00   ` [PATCH v2 5/5] t/README: fix multi-prerequisite example Štěpán Němec
2023-10-05 20:17   ` [PATCH v2 1/5] doc: fix some typos, grammar and wording issues Junio C Hamano
2023-10-18 20:21     ` 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=xmqqjzs3xwm1.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=stepnem@smrk.net \
    --cc=sunshine@sunshineco.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).