Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sat, 20 Sep 2008 06:15:44 +0000 (23:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 20 Sep 2008 06:15:44 +0000 (23:15 -0700)
* maint:
Start draft release notes for 1.6.0.3
git-repack uses --no-repack-object, not --no-repack-delta.
Typo "bogos" in format-patch error message.
builtin-clone: fix typo
Bust the ghost of long-defunct diffcore-pathspec.
completion: git commit should list --interactive

Conflicts:
RelNotes

1  2 
builtin-log.c
contrib/completion/git-completion.bash
diff --combined builtin-log.c
index 081e660f6ff3cea2171e0ce30bdef2c347293863,2efe5937346ee7c0a4d85e4087a4ea49a9806005..fc5e4da822c470fdb2fb4738874a56e0103a2013
@@@ -14,6 -14,7 +14,6 @@@
  #include "tag.h"
  #include "reflog-walk.h"
  #include "patch-ids.h"
 -#include "refs.h"
  #include "run-command.h"
  #include "shortlog.h"
  
@@@ -24,6 -25,31 +24,6 @@@ static int default_show_root = 1
  static const char *fmt_patch_subject_prefix = "PATCH";
  static const char *fmt_pretty;
  
 -static void add_name_decoration(const char *prefix, const char *name, struct object *obj)
 -{
 -      int plen = strlen(prefix);
 -      int nlen = strlen(name);
 -      struct name_decoration *res = xmalloc(sizeof(struct name_decoration) + plen + nlen);
 -      memcpy(res->name, prefix, plen);
 -      memcpy(res->name + plen, name, nlen + 1);
 -      res->next = add_decoration(&name_decoration, obj, res);
 -}
 -
 -static int add_ref_decoration(const char *refname, const unsigned char *sha1, int flags, void *cb_data)
 -{
 -      struct object *obj = parse_object(sha1);
 -      if (!obj)
 -              return 0;
 -      add_name_decoration("", refname, obj);
 -      while (obj->type == OBJ_TAG) {
 -              obj = ((struct tag *)obj)->tagged;
 -              if (!obj)
 -                      break;
 -              add_name_decoration("tag: ", refname, obj);
 -      }
 -      return 0;
 -}
 -
  static void cmd_log_init(int argc, const char **argv, const char *prefix,
                      struct rev_info *rev)
  {
@@@ -54,7 -80,8 +54,7 @@@
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
                if (!strcmp(arg, "--decorate")) {
 -                      if (!decorate)
 -                              for_each_ref(add_ref_decoration, NULL);
 +                      load_ref_decorations();
                        decorate = 1;
                } else
                        die("unrecognized argument: %s", arg);
@@@ -190,11 -217,6 +190,11 @@@ static int cmd_log_walk(struct rev_inf
        if (rev->early_output)
                finish_early_output(rev);
  
 +      /*
 +       * For --check and --exit-code, the exit code is based on CHECK_FAILED
 +       * and HAS_CHANGES being accumulated in rev->diffopt, so be careful to
 +       * retain that state information if replacing rev->diffopt in this loop
 +       */
        while ((commit = get_revision(rev)) != NULL) {
                log_tree_commit(rev, commit);
                if (!rev->reflog_info) {
                free_commit_list(commit->parents);
                commit->parents = NULL;
        }
 -      return 0;
 +      if (rev->diffopt.output_format & DIFF_FORMAT_CHECKDIFF &&
 +          DIFF_OPT_TST(&rev->diffopt, CHECK_FAILED)) {
 +              return 02;
 +      }
 +      return diff_result_code(&rev->diffopt, 0);
  }
  
  static int git_log_config(const char *var, const char *value, void *cb)
@@@ -817,7 -835,7 +817,7 @@@ int cmd_format_patch(int argc, const ch
                        committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
                        endpos = strchr(committer, '>');
                        if (!endpos)
-                               die("bogos committer info %s\n", committer);
+                               die("bogus committer info %s\n", committer);
                        add_signoff = xmemdupz(committer, endpos - committer + 1);
                }
                else if (!strcmp(argv[i], "--attach")) {
        if (argc > 1)
                die ("unrecognized argument: %s", argv[1]);
  
 -      if (!rev.diffopt.output_format)
 +      if (!rev.diffopt.output_format
 +              || rev.diffopt.output_format == DIFF_FORMAT_PATCH)
                rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT | DIFF_FORMAT_SUMMARY | DIFF_FORMAT_PATCH;
  
        if (!DIFF_OPT_TST(&rev.diffopt, TEXT) && !no_binary_diff)
index fccb4998504f1b9773fddc25b2335306bdac01f9,3bc45f6b47837489f36e34b7af43f2be52838272..93f088189e6b65e03eddea9013273f0559837d26
@@@ -154,8 -154,11 +154,8 @@@ __git_heads (
  {
        local cmd i is_hash=y dir="$(__gitdir "$1")"
        if [ -d "$dir" ]; then
 -              for i in $(git --git-dir="$dir" \
 -                      for-each-ref --format='%(refname)' \
 -                      refs/heads ); do
 -                      echo "${i#refs/heads/}"
 -              done
 +              git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
 +                      refs/heads
                return
        fi
        for i in $(git ls-remote "$1" 2>/dev/null); do
@@@ -172,8 -175,11 +172,8 @@@ __git_tags (
  {
        local cmd i is_hash=y dir="$(__gitdir "$1")"
        if [ -d "$dir" ]; then
 -              for i in $(git --git-dir="$dir" \
 -                      for-each-ref --format='%(refname)' \
 -                      refs/tags ); do
 -                      echo "${i#refs/tags/}"
 -              done
 +              git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
 +                      refs/tags
                return
        fi
        for i in $(git ls-remote "$1" 2>/dev/null); do
@@@ -191,8 -197,16 +191,8 @@@ __git_refs (
        local cmd i is_hash=y dir="$(__gitdir "$1")"
        if [ -d "$dir" ]; then
                if [ -e "$dir/HEAD" ]; then echo HEAD; fi
 -              for i in $(git --git-dir="$dir" \
 -                      for-each-ref --format='%(refname)' \
 -                      refs/tags refs/heads refs/remotes); do
 -                      case "$i" in
 -                              refs/tags/*)    echo "${i#refs/tags/}" ;;
 -                              refs/heads/*)   echo "${i#refs/heads/}" ;;
 -                              refs/remotes/*) echo "${i#refs/remotes/}" ;;
 -                              *)              echo "$i" ;;
 -                      esac
 -              done
 +              git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
 +                      refs/tags refs/heads refs/remotes
                return
        fi
        for i in $(git ls-remote "$dir" 2>/dev/null); do
@@@ -736,7 -750,7 +736,7 @@@ _git_commit (
        --*)
                __gitcomp "
                        --all --author= --signoff --verify --no-verify
-                       --edit --amend --include --only
+                       --edit --amend --include --only --interactive
                        "
                return
        esac
@@@ -1479,7 -1493,7 +1479,7 @@@ _git_submodule (
  {
        __git_has_doubledash && return
  
 -      local subcommands="add status init update"
 +      local subcommands="add status init update summary foreach sync"
        if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
                local cur="${COMP_WORDS[COMP_CWORD]}"
                case "$cur" in