i18n: git-revert basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:42 UTC
f30f71ce7aecd86823f7a2d93f56c212bac8f510
1 file changed
+23
-23
builtin/revert.c
+23
-23
@@ -96,7 +96,7 @@ static void parse_args(int argc, const char **argv)
96
OPT_END(),
97
};
98
if (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))
99
- die("program error");
99
+ die(_("program error"));
100
}
101
102
commit_argc = parse_options(argc, argv, NULL, options, usage_str,
@@ -168,7 +168,7 @@ static char *get_encoding(const char *message)
168
const char *p = message, *eol;
169
170
if (!p)
171
- die ("Could not read commit message of %s",
171
+ die (_("Could not read commit message of %s"),
172
sha1_to_hex(commit->object.sha1));
173
while (*p && *p != '\n') {
174
for (eol = p + 1; *eol && *eol != '\n'; eol++)
@@ -202,7 +202,7 @@ static void set_author_ident_env(const char *message)
202
{
203
const char *p = message;
204
if (!p)
205
- die ("Could not read commit message of %s",
205
+ die (_("Could not read commit message of %s"),
206
sha1_to_hex(commit->object.sha1));
207
while (*p && *p != '\n') {
208
const char *eol;
@@ -216,7 +216,7 @@ static void set_author_ident_env(const char *message)
216
line = xmemdupz(p, eol - p);
217
email = strchr(line, '<');
218
if (!email)
219
- die ("Could not extract author email from %s",
219
+ die (_("Could not extract author email from %s"),
220
sha1_to_hex(commit->object.sha1));
221
if (email == line)
222
pend = line;
@@ -228,7 +228,7 @@ static void set_author_ident_env(const char *message)
228
email++;
229
timestamp = strchr(email, '>');
230
if (!timestamp)
231
- die ("Could not extract author time from %s",
231
+ die (_("Could not extract author time from %s"),
232
sha1_to_hex(commit->object.sha1));
233
*timestamp = '\0';
234
for (timestamp++; *timestamp && isspace(*timestamp);
@@ -244,7 +244,7 @@ static void set_author_ident_env(const char *message)
244
if (*p == '\n')
245
p++;
246
}
247
- die ("No author information found in %s",
247
+ die (_("No author information found in %s"),
248
sha1_to_hex(commit->object.sha1));
249
}
250
@@ -281,10 +281,10 @@ static void write_message(struct strbuf *msgbuf, const char *filename)
281
int msg_fd = hold_lock_file_for_update(&msg_file, filename,
282
LOCK_DIE_ON_ERROR);
283
if (write_in_full(msg_fd, msgbuf->buf, msgbuf->len) < 0)
284
- die_errno("Could not write to %s.", filename);
284
+ die_errno(_("Could not write to %s."), filename);
285
strbuf_release(msgbuf);
286
if (commit_lock_file(&msg_file) < 0)
287
- die("Error wrapping up %s", filename);
287
+ die(_("Error wrapping up %s"), filename);
288
}
289
290
static struct tree *empty_tree(void)
@@ -420,10 +420,10 @@ static int do_pick_commit(void)
420
* to work on.
421
*/
422
if (write_cache_as_tree(head, 0, NULL))
423
- die ("Your index file is unmerged.");
423
+ die (_("Your index file is unmerged."));
424
} else {
425
if (get_sha1("HEAD", head))
426
- die ("You do not have a valid HEAD");
426
+ die (_("You do not have a valid HEAD"));
427
if (index_differs_from("HEAD", 0))
428
die_dirty_index(me);
429
}
@@ -431,7 +431,7 @@ static int do_pick_commit(void)
431
432
if (!commit->parents) {
433
if (action == REVERT)
434
- die ("Cannot revert a root commit");
434
+ die (_("Cannot revert a root commit"));
435
parent = NULL;
436
}
437
else if (commit->parents->next) {
@@ -440,7 +440,7 @@ static int do_pick_commit(void)
440
struct commit_list *p;
441
442
if (!mainline)
443
- die("Commit %s is a merge but no -m option was given.",
443
+ die(_("Commit %s is a merge but no -m option was given."),
444
sha1_to_hex(commit->object.sha1));
445
446
for (cnt = 1, p = commit->parents;
@@ -448,11 +448,11 @@ static int do_pick_commit(void)
448
cnt++)
449
p = p->next;
450
if (cnt != mainline || !p)
451
- die("Commit %s does not have parent %d",
451
+ die(_("Commit %s does not have parent %d"),
452
sha1_to_hex(commit->object.sha1), mainline);
453
parent = p->item;
454
} else if (0 < mainline)
455
- die("Mainline was specified but commit %s is not a merge.",
455
+ die(_("Mainline was specified but commit %s is not a merge."),
456
sha1_to_hex(commit->object.sha1));
457
else
458
parent = commit->parents->item;
@@ -465,7 +465,7 @@ static int do_pick_commit(void)
465
me, sha1_to_hex(parent->object.sha1));
466
467
if (get_message(commit->buffer, &msg) != 0)
468
- die("Cannot get commit message for %s",
468
+ die(_("Cannot get commit message for %s"),
469
sha1_to_hex(commit->object.sha1));
470
471
/*
@@ -556,10 +556,10 @@ static void prepare_revs(struct rev_info *revs)
556
usage(*revert_or_cherry_pick_usage());
557
558
if (prepare_revision_walk(revs))
559
- die("revision walk setup failed");
559
+ die(_("revision walk setup failed"));
560
561
if (!revs->commits)
562
- die("empty commit set passed");
562
+ die(_("empty commit set passed"));
563
}
564
565
static void read_and_refresh_cache(const char *me)
@@ -567,12 +567,12 @@ static void read_and_refresh_cache(const char *me)
567
static struct lock_file index_lock;
568
int index_fd = hold_locked_index(&index_lock, 0);
569
if (read_index_preload(&the_index, NULL) < 0)
570
- die("git %s: failed to read the index", me);
570
+ die(_("git %s: failed to read the index"), me);
571
refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
572
if (the_index.cache_changed) {
573
if (write_index(&the_index, index_fd) ||
574
commit_locked_index(&index_lock))
575
- die("git %s: failed to refresh the index", me);
575
+ die(_("git %s: failed to refresh the index"), me);
576
}
577
rollback_lock_file(&index_lock);
578
}
@@ -588,13 +588,13 @@ static int revert_or_cherry_pick(int argc, const char **argv)
588
589
if (allow_ff) {
590
if (signoff)
591
- die("cherry-pick --ff cannot be used with --signoff");
591
+ die(_("cherry-pick --ff cannot be used with --signoff"));
592
if (no_commit)
593
- die("cherry-pick --ff cannot be used with --no-commit");
593
+ die(_("cherry-pick --ff cannot be used with --no-commit"));
594
if (no_replay)
595
- die("cherry-pick --ff cannot be used with -x");
595
+ die(_("cherry-pick --ff cannot be used with -x"));
596
if (edit)
597
- die("cherry-pick --ff cannot be used with --edit");
597
+ die(_("cherry-pick --ff cannot be used with --edit"));
598
}
599
600
read_and_refresh_cache(me);