X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=revision.c;h=f2a9f25fe11f3883281ea5fdd783700056fd5c6e;hb=b6c4a480b3161effaa3578df91d8cdc83044d7b6;hp=4d2a64ef6b3e0a8f9af30264c5e7f2dc8b56d148;hpb=3a624b346db02a07b0317743b362d1a15c6c3c18;p=git.git diff --git a/revision.c b/revision.c index 4d2a64ef..f2a9f25f 100644 --- a/revision.c +++ b/revision.c @@ -152,6 +152,7 @@ static struct commit *handle_commit(struct rev_info *revs, struct object *object if (parse_commit(commit) < 0) die("unable to parse commit %s", name); if (flags & UNINTERESTING) { + commit->object.flags |= UNINTERESTING; mark_parents_uninteresting(commit); revs->limited = 1; } @@ -751,17 +752,15 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch arg++; } if (get_sha1(arg, sha1) < 0) { - struct stat st; int j; if (seen_dashdash || local_flags) die("bad revision '%s'", arg); /* If we didn't have a "--", all filenames must exist */ - for (j = i; j < argc; j++) { - if (lstat(argv[j], &st) < 0) - die("'%s': %s", argv[j], strerror(errno)); - } + for (j = i; j < argc; j++) + verify_filename(revs->prefix, argv[j]); + revs->prune_data = get_pathspec(revs->prefix, argv + i); break; } @@ -788,7 +787,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch } if (revs->combine_merges) { revs->ignore_merges = 0; - if (revs->dense_combined_merges) + if (revs->dense_combined_merges && + (revs->diffopt.output_format != DIFF_FORMAT_DIFFSTAT)) revs->diffopt.output_format = DIFF_FORMAT_PATCH; } revs->diffopt.abbrev = revs->abbrev; @@ -851,6 +851,17 @@ static void rewrite_parents(struct rev_info *revs, struct commit *commit) } } +static void mark_boundary_to_show(struct commit *commit) +{ + struct commit_list *p = commit->parents; + while (p) { + commit = p->item; + p = p->next; + if (commit->object.flags & BOUNDARY) + commit->object.flags |= BOUNDARY_SHOW; + } +} + struct commit *get_revision(struct rev_info *revs) { struct commit_list *list = revs->commits; @@ -888,8 +899,20 @@ struct commit *get_revision(struct rev_info *revs) } if (commit->object.flags & SHOWN) continue; - if (!(commit->object.flags & BOUNDARY) && - (commit->object.flags & UNINTERESTING)) + + /* We want to show boundary commits only when their + * children are shown. When path-limiter is in effect, + * rewrite_parents() drops some commits from getting shown, + * and there is no point showing boundary parents that + * are not shown. After rewrite_parents() rewrites the + * parents of a commit that is shown, we mark the boundary + * parents with BOUNDARY_SHOW. + */ + if (commit->object.flags & BOUNDARY_SHOW) { + commit->object.flags |= SHOWN; + return commit; + } + if (commit->object.flags & UNINTERESTING) continue; if (revs->min_age != -1 && (commit->date > revs->min_age)) continue; @@ -902,6 +925,8 @@ struct commit *get_revision(struct rev_info *revs) if (revs->parents) rewrite_parents(revs, commit); } + if (revs->boundary) + mark_boundary_to_show(commit); commit->object.flags |= SHOWN; return commit; } while (revs->commits);