Sync with maint
authorJunio C Hamano <gitster@pobox.com>
Sun, 22 Mar 2009 06:24:11 +0000 (23:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Mar 2009 06:24:11 +0000 (23:24 -0700)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1  2 
Documentation/RelNotes-1.6.3.txt
Documentation/git-format-patch.txt
builtin-log.c
index 4353cbf8c32cf7384c8fffebbb63e8ca9764ada9,0000000000000000000000000000000000000000..5860b515f57adee9ebf0e3ddb4f8042a7f46dc8a
mode 100644,000000..100644
--- /dev/null
@@@ -1,133 -1,0 +1,114 @@@
- * "git diff --pickaxe-regexp" did not count overlapping matches
-   correctly (backport by cherry-picking 50fd699).
- * "git-fetch" in a repository that was not cloned from anywhere said
-   it cannot find 'origin', which was hard to understand for new people.
 +GIT v1.6.3 Release Notes
 +========================
 +
 +With the next major release, "git push" into a branch that is
 +currently checked out will be refused by default.  You can choose
 +what should happen upon such a push by setting the configuration
 +variable receive.denyCurrentBranch in the receiving repository.
 +
 +To ease the transition plan, the receiving repository of such a
 +push running this release will issue a big warning when the
 +configuration variable is missing.  Please refer to:
 +
 +  http://git.or.cz/gitwiki/GitFaq#non-bare
 +  http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007
 +
 +for more details on the reason why this change is needed and the
 +transition plan.
 +
 +For a similar reason, "git push $there :$killed" to delete the branch
 +$killed in a remote repository $there, if $killed branch is the current
 +branch pointed at by its HEAD, gets a large warning.  You can choose what
 +should happen upon such a push by setting the configuration variable
 +receive.denyDeleteCurrent in the receiving repository.
 +
 +
 +Updates since v1.6.2
 +--------------------
 +
 +(subsystems)
 +
 +(performance)
 +
 +* many uses of lstat(2) in the codepath for "git checkout" have been
 +  optimized out.
 +
 +(usability, bells and whistles)
 +
 +* rsync:/path/to/repo can be used to run git over rsync for local
 +  repositories.  It may not be useful in practice; meant primarily for
 +  testing.
 +
 +* (msysgit) progress output that is sent over the sideband protocol can
 +  be handled appropriately in Windows console.
 +
 +* "--pretty=<style>" option to the log family of commands can now be
 +  spelled as "--format=<style>".  In addition, --format=%formatstring
 +  is a short-hand for --pretty=tformat:%formatstring.
 +
 +* "--oneline" is a synonym for "--pretty=oneline --abbrev=commit".
 +
 +* If you realize that you botched the patch when you are editing hunks
 +  with the 'edit' action in git-add -i/-p, you can abort the editor to
 +  tell git not to apply it.
 +
 +* git-archive learned --output=<file> option.
 +
 +* git-bisect shows not just the number of remaining commits whose goodness
 +  is unknown, but also shows the estimated number of remaining rounds.
 +
 +* You can give --date=<format> option to git-blame.
 +
 +* git-branch -r shows HEAD symref that points at a remote branch in
 +  interest of each tracked remote repository.
 +
 +* git-config learned -e option to open an editor to edit the config file
 +  directly.
 +
 +* git-clone runs post-checkout hook when run without --no-checkout.
 +
 +* git-format-patch can be told to use attachment with a new configuration,
 +  format.attach.
 +
 +* git-format-patch can be told to produce deep or shallow message threads.
 +
 +* git-grep learned to highlight the found substrings in color.
 +
 +* git-imap-send learned to work around Thunderbird's inability to easily
 +  disable format=flowed with a new configuration, imap.preformattedHTML.
 +
 +* git-rebase can be told to rebase the series even if your branch is a
 +  descendant of the commit you are rebasing onto with --force-rebase
 +  option.
 +
 +* git-rebase can be told to report diffstat with the --stat option.
 +
 +* Output from git-remote command has been vastly improved.
 +
 +* git-send-email learned --confirm option to review the Cc: list before
 +  sending the messages out.
 +
 +(developers)
 +
 +* Test scripts can be run under valgrind.
 +
 +* Makefile learned 'coverage' option to run the test suites with
 +  coverage tracking enabled.
 +
 +Fixes since v1.6.2
 +------------------
 +
 +All of the fixes in v1.6.2.X maintenance series are included in this
 +release, unless otherwise noted.
 +
 +Here are fixes that this release has, but have not been backported to
 +v1.6.2.X series.
 +
- * "git-ls-files --deleted" did not work well with GIT_DIR&GIT_WORK_TREE
-   (backport by cherry-picking 8ad3dae).
- * "git-read-tree A B C..." without -m option has been broken for a long time
-   (backport by merging jc/maint-1.6.0-read-tree-overlay)
- * 'git-submodule add' did not tolerate extra slashes and ./ in the
-   path it accepted from the command line; it now is more lenient
-  (if needed, backport by merging db75ada).
- * git-send-email ignored --in-reply-to when --no-thread was given
-   (backport by merging tr/maint-1.6.0-send-email-irt)
 +* git-gc spent excessive amount of time to decide if an object appears
 +  in a locally existing pack (if needed, backport by merging 69e020a).
 +
 +---
 +exec >/var/tmp/1
 +O=v1.6.2.1-213-g7d4e3a7
 +echo O=$(git describe master)
 +git shortlog --no-merges $O..master ^maint
index c14e3ee395f465c761bcdcd71e49807286f08742,dc40f471694073b8aeb77c1cbe0491d458af3891..c2eb5fab4caff69b98fbcd3cb66d78e3371f81e4
@@@ -10,8 -10,7 +10,8 @@@ SYNOPSI
  --------
  [verse]
  'git format-patch' [-k] [-o <dir> | --stdout] [--thread]
 -                 [--attach[=<boundary>] | --inline[=<boundary>]]
 +                 [--attach[=<boundary>] | --inline[=<boundary>] |
 +                   [--no-attach]]
                   [-s | --signoff] [<common diff options>]
                   [-n | --numbered | -N | --no-numbered]
                   [--start-number <n>] [--numbered-files]
@@@ -97,7 -96,6 +97,6 @@@ include::diff-options.txt[
  --numbered-files::
        Output file names will be a simple number sequence
        without the default first line of the commit appended.
-       Mutually exclusive with the --stdout option.
  
  -k::
  --keep-subject::
        which is the commit message and the patch itself in the
        second part, with "Content-Disposition: attachment".
  
 +--no-attach::
 +      Disable the creation of an attachment, overriding the
 +      configuration setting.
 +
  --inline[=<boundary>]::
        Create multipart/mixed attachment, the first part of
        which is the commit message and the patch itself in the
        second part, with "Content-Disposition: inline".
  
 ---thread::
 +--thread[=<style>]::
        Add In-Reply-To and References headers to make the second and
        subsequent mails appear as replies to the first.  Also generates
        the Message-Id header to reference.
 ++
 +The optional <style> argument can be either `shallow` or `deep`.
 +'Shallow' threading makes every mail a reply to the head of the
 +series, where the head is chosen from the cover letter, the
 +`\--in-reply-to`, and the first patch mail, in this order.  'Deep'
 +threading makes every mail a reply to the previous one.  If not
 +specified, defaults to the 'format.thread' configuration, or `shallow`
 +if that is not set.
  
  --in-reply-to=Message-Id::
        Make the first mail (or all the mails with --no-thread) appear as a
@@@ -187,8 -173,7 +186,8 @@@ CONFIGURATIO
  -------------
  You can specify extra mail header lines to be added to each message
  in the repository configuration, new defaults for the subject prefix
 -and file suffix, and number patches when outputting more than one.
 +and file suffix, control attachements, and number patches when outputting
 +more than one.
  
  ------------
  [format]
        suffix = .txt
        numbered = auto
        cc = <email>
 +      attach [ = mime-boundary-string ]
  ------------
  
  
diff --combined builtin-log.c
index 8af55d28793ae1fb7180198fb4f63eb7783c6335,0f0adf2bab69328f5b6320c1baca58ad226570df..c7a57725948553a955f49ab891aed3fbdd3aa33d
@@@ -17,7 -17,6 +17,7 @@@
  #include "run-command.h"
  #include "shortlog.h"
  #include "remote.h"
 +#include "string-list.h"
  
  /* Set a default date-time format for git log ("log.date" config variable) */
  static const char *default_date_mode = NULL;
@@@ -429,8 -428,6 +429,8 @@@ static const char *fmt_patch_suffix = "
  static int numbered = 0;
  static int auto_number = 1;
  
 +static char *default_attach = NULL;
 +
  static char **extra_hdr;
  static int extra_hdr_nr;
  static int extra_hdr_alloc;
@@@ -462,10 -459,6 +462,10 @@@ static void add_header(const char *valu
        extra_hdr[extra_hdr_nr++] = xstrndup(value, len);
  }
  
 +#define THREAD_SHALLOW 1
 +#define THREAD_DEEP 2
 +static int thread = 0;
 +
  static int git_format_config(const char *var, const char *value, void *cb)
  {
        if (!strcmp(var, "format.headers")) {
                auto_number = auto_number && numbered;
                return 0;
        }
 +      if (!strcmp(var, "format.attach")) {
 +              if (value && *value)
 +                      default_attach = xstrdup(value);
 +              else
 +                      default_attach = xstrdup(git_version_string);
 +              return 0;
 +      }
 +      if (!strcmp(var, "format.thread")) {
 +              if (value && !strcasecmp(value, "deep")) {
 +                      thread = THREAD_DEEP;
 +                      return 0;
 +              }
 +              if (value && !strcasecmp(value, "shallow")) {
 +                      thread = THREAD_SHALLOW;
 +                      return 0;
 +              }
 +              thread = git_config_bool(var, value) && THREAD_SHALLOW;
 +              return 0;
 +      }
  
        return git_log_config(var, value, cb);
  }
@@@ -573,7 -547,7 +573,7 @@@ static FILE *realstdout = NULL
  static const char *output_directory = NULL;
  static int outdir_offset;
  
 -static int reopen_stdout(const char *oneline, int nr, int total)
 +static int reopen_stdout(const char *oneline, int nr, struct rev_info *rev)
  {
        char filename[PATH_MAX];
        int len = 0;
                strcpy(filename + len, fmt_patch_suffix);
        }
  
 -      fprintf(realstdout, "%s\n", filename + outdir_offset);
 +      if (!DIFF_OPT_TST(&rev->diffopt, QUIET))
 +              fprintf(realstdout, "%s\n", filename + outdir_offset);
 +
        if (freopen(filename, "w", stdout) == NULL)
                return error("Cannot open patch file %s",filename);
  
@@@ -689,7 -661,7 +689,7 @@@ static void make_cover_letter(struct re
                die("Cover letter needs email format");
  
        if (!use_stdout && reopen_stdout(numbered_files ?
 -                              NULL : "cover-letter", 0, rev->total))
 +                              NULL : "cover-letter", 0, rev))
                return;
  
        head_sha1 = sha1_to_hex(head->object.sha1);
@@@ -794,6 -766,7 +794,6 @@@ int cmd_format_patch(int argc, const ch
        int numbered_files = 0;         /* _just_ numbers */
        int subject_prefix = 0;
        int ignore_if_in_upstream = 0;
 -      int thread = 0;
        int cover_letter = 0;
        int boundary_count = 0;
        int no_binary_diff = 0;
  
        rev.subject_prefix = fmt_patch_subject_prefix;
  
 +      if (default_attach) {
 +              rev.mime_boundary = default_attach;
 +              rev.no_inline = 1;
 +      }
 +
        /*
         * Parse the arguments before setup_revisions(), or something
         * like "git format-patch -o a123 HEAD^.." may fail; a123 is
                        rev.mime_boundary = argv[i] + 9;
                        rev.no_inline = 1;
                }
 +              else if (!strcmp(argv[i], "--no-attach")) {
 +                      rev.mime_boundary = NULL;
 +                      rev.no_inline = 0;
 +              }
                else if (!strcmp(argv[i], "--inline")) {
                        rev.mime_boundary = git_version_string;
                        rev.no_inline = 0;
                }
                else if (!strcmp(argv[i], "--ignore-if-in-upstream"))
                        ignore_if_in_upstream = 1;
 -              else if (!strcmp(argv[i], "--thread"))
 -                      thread = 1;
 +              else if (!strcmp(argv[i], "--thread")
 +                      || !strcmp(argv[i], "--thread=shallow"))
 +                      thread = THREAD_SHALLOW;
 +              else if (!strcmp(argv[i], "--thread=deep"))
 +                      thread = THREAD_DEEP;
 +              else if (!strcmp(argv[i], "--no-thread"))
 +                      thread = 0;
                else if (!prefixcmp(argv[i], "--in-reply-to="))
                        in_reply_to = argv[i] + 14;
                else if (!strcmp(argv[i], "--in-reply-to")) {
                die ("-n and -k are mutually exclusive.");
        if (keep_subject && subject_prefix)
                die ("--subject-prefix and -k are mutually exclusive.");
-       if (numbered_files && use_stdout)
-               die ("--numbered-files and --stdout are mutually exclusive.");
  
        argc = setup_revisions(argc, argv, &rev, "HEAD");
        if (argc > 1)
                numbered = 1;
        if (numbered)
                rev.total = total + start_number - 1;
 -      if (in_reply_to)
 -              rev.ref_message_id = clean_message_id(in_reply_to);
 +      if (in_reply_to || thread || cover_letter)
 +              rev.ref_message_ids = xcalloc(1, sizeof(struct string_list));
 +      if (in_reply_to) {
 +              const char *msgid = clean_message_id(in_reply_to);
 +              string_list_append(msgid, rev.ref_message_ids);
 +      }
        if (cover_letter) {
                if (thread)
                        gen_message_id(&rev, "cover");
                        /* Have we already had a message ID? */
                        if (rev.message_id) {
                                /*
 -                               * If we've got the ID to be a reply
 -                               * to, discard the current ID;
 -                               * otherwise, make everything a reply
 -                               * to that.
 +                               * For deep threading: make every mail
 +                               * a reply to the previous one, no
 +                               * matter what other options are set.
 +                               *
 +                               * For shallow threading:
 +                               *
 +                               * Without --cover-letter and
 +                               * --in-reply-to, make every mail a
 +                               * reply to the one before.
 +                               *
 +                               * With --in-reply-to but no
 +                               * --cover-letter, make every mail a
 +                               * reply to the <reply-to>.
 +                               *
 +                               * With --cover-letter, make every
 +                               * mail but the cover letter a reply
 +                               * to the cover letter.  The cover
 +                               * letter is a reply to the
 +                               * --in-reply-to, if specified.
                                 */
 -                              if (rev.ref_message_id)
 +                              if (thread == THREAD_SHALLOW
 +                                  && rev.ref_message_ids->nr > 0
 +                                  && (!cover_letter || rev.nr > 1))
                                        free(rev.message_id);
                                else
 -                                      rev.ref_message_id = rev.message_id;
 +                                      string_list_append(rev.message_id,
 +                                                         rev.ref_message_ids);
                        }
                        gen_message_id(&rev, sha1_to_hex(commit->object.sha1));
                }
                if (!use_stdout && reopen_stdout(numbered_files ? NULL :
                                get_oneline_for_filename(commit, keep_subject),
 -                              rev.nr, rev.total))
 +                              rev.nr, &rev))
                        die("Failed to create output files");
                shown = log_tree_commit(&rev, commit);
                free(commit->buffer);