Merge branch 'mv/format-cc'
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 May 2008 20:34:34 +0000 (13:34 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 May 2008 20:34:34 +0000 (13:34 -0700)
* 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

1  2 
Documentation/git-format-patch.txt
builtin-log.c
index 7548a21d352f0625a114f48c3063612f2a063436,2336b3e3c2829d5da712c1d477da1f93a2f382c3..c60ce123ec745e1903da0b5ab50e4efabeeb5dc3
@@@ -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 = <email>
  ------------
  
  
  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 80a01f8d44a40608e989b1cc1973a28c0b9040a5,d7907c942f3d7c04b44fff497e339c0fcd7de5ff..9d046b2e035bfa6ae63d6d004e5a92072a202d70
@@@ -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;
        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;
                        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];
        }
        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)