diff options
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/revision.c b/revision.c index 8b2dfe3160..8a29cb03c5 100644 --- a/revision.c +++ b/revision.c @@ -59,10 +59,10 @@ static void mark_tree_contents_uninteresting(struct tree *tree) while (tree_entry(&desc, &entry)) { switch (object_type(entry.mode)) { case OBJ_TREE: - mark_tree_uninteresting(lookup_tree(entry.sha1)); + mark_tree_uninteresting(lookup_tree(entry.oid->hash)); break; case OBJ_BLOB: - mark_blob_uninteresting(lookup_blob(entry.sha1)); + mark_blob_uninteresting(lookup_blob(entry.oid->hash)); break; default: /* Subproject commit - not in this repository */ @@ -846,7 +846,7 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs) */ if (left_first != !!(flags & SYMMETRIC_LEFT)) continue; - commit->util = add_commit_patch_id(commit, &ids); + add_commit_patch_id(commit, &ids); } /* either cherry_mark or cherry_pick are true */ @@ -873,21 +873,9 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs) id = has_commit_patch_id(commit, &ids); if (!id) continue; - id->seen = 1; - commit->object.flags |= cherry_flag; - } - - /* Now check the original side for seen ones */ - for (p = list; p; p = p->next) { - struct commit *commit = p->item; - struct patch_id *ent; - ent = commit->util; - if (!ent) - continue; - if (ent->seen) - commit->object.flags |= cherry_flag; - commit->util = NULL; + commit->object.flags |= cherry_flag; + id->commit->object.flags |= cherry_flag; } free_patch_ids(&ids); @@ -1356,8 +1344,10 @@ void init_revisions(struct rev_info *revs, const char *prefix) revs->skip_count = -1; revs->max_count = -1; revs->max_parents = -1; + revs->expand_tabs_in_log = -1; revs->commit_format = CMIT_FMT_DEFAULT; + revs->expand_tabs_in_log_default = 8; init_grep_defaults(); grep_init(&revs->grep_filter, prefix); @@ -1423,7 +1413,7 @@ static void prepare_show_merge(struct rev_info *revs) ce_same_name(ce, active_cache[i+1])) i++; } - free_pathspec(&revs->prune_data); + clear_pathspec(&revs->prune_data); parse_pathspec(&revs->prune_data, PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL, PATHSPEC_PREFER_FULL | PATHSPEC_LITERAL_PATH, "", prune); revs->limited = 1; @@ -1854,12 +1844,23 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg revs->verbose_header = 1; revs->pretty_given = 1; get_commit_format(arg+9, revs); + } else if (!strcmp(arg, "--expand-tabs")) { + revs->expand_tabs_in_log = 8; + } else if (!strcmp(arg, "--no-expand-tabs")) { + revs->expand_tabs_in_log = 0; + } else if (skip_prefix(arg, "--expand-tabs=", &arg)) { + int val; + if (strtol_i(arg, 10, &val) < 0 || val < 0) + die("'%s': not a non-negative integer", arg); + revs->expand_tabs_in_log = val; } else if (!strcmp(arg, "--show-notes") || !strcmp(arg, "--notes")) { revs->show_notes = 1; revs->show_notes_given = 1; revs->notes_opt.use_default_notes = 1; } else if (!strcmp(arg, "--show-signature")) { revs->show_signature = 1; + } else if (!strcmp(arg, "--no-show-signature")) { + revs->show_signature = 0; } else if (!strcmp(arg, "--show-linear-break") || starts_with(arg, "--show-linear-break=")) { if (starts_with(arg, "--show-linear-break=")) @@ -1960,16 +1961,16 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg } else if (!strcmp(arg, "--grep-debug")) { revs->grep_filter.debug = 1; } else if (!strcmp(arg, "--basic-regexp")) { - grep_set_pattern_type_option(GREP_PATTERN_TYPE_BRE, &revs->grep_filter); + revs->grep_filter.pattern_type_option = GREP_PATTERN_TYPE_BRE; } else if (!strcmp(arg, "--extended-regexp") || !strcmp(arg, "-E")) { - grep_set_pattern_type_option(GREP_PATTERN_TYPE_ERE, &revs->grep_filter); + revs->grep_filter.pattern_type_option = GREP_PATTERN_TYPE_ERE; } else if (!strcmp(arg, "--regexp-ignore-case") || !strcmp(arg, "-i")) { revs->grep_filter.regflags |= REG_ICASE; DIFF_OPT_SET(&revs->diffopt, PICKAXE_IGNORE_CASE); } else if (!strcmp(arg, "--fixed-strings") || !strcmp(arg, "-F")) { - grep_set_pattern_type_option(GREP_PATTERN_TYPE_FIXED, &revs->grep_filter); + revs->grep_filter.pattern_type_option = GREP_PATTERN_TYPE_FIXED; } else if (!strcmp(arg, "--perl-regexp")) { - grep_set_pattern_type_option(GREP_PATTERN_TYPE_PCRE, &revs->grep_filter); + revs->grep_filter.pattern_type_option = GREP_PATTERN_TYPE_PCRE; } else if (!strcmp(arg, "--all-match")) { revs->grep_filter.all_match = 1; } else if (!strcmp(arg, "--invert-grep")) { @@ -2327,6 +2328,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s if (revs->first_parent_only && revs->bisect) die(_("--first-parent is incompatible with --bisect")); + if (revs->expand_tabs_in_log < 0) + revs->expand_tabs_in_log = revs->expand_tabs_in_log_default; + return left; } |