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

[PATCH 06/13] gettextize: git-branch basic messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 1, 2010, 20:43 UTC
Message-ID
<1283373845-2022-7-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/branch.c |   58 +++++++++++++++++++++++++++---------------------------
 1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index 87976f0..50c15c1 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -133,12 +133,12 @@ static int branch_merged(int kind, const char *name,
 	if ((head_rev != reference_rev) &&
 	    in_merge_bases(rev, &head_rev, 1) != merged) {
 		if (merged)
-			warning("deleting branch '%s' that has been merged to\n"
-				"         '%s', but it is not yet merged to HEAD.",
+			warning(_("deleting branch '%s' that has been merged to\n"
+				"         '%s', but it is not yet merged to HEAD."),
 				name, reference_name);
 		else
-			warning("not deleting branch '%s' that is not yet merged to\n"
-				"         '%s', even though it is merged to HEAD.",
+			warning(_("not deleting branch '%s' that is not yet merged to\n"
+				"         '%s', even though it is merged to HEAD."),
 				name, reference_name);
 	}
 	return merged;
@@ -165,19 +165,19 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 		remote = "";
 		break;
 	default:
-		die("cannot use -a with -d");
+		die(_("cannot use -a with -d"));
 	}
 
 	if (!force) {
 		head_rev = lookup_commit_reference(head_sha1);
 		if (!head_rev)
-			die("Couldn't look up commit object for HEAD");
+			die(_("Couldn't look up commit object for HEAD"));
 	}
 	for (i = 0; i < argc; i++, strbuf_release(&bname)) {
 		strbuf_branchname(&bname, argv[i]);
 		if (kinds == REF_LOCAL_BRANCH && !strcmp(head, bname.buf)) {
-			error("Cannot delete the branch '%s' "
-			      "which you are currently on.", bname.buf);
+			error(_("Cannot delete the branch '%s' "
+			      "which you are currently on."), bname.buf);
 			ret = 1;
 			continue;
 		}
@@ -186,7 +186,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		name = xstrdup(mkpath(fmt, bname.buf));
 		if (!resolve_ref(name, sha1, 1, NULL)) {
-			error("%sbranch '%s' not found.",
+			error(_("%sbranch '%s' not found."),
 					remote, bname.buf);
 			ret = 1;
 			continue;
@@ -194,31 +194,31 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
 
 		rev = lookup_commit_reference(sha1);
 		if (!rev) {
-			error("Couldn't look up commit object for '%s'", name);
+			error(_("Couldn't look up commit object for '%s'"), name);
 			ret = 1;
 			continue;
 		}
 
 		if (!force && !branch_merged(kinds, bname.buf, rev, head_rev)) {
-			error("The branch '%s' is not fully merged.\n"
+			error(_("The branch '%s' is not fully merged.\n"
 			      "If you are sure you want to delete it, "
-			      "run 'git branch -D %s'.", bname.buf, bname.buf);
+			      "run 'git branch -D %s'."), bname.buf, bname.buf);
 			ret = 1;
 			continue;
 		}
 
 		if (delete_ref(name, sha1, 0)) {
-			error("Error deleting %sbranch '%s'", remote,
+			error(_("Error deleting %sbranch '%s'"), remote,
 			      bname.buf);
 			ret = 1;
 		} else {
 			struct strbuf buf = STRBUF_INIT;
-			printf("Deleted %sbranch %s (was %s).\n", remote,
+			printf(_("Deleted %sbranch %s (was %s).\n"), remote,
 			       bname.buf,
 			       find_unique_abbrev(sha1, DEFAULT_ABBREV));
 			strbuf_addf(&buf, "branch.%s", bname.buf);
 			if (git_config_rename_section(buf.buf, NULL) < 0)
-				warning("Update of config-file failed");
+				warning(_("Update of config-file failed"));
 			strbuf_release(&buf);
 		}
 	}
@@ -300,7 +300,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
 	if (ref_list->verbose || ref_list->with_commit || merge_filter != NO_FILTER) {
 		commit = lookup_commit_reference_gently(sha1, 1);
 		if (!commit) {
-			cb->ret = error("branch '%s' does not point at a commit", refname);
+			cb->ret = error(_("branch '%s' does not point at a commit"), refname);
 			return 0;
 		}
 
@@ -540,7 +540,7 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
 	free_ref_list(&ref_list);
 
 	if (cb.ret)
-		error("some refs could not be read");
+		error(_("some refs could not be read"));
 
 	return cb.ret;
 }
@@ -553,7 +553,7 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 	int recovery = 0;
 
 	if (!oldname)
-		die("cannot rename the current branch while not on any.");
+		die(_("cannot rename the current branch while not on any."));
 
 	if (strbuf_check_branch_ref(&oldref, oldname)) {
 		/*
@@ -563,35 +563,35 @@ static void rename_branch(const char *oldname, const char *newname, int force)
 		if (resolve_ref(oldref.buf, sha1, 1, NULL))
 			recovery = 1;
 		else
-			die("Invalid branch name: '%s'", oldname);
+			die(_("Invalid branch name: '%s'"), oldname);
 	}
 
 	if (strbuf_check_branch_ref(&newref, newname))
-		die("Invalid branch name: '%s'", newname);
+		die(_("Invalid branch name: '%s'"), newname);
 
 	if (resolve_ref(newref.buf, sha1, 1, NULL) && !force)
-		die("A branch named '%s' already exists.", newref.buf + 11);
+		die(_("A branch named '%s' already exists."), newref.buf + 11);
 
 	strbuf_addf(&logmsg, "Branch: renamed %s to %s",
 		 oldref.buf, newref.buf);
 
 	if (rename_ref(oldref.buf, newref.buf, logmsg.buf))
-		die("Branch rename failed");
+		die(_("Branch rename failed"));
 	strbuf_release(&logmsg);
 
 	if (recovery)
-		warning("Renamed a misnamed branch '%s' away", oldref.buf + 11);
+		warning(_("Renamed a misnamed branch '%s' away"), oldref.buf + 11);
 
 	/* no need to pass logmsg here as HEAD didn't really move */
 	if (!strcmp(oldname, head) && create_symref("HEAD", newref.buf, NULL))
-		die("Branch renamed to %s, but HEAD is not updated!", newname);
+		die(_("Branch renamed to %s, but HEAD is not updated!"), newname);
 
 	strbuf_addf(&oldsection, "branch.%s", oldref.buf + 11);
 	strbuf_release(&oldref);
 	strbuf_addf(&newsection, "branch.%s", newref.buf + 11);
 	strbuf_release(&newref);
 	if (git_config_rename_section(oldsection.buf, newsection.buf) < 0)
-		die("Branch is renamed, but update of config-file failed");
+		die(_("Branch is renamed, but update of config-file failed"));
 	strbuf_release(&oldsection);
 	strbuf_release(&newsection);
 }
@@ -606,7 +606,7 @@ static int opt_parse_merge_filter(const struct option *opt, const char *arg, int
 	if (!arg)
 		arg = "HEAD";
 	if (get_sha1(arg, merge_filter_ref))
-		die("malformed object name %s", arg);
+		die(_("malformed object name %s"), arg);
 	return 0;
 }
 
@@ -676,13 +676,13 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 
 	head = resolve_ref("HEAD", head_sha1, 0, NULL);
 	if (!head)
-		die("Failed to resolve HEAD as a valid ref.");
+		die(_("Failed to resolve HEAD as a valid ref."));
 	head = xstrdup(head);
 	if (!strcmp(head, "HEAD")) {
 		detached = 1;
 	} else {
 		if (prefixcmp(head, "refs/heads/"))
-			die("HEAD not found below refs/heads!");
+			die(_("HEAD not found below refs/heads!"));
 		head += 11;
 	}
 	hashcpy(merge_filter_ref, head_sha1);
@@ -702,7 +702,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
 		rename_branch(argv[0], argv[1], rename > 1);
 	else if (argc <= 2) {
 		if (kinds != REF_LOCAL_BRANCH)
-			die("-a and -r options to 'git branch' do not make sense with a branch name");
+			die(_("-a and -r options to 'git branch' do not make sense with a branch name"));
 		create_branch(head, argv[0], (argc == 2) ? argv[1] : head,
 			      force_create, reflog, track);
 	} else
-- 
1.7.2.2.579.g2183d
Previous: Jonathan NiederNext: Ævar Arnfjörð Bjarmason
Message 8 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.