Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Teng Long <dyroneteng@gmail.com>
Cc: git@vger.kernel.org, tenglong.tl@alibaba-inc.com
Subject: Re: [PATCH v1 1/1] surround %s with quotes when failed to lookup commit
Date: Sat, 03 Jun 2023 09:11:20 +0900	[thread overview]
Message-ID: <xmqqo7lx8kwn.fsf@gitster.g> (raw)
In-Reply-To: <1f7c62a8870433792076fae30d6c4dc4b61a00d8.1685366301.git.dyroneteng@gmail.com> (Teng Long's message of "Mon, 29 May 2023 21:27:56 +0800")

Teng Long <dyroneteng@gmail.com> writes:

> From: Teng Long <dyroneteng@gmail.com>
>
> The output maybe become confused to recognize if the user
> accidentally mistook an extra opening space, like:
>
>    $git commit --fixup=" 6d6360b67e99c2fd82d64619c971fdede98ee74b"
>    fatal: could not lookup commit  6d6360b67e99c2fd82d64619c971fdede98ee74b
>
> and it will be better if we surround the %s specifier with single quotes.

The only remaining hits from

    $ git grep -e '_("[^('\'']%s'

(that is, "find the messages that has %s without a single quote or
an opening parenthesis immediately before it") are found in
builtin/remote.c where this template

	const char *dangling_msg = dry_run
		? _(" %s will become dangling!")
		: _(" %s has become dangling!");

is given to the refs.c::warn_dangling_symrefs() API function to be
used to show refs found by the system to be dangling.  It can be
argued that these are better quoted for consistency, but I tend to
side with the current code, as there is much less risk (than the
cases you fixed in your patch) for ambiguity and confusion there.







      parent reply	other threads:[~2023-06-03  0:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 13:27 [PATCH v1 0/1] surround %s with quotes when failed to lookup commit Teng Long
2023-05-29 13:27 ` [PATCH v1 1/1] " Teng Long
2023-06-03  0:00   ` Junio C Hamano
2023-06-03  0:11   ` Junio C Hamano [this message]

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=xmqqo7lx8kwn.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=dyroneteng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tenglong.tl@alibaba-inc.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 read-only IMAP folder(s) and NNTP newsgroup(s).