Re: [PATCH v2] builtin/*: fix error message usage typo
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 14, 2023, 22:13 UTC
- Message-ID
- <xmqqa61f521c.fsf@gitster.g>
- In-Reply-To
- <20230214215403.1450903-1-cheskaqiqi@gmail.com>
Shuqi Liang <cheskaqiqi@gmail.com> writes:
Show 8 quoted lines
> 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.shthat seem to expect "Not a valid object name", starting in capital.