@@ -191,7 +191,7 @@ static void prepare_note_data(const unsigned char *object, struct note_data *d,
191
191
strbuf_reset (& d -> buf );
192
192
193
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
195
}
196
196
strbuf_stripspace (& d -> buf , 1 );
197
197
}
@@ -202,7 +202,7 @@ static void write_note_data(struct note_data *d, unsigned char *sha1)
202
202
if (write_sha1_file (d -> buf .buf , d -> buf .len , blob_type , sha1 )) {
203
203
error (_ ("unable to write note object" ));
204
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
206
d -> edit_path );
207
207
exit (128 );
208
208
}
@@ -251,14 +251,14 @@ static int parse_reuse_arg(const struct option *opt, const char *arg, int unset)
251
251
strbuf_addch (& d -> buf , '\n' );
252
252
253
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
255
if (!(buf = read_sha1_file (object , & type , & len ))) {
256
256
free (buf );
257
- die (_ ("Failed to read object '%s'." ), arg );
257
+ die (_ ("failed to read object '%s'." ), arg );
258
258
}
259
259
if (type != OBJ_BLOB ) {
260
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
262
}
263
263
strbuf_add (& d -> buf , buf , len );
264
264
free (buf );
@@ -298,13 +298,13 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
298
298
299
299
split = strbuf_split (& buf , ' ' );
300
300
if (!split [0 ] || !split [1 ])
301
- die (_ ("Malformed input line: '%s'." ), buf .buf );
301
+ die (_ ("malformed input line: '%s'." ), buf .buf );
302
302
strbuf_rtrim (split [0 ]);
303
303
strbuf_rtrim (split [1 ]);
304
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
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
308
309
309
if (rewrite_cmd )
310
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
313
combine_notes_overwrite );
314
314
315
315
if (err ) {
316
- error (_ ("Failed to copy notes from '%s' to '%s'" ),
316
+ error (_ ("failed to copy notes from '%s' to '%s'" ),
317
317
split [0 ]-> buf , split [1 ]-> buf );
318
318
ret = 1 ;
319
319
}
@@ -340,7 +340,9 @@ static struct notes_tree *init_notes_check(const char *subcommand,
340
340
341
341
ref = (flags & NOTES_INIT_WRITABLE ) ? t -> update_ref : t -> ref ;
342
342
if (!starts_with (ref , "refs/notes/" ))
343
- die ("Refusing to %s notes in %s (outside of 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/)" ),
344
346
subcommand , ref );
345
347
return t ;
346
348
}
@@ -367,13 +369,13 @@ static int list(int argc, const char **argv, const char *prefix)
367
369
t = init_notes_check ("list" , 0 );
368
370
if (argc ) {
369
371
if (get_sha1 (argv [0 ], object ))
370
- die (_ ("Failed to resolve '%s' as a valid ref." ), argv [0 ]);
372
+ die (_ ("failed to resolve '%s' as a valid ref." ), argv [0 ]);
371
373
note = get_note (t , object );
372
374
if (note ) {
373
375
puts (sha1_to_hex (note ));
374
376
retval = 0 ;
375
377
} else
376
- retval = error (_ ("No note found for object %s." ),
378
+ retval = error (_ ("no note found for object %s." ),
377
379
sha1_to_hex (object ));
378
380
} else
379
381
retval = for_each_note (t , 0 , list_each_note , NULL );
@@ -422,7 +424,7 @@ static int add(int argc, const char **argv, const char *prefix)
422
424
object_ref = argc > 1 ? argv [1 ] : "HEAD" ;
423
425
424
426
if (get_sha1 (object_ref , object ))
425
- die (_ ("Failed to resolve '%s' as a valid ref." ), object_ref );
427
+ die (_ ("failed to resolve '%s' as a valid ref." ), object_ref );
426
428
427
429
t = init_notes_check ("add" , NOTES_INIT_WRITABLE );
428
430
note = get_note (t , object );
@@ -508,12 +510,12 @@ static int copy(int argc, const char **argv, const char *prefix)
508
510
}
509
511
510
512
if (get_sha1 (argv [0 ], from_obj ))
511
- die (_ ("Failed to resolve '%s' as a valid ref." ), argv [0 ]);
513
+ die (_ ("failed to resolve '%s' as a valid ref." ), argv [0 ]);
512
514
513
515
object_ref = 1 < argc ? argv [1 ] : "HEAD" ;
514
516
515
517
if (get_sha1 (object_ref , object ))
516
- die (_ ("Failed to resolve '%s' as a valid ref." ), object_ref );
518
+ die (_ ("failed to resolve '%s' as a valid ref." ), object_ref );
517
519
518
520
t = init_notes_check ("copy" , NOTES_INIT_WRITABLE );
519
521
note = get_note (t , object );
@@ -532,7 +534,7 @@ static int copy(int argc, const char **argv, const char *prefix)
532
534
533
535
from_note = get_note (t , from_obj );
534
536
if (!from_note ) {
535
- retval = error (_ ("Missing notes on source object %s. Cannot "
537
+ retval = error (_ ("missing notes on source object %s. Cannot "
536
538
"copy." ), sha1_to_hex (from_obj ));
537
539
goto out ;
538
540
}
@@ -591,7 +593,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
591
593
object_ref = 1 < argc ? argv [1 ] : "HEAD" ;
592
594
593
595
if (get_sha1 (object_ref , object ))
594
- die (_ ("Failed to resolve '%s' as a valid ref." ), object_ref );
596
+ die (_ ("failed to resolve '%s' as a valid ref." ), object_ref );
595
597
596
598
t = init_notes_check (argv [0 ], NOTES_INIT_WRITABLE );
597
599
note = get_note (t , object );
@@ -654,13 +656,13 @@ static int show(int argc, const char **argv, const char *prefix)
654
656
object_ref = argc ? argv [0 ] : "HEAD" ;
655
657
656
658
if (get_sha1 (object_ref , object ))
657
- die (_ ("Failed to resolve '%s' as a valid ref." ), object_ref );
659
+ die (_ ("failed to resolve '%s' as a valid ref." ), object_ref );
658
660
659
661
t = init_notes_check ("show" , 0 );
660
662
note = get_note (t , object );
661
663
662
664
if (!note )
663
- retval = error (_ ("No note found for object %s." ),
665
+ retval = error (_ ("no note found for object %s." ),
664
666
sha1_to_hex (object ));
665
667
else {
666
668
const char * show_args [3 ] = {"show" , sha1_to_hex (note ), NULL };
@@ -680,11 +682,11 @@ static int merge_abort(struct notes_merge_options *o)
680
682
*/
681
683
682
684
if (delete_ref ("NOTES_MERGE_PARTIAL" , NULL , 0 ))
683
- ret += error ("Failed to delete ref NOTES_MERGE_PARTIAL" );
685
+ ret += error (_ ( "failed to delete ref NOTES_MERGE_PARTIAL") );
684
686
if (delete_ref ("NOTES_MERGE_REF" , NULL , REF_NODEREF ))
685
- ret += error ("Failed to delete ref NOTES_MERGE_REF" );
687
+ ret += error (_ ( "failed to delete ref NOTES_MERGE_REF") );
686
688
if (notes_merge_abort (o ))
687
- ret += error ("Failed to remove 'git notes merge' worktree" );
689
+ ret += error (_ ( "failed to remove 'git notes merge' worktree") );
688
690
return ret ;
689
691
}
690
692
@@ -704,11 +706,11 @@ static int merge_commit(struct notes_merge_options *o)
704
706
*/
705
707
706
708
if (get_sha1 ("NOTES_MERGE_PARTIAL" , sha1 ))
707
- die ("Failed to read ref NOTES_MERGE_PARTIAL" );
709
+ die (_ ( "failed to read ref NOTES_MERGE_PARTIAL") );
708
710
else if (!(partial = lookup_commit_reference (sha1 )))
709
- die ("Could not find commit from NOTES_MERGE_PARTIAL." );
711
+ die (_ ( "could not find commit from NOTES_MERGE_PARTIAL.") );
710
712
else if (parse_commit (partial ))
711
- die ("Could not parse commit from NOTES_MERGE_PARTIAL." );
713
+ die (_ ( "could not parse commit from NOTES_MERGE_PARTIAL.") );
712
714
713
715
if (partial -> parents )
714
716
hashcpy (parent_sha1 , partial -> parents -> item -> object .oid .hash );
@@ -721,10 +723,10 @@ static int merge_commit(struct notes_merge_options *o)
721
723
o -> local_ref = local_ref_to_free =
722
724
resolve_refdup ("NOTES_MERGE_REF" , 0 , sha1 , NULL );
723
725
if (!o -> local_ref )
724
- die ("Failed to resolve NOTES_MERGE_REF" );
726
+ die (_ ( "failed to resolve NOTES_MERGE_REF") );
725
727
726
728
if (notes_merge_commit (o , t , partial , sha1 ))
727
- die ("Failed to finalize notes merge" );
729
+ die (_ ( "failed to finalize notes merge") );
728
730
729
731
/* Reuse existing commit message in reflog message */
730
732
memset (& pretty_ctx , 0 , sizeof (pretty_ctx ));
@@ -794,7 +796,7 @@ static int merge(int argc, const char **argv, const char *prefix)
794
796
}
795
797
796
798
if (do_merge && argc != 1 ) {
797
- error (_ ("Must specify a notes ref to merge" ));
799
+ error (_ ("must specify a notes ref to merge" ));
798
800
usage_with_options (git_notes_merge_usage , options );
799
801
} else if (!do_merge && argc ) {
800
802
error (_ ("too many parameters" ));
@@ -818,7 +820,7 @@ static int merge(int argc, const char **argv, const char *prefix)
818
820
819
821
if (strategy ) {
820
822
if (parse_notes_merge_strategy (strategy , & o .strategy )) {
821
- error (_ ("Unknown -s/--strategy: %s" ), strategy );
823
+ error (_ ("unknown -s/--strategy: %s" ), strategy );
822
824
usage_with_options (git_notes_merge_usage , options );
823
825
}
824
826
} else {
@@ -855,10 +857,10 @@ static int merge(int argc, const char **argv, const char *prefix)
855
857
/* Store ref-to-be-updated into .git/NOTES_MERGE_REF */
856
858
wt = find_shared_symref ("NOTES_MERGE_REF" , default_notes_ref ());
857
859
if (wt )
858
- 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" ),
859
861
default_notes_ref (), wt -> path );
860
862
if (create_symref ("NOTES_MERGE_REF" , default_notes_ref (), NULL ))
861
- die (_ ("Failed to store link to current notes ref (%s)" ),
863
+ die (_ ("failed to store link to current notes ref (%s)" ),
862
864
default_notes_ref ());
863
865
printf (_ ("Automatic notes merge failed. Fix conflicts in %s and "
864
866
"commit the result with 'git notes merge --commit', or "
@@ -1014,7 +1016,7 @@ int cmd_notes(int argc, const char **argv, const char *prefix)
1014
1016
else if (!strcmp (argv [0 ], "get-ref" ))
1015
1017
result = get_ref (argc , argv , prefix );
1016
1018
else {
1017
- result = error (_ ("Unknown subcommand: %s" ), argv [0 ]);
1019
+ result = error (_ ("unknown subcommand: %s" ), argv [0 ]);
1018
1020
usage_with_options (git_notes_usage , options );
1019
1021
}
1020
1022
0 commit comments