Skip to content

Commit 28fc9ab

Browse files
tgummerergitster
authored andcommitted
rerere: wrap paths in output in sq
It looks like most paths in the output in the git codebase are wrapped in single quotes. Standardize on that in rerere as well. Apart from being more consistent, this also makes some of the strings match strings that are already translated in other parts of the codebase, thus reducing the work for translators, when the strings are marked for translation in a subsequent commit. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent c5d1d13 commit 28fc9ab

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

builtin/rerere.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int cmd_rerere(int argc, const char **argv, const char *prefix)
107107
const char *path = merge_rr.items[i].string;
108108
const struct rerere_id *id = merge_rr.items[i].util;
109109
if (diff_two(rerere_path(id, "preimage"), path, path, path))
110-
die("unable to generate diff for %s", rerere_path(id, NULL));
110+
die("unable to generate diff for '%s'", rerere_path(id, NULL));
111111
}
112112
} else
113113
usage_with_options(rerere_usage, options);

rerere.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -484,12 +484,12 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
484484
io.input = fopen(path, "r");
485485
io.io.wrerror = 0;
486486
if (!io.input)
487-
return error_errno("could not open %s", path);
487+
return error_errno("could not open '%s'", path);
488488

489489
if (output) {
490490
io.io.output = fopen(output, "w");
491491
if (!io.io.output) {
492-
error_errno("could not write %s", output);
492+
error_errno("could not write '%s'", output);
493493
fclose(io.input);
494494
return -1;
495495
}
@@ -499,15 +499,15 @@ static int handle_file(const char *path, unsigned char *sha1, const char *output
499499

500500
fclose(io.input);
501501
if (io.io.wrerror)
502-
error("there were errors while writing %s (%s)",
502+
error("there were errors while writing '%s' (%s)",
503503
path, strerror(io.io.wrerror));
504504
if (io.io.output && fclose(io.io.output))
505-
io.io.wrerror = error_errno("failed to flush %s", path);
505+
io.io.wrerror = error_errno("failed to flush '%s'", path);
506506

507507
if (hunk_no < 0) {
508508
if (output)
509509
unlink_or_warn(output);
510-
return error("could not parse conflict hunks in %s", path);
510+
return error("could not parse conflict hunks in '%s'", path);
511511
}
512512
if (io.io.wrerror)
513513
return -1;
@@ -684,17 +684,17 @@ static int merge(const struct rerere_id *id, const char *path)
684684
* Mark that "postimage" was used to help gc.
685685
*/
686686
if (utime(rerere_path(id, "postimage"), NULL) < 0)
687-
warning_errno("failed utime() on %s",
687+
warning_errno("failed utime() on '%s'",
688688
rerere_path(id, "postimage"));
689689

690690
/* Update "path" with the resolution */
691691
f = fopen(path, "w");
692692
if (!f)
693-
return error_errno("could not open %s", path);
693+
return error_errno("could not open '%s'", path);
694694
if (fwrite(result.ptr, result.size, 1, f) != 1)
695-
error_errno("could not write %s", path);
695+
error_errno("could not write '%s'", path);
696696
if (fclose(f))
697-
return error_errno("writing %s failed", path);
697+
return error_errno("writing '%s' failed", path);
698698

699699
out:
700700
free(cur.ptr);
@@ -878,7 +878,7 @@ static int is_rerere_enabled(void)
878878
return rr_cache_exists;
879879

880880
if (!rr_cache_exists && mkdir_in_gitdir(git_path_rr_cache()))
881-
die("could not create directory %s", git_path_rr_cache());
881+
die("could not create directory '%s'", git_path_rr_cache());
882882
return 1;
883883
}
884884

@@ -1067,9 +1067,9 @@ static int rerere_forget_one_path(const char *path, struct string_list *rr)
10671067
filename = rerere_path(id, "postimage");
10681068
if (unlink(filename)) {
10691069
if (errno == ENOENT)
1070-
error("no remembered resolution for %s", path);
1070+
error("no remembered resolution for '%s'", path);
10711071
else
1072-
error_errno("cannot unlink %s", filename);
1072+
error_errno("cannot unlink '%s'", filename);
10731073
goto fail_exit;
10741074
}
10751075

@@ -1088,7 +1088,7 @@ static int rerere_forget_one_path(const char *path, struct string_list *rr)
10881088
item = string_list_insert(rr, path);
10891089
free_rerere_id(item);
10901090
item->util = id;
1091-
fprintf(stderr, "Forgot resolution for %s\n", path);
1091+
fprintf(stderr, "Forgot resolution for '%s'\n", path);
10921092
return 0;
10931093

10941094
fail_exit:

0 commit comments

Comments
 (0)