X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=revision.c;h=7834bb108e27a819a4a619a85123443f254d421d;hb=0cae23467ada9b94210a0e770064841efea8ad40;hp=0125d41136871ad2cd07daaaabf40bd2f902a44f;hpb=8299886619b8dab99773b5810f50c63a50b2d611;p=git.git diff --git a/revision.c b/revision.c index 0125d4113..7834bb108 100644 --- a/revision.c +++ b/revision.c @@ -114,12 +114,7 @@ void mark_parents_uninteresting(struct commit *commit) } } -void add_pending_object(struct rev_info *revs, struct object *obj, const char *name) -{ - add_pending_object_with_mode(revs, obj, name, S_IFINVALID); -} - -void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode) +static void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode) { if (revs->no_walk && (obj->flags & UNINTERESTING)) die("object ranges do not make sense when not walking revisions"); @@ -129,6 +124,11 @@ void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, con (struct commit *)obj, name); } +void add_pending_object(struct rev_info *revs, struct object *obj, const char *name) +{ + add_pending_object_with_mode(revs, obj, name, S_IFINVALID); +} + static struct object *get_reference(struct rev_info *revs, const char *name, const unsigned char *sha1, unsigned int flags) { struct object *object; @@ -262,7 +262,7 @@ static void file_change(struct diff_options *options, options->has_changes = 1; } -int rev_compare_tree(struct rev_info *revs, struct tree *t1, struct tree *t2) +static int rev_compare_tree(struct rev_info *revs, struct tree *t1, struct tree *t2) { if (!t1) return REV_TREE_NEW; @@ -276,7 +276,7 @@ int rev_compare_tree(struct rev_info *revs, struct tree *t1, struct tree *t2) return tree_difference; } -int rev_same_tree_as_empty(struct rev_info *revs, struct tree *t1) +static int rev_same_tree_as_empty(struct rev_info *revs, struct tree *t1) { int retval; void *tree; @@ -881,6 +881,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch const char **unrecognized = argv + 1; int left = 1; int all_match = 0; + int regflags = 0; /* First, search for "--" */ seen_dashdash = 0; @@ -1152,6 +1153,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch add_message_grep(revs, arg+7); continue; } + if (!prefixcmp(arg, "--extended-regexp")) { + regflags |= REG_EXTENDED; + continue; + } + if (!prefixcmp(arg, "--regexp-ignore-case")) { + regflags |= REG_ICASE; + continue; + } if (!strcmp(arg, "--all-match")) { all_match = 1; continue; @@ -1171,7 +1180,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch opts = diff_opt_parse(&revs->diffopt, argv+i, argc-i); if (opts > 0) { - revs->diff = 1; + if (strcmp(argv[i], "-z")) + revs->diff = 1; i += opts - 1; continue; } @@ -1200,6 +1210,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch } } + if (revs->grep_filter) + revs->grep_filter->regflags |= regflags; + if (show_merge) prepare_show_merge(revs); if (def && !revs->pending.nr) { @@ -1217,7 +1230,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch if (revs->prune_data) { diff_tree_setup_paths(revs->prune_data, &revs->pruning); - revs->prune_fn = try_to_simplify_commit; + /* Can't prune commits with rename following: the paths change.. */ + if (!revs->diffopt.follow_renames) + revs->prune_fn = try_to_simplify_commit; if (!revs->full_diff) diff_tree_setup_paths(revs->prune_data, &revs->diffopt); }