Merge branch 'master' into next
authorJunio C Hamano <junkio@cox.net>
Thu, 4 May 2006 00:18:21 +0000 (17:18 -0700)
committerJunio C Hamano <junkio@cox.net>
Thu, 4 May 2006 00:18:21 +0000 (17:18 -0700)
* master:
fix various typos in documentation
blame: Fix path pruning
cvsserver: use git-rev-list instead of git-log
Fix "git-log --parents" breakage post v1.3.0
add documentation for update-index --unresolve

1  2 
log-tree.c
revision.c
update-index.c
diff --combined log-tree.c
index aaf2b9423f01243584e15e6c93007a3f42c9d917,b90ba6762ad0aa469a19c42cf8d53f7a79db02d5..d92abaf64bc3cecce06f09d1e523c8f203a93b06
@@@ -3,6 -3,15 +3,15 @@@
  #include "commit.h"
  #include "log-tree.h"
  
+ static void show_parents(struct commit *commit, int abbrev)
+ {
+       struct commit_list *p;
+       for (p = commit->parents; p ; p = p->next) {
+               struct commit *parent = p->item;
+               printf(" %s", diff_unique_abbrev(parent->object.sha1, abbrev));
+       }
+ }
  void show_log(struct rev_info *opt, struct log_info *log, const char *sep)
  {
        static char this_header[16384];
  
        opt->loginfo = NULL;
        if (!opt->verbose_header) {
-               puts(sha1_to_hex(commit->object.sha1));
+               fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
+               if (opt->parents)
+                       show_parents(commit, abbrev_commit);
+               putchar('\n');
                return;
        }
  
        /*
         * Print header line of header..
         */
 -      printf("%s%s",
 -              opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ",
 -              diff_unique_abbrev(commit->object.sha1, abbrev_commit));
 -      if (opt->parents)
 -              show_parents(commit, abbrev_commit);
 -      if (parent)
 -              printf(" (from %s)", diff_unique_abbrev(parent->object.sha1, abbrev_commit));
 -      putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');
 +
 +      if (opt->commit_format == CMIT_FMT_EMAIL)
 +              printf("From %s  Thu Apr 7 15:13:13 2005\n",
 +                     sha1_to_hex(commit->object.sha1));
 +      else {
 +              printf("%s%s",
 +                     opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ",
 +                     diff_unique_abbrev(commit->object.sha1, abbrev_commit));
++              if (opt->parents)
++                      show_parents(commit, abbrev_commit);
 +              if (parent) 
 +                      printf(" (from %s)",
 +                             diff_unique_abbrev(parent->object.sha1,
 +                                                abbrev_commit));
 +              putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');
 +      }
  
        /*
         * And then the pretty-printed message itself
@@@ -160,18 -166,15 +174,18 @@@ static int log_tree_diff(struct rev_inf
  int log_tree_commit(struct rev_info *opt, struct commit *commit)
  {
        struct log_info log;
 +      int shown;
  
        log.commit = commit;
        log.parent = NULL;
        opt->loginfo = &log;
  
 -      if (!log_tree_diff(opt, commit, &log) && opt->loginfo && opt->always_show_header) {
 +      shown = log_tree_diff(opt, commit, &log);
 +      if (!shown && opt->loginfo && opt->always_show_header) {
                log.parent = NULL;
                show_log(opt, opt->loginfo, "");
 +              shown = 1;
        }
        opt->loginfo = NULL;
 -      return 0;
 +      return shown;
  }
diff --combined revision.c
index 846c9ec463e9b7e4fd2f7b4e41c5ee1aa7a7007c,c6e8702f380ccb9be914ae7608e9f6c3ec77d796..f8ee38e54d52661cf91842e9f2fd14f74983a5d6
@@@ -574,7 -574,7 +574,7 @@@ int setup_revisions(int argc, const cha
                                revs->max_count = atoi(arg + 12);
                                continue;
                        }
-                       /* accept -<digit>, like traditilnal "head" */
+                       /* accept -<digit>, like traditional "head" */
                        if ((*arg == '-') && isdigit(arg[1])) {
                                revs->max_count = atoi(arg + 1);
                                continue;
                        }
                        if (!strcmp(arg, "-c")) {
                                revs->diff = 1;
 +                              revs->dense_combined_merges = 0;
                                revs->combine_merges = 1;
                                continue;
                        }
diff --combined update-index.c
index 1c1f13bd7044ad78800b4f9faa0ff1b05b9b6c21,9fa3d2bb96a6e01a6d28fa80efc60871ca32dbf9..061b18c1a568539cbaf2dae3e80c479fe06df2d8
@@@ -6,7 -6,6 +6,7 @@@
  #include "cache.h"
  #include "strbuf.h"
  #include "quote.h"
 +#include "cache-tree.h"
  #include "tree-walk.h"
  
  /*
@@@ -72,7 -71,6 +72,7 @@@ static int mark_valid(const char *path
                        active_cache[pos]->ce_flags &= ~htons(CE_VALID);
                        break;
                }
 +              cache_tree_invalidate_path(active_cache_tree, path);
                active_cache_changed = 1;
                return 0;
        }
@@@ -86,12 -84,6 +86,12 @@@ static int add_file_to_cache(const cha
        struct stat st;
  
        status = lstat(path, &st);
 +
 +      /* We probably want to do this in remove_file_from_cache() and
 +       * add_cache_entry() instead...
 +       */
 +      cache_tree_invalidate_path(active_cache_tree, path);
 +
        if (status < 0 || S_ISDIR(st.st_mode)) {
                /* When we used to have "path" and now we want to add
                 * "path/file", we need a way to remove "path" before
@@@ -334,7 -326,6 +334,7 @@@ static int add_cacheinfo(unsigned int m
                return error("%s: cannot add to the index - missing --add option?",
                             path);
        report("add '%s'", path);
 +      cache_tree_invalidate_path(active_cache_tree, path);
        return 0;
  }
  
@@@ -359,7 -350,6 +359,7 @@@ static void chmod_path(int flip, const 
        default:
                goto fail;
        }
 +      cache_tree_invalidate_path(active_cache_tree, path);
        active_cache_changed = 1;
        report("chmod %cx '%s'", flip, path);
        return;
@@@ -381,7 -371,6 +381,7 @@@ static void update_one(const char *path
                        die("Unable to mark file %s", path);
                return;
        }
 +      cache_tree_invalidate_path(active_cache_tree, path);
  
        if (force_remove) {
                if (remove_file_from_cache(p))
@@@ -457,7 -446,6 +457,7 @@@ static void read_index_info(int line_te
                                free(path_name);
                        continue;
                }
 +              cache_tree_invalidate_path(active_cache_tree, path_name);
  
                if (!mode) {
                        /* mode == 0 means there is no such path -- remove */
  }
  
  static const char update_index_usage[] =
- "git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--cacheinfo] [--chmod=(+|-)x] [--info-only] [--force-remove] [--stdin] [--index-info] [--ignore-missing] [-z] [--verbose] [--] <file>...";
+ "git-update-index [-q] [--add] [--replace] [--remove] [--unmerged] [--refresh] [--really-refresh] [--cacheinfo] [--chmod=(+|-)x] [--assume-unchanged] [--info-only] [--force-remove] [--stdin] [--index-info] [--unresolve] [--ignore-missing] [-z] [--verbose] [--] <file>...";
  
  static unsigned char head_sha1[20];
  static unsigned char merge_head_sha1[20];
@@@ -562,7 -550,6 +562,7 @@@ static int unresolve_one(const char *pa
                goto free_return;
        }
  
 +      cache_tree_invalidate_path(active_cache_tree, path);
        remove_file_from_cache(path);
        if (add_cache_entry(ce_2, ADD_CACHE_OK_TO_ADD)) {
                error("%s: cannot add our version to the index.", path);