builtin/tag.c: show tag name to hint in the message editor

Display the tag name about to be added to the user during interactive editing. Signed-off-by: Thorsten Glaser <tg@debian.org> Signed-off-by: Richard Hartmann <richih@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Thorsten Glaser committed Aug 30, 2013 at 00:03 UTC d78f340ed6250dfe8de6e039acc56a013bcf3637
1 file changed +4 -4
builtin/tag.c
+4 -4
@@ -246,11 +246,11 @@ static int do_sign(struct strbuf *buffer)
246 }
247
248 static const char tag_template[] =
249 - N_("\nWrite a tag message\n"
249 + N_("\nWrite a message for tag:\n %s\n"
250 "Lines starting with '%c' will be ignored.\n");
251
252 static const char tag_template_nocleanup[] =
253 - N_("\nWrite a tag message\n"
253 + N_("\nWrite a message for tag:\n %s\n"
254 "Lines starting with '%c' will be kept; you may remove them"
255 " yourself if you want to.\n");
256
@@ -346,9 +346,9 @@ static void create_tag(const unsigned char *object, const char *tag,
346 struct strbuf buf = STRBUF_INIT;
347 strbuf_addch(&buf, '\n');
348 if (opt->cleanup_mode == CLEANUP_ALL)
349 - strbuf_commented_addf(&buf, _(tag_template), comment_line_char);
349 + strbuf_commented_addf(&buf, _(tag_template), tag, comment_line_char);
350 else
351 - strbuf_commented_addf(&buf, _(tag_template_nocleanup), comment_line_char);
351 + strbuf_commented_addf(&buf, _(tag_template_nocleanup), tag, comment_line_char);
352 write_or_die(fd, buf.buf, buf.len);
353 strbuf_release(&buf);
354 }