Skip to content

Commit

Permalink
git-show: Reject native ref
Browse files Browse the repository at this point in the history
So when we do

	git show v1.4.4..v1.5.0

that's an illogical thing to do, since "git show" is defined to be a
non-revision-walking action, which means the range operator be pointless
and wrong. The fact that we happily accept it (and then _only_ show
v1.5.0, which is the positive end of the range) is quite arguably not very
logical.

We should complain, and say that you can only do "no_walk" with positive
refs. Negative object refs really don't make any sense unless you walk
the obejct list (or you're "git diff" and know about ranges explicitly).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Linus Torvalds authored and Junio C Hamano committed Feb 28, 2007
1 parent 7ee70a7 commit aa27e46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ void mark_parents_uninteresting(struct commit *commit)

void add_pending_object(struct rev_info *revs, struct object *obj, const char *name)
{
if (revs->no_walk && (obj->flags & UNINTERESTING))
die("object ranges do not make sense when not walking revisions");
add_object_array(obj, name, &revs->pending);
if (revs->reflog_info && obj->type == OBJ_COMMIT)
add_reflog_for_walk(revs->reflog_info,
Expand Down

0 comments on commit aa27e46

Please sign in to comment.