diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-10-16 14:32:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-16 14:32:34 -0700 |
commit | 14d5a3e47e38b29bf8aa7d6081d43ce0f24c3444 (patch) | |
tree | 2d7e39ada8a1bbed93bcc115d733252222907fe4 /builtin | |
parent | be4d6f4c7f94541fac1a06e4c04acc2d60de1f8c (diff) | |
parent | 95a4fb0eac20de024fed242a7c9227af86334202 (diff) | |
download | git-14d5a3e47e38b29bf8aa7d6081d43ce0f24c3444.tar.gz |
Merge branch 'jk/blame-first-parent' into maint
"git blame --first-parent v1.0..v2.0" was not rejected but did not
limit the blame to commits on the first parent chain.
* jk/blame-first-parent:
blame: handle --first-parent
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/blame.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/builtin/blame.c b/builtin/blame.c index 245d253d04..295ce92da5 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -1371,8 +1371,15 @@ static void pass_whole_blame(struct scoreboard *sb, */ static struct commit_list *first_scapegoat(struct rev_info *revs, struct commit *commit) { - if (!reverse) + if (!reverse) { + if (revs->first_parent_only && + commit->parents && + commit->parents->next) { + free_commit_list(commit->parents->next); + commit->parents->next = NULL; + } return commit->parents; + } return lookup_decoration(&revs->children, &commit->object); } @@ -2685,6 +2692,8 @@ parse_done: } else if (contents_from) die("--contents and --children do not blend well."); + else if (revs.first_parent_only) + die("combining --first-parent and --reverse is not supported"); else { final_commit_name = prepare_initial(&sb); sb.commits.compare = compare_commits_by_reverse_commit_date; |