@@ -627,7 +627,7 @@ static FILE *realstdout = NULL;
627
627
static const char * output_directory = NULL ;
628
628
static int outdir_offset ;
629
629
630
- static int reopen_stdout (struct commit * commit , struct rev_info * rev )
630
+ static int reopen_stdout (struct commit * commit , struct rev_info * rev , int quiet )
631
631
{
632
632
struct strbuf filename = STRBUF_INIT ;
633
633
int suffix_len = strlen (fmt_patch_suffix ) + 1 ;
@@ -643,7 +643,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
643
643
644
644
get_patch_filename (commit , rev -> nr , fmt_patch_suffix , & filename );
645
645
646
- if (!DIFF_OPT_TST ( & rev -> diffopt , QUICK ) )
646
+ if (!quiet )
647
647
fprintf (realstdout , "%s\n" , filename .buf + outdir_offset );
648
648
649
649
if (freopen (filename .buf , "w" , stdout ) == NULL )
@@ -722,7 +722,8 @@ static void print_signature(void)
722
722
static void make_cover_letter (struct rev_info * rev , int use_stdout ,
723
723
int numbered , int numbered_files ,
724
724
struct commit * origin ,
725
- int nr , struct commit * * list , struct commit * head )
725
+ int nr , struct commit * * list , struct commit * head ,
726
+ int quiet )
726
727
{
727
728
const char * committer ;
728
729
const char * subject_start = NULL ;
@@ -758,7 +759,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
758
759
sha1_to_hex (head -> object .sha1 ), committer , committer );
759
760
}
760
761
761
- if (!use_stdout && reopen_stdout (commit , rev ))
762
+ if (!use_stdout && reopen_stdout (commit , rev , quiet ))
762
763
return ;
763
764
764
765
if (commit ) {
@@ -999,6 +1000,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
999
1000
char * add_signoff = NULL ;
1000
1001
struct strbuf buf = STRBUF_INIT ;
1001
1002
int use_patch_format = 0 ;
1003
+ int quiet = 0 ;
1002
1004
const struct option builtin_format_patch_options [] = {
1003
1005
{ OPTION_CALLBACK , 'n' , "numbered" , & numbered , NULL ,
1004
1006
"use [PATCH n/m] even with a single patch" ,
@@ -1054,6 +1056,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1054
1056
PARSE_OPT_OPTARG , thread_callback },
1055
1057
OPT_STRING (0 , "signature" , & signature , "signature" ,
1056
1058
"add a signature" ),
1059
+ OPT_BOOLEAN (0 , "quiet" , & quiet ,
1060
+ "don't print the patch filenames" ),
1057
1061
OPT_END ()
1058
1062
};
1059
1063
@@ -1263,7 +1267,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1263
1267
if (thread )
1264
1268
gen_message_id (& rev , "cover" );
1265
1269
make_cover_letter (& rev , use_stdout , numbered , numbered_files ,
1266
- origin , nr , list , head );
1270
+ origin , nr , list , head , quiet );
1267
1271
total ++ ;
1268
1272
start_number -- ;
1269
1273
}
@@ -1309,7 +1313,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1309
1313
}
1310
1314
1311
1315
if (!use_stdout && reopen_stdout (numbered_files ? NULL : commit ,
1312
- & rev ))
1316
+ & rev , quiet ))
1313
1317
die (_ ("Failed to create output files" ));
1314
1318
shown = log_tree_commit (& rev , commit );
1315
1319
free (commit -> buffer );
0 commit comments