@ -1196,6 +1196,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
int cover_letter = -1;
int cover_letter = -1;
int boundary_count = 0;
int boundary_count = 0;
int no_binary_diff = 0;
int no_binary_diff = 0;
int zero_commit = 0;
struct commit *origin = NULL;
struct commit *origin = NULL;
const char *in_reply_to = NULL;
const char *in_reply_to = NULL;
struct patch_ids ids;
struct patch_ids ids;
@ -1236,6 +1237,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
PARSE_OPT_NOARG | PARSE_OPT_NONEG, keep_callback },
PARSE_OPT_NOARG | PARSE_OPT_NONEG, keep_callback },
OPT_BOOL(0, "no-binary", &no_binary_diff,
OPT_BOOL(0, "no-binary", &no_binary_diff,
N_("don't output binary diffs")),
N_("don't output binary diffs")),
OPT_BOOL(0, "zero-commit", &zero_commit,
N_("output all-zero hash in From header")),
OPT_BOOL(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
OPT_BOOL(0, "ignore-if-in-upstream", &ignore_if_in_upstream,
N_("don't include a patch matching a commit upstream")),
N_("don't include a patch matching a commit upstream")),
{ OPTION_SET_INT, 'p', "no-stat", &use_patch_format, NULL,
{ OPTION_SET_INT, 'p', "no-stat", &use_patch_format, NULL,
@ -1380,6 +1383,8 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
/* Always generate a patch */
/* Always generate a patch */
rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
rev.zero_commit = zero_commit;
if (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)
if (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)
DIFF_OPT_SET(&rev.diffopt, BINARY);
DIFF_OPT_SET(&rev.diffopt, BINARY);