Re: [PATCH] git-rev-parse.txt: clarify meaning of rev~ and rev~0.
- From
- Sergei Organov <osv@javad.com>
- Date
- Mar 14, 2008, 19:11 UTC
- Message-ID
- <87prtxm875.fsf@osv.gnss.ru>
- In-Reply-To
- <alpine.LFD.1.00.0803141141240.3557@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 15 quoted lines
> On Fri, 14 Mar 2008, Sergei Organov wrote:
>>
>> + ... 'rev{tilde}' is equivalent to 'rev{tilde}0'
>> + which in turn is equivalent to 'rev'.
>
> I'd actually prefer to just fix that.
>
> I think it would make more sense 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. If we document it, we should fix it and document the
> logical behaviour instead, no?
>I entirely agree. I just took (maybe erroneously) Junio's answer to my original question as "this behavior is by design", assuming some rationale behind it, so submitted the above patch to documentation.
-- Sergei.