From: Junio C Hamano Date: Sat, 29 Aug 2009 02:38:19 +0000 (-0700) Subject: Merge branch 'jc/shortstatus' X-Git-Tag: v1.6.5-rc0~26 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/433233e0b60e55e1afcded413e78c85fde4db722?hp=-c Merge branch 'jc/shortstatus' * jc/shortstatus: git commit --dry-run -v: show diff in color when asked Documentation/git-commit.txt: describe --dry-run wt-status: collect untracked files in a separate "collect" phase Make git_status_config() file scope static to builtin-commit.c wt-status: move wt_status_colors[] into wt_status structure wt-status: move many global settings to wt_status structure commit: --dry-run status: show worktree status of conflicted paths separately wt-status.c: rework the way changes to the index and work tree are summarized diff-index: keep the original index intact diff-index: report unmerged new entries --- 433233e0b60e55e1afcded413e78c85fde4db722 diff --combined diff-lib.c index 22da66ef14,2a82dac101..0c74ef5cbe --- a/diff-lib.c +++ b/diff-lib.c @@@ -162,8 -162,7 +162,8 @@@ int run_diff_files(struct rev_info *rev if (ce_uptodate(ce)) continue; - changed = check_removed(ce, &st); + /* If CE_VALID is set, don't look at workdir for file removal */ + changed = (ce->ce_flags & CE_VALID) ? 0 : check_removed(ce, &st); if (changed) { if (changed < 0) { perror(ce->name); @@@ -309,22 -308,6 +309,6 @@@ static int show_modified(struct rev_inf return 0; } - /* - * This turns all merge entries into "stage 3". That guarantees that - * when we read in the new tree (into "stage 1"), we won't lose sight - * of the fact that we had unmerged entries. - */ - static void mark_merge_entries(void) - { - int i; - for (i = 0; i < active_nr; i++) { - struct cache_entry *ce = active_cache[i]; - if (!ce_stage(ce)) - continue; - ce->ce_flags |= CE_STAGEMASK; - } - } - /* * This gets a mix of an existing index and a tree, one pathname entry * at a time. The index entry may be a single stage-0 one, but it could @@@ -338,8 -321,6 +322,8 @@@ static void do_oneway_diff(struct unpac struct rev_info *revs = o->unpack_data; int match_missing, cached; + /* if the entry is not checked out, don't examine work tree */ + cached = o->index_only || (idx && (idx->ce_flags & CE_VALID)); /* * Backward compatibility wart - "diff-index -m" does * not mean "do not ignore merges", but "match_missing". @@@ -347,11 -328,12 +331,11 @@@ * But with the revision flag parsing, that's found in * "!revs->ignore_merges". */ - cached = o->index_only; match_missing = !revs->ignore_merges; if (cached && idx && ce_stage(idx)) { - if (tree) - diff_unmerge(&revs->diffopt, idx->name, idx->ce_mode, idx->sha1); + diff_unmerge(&revs->diffopt, idx->name, idx->ce_mode, + idx->sha1); return; } @@@ -437,8 -419,6 +421,6 @@@ int run_diff_index(struct rev_info *rev struct unpack_trees_options opts; struct tree_desc t; - mark_merge_entries(); - ent = revs->pending.objects[0].item; tree_name = revs->pending.objects[0].name; tree = parse_tree_indirect(ent->sha1);