Merge branch 'jc/fpl'
* jc/fpl: git-log --first-parent: show only the first parent log
This commit is contained in:
commit
3a81b9f571
12
revision.c
12
revision.c
@ -360,6 +360,7 @@ static void add_parents_to_list(struct rev_info *revs, struct commit *commit, st
|
|||||||
{
|
{
|
||||||
struct commit_list *parent = commit->parents;
|
struct commit_list *parent = commit->parents;
|
||||||
unsigned left_flag;
|
unsigned left_flag;
|
||||||
|
int add, rest;
|
||||||
|
|
||||||
if (commit->object.flags & ADDED)
|
if (commit->object.flags & ADDED)
|
||||||
return;
|
return;
|
||||||
@ -405,17 +406,18 @@ static void add_parents_to_list(struct rev_info *revs, struct commit *commit, st
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
left_flag = (commit->object.flags & SYMMETRIC_LEFT);
|
left_flag = (commit->object.flags & SYMMETRIC_LEFT);
|
||||||
parent = commit->parents;
|
|
||||||
while (parent) {
|
rest = !revs->first_parent_only;
|
||||||
|
for (parent = commit->parents, add = 1; parent; add = rest) {
|
||||||
struct commit *p = parent->item;
|
struct commit *p = parent->item;
|
||||||
|
|
||||||
parent = parent->next;
|
parent = parent->next;
|
||||||
|
|
||||||
parse_commit(p);
|
parse_commit(p);
|
||||||
p->object.flags |= left_flag;
|
p->object.flags |= left_flag;
|
||||||
if (p->object.flags & SEEN)
|
if (p->object.flags & SEEN)
|
||||||
continue;
|
continue;
|
||||||
p->object.flags |= SEEN;
|
p->object.flags |= SEEN;
|
||||||
|
if (add)
|
||||||
insert_by_date(p, list);
|
insert_by_date(p, list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -847,6 +849,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
|
|||||||
handle_all(revs, flags);
|
handle_all(revs, flags);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(arg, "--first-parent")) {
|
||||||
|
revs->first_parent_only = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!strcmp(arg, "--reflog")) {
|
if (!strcmp(arg, "--reflog")) {
|
||||||
handle_reflog(revs, flags);
|
handle_reflog(revs, flags);
|
||||||
continue;
|
continue;
|
||||||
|
@ -46,7 +46,8 @@ struct rev_info {
|
|||||||
boundary:2,
|
boundary:2,
|
||||||
left_right:1,
|
left_right:1,
|
||||||
parents:1,
|
parents:1,
|
||||||
reverse:1;
|
reverse:1,
|
||||||
|
first_parent_only:1;
|
||||||
|
|
||||||
/* Diff flags */
|
/* Diff flags */
|
||||||
unsigned int diff:1,
|
unsigned int diff:1,
|
||||||
|
Loading…
Reference in New Issue
Block a user