From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Denton Liu <liu.denton@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] revisions.txt: mention <rev>~ form
Date: Wed, 24 Apr 2019 10:05:54 +0900 [thread overview]
Message-ID: <xmqqh8ao43gt.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CACsJy8DB3k=9PaQT4CBz-K3=yjQ1oJAtz6p00PAOjy047XvAyA@mail.gmail.com> (Duy Nguyen's message of "Mon, 22 Apr 2019 16:59:43 +0700")
Duy Nguyen <pclouds@gmail.com> writes:
> On Mon, Apr 22, 2019 at 1:14 PM Denton Liu <liu.denton@gmail.com> wrote:
>>
>> In revisions.txt, the '<rev>^' form is mentioned but the '<rev>~' form
>> is missing. Although both forms are essentially equivalent (they each
>> get the first parent of the specified revision), we should mention the
>> latter for completeness. Make this change.
>
> Do we really support this, or is it a bug in rev parsing code that
> treats <rev>~ like <rev>~1?
>
> Hmm.. digging... ah 621ff67594 (rev-parse: fix meaning of rev~ vs
> rev~0., 2008-03-14) at least it's not an unintended bahaviour.
commit 621ff6759414e2a723f61b6d8fc04b9805eb0c20
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Fri Mar 14 11:49:40 2008 -0700
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.
Yes, I remember that one: if rev^ means rev^1, rev~ should mean
rev~1, not rev or rev~0.
next prev parent reply other threads:[~2019-04-24 1:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 6:12 [PATCH] revisions.txt: mention <rev>~ form Denton Liu
2019-04-22 6:32 ` Junio C Hamano
2019-04-22 7:39 ` Denton Liu
2019-04-22 11:21 ` Junio C Hamano
2019-04-22 9:59 ` Duy Nguyen
2019-04-24 1:05 ` Junio C Hamano [this message]
2019-04-26 20:55 ` Andreas Heiduk
2019-04-26 21:16 ` Denton Liu
2019-04-27 12:15 ` [PATCH v2 0/3] cleanup revisions.txt Denton Liu
2019-04-27 12:15 ` [PATCH v2 1/3] revisions.txt: change "rev" to "<rev>" Denton Liu
2019-04-27 12:16 ` [PATCH v2 2/3] revisions.txt: mark optional rev arguments with [] Denton Liu
2019-05-03 7:17 ` Andreas Heiduk
2019-05-03 7:35 ` Andreas Heiduk
2019-04-27 12:16 ` [PATCH v2 3/3] revisions.txt: mention <rev>~ form Denton Liu
2019-05-03 8:01 ` [PATCH v2 0/3] cleanup revisions.txt Andreas Heiduk
2019-05-03 8:13 ` Denton Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqh8ao43gt.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=liu.denton@gmail.com \
--cc=pclouds@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).