Skip to content

Commit

Permalink
Revert "Make left-right automatic."
Browse files Browse the repository at this point in the history
This reverts commit 5761231.

Feeding symmetric difference to gitk is so useful, and it is the
same for other graphical Porcelains.  Rather than forcing them
to pass --no-left-right, making it optional.

Noticed and reported by Jeff King.
  • Loading branch information
Junio C Hamano committed Dec 19, 2006
1 parent 5761231 commit 8dce823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,8 +853,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
revs->boundary = 1;
continue;
}
if (!strcmp(arg, "--no-left-right")) {
revs->no_left_right = 1;
if (!strcmp(arg, "--left-right")) {
revs->left_right = 1;
continue;
}
if (!strcmp(arg, "--objects")) {
Expand Down Expand Up @@ -1055,18 +1055,13 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
void prepare_revision_walk(struct rev_info *revs)
{
int nr = revs->pending.nr;
int has_symmetric = 0;
struct object_array_entry *list = revs->pending.objects;

revs->pending.nr = 0;
revs->pending.alloc = 0;
revs->pending.objects = NULL;
while (--nr >= 0) {
struct commit *commit;

if (list->item->flags & SYMMETRIC_LEFT)
has_symmetric = 1;
commit = handle_commit(revs, list->item, list->name);
struct commit *commit = handle_commit(revs, list->item, list->name);
if (commit) {
if (!(commit->object.flags & SEEN)) {
commit->object.flags |= SEEN;
Expand All @@ -1078,8 +1073,6 @@ void prepare_revision_walk(struct rev_info *revs)

if (revs->no_walk)
return;
if (!revs->no_left_right && has_symmetric)
revs->left_right = 1;
if (revs->limited)
limit_list(revs);
if (revs->topo_order)
Expand Down
1 change: 0 additions & 1 deletion revision.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct rev_info {
limited:1,
unpacked:1, /* see also ignore_packed below */
boundary:1,
no_left_right:1,
left_right:1,
parents:1;

Expand Down

0 comments on commit 8dce823

Please sign in to comment.