diff mbox series

[v2,03/10] mktag: reword write_object_file() error

Message ID 20201126222257.5629-4-avarab@gmail.com (mailing list archive)
State Superseded
Headers show
Series make "mktag" use fsck_tag() | expand

Commit Message

Ævar Arnfjörð Bjarmason Nov. 26, 2020, 10:22 p.m. UTC
Change the error message emitted when write_object_file() fails to
make more sense. At this point we're not writing a "tag file" (which
as an aside we never do, we just write to stdout). We are writing an
annotated tag object, let's say that instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/mktag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Junio C Hamano Dec. 1, 2020, 8:20 p.m. UTC | #1
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:

> Change the error message emitted when write_object_file() fails to
> make more sense. At this point we're not writing a "tag file" (which
> as an aside we never do, we just write to stdout). We are writing an
> annotated tag object, let's say that instead.
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  builtin/mktag.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/mktag.c b/builtin/mktag.c
> index ff7ac8e0e5..603b55aca0 100644
> --- a/builtin/mktag.c
> +++ b/builtin/mktag.c
> @@ -171,7 +171,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
>  		die("invalid tag signature file");
>  
>  	if (write_object_file(buf.buf, buf.len, tag_type, &result) < 0)
> -		die("unable to write tag file");
> +		die("unable to write annotated tag object");

"write an annotated tag object"?

It is not just this call to die(), but we'd eventually want to _(l10n/i18n)
these messages.  Perhaps in a separate step but on all messages fed
to die/error/warn in this file.

>  
>  	strbuf_release(&buf);
>  	printf("%s\n", oid_to_hex(&result));
Junio C Hamano Dec. 1, 2020, 8:49 p.m. UTC | #2
Junio C Hamano <gitster@pobox.com> writes:

> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> Change the error message emitted when write_object_file() fails to
>> make more sense. At this point we're not writing a "tag file" (which
>> as an aside we never do, we just write to stdout). We are writing an
>> annotated tag object, let's say that instead.
>>
>> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>> ---
>>  builtin/mktag.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/builtin/mktag.c b/builtin/mktag.c
>> index ff7ac8e0e5..603b55aca0 100644
>> --- a/builtin/mktag.c
>> +++ b/builtin/mktag.c
>> @@ -171,7 +171,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
>>  		die("invalid tag signature file");
>>  
>>  	if (write_object_file(buf.buf, buf.len, tag_type, &result) < 0)
>> -		die("unable to write tag file");
>> +		die("unable to write annotated tag object");
>
> "write an annotated tag object"?

Actually, there is no such thing as an "unannotated tag object".
Perhaps _("unable to create a tag object")?

>
> It is not just this call to die(), but we'd eventually want to _(l10n/i18n)
> these messages.  Perhaps in a separate step but on all messages fed
> to die/error/warn in this file.
>
>>  
>>  	strbuf_release(&buf);
>>  	printf("%s\n", oid_to_hex(&result));
diff mbox series

Patch

diff --git a/builtin/mktag.c b/builtin/mktag.c
index ff7ac8e0e5..603b55aca0 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -171,7 +171,7 @@  int cmd_mktag(int argc, const char **argv, const char *prefix)
 		die("invalid tag signature file");
 
 	if (write_object_file(buf.buf, buf.len, tag_type, &result) < 0)
-		die("unable to write tag file");
+		die("unable to write annotated tag object");
 
 	strbuf_release(&buf);
 	printf("%s\n", oid_to_hex(&result));