notes: spell first word of error messages in lowercase
That's the usual style. Update one test to reflect these changes. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Vasco Almeida committed
Sep 15, 2016 at 14:59 UTC
8d79589ad61132e038dd7312ab018c6d6518ead7
2 files changed
+33
-33
builtin/notes.c
+32
-32
@@ -191,7 +191,7 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,
191
strbuf_reset(&d->buf);
192
193
if (launch_editor(d->edit_path, &d->buf, NULL)) {
194
- die(_("Please supply the note contents using either -m or -F option"));
194
+ die(_("please supply the note contents using either -m or -F option"));
195
}
196
strbuf_stripspace(&d->buf, 1);
197
}
@@ -202,7 +202,7 @@ static void write_note_data(struct note_data *d, unsigned char *sha1)
202
if (write_sha1_file(d->buf.buf, d->buf.len, blob_type, sha1)) {
203
error(_("unable to write note object"));
204
if (d->edit_path)
205
- error(_("The note contents have been left in %s"),
205
+ error(_("the note contents have been left in %s"),
206
d->edit_path);
207
exit(128);
208
}
@@ -251,14 +251,14 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
251
strbuf_addch(&d->buf, '\n');
252
253
if (get_sha1(arg, object))
254
- die(_("Failed to resolve '%s' as a valid ref."), arg);
254
+ die(_("failed to resolve '%s' as a valid ref."), arg);
255
if (!(buf = read_sha1_file(object, &type, &len))) {
256
free(buf);
257
- die(_("Failed to read object '%s'."), arg);
257
+ die(_("failed to read object '%s'."), arg);
258
}
259
if (type != OBJ_BLOB) {
260
free(buf);
261
- die(_("Cannot read note data from non-blob object '%s'."), arg);
261
+ die(_("cannot read note data from non-blob object '%s'."), arg);
262
}
263
strbuf_add(&d->buf, buf, len);
264
free(buf);
@@ -298,13 +298,13 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
298
299
split = strbuf_split(&buf, ' ');
300
if (!split[0] || !split[1])
301
- die(_("Malformed input line: '%s'."), buf.buf);
301
+ die(_("malformed input line: '%s'."), buf.buf);
302
strbuf_rtrim(split[0]);
303
strbuf_rtrim(split[1]);
304
if (get_sha1(split[0]->buf, from_obj))
305
- die(_("Failed to resolve '%s' as a valid ref."), split[0]->buf);
305
+ die(_("failed to resolve '%s' as a valid ref."), split[0]->buf);
306
if (get_sha1(split[1]->buf, to_obj))
307
- die(_("Failed to resolve '%s' as a valid ref."), split[1]->buf);
307
+ die(_("failed to resolve '%s' as a valid ref."), split[1]->buf);
308
309
if (rewrite_cmd)
310
err = copy_note_for_rewrite(c, from_obj, to_obj);
@@ -313,7 +313,7 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
313
combine_notes_overwrite);
314
315
if (err) {
316
- error(_("Failed to copy notes from '%s' to '%s'"),
316
+ error(_("failed to copy notes from '%s' to '%s'"),
317
split[0]->buf, split[1]->buf);
318
ret = 1;
319
}
@@ -342,7 +342,7 @@ static struct notes_tree *init_notes_check(const char *subcommand,
342
if (!starts_with(ref, "refs/notes/"))
343
/* TRANSLATORS: the first %s will be replaced by a
344
git notes command: 'add', 'merge', 'remove', etc.*/
345
- die(_("Refusing to %s notes in %s (outside of refs/notes/)"),
345
+ die(_("refusing to %s notes in %s (outside of refs/notes/)"),
346
subcommand, ref);
347
return t;
348
}
@@ -369,13 +369,13 @@ static int list(int argc, const char **argv, const char *prefix)
369
t = init_notes_check("list", 0);
370
if (argc) {
371
if (get_sha1(argv[0], object))
372
- die(_("Failed to resolve '%s' as a valid ref."), argv[0]);
372
+ die(_("failed to resolve '%s' as a valid ref."), argv[0]);
373
note = get_note(t, object);
374
if (note) {
375
puts(sha1_to_hex(note));
376
retval = 0;
377
} else
378
- retval = error(_("No note found for object %s."),
378
+ retval = error(_("no note found for object %s."),
379
sha1_to_hex(object));
380
} else
381
retval = for_each_note(t, 0, list_each_note, NULL);
@@ -424,7 +424,7 @@ static int add(int argc, const char **argv, const char *prefix)
424
object_ref = argc > 1 ? argv[1] : "HEAD";
425
426
if (get_sha1(object_ref, object))
427
- die(_("Failed to resolve '%s' as a valid ref."), object_ref);
427
+ die(_("failed to resolve '%s' as a valid ref."), object_ref);
428
429
t = init_notes_check("add", NOTES_INIT_WRITABLE);
430
note = get_note(t, object);
@@ -510,12 +510,12 @@ static int copy(int argc, const char **argv, const char *prefix)
510
}
511
512
if (get_sha1(argv[0], from_obj))
513
- die(_("Failed to resolve '%s' as a valid ref."), argv[0]);
513
+ die(_("failed to resolve '%s' as a valid ref."), argv[0]);
514
515
object_ref = 1 < argc ? argv[1] : "HEAD";
516
517
if (get_sha1(object_ref, object))
518
- die(_("Failed to resolve '%s' as a valid ref."), object_ref);
518
+ die(_("failed to resolve '%s' as a valid ref."), object_ref);
519
520
t = init_notes_check("copy", NOTES_INIT_WRITABLE);
521
note = get_note(t, object);
@@ -534,7 +534,7 @@ static int copy(int argc, const char **argv, const char *prefix)
534
535
from_note = get_note(t, from_obj);
536
if (!from_note) {
537
- retval = error(_("Missing notes on source object %s. Cannot "
537
+ retval = error(_("missing notes on source object %s. Cannot "
538
"copy."), sha1_to_hex(from_obj));
539
goto out;
540
}
@@ -593,7 +593,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
593
object_ref = 1 < argc ? argv[1] : "HEAD";
594
595
if (get_sha1(object_ref, object))
596
- die(_("Failed to resolve '%s' as a valid ref."), object_ref);
596
+ die(_("failed to resolve '%s' as a valid ref."), object_ref);
597
598
t = init_notes_check(argv[0], NOTES_INIT_WRITABLE);
599
note = get_note(t, object);
@@ -656,13 +656,13 @@ static int show(int argc, const char **argv, const char *prefix)
656
object_ref = argc ? argv[0] : "HEAD";
657
658
if (get_sha1(object_ref, object))
659
- die(_("Failed to resolve '%s' as a valid ref."), object_ref);
659
+ die(_("failed to resolve '%s' as a valid ref."), object_ref);
660
661
t = init_notes_check("show", 0);
662
note = get_note(t, object);
663
664
if (!note)
665
- retval = error(_("No note found for object %s."),
665
+ retval = error(_("no note found for object %s."),
666
sha1_to_hex(object));
667
else {
668
const char *show_args[3] = {"show", sha1_to_hex(note), NULL};
@@ -682,11 +682,11 @@ static int merge_abort(struct notes_merge_options *o)
682
*/
683
684
if (delete_ref("NOTES_MERGE_PARTIAL", NULL, 0))
685
- ret += error(_("Failed to delete ref NOTES_MERGE_PARTIAL"));
685
+ ret += error(_("failed to delete ref NOTES_MERGE_PARTIAL"));
686
if (delete_ref("NOTES_MERGE_REF", NULL, REF_NODEREF))
687
- ret += error(_("Failed to delete ref NOTES_MERGE_REF"));
687
+ ret += error(_("failed to delete ref NOTES_MERGE_REF"));
688
if (notes_merge_abort(o))
689
- ret += error(_("Failed to remove 'git notes merge' worktree"));
689
+ ret += error(_("failed to remove 'git notes merge' worktree"));
690
return ret;
691
}
692
@@ -706,11 +706,11 @@ static int merge_commit(struct notes_merge_options *o)
706
*/
707
708
if (get_sha1("NOTES_MERGE_PARTIAL", sha1))
709
- die(_("Failed to read ref NOTES_MERGE_PARTIAL"));
709
+ die(_("failed to read ref NOTES_MERGE_PARTIAL"));
710
else if (!(partial = lookup_commit_reference(sha1)))
711
- die(_("Could not find commit from NOTES_MERGE_PARTIAL."));
711
+ die(_("could not find commit from NOTES_MERGE_PARTIAL."));
712
else if (parse_commit(partial))
713
- die(_("Could not parse commit from NOTES_MERGE_PARTIAL."));
713
+ die(_("could not parse commit from NOTES_MERGE_PARTIAL."));
714
715
if (partial->parents)
716
hashcpy(parent_sha1, partial->parents->item->object.oid.hash);
@@ -723,10 +723,10 @@ static int merge_commit(struct notes_merge_options *o)
723
o->local_ref = local_ref_to_free =
724
resolve_refdup("NOTES_MERGE_REF", 0, sha1, NULL);
725
if (!o->local_ref)
726
- die(_("Failed to resolve NOTES_MERGE_REF"));
726
+ die(_("failed to resolve NOTES_MERGE_REF"));
727
728
if (notes_merge_commit(o, t, partial, sha1))
729
- die(_("Failed to finalize notes merge"));
729
+ die(_("failed to finalize notes merge"));
730
731
/* Reuse existing commit message in reflog message */
732
memset(&pretty_ctx, 0, sizeof(pretty_ctx));
@@ -796,7 +796,7 @@ static int merge(int argc, const char **argv, const char *prefix)
796
}
797
798
if (do_merge && argc != 1) {
799
- error(_("Must specify a notes ref to merge"));
799
+ error(_("must specify a notes ref to merge"));
800
usage_with_options(git_notes_merge_usage, options);
801
} else if (!do_merge && argc) {
802
error(_("too many parameters"));
@@ -820,7 +820,7 @@ static int merge(int argc, const char **argv, const char *prefix)
820
821
if (strategy) {
822
if (parse_notes_merge_strategy(strategy, &o.strategy)) {
823
- error(_("Unknown -s/--strategy: %s"), strategy);
823
+ error(_("unknown -s/--strategy: %s"), strategy);
824
usage_with_options(git_notes_merge_usage, options);
825
}
826
} else {
@@ -857,10 +857,10 @@ static int merge(int argc, const char **argv, const char *prefix)
857
/* Store ref-to-be-updated into .git/NOTES_MERGE_REF */
858
wt = find_shared_symref("NOTES_MERGE_REF", default_notes_ref());
859
if (wt)
860
- die(_("A notes merge into %s is already in-progress at %s"),
860
+ die(_("a notes merge into %s is already in-progress at %s"),
861
default_notes_ref(), wt->path);
862
if (create_symref("NOTES_MERGE_REF", default_notes_ref(), NULL))
863
- die(_("Failed to store link to current notes ref (%s)"),
863
+ die(_("failed to store link to current notes ref (%s)"),
864
default_notes_ref());
865
printf(_("Automatic notes merge failed. Fix conflicts in %s and "
866
"commit the result with 'git notes merge --commit', or "
@@ -1016,7 +1016,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
1016
else if (!strcmp(argv[0], "get-ref"))
1017
result = get_ref(argc, argv, prefix);
1018
else {
1019
- result = error(_("Unknown subcommand: %s"), argv[0]);
1019
+ result = error(_("unknown subcommand: %s"), argv[0]);
1020
usage_with_options(git_notes_usage, options);
1021
}
1022
t/t3320-notes-merge-worktrees.sh
+1
-1
@@ -52,7 +52,7 @@ test_expect_success 'merge z into y while mid-merge in another workdir fails' '
52
cd worktree &&
53
git config core.notesRef refs/notes/y &&
54
test_must_fail git notes merge z 2>err &&
55
- test_i18ngrep "A notes merge into refs/notes/y is already in-progress at" err
55
+ test_i18ngrep "a notes merge into refs/notes/y is already in-progress at" err
56
) &&
57
test_path_is_missing .git/worktrees/worktree/NOTES_MERGE_REF
58
'