git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Shuqi Liang <cheskaqiqi@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] builtin/*: fix error message usage typo
Date: Tue, 14 Feb 2023 14:13:03 -0800	[thread overview]
Message-ID: <xmqqa61f521c.fsf@gitster.g> (raw)
In-Reply-To: <20230214215403.1450903-1-cheskaqiqi@gmail.com> (Shuqi Liang's message of "Tue, 14 Feb 2023 16:54:03 -0500")

Shuqi Liang <cheskaqiqi@gmail.com> writes:

>  builtin/merge-base.c        |  6 +++---
>  	if (get_oid(arg, &revkey))
> -		die("Not a valid object name %s", arg);
> +		die("not a valid object name %s", arg);
>  	r = lookup_commit_reference(the_repository, &revkey);
>  	if (!r)
> -		die("Not a valid commit name %s", arg);
> +		die("not a valid commit name %s", arg);

You picked a rather unfortunate one.

    $ git grep -E -e 'Not a valid (object|commit) name ' '*.c'
    bisect.c:		die(_("Not a valid commit name %s"), oid_to_hex(oid));
    builtin/cat-file.c:		die("Not a valid object name %s", obj_name);
    builtin/cat-file.c:			die("Not a valid object name %s", obj_name);
    builtin/describe.c:		die(_("Not a valid object name %s"), arg);
    builtin/ls-tree.c:		die("Not a valid object name %s", argv[0]);
    builtin/merge-base.c:		die("Not a valid object name %s", arg);
    builtin/merge-base.c:		die("Not a valid commit name %s", arg);
    builtin/read-tree.c:			die("Not a valid object name %s", arg);
    builtin/unpack-file.c:		die("Not a valid object name %s", argv[1]);

Updating only one file would mean you leave two variants each for
the same message, making the messages less consistent and adding
more strings for translators to translate.  If we were to do this,
it probably makes sense to fix these (or just "valid object name"
ones) as a single group in a patch (with updates to tests that
expect the old spelling).

    Subject: [PATCH] errors: downcase "Not a valid object name"

    There are many instances of "Not a valid object name %s" given
    to die(), which should start with lowercase "not a valid ...".
    Fix them.

or something, which would touch the grep hits we see above, plus
some tests in these files

    $ git grep -l -e 'Not a valid object name ' t/
    t/t1006-cat-file.sh
    t/t8007-cat-file-textconv.sh

that seem to expect "Not a valid object name", starting in capital.

      reply	other threads:[~2023-02-14 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  3:25 [GSoC][PATCH] builtin/clean.c: fix error message usage typo Shuqi Liang
2023-02-14  5:32 ` Junio C Hamano
2023-02-14 21:55   ` Shuqi Liang
2023-02-14 21:54 ` [PATCH v2] builtin/*: " Shuqi Liang
2023-02-14 22:13   ` 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

  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=xmqqa61f521c.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=cheskaqiqi@gmail.com \
    --cc=git@vger.kernel.org \
    /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).