Re: [PATCH] peel_onion(): add support for <rev>^{tag}
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 20, 2013, 18:03 UTC
- Message-ID
- <7v4ncswtfo.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <51C20FD1.4090203@bbn.com>
Richard Hansen <rhansen@bbn.com> writes:
> Barfing on non-tags is the feature this adds. It's otherwise useless,
> just like <object>^{object} is useless except to barf when <object>
> doesn't exist.Thanks.
I could buy that. And after re-reading the proposed log message, you do not quite have anything to say that. Instead, you have this:
Note that <rev>^{tag} is not the same as <rev>^{object} when <rev> is
not a tag: $ git rev-parse --verify v1.8.3.1^{}^{object}
362de916c06521205276acb7f51c99f47db94727
$ git rev-parse --verify v1.8.3.1^{}^{tag}
error: v1.8.3.1^{}^{tag}: expected tag type, but the object deref...
fatal: Needed a single revisionThe latter peels v1.8.3.1 to a non-tag (i.e. a commit) and then asks to peel that commit to a tag, which will of course fail, but that is not a good example.
Perhaps something like this instead.
Note that <rev>^{tag} can be used to make sure <rev> names a tag: $ git rev-parse --verify v1.8.3.1^{tag}
$ git rev-parse --verify master^{tag}The former succeeds, while the latter fails.