summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-14 18:49:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-15 00:59:24 (GMT)
commit621ff6759414e2a723f61b6d8fc04b9805eb0c20 (patch)
tree66a4e202a7baf9cf65c15bc17d182f65c1013d44 /commit.h
parented0b9d43097349f4d730472673c07f427480e14a (diff)
downloadgit-621ff6759414e2a723f61b6d8fc04b9805eb0c20.zip
git-621ff6759414e2a723f61b6d8fc04b9805eb0c20.tar.gz
git-621ff6759414e2a723f61b6d8fc04b9805eb0c20.tar.bz2
rev-parse: fix meaning of rev~ vs rev~0.
I think it would make more sense for rev~ to have the same guarantees that rev^ has, namely to always return a commit. I would also suggest that not giving a number would have the same effect of defaulting to 1, not 0. Right now it's a bit illogical, but at least it's an _undocumented_ illogical behaviour. This patch makes '^' and '~' act the same for the default count (i.e. both default to 1), and also have the same behaviour for a count of zero. Before (no discernible pattern): [torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~ 45354a57ee7e3e42c7137db6c94fa968c6babe8d 89815cab95268e8f0f58142b848ac4cd5e9cbdcb 45354a57ee7e3e42c7137db6c94fa968c6babe8d 045f5759c97746589a067461e50fad16f60711ac 45354a57ee7e3e42c7137db6c94fa968c6babe8d After (fairly logical): [torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~ 45354a57ee7e3e42c7137db6c94fa968c6babe8d 89815cab95268e8f0f58142b848ac4cd5e9cbdcb 89815cab95268e8f0f58142b848ac4cd5e9cbdcb 045f5759c97746589a067461e50fad16f60711ac 045f5759c97746589a067461e50fad16f60711ac Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
0 files changed, 0 insertions, 0 deletions