Skip to content

Commit

Permalink
Merge branch 'lt/revision-walker'
Browse files Browse the repository at this point in the history
* lt/revision-walker:
  Add "--show-all" revision walker flag for debugging
  • Loading branch information
Junio C Hamano committed Feb 21, 2008
2 parents 356eff5 + 3131b71 commit 428ae2e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
4 changes: 3 additions & 1 deletion builtin-rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ static void show_commit(struct commit *commit)
fputs(header_prefix, stdout);
if (commit->object.flags & BOUNDARY)
putchar('-');
else if (commit->object.flags & UNINTERESTING)
putchar('^');
else if (revs.left_right) {
if (commit->object.flags & SYMMETRIC_LEFT)
putchar('<');
Expand All @@ -84,7 +86,7 @@ static void show_commit(struct commit *commit)
else
putchar('\n');

if (revs.verbose_header) {
if (revs.verbose_header && commit->buffer) {
struct strbuf buf;
strbuf_init(&buf, 0);
pretty_print_commit(revs.commit_format, commit,
Expand Down
15 changes: 11 additions & 4 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ void show_log(struct rev_info *opt, const char *sep)

opt->loginfo = NULL;
if (!opt->verbose_header) {
if (opt->left_right) {
if (commit->object.flags & BOUNDARY)
putchar('-');
else if (commit->object.flags & SYMMETRIC_LEFT)
if (commit->object.flags & BOUNDARY)
putchar('-');
else if (commit->object.flags & UNINTERESTING)
putchar('^');
else if (opt->left_right) {
if (commit->object.flags & SYMMETRIC_LEFT)
putchar('<');
else
putchar('>');
Expand Down Expand Up @@ -250,6 +252,8 @@ void show_log(struct rev_info *opt, const char *sep)
fputs("commit ", stdout);
if (commit->object.flags & BOUNDARY)
putchar('-');
else if (commit->object.flags & UNINTERESTING)
putchar('^');
else if (opt->left_right) {
if (commit->object.flags & SYMMETRIC_LEFT)
putchar('<');
Expand Down Expand Up @@ -278,6 +282,9 @@ void show_log(struct rev_info *opt, const char *sep)
}
}

if (!commit->buffer)
return;

/*
* And then the pretty-printed message itself
*/
Expand Down
20 changes: 18 additions & 2 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,12 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
free_patch_ids(&ids);
}

static void add_to_list(struct commit_list **p, struct commit *commit, struct commit_list *n)
{
p = &commit_list_insert(commit, p)->next;
*p = n;
}

static int limit_list(struct rev_info *revs)
{
struct commit_list *list = revs->commits;
Expand All @@ -585,9 +591,13 @@ static int limit_list(struct rev_info *revs)
return -1;
if (obj->flags & UNINTERESTING) {
mark_parents_uninteresting(commit);
if (everybody_uninteresting(list))
if (everybody_uninteresting(list)) {
if (revs->show_all)
add_to_list(p, commit, list);
break;
continue;
}
if (!revs->show_all)
continue;
}
if (revs->min_age != -1 && (commit->date > revs->min_age))
continue;
Expand Down Expand Up @@ -1063,6 +1073,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
revs->dense = 0;
continue;
}
if (!strcmp(arg, "--show-all")) {
revs->show_all = 1;
continue;
}
if (!strcmp(arg, "--remove-empty")) {
revs->remove_empty_trees = 1;
continue;
Expand Down Expand Up @@ -1446,6 +1460,8 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
return commit_ignore;
if (revs->unpacked && has_sha1_pack(commit->object.sha1, revs->ignore_packed))
return commit_ignore;
if (revs->show_all)
return commit_show;
if (commit->object.flags & UNINTERESTING)
return commit_ignore;
if (revs->min_age != -1 && (commit->date > revs->min_age))
Expand Down
1 change: 1 addition & 0 deletions revision.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct rev_info {
prune:1,
no_merges:1,
no_walk:1,
show_all:1,
remove_empty_trees:1,
simplify_history:1,
lifo:1,
Expand Down

0 comments on commit 428ae2e

Please sign in to comment.