git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 08/25] gettextize: git-log basic messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 2, 2010, 19:40 UTC
Message-ID
<1283456446-22577-9-git-send-email-avarab@gmail.com>
In-Reply-To
<1283373845-2022-1-git-send-email-avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 builtin/log.c |   74 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index ed8598e..460353b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -141,9 +141,9 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
 			free((void *)fullpath);
 			if (range->nr == 0) {
 				if (range->next) {
-					die("Path %s need a -L <range> option\n"
+					die(_("Path %s need a -L <range> option\n"
 					"If you want follow the history of the whole file "
-					"use 'git log -L 1,$ <path>'", range->spec->path);
+					"use 'git log -L 1,$ <path>'"), range->spec->path);
 				} else {
 					parse_options_next(&ctx, 1);
 					continue;
@@ -167,7 +167,7 @@ parse_done:
 
 	/* die if '-L <range>' with no pathspec follow */
 	if (range->nr > 0 && range->spec == NULL)
-		die("Each -L should follow a path");
+		die(_("Each -L should follow a path"));
 	/* clear up the last range */
 	if (range->nr == 0) {
 		struct diff_line_range *r = range->next;
@@ -201,7 +201,7 @@ parse_done:
 			const char *v = skip_prefix(arg, "--decorate=");
 			decoration_style = parse_decoration_style(arg, v);
 			if (decoration_style < 0)
-				die("invalid --decorate option: %s", arg);
+				die(_("invalid --decorate option: %s"), arg);
 			decoration_given = 1;
 		} else if (!strcmp(arg, "--no-decorate")) {
 			decoration_style = 0;
@@ -210,7 +210,7 @@ parse_done:
 		} else if (!strcmp(arg, "-h")) {
 			usage(builtin_log_usage);
 		} else
-			die("unrecognized argument: %s", arg);
+			die(_("unrecognized argument: %s"), arg);
 	}
 
 	/*
@@ -259,7 +259,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)
 		if (rev->commit_format != CMIT_FMT_ONELINE)
 			putchar(rev->diffopt.line_termination);
 	}
-	printf("Final output: %d %s\n", nr, stage);
+	printf(_("Final output: %d %s\n"), nr, stage);
 }
 
 static struct itimerval early_output_timer;
@@ -358,7 +358,7 @@ static int cmd_log_walk(struct rev_info *rev)
 		setup_early_output(rev);
 
 	if (prepare_revision_walk(rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	if (rev->early_output)
 		finish_early_output(rev);
@@ -450,7 +450,7 @@ static int show_object(const unsigned char *sha1, int show_tag_object,
 	int offset = 0;
 
 	if (!buf)
-		return error("Could not read object %s", sha1_to_hex(sha1));
+		return error(_("Could not read object %s"), sha1_to_hex(sha1));
 
 	if (show_tag_object)
 		while (offset < size && buf[offset] != '\n') {
@@ -537,7 +537,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 				break;
 			o = parse_object(t->tagged->sha1);
 			if (!o)
-				ret = error("Could not read object %s",
+				ret = error(_("Could not read object %s"),
 					    sha1_to_hex(t->tagged->sha1));
 			objects[i].item = o;
 			i--;
@@ -561,7 +561,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
 			ret = cmd_log_walk(&rev);
 			break;
 		default:
-			ret = error("Unknown type: %d", o->type);
+			ret = error(_("Unknown type: %d"), o->type);
 		}
 	}
 	free(objects);
@@ -664,7 +664,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
 {
 	if (!strcmp(var, "format.headers")) {
 		if (!value)
-			die("format.headers without value");
+			die(_("format.headers without value"));
 		add_header(value);
 		return 0;
 	}
@@ -736,7 +736,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
 		strbuf_addstr(&filename, output_directory);
 		if (filename.len >=
 		    PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len)
-			return error("name of output directory is too long");
+			return error(_("name of output directory is too long"));
 		if (filename.buf[filename.len - 1] != '/')
 			strbuf_addch(&filename, '/');
 	}
@@ -747,7 +747,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
 		fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
 
 	if (freopen(filename.buf, "w", stdout) == NULL)
-		return error("Cannot open patch file %s", filename.buf);
+		return error(_("Cannot open patch file %s"), filename.buf);
 
 	strbuf_release(&filename);
 	return 0;
@@ -761,7 +761,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	unsigned flags1, flags2;
 
 	if (rev->pending.nr != 2)
-		die("Need exactly one range.");
+		die(_("Need exactly one range."));
 
 	o1 = rev->pending.objects[0].item;
 	flags1 = o1->flags;
@@ -769,7 +769,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	flags2 = o2->flags;
 
 	if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
-		die("Not a range.");
+		die(_("Not a range."));
 
 	init_patch_ids(ids);
 
@@ -780,7 +780,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
 	add_pending_object(&check_rev, o1, "o1");
 	add_pending_object(&check_rev, o2, "o2");
 	if (prepare_revision_walk(&check_rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 
 	while ((commit = get_revision(&check_rev)) != NULL) {
 		/* ignore merges */
@@ -806,7 +806,7 @@ static void gen_message_id(struct rev_info *info, char *base)
 	const char *email_end = strrchr(committer, '>');
 	struct strbuf buf = STRBUF_INIT;
 	if (!email_start || !email_end || email_start > email_end - 1)
-		die("Could not extract email from committer identity.");
+		die(_("Could not extract email from committer identity."));
 	strbuf_addf(&buf, "%s.%lu.git.%.*s", base,
 		    (unsigned long) time(NULL),
 		    (int)(email_end - email_start - 1), email_start + 1);
@@ -838,7 +838,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
 	struct commit *commit = NULL;
 
 	if (rev->commit_format != CMIT_FMT_EMAIL)
-		die("Cover letter needs email format");
+		die(_("Cover letter needs email format"));
 
 	committer = git_committer_info(0);
 
@@ -931,7 +931,7 @@ static const char *clean_message_id(const char *msg_id)
 		m++;
 	}
 	if (!z)
-		die("insane in-reply-to: %s", msg_id);
+		die(_("insane in-reply-to: %s"), msg_id);
 	if (++z == m)
 		return a;
 	return xmemdupz(a, z - a);
@@ -1004,7 +1004,7 @@ static int output_directory_callback(const struct option *opt, const char *arg,
 {
 	const char **dir = (const char **)opt->value;
 	if (*dir)
-		die("Two output directories?");
+		die(_("Two output directories?"));
 	*dir = arg;
 	return 0;
 }
@@ -1192,7 +1192,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
 		endpos = strchr(committer, '>');
 		if (!endpos)
-			die("bogus committer info %s", committer);
+			die(_("bogus committer info %s"), committer);
 		add_signoff = xmemdupz(committer, endpos - committer + 1);
 	}
 
@@ -1237,20 +1237,20 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		numbered = 0;
 
 	if (numbered && keep_subject)
-		die ("-n and -k are mutually exclusive.");
+		die (_("-n and -k are mutually exclusive."));
 	if (keep_subject && subject_prefix)
-		die ("--subject-prefix and -k are mutually exclusive.");
+		die (_("--subject-prefix and -k are mutually exclusive."));
 
 	argc = setup_revisions(argc, argv, &rev, &s_r_opt);
 	if (argc > 1)
-		die ("unrecognized argument: %s", argv[1]);
+		die (_("unrecognized argument: %s"), argv[1]);
 
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
-		die("--name-only does not make sense");
+		die(_("--name-only does not make sense"));
 	if (rev.diffopt.output_format & DIFF_FORMAT_NAME_STATUS)
-		die("--name-status does not make sense");
+		die(_("--name-status does not make sense"));
 	if (rev.diffopt.output_format & DIFF_FORMAT_CHECKDIFF)
-		die("--check does not make sense");
+		die(_("--check does not make sense"));
 
 	if (!use_patch_format &&
 		(!rev.diffopt.output_format ||
@@ -1271,9 +1271,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 	if (output_directory) {
 		if (use_stdout)
-			die("standard output, or directory, which one?");
+			die(_("standard output, or directory, which one?"));
 		if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
-			die_errno("Could not create directory '%s'",
+			die_errno(_("Could not create directory '%s'"),
 				  output_directory);
 	}
 
@@ -1327,7 +1327,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 		realstdout = xfdopen(xdup(1), "w");
 
 	if (prepare_revision_walk(&rev))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	rev.boundary = 1;
 	while ((commit = get_revision(&rev)) != NULL) {
 		if (commit->object.flags & BOUNDARY) {
@@ -1408,7 +1408,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
 
 		if (!use_stdout && reopen_stdout(numbered_files ? NULL : commit,
 						 &rev))
-			die("Failed to create output files");
+			die(_("Failed to create output files"));
 		shown = log_tree_commit(&rev, commit);
 		free(commit->buffer);
 		commit->buffer = NULL;
@@ -1495,9 +1495,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 		if (!current_branch || !current_branch->merge
 					|| !current_branch->merge[0]
 					|| !current_branch->merge[0]->dst) {
-			fprintf(stderr, "Could not find a tracked"
+			fprintf(stderr, _("Could not find a tracked"
 					" remote branch, please"
-					" specify <upstream> manually.\n");
+					" specify <upstream> manually.\n"));
 			usage_with_options(cherry_usage, options);
 		}
 
@@ -1511,9 +1511,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	DIFF_OPT_SET(&revs.diffopt, RECURSIVE);
 
 	if (add_pending_commit(head, &revs, 0))
-		die("Unknown commit %s", head);
+		die(_("Unknown commit %s"), head);
 	if (add_pending_commit(upstream, &revs, UNINTERESTING))
-		die("Unknown commit %s", upstream);
+		die(_("Unknown commit %s"), upstream);
 
 	/* Don't say anything if head and upstream are the same. */
 	if (revs.pending.nr == 2) {
@@ -1525,11 +1525,11 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
 	get_patch_ids(&revs, &ids, prefix);
 
 	if (limit && add_pending_commit(limit, &revs, UNINTERESTING))
-		die("Unknown commit %s", limit);
+		die(_("Unknown commit %s"), limit);
 
 	/* reverse the list of commits */
 	if (prepare_revision_walk(&revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	while ((commit = get_revision(&revs)) != NULL) {
 		/* ignore merges */
 		if (commit->parents && commit->parents->next)
-- 
1.7.2.2.614.g1dc9
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 28 of 63 in “gettextize the first 4 C mainporcelain common commands”
  1. 00/13 gettextize the first 4 C mainporcelain common commandsÆvar Arnfjörð Bjarmason, Sep 1, 2010
  2. 01/13 git-clone: use builtin.h to get gettext.hÆvar Arnfjörð Bjarmason, Sep 1, 2010
  3. 02/13 gettextize: git-clone basic messagesÆvar Arnfjörð Bjarmason, Sep 1, 2010
  4. 03/13 gettextize: git-clone "Cloning into" messageÆvar Arnfjörð Bjarmason, Sep 1, 2010
  5. 04/13 gettextize: git-add basic messagesÆvar Arnfjörð Bjarmason, Sep 1, 2010
  6. 05/13 gettextize: git-add refresh_index messageÆvar Arnfjörð Bjarmason, Sep 1, 2010
  7. Jonathan NiederSep 2, 2010
  8. 06/13 gettextize: git-branch basic messagesÆvar Arnfjörð Bjarmason, Sep 1, 2010
  9. 07/13 gettextize: git-branch "remote branch '%s' not found" messageÆvar Arnfjörð Bjarmason, Sep 1, 2010
  10. 08/13 gettextize: git-branch "git branch -v" messagesÆvar Arnfjörð Bjarmason, Sep 1, 2010
  11. 09/13 gettextize: git-branch "(no branch)" messageÆvar Arnfjörð Bjarmason, Sep 1, 2010
  12. 10/13 gettextize: git-checkout: our/their version messageÆvar Arnfjörð Bjarmason, Sep 1, 2010
  13. 11/13 gettextize: git-checkout basic messagesÆvar Arnfjörð Bjarmason, Sep 1, 2010
  14. 12/13 gettextize: git-checkout describe_detached_head messagesÆvar Arnfjörð Bjarmason, Sep 1, 2010
  15. 13/13 gettextize: git-checkout "Switched to a .. branch" messageÆvar Arnfjörð Bjarmason, Sep 1, 2010
  16. 00/25 [CONTINUED] gettextize all C mainporcelain common commandsÆvar Arnfjörð Bjarmason, Sep 2, 2010
  17. 01/25 gettextize: git-commit basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  18. 02/25 gettextize: git-commit formatting messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  19. 03/25 gettextize: git-commit advice messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  20. 04/25 gettextize: git-diff basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  21. 05/25 gettextize: git-fetch basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  22. 06/25 gettextize: git-fetch formatting messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  23. Jonathan NiederSep 2, 2010
  24. Ævar Arnfjörð BjarmasonSep 2, 2010
  25. Jeff KingSep 2, 2010
  26. Ævar Arnfjörð BjarmasonSep 2, 2010
  27. 07/25 gettextize: git-grep basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  28. 08/25 gettextize: git-log basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  29. 09/25 gettextize: git-format-patch --cover-letter messageÆvar Arnfjörð Bjarmason, Sep 2, 2010
  30. 10/25 gettextize: git-merge basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  31. Jonathan NiederSep 2, 2010
  32. Ævar Arnfjörð BjarmasonSep 2, 2010
  33. Jonathan NiederSep 2, 2010
  34. Ævar Arnfjörð BjarmasonSep 2, 2010
  35. Jonathan NiederSep 2, 2010
  36. Ævar Arnfjörð BjarmasonSep 2, 2010
  37. Jonathan NiederSep 2, 2010
  38. Ævar Arnfjörð BjarmasonSep 3, 2010
  39. Jonathan NiederSep 3, 2010
  40. Ævar Arnfjörð BjarmasonSep 3, 2010
  41. Ævar Arnfjörð BjarmasonSep 3, 2010
  42. 11/25 gettextize: git-merge "In-index merge" messageÆvar Arnfjörð Bjarmason, Sep 2, 2010
  43. 12/25 gettextize: git-merge "Merge made by %s." messageÆvar Arnfjörð Bjarmason, Sep 2, 2010
  44. 13/25 gettextize: git-merge remaining cmd_merge messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  45. 14/25 gettextize: git-mv basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  46. 15/25 gettextize: git-mv "bad" messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  47. 16/25 gettextize: git-rm basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  48. 17/25 builtin: use builtin.h in git-resetÆvar Arnfjörð Bjarmason, Sep 2, 2010
  49. 18/25 gettextize: git-reset basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  50. 19/25 gettextize: git-reset reset_type_names messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  51. Peter KreftingSep 15, 2010
  52. Thomas RastSep 15, 2010
  53. 20/25 gettextize: git-tag basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  54. 21/25 gettextize: git-tag tag_template messageÆvar Arnfjörð Bjarmason, Sep 2, 2010
  55. 22/25 gettextize: git-push basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  56. 23/25 builtin: use builtin.h in git-statusÆvar Arnfjörð Bjarmason, Sep 2, 2010
  57. 24/25 gettextize: git-status basic messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  58. Jonathan NiederSep 2, 2010
  59. Ævar Arnfjörð BjarmasonSep 2, 2010
  60. Jonathan NiederSep 2, 2010
  61. 25/25 gettextize: git-status shortstatus messagesÆvar Arnfjörð Bjarmason, Sep 2, 2010
  62. Jonathan NiederSep 2, 2010
  63. Ævar Arnfjörð BjarmasonSep 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.