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

[PATCH 05/25] gettextize: git-fetch basic messages

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 2, 2010, 19:40 UTC
Message-ID
<1283456446-22577-6-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/fetch.c |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index c218657..4c90fc5 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -178,7 +178,7 @@ static struct ref *get_ref_map(struct transport *transport,
 		} else {
 			ref_map = get_remote_ref(remote_refs, "HEAD");
 			if (!ref_map)
-				die("Couldn't find remote ref HEAD");
+				die(_("Couldn't find remote ref HEAD"));
 			ref_map->merge = 1;
 			tail = &ref_map->next;
 		}
@@ -231,7 +231,7 @@ static int update_local_ref(struct ref *ref,
 	*display = 0;
 	type = sha1_object_info(ref->new_sha1, NULL);
 	if (type < 0)
-		die("object %s not found", sha1_to_hex(ref->new_sha1));
+		die(_("object %s not found"), sha1_to_hex(ref->new_sha1));
 
 	if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
 		if (verbosity > 0)
@@ -331,7 +331,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 
 	fp = fopen(filename, "a");
 	if (!fp)
-		return error("cannot open %s: %s\n", filename, strerror(errno));
+		return error(_("cannot open %s: %s\n"), filename, strerror(errno));
 
 	if (raw_url)
 		url = transport_anonymize_url(raw_url);
@@ -420,9 +420,9 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
 	free(url);
 	fclose(fp);
 	if (rc & STORE_REF_ERROR_DF_CONFLICT)
-		error("some local refs could not be updated; try running\n"
+		error(_("some local refs could not be updated; try running\n"
 		      " 'git remote prune %s' to remove any old, conflicting "
-		      "branches", remote_name);
+		      "branches"), remote_name);
 	return rc;
 }
 
@@ -470,7 +470,7 @@ static int quickfetch(struct ref *ref_map)
 
 	err = start_command(&revlist);
 	if (err) {
-		error("could not run rev-list");
+		error(_("could not run rev-list"));
 		return err;
 	}
 
@@ -484,14 +484,14 @@ static int quickfetch(struct ref *ref_map)
 		if (write_in_full(revlist.in, sha1_to_hex(ref->old_sha1), 40) < 0 ||
 		    write_str_in_full(revlist.in, "\n") < 0) {
 			if (errno != EPIPE && errno != EINVAL)
-				error("failed write to rev-list: %s", strerror(errno));
+				error(_("failed write to rev-list: %s"), strerror(errno));
 			err = -1;
 			break;
 		}
 	}
 
 	if (close(revlist.in)) {
-		error("failed to close rev-list's stdin: %s", strerror(errno));
+		error(_("failed to close rev-list's stdin: %s"), strerror(errno));
 		err = -1;
 	}
 
@@ -644,8 +644,8 @@ static void check_not_current_branch(struct ref *ref_map)
 	for (; ref_map; ref_map = ref_map->next)
 		if (ref_map->peer_ref && !strcmp(current_branch->refname,
 					ref_map->peer_ref->name))
-			die("Refusing to fetch into current branch %s "
-			    "of non-bare repository", current_branch->refname);
+			die(_("Refusing to fetch into current branch %s "
+			    "of non-bare repository"), current_branch->refname);
 }
 
 static int truncate_fetch_head(void)
@@ -654,7 +654,7 @@ static int truncate_fetch_head(void)
 	FILE *fp = fopen(filename, "w");
 
 	if (!fp)
-		return error("cannot open %s: %s\n", filename, strerror(errno));
+		return error(_("cannot open %s: %s\n"), filename, strerror(errno));
 	fclose(fp);
 	return 0;
 }
@@ -678,7 +678,7 @@ static int do_fetch(struct transport *transport,
 	}
 
 	if (!transport->get_refs_list || !transport->fetch)
-		die("Don't know how to fetch from %s", transport->url);
+		die(_("Don't know how to fetch from %s"), transport->url);
 
 	/* if not appending, truncate FETCH_HEAD */
 	if (!append && !dry_run) {
@@ -732,10 +732,10 @@ static void set_option(const char *name, const char *value)
 {
 	int r = transport_set_option(transport, name, value);
 	if (r < 0)
-		die("Option \"%s\" value \"%s\" is not valid for %s",
+		die(_("Option \"%s\" value \"%s\" is not valid for %s"),
 			name, value, transport->url);
 	if (r > 0)
-		warning("Option \"%s\" is ignored for %s\n",
+		warning(_("Option \"%s\" is ignored for %s\n"),
 			name, transport->url);
 }
 
@@ -824,9 +824,9 @@ static int fetch_multiple(struct string_list *list)
 		argv[argc] = name;
 		argv[argc + 1] = NULL;
 		if (verbosity >= 0)
-			printf("Fetching %s\n", name);
+			printf(_("Fetching %s\n"), name);
 		if (run_command_v_opt(argv, RUN_GIT_CMD)) {
-			error("Could not fetch %s", name);
+			error(_("Could not fetch %s"), name);
 			result = 1;
 		}
 	}
@@ -842,8 +842,8 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 	int exit_code;
 
 	if (!remote)
-		die("No remote repository specified.  Please, specify either a URL or a\n"
-		    "remote name from which new revisions should be fetched.");
+		die(_("No remote repository specified.  Please, specify either a URL or a\n"
+		    "remote name from which new revisions should be fetched."));
 
 	transport = transport_get(remote, NULL);
 	transport_set_verbosity(transport, verbosity, progress);
@@ -862,7 +862,7 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 				char *ref;
 				i++;
 				if (i >= argc)
-					die("You need to specify a tag name.");
+					die(_("You need to specify a tag name."));
 				ref = xmalloc(strlen(argv[i]) * 2 + 22);
 				strcpy(ref, "refs/tags/");
 				strcat(ref, argv[i]);
@@ -902,9 +902,9 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 
 	if (all) {
 		if (argc == 1)
-			die("fetch --all does not take a repository argument");
+			die(_("fetch --all does not take a repository argument"));
 		else if (argc > 1)
-			die("fetch --all does not make sense with refspecs");
+			die(_("fetch --all does not make sense with refspecs"));
 		(void) for_each_remote(get_one_remote_for_fetch, &list);
 		result = fetch_multiple(&list);
 	} else if (argc == 0) {
@@ -915,7 +915,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 		/* All arguments are assumed to be remotes or groups */
 		for (i = 0; i < argc; i++)
 			if (!add_remote_or_group(argv[i], &list))
-				die("No such remote or remote group: %s", argv[i]);
+				die(_("No such remote or remote group: %s"), argv[i]);
 		result = fetch_multiple(&list);
 	} else {
 		/* Single remote or group */
@@ -923,7 +923,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 		if (list.nr > 1) {
 			/* More than one remote */
 			if (argc > 1)
-				die("Fetching a group and specifying refspecs does not make sense");
+				die(_("Fetching a group and specifying refspecs does not make sense"));
 			result = fetch_multiple(&list);
 		} else {
 			/* Zero or one remotes */
-- 
1.7.2.2.614.g1dc9
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 21 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.