From: Junio C Hamano Date: Wed, 14 May 2008 20:34:34 +0000 (-0700) Subject: Merge branch 'mv/format-cc' X-Git-Tag: v1.5.6-rc0~58 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/486d1a56443fb19770a7d1abe08f1f4e9e44534d?hp=-c Merge branch 'mv/format-cc' * mv/format-cc: Add tests for sendemail.cc configuration variable git-send-email: add a new sendemail.cc configuration variable git-format-patch: add a new format.cc configuration variable --- 486d1a56443fb19770a7d1abe08f1f4e9e44534d diff --combined Documentation/git-format-patch.txt index 7548a21d35,2336b3e3c2..c60ce123ec --- a/Documentation/git-format-patch.txt +++ b/Documentation/git-format-patch.txt @@@ -156,12 -156,6 +156,12 @@@ want a filename like `0001-description- the first letter does not have to be a dot. Leaving it empty would not add any suffix. +--no-binary:: + Don't output contents of changes in binary files, just take note + that they differ. Note that this disable the patch to be properly + applied. By default the contents of changes in those files are + encoded in the patch. + CONFIGURATION ------------- You can specify extra mail header lines to be added to each message @@@ -174,53 -168,39 +174,54 @@@ and file suffix, and number patches whe subjectprefix = CHANGE suffix = .txt numbered = auto + cc = ------------ EXAMPLES -------- -git-format-patch -k --stdout R1..R2 | git-am -3 -k:: - Extract commits between revisions R1 and R2, and apply - them on top of the current branch using `git-am` to - cherry-pick them. - -git-format-patch origin:: - Extract all commits which are in the current branch but - not in the origin branch. For each commit a separate file - is created in the current directory. - -git-format-patch \--root origin:: - Extract all commits that lead to 'origin' since the - inception of the project. - -git-format-patch -M -B origin:: - The same as the previous one. Additionally, it detects - and handles renames and complete rewrites intelligently to - produce a renaming patch. A renaming patch reduces the - amount of text output, and generally makes it easier to - review it. Note that the "patch" program does not - understand renaming patches, so use it only when you know - the recipient uses git to apply your patch. - -git-format-patch -3:: - Extract three topmost commits from the current branch - and format them as e-mailable patches. +* Extract commits between revisions R1 and R2, and apply them on top of +the current branch using `git-am` to cherry-pick them: ++ +------------ +$ git format-patch -k --stdout R1..R2 | git-am -3 -k +------------ + +* Extract all commits which are in the current branch but not in the +origin branch: ++ +------------ +$ git format-patch origin +------------ ++ +For each commit a separate file is created in the current directory. + +* Extract all commits that lead to 'origin' since the inception of the +project: ++ +------------ +$ git format-patch \--root origin +------------ + +* The same as the previous one: ++ +------------ +$ git format-patch -M -B origin +------------ ++ +Additionally, it detects and handles renames and complete rewrites +intelligently to produce a renaming patch. A renaming patch reduces +the amount of text output, and generally makes it easier to review it. +Note that the "patch" program does not understand renaming patches, so +use it only when you know the recipient uses git to apply your patch. + +* Extract three topmost commits from the current branch and format them +as e-mailable patches: ++ +------------ +$ git format-patch -3 +------------ See Also -------- diff --combined builtin-log.c index 80a01f8d44,d7907c942f..9d046b2e03 --- a/builtin-log.c +++ b/builtin-log.c @@@ -485,6 -485,13 +485,13 @@@ static int git_format_config(const cha fmt_patch_suffix = xstrdup(value); return 0; } + if (!strcmp(var, "format.cc")) { + if (!value) + return config_error_nonbool(var); + ALLOC_GROW(extra_cc, extra_cc_nr + 1, extra_cc_alloc); + extra_cc[extra_cc_nr++] = xstrdup(value); + return 0; + } if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) { return 0; } @@@ -757,7 -764,6 +764,7 @@@ int cmd_format_patch(int argc, const ch int thread = 0; int cover_letter = 0; int boundary_count = 0; + int no_binary_diff = 0; struct commit *origin = NULL, *head = NULL; const char *in_reply_to = NULL; struct patch_ids ids; @@@ -771,6 -777,7 +778,6 @@@ rev.diff = 1; rev.combine_merges = 0; rev.ignore_merges = 1; - rev.diffopt.msg_sep = ""; DIFF_OPT_SET(&rev.diffopt, RECURSIVE); rev.subject_prefix = fmt_patch_subject_prefix; @@@ -863,8 -870,6 +870,8 @@@ fmt_patch_suffix = argv[i] + 9; else if (!strcmp(argv[i], "--cover-letter")) cover_letter = 1; + else if (!strcmp(argv[i], "--no-binary")) + no_binary_diff = 1; else argv[j++] = argv[i]; } @@@ -917,7 -922,7 +924,7 @@@ if (!rev.diffopt.output_format) rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH; - if (!DIFF_OPT_TST(&rev.diffopt, TEXT)) + if (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff) DIFF_OPT_SET(&rev.diffopt, BINARY); if (!output_directory && !use_stdout)