summaryrefslogtreecommitdiff
path: root/builtin/blame.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-10-05 19:30:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-05 19:30:24 (GMT)
commitff2be2610ad12a87636141c1868b47f035488331 (patch)
treeb0e13c073f8d800868c1d605e5aff40e3fd9ac8d /builtin/blame.c
parent1e7ea4e7abe6214a06d8acd60e6f6e2a09f7d05c (diff)
parent95a4fb0eac20de024fed242a7c9227af86334202 (diff)
downloadgit-ff2be2610ad12a87636141c1868b47f035488331.zip
git-ff2be2610ad12a87636141c1868b47f035488331.tar.gz
git-ff2be2610ad12a87636141c1868b47f035488331.tar.bz2
Merge branch 'jk/blame-first-parent'
"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/blame.c')
-rw-r--r--builtin/blame.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index 6fd1a63..01ea770 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1366,8 +1366,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);
}
@@ -2679,6 +2686,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;