From: Junio C Hamano Date: Thu, 4 May 2006 00:18:21 +0000 (-0700) Subject: Merge branch 'master' into next X-Git-Tag: v1.4.1-rc1~137 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e33b1dfe2834ceca1c449ec653dea636ca2d0200?hp=-c Merge branch 'master' into next * 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 --- e33b1dfe2834ceca1c449ec653dea636ca2d0200 diff --combined log-tree.c index aaf2b9423f,b90ba6762a..d92abaf64b --- a/log-tree.c +++ b/log-tree.c @@@ -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]; @@@ -14,7 -23,10 +23,10 @@@ 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; } @@@ -37,20 -49,14 +49,22 @@@ /* * 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 846c9ec463,c6e8702f38..f8ee38e54d --- a/revision.c +++ b/revision.c @@@ -574,7 -574,7 +574,7 @@@ int setup_revisions(int argc, const cha revs->max_count = atoi(arg + 12); continue; } - /* accept -, like traditilnal "head" */ + /* accept -, like traditional "head" */ if ((*arg == '-') && isdigit(arg[1])) { revs->max_count = atoi(arg + 1); continue; @@@ -694,7 -694,6 +694,7 @@@ } if (!strcmp(arg, "-c")) { revs->diff = 1; + revs->dense_combined_merges = 0; revs->combine_merges = 1; continue; } diff --combined update-index.c index 1c1f13bd70,9fa3d2bb96..061b18c1a5 --- a/update-index.c +++ b/update-index.c @@@ -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 */ @@@ -485,7 -473,7 +485,7 @@@ } 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] [--] ..."; + "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] [--] ..."; 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);