git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH v2 13/27] fetch-pack.c: mark strings for translating
Date: Sun, 12 Jun 2016 17:53:55 +0700	[thread overview]
Message-ID: <20160612105409.22156-14-pclouds@gmail.com> (raw)
In-Reply-To: <20160612105409.22156-1-pclouds@gmail.com>

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 fetch-pack.c | 75 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 37 insertions(+), 38 deletions(-)

diff --git a/fetch-pack.c b/fetch-pack.c
index 4020744..08caf1d 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -208,7 +208,7 @@ static void consume_shallow_list(struct fetch_pack_args *args, int fd)
 				continue;
 			if (starts_with(line, "unshallow "))
 				continue;
-			die("git fetch-pack: expected shallow list");
+			die(_("git fetch-pack: expected shallow list"));
 		}
 	}
 }
@@ -220,7 +220,7 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
 	const char *arg;
 
 	if (!len)
-		die("git fetch-pack: expected ACK/NAK, got EOF");
+		die(_("git fetch-pack: expected ACK/NAK, got EOF"));
 	if (!strcmp(line, "NAK"))
 		return NAK;
 	if (skip_prefix(line, "ACK ", &arg)) {
@@ -238,7 +238,7 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
 			return ACK;
 		}
 	}
-	die("git fetch_pack: expected ACK/NAK, got '%s'", line);
+	die(_("git fetch_pack: expected ACK/NAK, got '%s'"), line);
 }
 
 static void send_request(struct fetch_pack_args *args,
@@ -285,7 +285,7 @@ static int find_common(struct fetch_pack_args *args,
 	size_t state_len = 0;
 
 	if (args->stateless_rpc && multi_ack == 1)
-		die("--stateless-rpc requires multi_ack_detailed");
+		die(_("--stateless-rpc requires multi_ack_detailed"));
 	if (marked)
 		for_each_ref(clear_marks, NULL);
 	marked = 1;
@@ -357,23 +357,23 @@ static int find_common(struct fetch_pack_args *args,
 		while ((line = packet_read_line(fd[0], NULL))) {
 			if (skip_prefix(line, "shallow ", &arg)) {
 				if (get_sha1_hex(arg, sha1))
-					die("invalid shallow line: %s", line);
+					die(_("invalid shallow line: %s"), line);
 				register_shallow(sha1);
 				continue;
 			}
 			if (skip_prefix(line, "unshallow ", &arg)) {
 				if (get_sha1_hex(arg, sha1))
-					die("invalid unshallow line: %s", line);
+					die(_("invalid unshallow line: %s"), line);
 				if (!lookup_object(sha1))
-					die("object not found: %s", line);
+					die(_("object not found: %s"), line);
 				/* make sure that it is parsed as shallow */
 				if (!parse_object(sha1))
-					die("error in object: %s", line);
+					die(_("error in object: %s"), line);
 				if (unregister_shallow(sha1))
-					die("no shallow found: %s", line);
+					die(_("no shallow found: %s"), line);
 				continue;
 			}
-			die("expected shallow/unshallow, got %s", line);
+			die(_("expected shallow/unshallow, got %s"), line);
 		}
 	} else if (!args->stateless_rpc)
 		send_request(args, fd[1], &req_buf);
@@ -412,8 +412,8 @@ static int find_common(struct fetch_pack_args *args,
 			do {
 				ack = get_ack(fd[0], result_sha1);
 				if (ack)
-					print_verbose(args, "got ack %d %s", ack,
-						      sha1_to_hex(result_sha1));
+					print_verbose(args, _("got %s %d %s"), "ack",
+						      ack, sha1_to_hex(result_sha1));
 				switch (ack) {
 				case ACK:
 					flushes = 0;
@@ -426,7 +426,7 @@ static int find_common(struct fetch_pack_args *args,
 					struct commit *commit =
 						lookup_commit(result_sha1);
 					if (!commit)
-						die("invalid commit %s", sha1_to_hex(result_sha1));
+						die(_("invalid commit %s"), sha1_to_hex(result_sha1));
 					if (args->stateless_rpc
 					 && ack == ACK_common
 					 && !(commit->object.flags & COMMON)) {
@@ -452,7 +452,7 @@ static int find_common(struct fetch_pack_args *args,
 			} while (ack);
 			flushes--;
 			if (got_continue && MAX_IN_VAIN < in_vain) {
-				print_verbose(args, "giving up");
+				print_verbose(args, _("giving up"));
 				break; /* give up */
 			}
 		}
@@ -462,7 +462,7 @@ done:
 		packet_buf_write(&req_buf, "done\n");
 		send_request(args, fd[1], &req_buf);
 	}
-	print_verbose(args, "done");
+	print_verbose(args, _("done"));
 	if (retval != 0) {
 		multi_ack = 0;
 		flushes++;
@@ -474,8 +474,8 @@ done:
 	while (flushes || multi_ack) {
 		int ack = get_ack(fd[0], result_sha1);
 		if (ack) {
-			print_verbose(args, "got ack (%d) %s", ack,
-				      sha1_to_hex(result_sha1));
+			print_verbose(args, _("got %s (%d) %s"), "ack",
+				      ack, sha1_to_hex(result_sha1));
 			if (ack == ACK)
 				return 0;
 			multi_ack = 1;
@@ -520,7 +520,7 @@ static void mark_recent_complete_commits(struct fetch_pack_args *args,
 					 unsigned long cutoff)
 {
 	while (complete && cutoff <= complete->item->date) {
-		print_verbose(args, "Marking %s as complete",
+		print_verbose(args, _("Marking %s as complete"),
 			      oid_to_hex(&complete->item->object.oid));
 		pop_most_recent_commit(&complete, COMPLETE);
 	}
@@ -666,7 +666,7 @@ static int everything_local(struct fetch_pack_args *args,
 				      ref->name);
 			continue;
 		}
-		print_verbose(args, "already have %s (%s)", sha1_to_hex(remote),
+		print_verbose(args, _("already have %s (%s)"), sha1_to_hex(remote),
 			      ref->name);
 	}
 	return retval;
@@ -702,8 +702,7 @@ static int get_pack(struct fetch_pack_args *args,
 		demux.data = xd;
 		demux.out = -1;
 		if (start_async(&demux))
-			die("fetch-pack: unable to fork off sideband"
-			    " demultiplexer");
+			die(_("fetch-pack: unable to fork off sideband demultiplexer"));
 	}
 	else
 		demux.out = xd[0];
@@ -711,7 +710,7 @@ static int get_pack(struct fetch_pack_args *args,
 	if (!args->keep_pack && unpack_limit) {
 
 		if (read_pack_header(demux.out, &header))
-			die("protocol error: bad pack header");
+			die(_("protocol error: bad pack header"));
 		pass_header = 1;
 		if (ntohl(header.hdr_entries) < unpack_limit)
 			do_keep = 0;
@@ -767,7 +766,7 @@ static int get_pack(struct fetch_pack_args *args,
 	cmd.in = demux.out;
 	cmd.git_cmd = 1;
 	if (start_command(&cmd))
-		die("fetch-pack: unable to fork off %s", cmd_name);
+		die(_("fetch-pack: unable to fork off %s"), cmd_name);
 	if (do_keep && pack_lockfile) {
 		*pack_lockfile = index_pack_lockfile(cmd.out);
 		close(cmd.out);
@@ -783,9 +782,9 @@ static int get_pack(struct fetch_pack_args *args,
 			args->check_self_contained_and_connected &&
 			ret == 0;
 	else
-		die("%s failed", cmd_name);
+		die(_("%s failed"), cmd_name);
 	if (use_sideband && finish_async(&demux))
-		die("error in sideband demultiplexer");
+		die(_("error in sideband demultiplexer"));
 	return 0;
 }
 
@@ -812,34 +811,34 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 	qsort(sought, nr_sought, sizeof(*sought), cmp_ref_by_name);
 
 	if ((args->depth > 0 || is_repository_shallow()) && !server_supports("shallow"))
-		die("Server does not support shallow clients");
+		die(_("Server does not support shallow clients"));
 	if (server_supports("multi_ack_detailed")) {
-		print_verbose(args, "Server supports multi_ack_detailed");
+		print_verbose(args, _("Server supports multi_ack_detailed"));
 		multi_ack = 2;
 		if (server_supports("no-done")) {
-			print_verbose(args, "Server supports no-done");
+			print_verbose(args, _("Server supports no-done"));
 			if (args->stateless_rpc)
 				no_done = 1;
 		}
 	}
 	else if (server_supports("multi_ack")) {
-		print_verbose(args, "Server supports multi_ack");
+		print_verbose(args, _("Server supports multi_ack"));
 		multi_ack = 1;
 	}
 	if (server_supports("side-band-64k")) {
-		print_verbose(args, "Server supports side-band-64k");
+		print_verbose(args, _("Server supports side-band-64k"));
 		use_sideband = 2;
 	}
 	else if (server_supports("side-band")) {
-		print_verbose(args, "Server supports side-band");
+		print_verbose(args, _("Server supports side-band"));
 		use_sideband = 1;
 	}
 	if (server_supports("allow-tip-sha1-in-want")) {
-		print_verbose(args, "Server supports allow-tip-sha1-in-want");
+		print_verbose(args, _("Server supports allow-tip-sha1-in-want"));
 		allow_unadvertised_object_request |= ALLOW_TIP_SHA1;
 	}
 	if (server_supports("allow-reachable-sha1-in-want")) {
-		print_verbose(args, "Server supports allow-reachable-sha1-in-want");
+		print_verbose(args, _("Server supports allow-reachable-sha1-in-want"));
 		allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1;
 	}
 	if (!server_supports("thin-pack"))
@@ -849,14 +848,14 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 	if (!server_supports("include-tag"))
 		args->include_tag = 0;
 	if (server_supports("ofs-delta"))
-		print_verbose(args, "Server supports ofs-delta");
+		print_verbose(args, _("Server supports ofs-delta"));
 	else
 		prefer_ofs_delta = 0;
 
 	if ((agent_feature = server_feature_value("agent", &agent_len))) {
 		agent_supported = 1;
 		if (agent_len)
-			print_verbose(args, "Server version is %.*s",
+			print_verbose(args, _("Server version is %.*s"),
 				      agent_len, agent_feature);
 	}
 
@@ -869,7 +868,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 			/* When cloning, it is not unusual to have
 			 * no common commit.
 			 */
-			warning("no common commits");
+			warning(_("no common commits"));
 
 	if (args->stateless_rpc)
 		packet_flush(fd[1]);
@@ -881,7 +880,7 @@ static struct ref *do_fetch_pack(struct fetch_pack_args *args,
 	else
 		alternate_shallow_file = NULL;
 	if (get_pack(args, fd, pack_lockfile))
-		die("git fetch-pack: fetch failed.");
+		die(_("git fetch-pack: fetch failed."));
 
  all_done:
 	return ref;
@@ -1043,7 +1042,7 @@ struct ref *fetch_pack(struct fetch_pack_args *args,
 
 	if (!ref) {
 		packet_flush(fd[1]);
-		die("no matching remote head");
+		die(_("no matching remote head"));
 	}
 	prepare_shallow_info(&si, shallow);
 	ref_cpy = do_fetch_pack(args, fd, ref, sought, nr_sought,
-- 
2.8.2.524.g6ff3d78

  parent reply	other threads:[~2016-06-12 10:55 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 12:26 [PATCH 00/27] nd/shallow-deepen updates Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 01/27] remote-curl.c: convert fetch_git() to use argv_array Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 02/27] transport-helper.c: refactor set_helper_option() Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 03/27] upload-pack: move shallow deepen code out of receive_needs() Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 04/27] upload-pack: move "shallow" sending code out of deepen() Nguyễn Thái Ngọc Duy
2016-06-10 20:05   ` Junio C Hamano
2016-06-10 12:26 ` [PATCH 05/27] upload-pack: remove unused variable "backup" Nguyễn Thái Ngọc Duy
2016-06-10 20:06   ` Junio C Hamano
2016-06-10 12:26 ` [PATCH 06/27] upload-pack: move "unshallow" sending code out of deepen() Nguyễn Thái Ngọc Duy
2016-06-10 20:09   ` Junio C Hamano
2016-06-10 12:26 ` [PATCH 07/27] upload-pack: use skip_prefix() instead of starts_with() Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 08/27] upload-pack: tighten number parsing at "deepen" lines Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 09/27] upload-pack: make check_non_tip() clean things up error Nguyễn Thái Ngọc Duy
2016-06-10 20:25   ` Junio C Hamano
2016-06-10 12:26 ` [PATCH 10/27] upload-pack: move rev-list code out of check_non_tip() Nguyễn Thái Ngọc Duy
2016-06-10 20:36   ` Junio C Hamano
2016-06-10 12:26 ` [PATCH 11/27] fetch-pack: use skip_prefix() instead of starts_with() Nguyễn Thái Ngọc Duy
2016-06-10 12:26 ` [PATCH 12/27] fetch-pack: use a common function for verbose printing Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 13/27] fetch-pack.c: mark strings for translating Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 14/27] fetch-pack: use a separate flag for fetch in deepening mode Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 15/27] shallow.c: implement a generic shallow boundary finder based on rev-list Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 16/27] upload-pack: add deepen-since to cut shallow repos based on time Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 17/27] fetch: define shallow boundary with --shallow-since Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 18/27] clone: define shallow clone boundary based on time " Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 19/27] t5500, t5539: tests for shallow depth since a specific date Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 20/27] refs: add expand_ref() Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 21/27] upload-pack: support define shallow boundary by excluding revisions Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 22/27] fetch: define shallow boundary with --shallow-exclude Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 23/27] clone: define shallow clone " Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 24/27] t5500, t5539: tests for shallow depth excluding a ref Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 25/27] upload-pack: split check_unreachable() in two, prep for get_reachable_list() Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 26/27] upload-pack: add get_reachable_list() Nguyễn Thái Ngọc Duy
2016-06-10 12:27 ` [PATCH 27/27] fetch, upload-pack: --deepen=N extends shallow boundary by N commits Nguyễn Thái Ngọc Duy
2016-06-10 23:42 ` [PATCH 00/27] nd/shallow-deepen updates Eric Sunshine
2016-06-13 17:10   ` Junio C Hamano
2016-06-14  9:21     ` Duy Nguyen
2016-06-12 10:53 ` [PATCH v2 " Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 01/27] remote-curl.c: convert fetch_git() to use argv_array Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 02/27] transport-helper.c: refactor set_helper_option() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 03/27] upload-pack: move shallow deepen code out of receive_needs() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 04/27] upload-pack: move "shallow" sending code out of deepen() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 05/27] upload-pack: remove unused variable "backup" Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 06/27] upload-pack: move "unshallow" sending code out of deepen() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 07/27] upload-pack: use skip_prefix() instead of starts_with() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 08/27] upload-pack: tighten number parsing at "deepen" lines Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 09/27] upload-pack: make check_non_tip() clean things up on error Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 10/27] upload-pack: move rev-list code out of check_non_tip() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 11/27] fetch-pack: use skip_prefix() instead of starts_with() Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 12/27] fetch-pack: use a common function for verbose printing Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` Nguyễn Thái Ngọc Duy [this message]
2016-06-12 10:53   ` [PATCH v2 14/27] fetch-pack: use a separate flag for fetch in deepening mode Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 15/27] shallow.c: implement a generic shallow boundary finder based on rev-list Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 16/27] upload-pack: add deepen-since to cut shallow repos based on time Nguyễn Thái Ngọc Duy
2016-06-12 10:53   ` [PATCH v2 17/27] fetch: define shallow boundary with --shallow-since Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 18/27] clone: define shallow clone boundary based on time " Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 19/27] t5500, t5539: tests for shallow depth since a specific date Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 20/27] refs: add expand_ref() Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 21/27] upload-pack: support define shallow boundary by excluding revisions Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 22/27] fetch: define shallow boundary with --shallow-exclude Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 23/27] clone: define shallow clone " Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 24/27] t5500, t5539: tests for shallow depth excluding a ref Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 25/27] upload-pack: split check_unreachable() in two, prep for get_reachable_list() Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 26/27] upload-pack: add get_reachable_list() Nguyễn Thái Ngọc Duy
2016-06-12 10:54   ` [PATCH v2 27/27] fetch, upload-pack: --deepen=N extends shallow boundary by N commits Nguyễn Thái Ngọc Duy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160612105409.22156-14-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).