Re: [PATCH v2] builtin/*: fix error message usage typo
From: Junio C Hamano <hidden>
Date: 2023-02-14 22:13:07
Shuqi Liang [off-list ref] 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.