@@ -623,7 +623,7 @@ static FILE *realstdout = NULL;
623
623
static const char * output_directory = NULL ;
624
624
static int outdir_offset ;
625
625
626
- static int reopen_stdout (struct commit * commit , struct rev_info * rev )
626
+ static int reopen_stdout (struct commit * commit , struct rev_info * rev , int quiet )
627
627
{
628
628
struct strbuf filename = STRBUF_INIT ;
629
629
int suffix_len = strlen (fmt_patch_suffix ) + 1 ;
@@ -639,7 +639,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
639
639
640
640
get_patch_filename (commit , rev -> nr , fmt_patch_suffix , & filename );
641
641
642
- if (!DIFF_OPT_TST ( & rev -> diffopt , QUICK ) )
642
+ if (!quiet )
643
643
fprintf (realstdout , "%s\n" , filename .buf + outdir_offset );
644
644
645
645
if (freopen (filename .buf , "w" , stdout ) == NULL )
@@ -718,7 +718,8 @@ static void print_signature(void)
718
718
static void make_cover_letter (struct rev_info * rev , int use_stdout ,
719
719
int numbered , int numbered_files ,
720
720
struct commit * origin ,
721
- int nr , struct commit * * list , struct commit * head )
721
+ int nr , struct commit * * list , struct commit * head ,
722
+ int quiet )
722
723
{
723
724
const char * committer ;
724
725
const char * subject_start = NULL ;
@@ -754,7 +755,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
754
755
sha1_to_hex (head -> object .sha1 ), committer , committer );
755
756
}
756
757
757
- if (!use_stdout && reopen_stdout (commit , rev ))
758
+ if (!use_stdout && reopen_stdout (commit , rev , quiet ))
758
759
return ;
759
760
760
761
if (commit ) {
@@ -995,6 +996,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
995
996
char * add_signoff = NULL ;
996
997
struct strbuf buf = STRBUF_INIT ;
997
998
int use_patch_format = 0 ;
999
+ int quiet = 0 ;
998
1000
const struct option builtin_format_patch_options [] = {
999
1001
{ OPTION_CALLBACK , 'n' , "numbered" , & numbered , NULL ,
1000
1002
"use [PATCH n/m] even with a single patch" ,
@@ -1050,6 +1052,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1050
1052
PARSE_OPT_OPTARG , thread_callback },
1051
1053
OPT_STRING (0 , "signature" , & signature , "signature" ,
1052
1054
"add a signature" ),
1055
+ OPT_BOOLEAN (0 , "quiet" , & quiet ,
1056
+ "don't print the patch filenames" ),
1053
1057
OPT_END ()
1054
1058
};
1055
1059
@@ -1259,7 +1263,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1259
1263
if (thread )
1260
1264
gen_message_id (& rev , "cover" );
1261
1265
make_cover_letter (& rev , use_stdout , numbered , numbered_files ,
1262
- origin , nr , list , head );
1266
+ origin , nr , list , head , quiet );
1263
1267
total ++ ;
1264
1268
start_number -- ;
1265
1269
}
@@ -1305,7 +1309,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1305
1309
}
1306
1310
1307
1311
if (!use_stdout && reopen_stdout (numbered_files ? NULL : commit ,
1308
- & rev ))
1312
+ & rev , quiet ))
1309
1313
die (_ ("Failed to create output files" ));
1310
1314
shown = log_tree_commit (& rev , commit );
1311
1315
free (commit -> buffer );
0 commit comments