]> git.ipfire.org Git - thirdparty/git.git/commit - object-name.c
object-name: make ambiguous object output translatable
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 27 Jan 2022 05:26:46 +0000 (06:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Jan 2022 20:09:33 +0000 (12:09 -0800)
commitba5e8a0eb8011f7ffb246804e91c9ba0db3befe4
tree4118113c11a075344309861a11c1baecb9bc5ed2
parent667a560be7ae977e61d81ca4bcb95ded1cdacc9c
object-name: make ambiguous object output translatable

Change the output of show_ambiguous_object() added in [1] and last
tweaked in [2] and the preceding commit to be more friendly to
translators.

By being able to customize the "<SP><SP>%s\n" format we're even ready
for RTL languages, who'd presumably like to change that to
"%s<SP><SP>\n".

In the case of the existing "tag [tag could not be parsed]" output
we'll now instead emit "[bad tag, could not parse it]". This is
consistent with the "[bad object]" output. Rephrasing the message like
this is possible because we're not unconditionally adding the
type_name() at the beginning.

1. 1ffa26c461 (get_short_sha1: list ambiguous objects on error,
   2016-09-26)
2. 5cc044e0257 (get_short_oid: sort ambiguous objects by type,
   then SHA-1, 2018-05-10)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-name.c