git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] revisions.txt: mention <rev>~ form

From
Denton Liu <liu.denton@gmail.com>
Date
Apr 22, 2019, 07:39 UTC
Message-ID
<20190422073935.GA7660@archbookpro.localdomain>
In-Reply-To
<xmqqv9z67doq.fsf@gitster-ct.c.googlers.com>
On Mon, Apr 22, 2019 at 03:32:21PM +0900, Junio C Hamano wrote:
Show 11 quoted lines
> Denton Liu <liu.denton@gmail.com> writes:
> 
> > @@ -139,7 +139,9 @@ thing no matter the case.
> >    '<rev>{caret}0' means the commit itself and is used when '<rev>' is the
> >    object name of a tag object that refers to a commit object.
> >  
> > -'<rev>{tilde}<n>', e.g. 'master{tilde}3'::
> > +'<rev>{tilde}[<n>]', e.g. 'HEAD~, master{tilde}3'::
> 
> Why doesn't this example say "HEAD{tilde}, master{tilde}3" instead,
> I wonder?
According to the doc-diff, it doesn't really make a difference:
	diff --git a/14c0f8d3ab6c36672189cd2dd217f4617d12ccba/home/denton/share/man/man7/gitrevisions.7 b/18c8ed70602271a28c93df922eb3da8fb7563e2e/home/denton/share/man/man7/gitrevisions.7
	index 6f0dc7b8fb..ef23d49e00 100644
	--- a/14c0f8d3ab6c36672189cd2dd217f4617d12ccba/home/denton/share/man/man7/gitrevisions.7
	+++ b/18c8ed70602271a28c93df922eb3da8fb7563e2e/home/denton/share/man/man7/gitrevisions.7
	@@ -146,19 +146,20 @@ SPECIFYING REVISIONS
				This suffix is also accepted when spelled in uppercase, and means
				the same thing no matter the case.
	 
	-       <rev>^, e.g. HEAD^, v1.5.1^0
	+       <rev>^[<n>], e.g. HEAD^, v1.5.1^0
				A suffix ^ to a revision parameter means the first parent of that
				commit object.  ^<n> means the <n>th parent (i.e.  <rev>^ is
				equivalent to <rev>^1). As a special rule, <rev>^0 means the commit
				itself and is used when <rev> is the object name of a tag object
				that refers to a commit object.
	 
	-       <rev>~<n>, e.g. master~3
	-           A suffix ~<n> to a revision parameter means the commit object that
	-           is the <n>th generation ancestor of the named commit object,
	-           following only the first parents. I.e.  <rev>~3 is equivalent to
	-           <rev>^^^ which is equivalent to <rev>^1^1^1. See below for an
	-           illustration of the usage of this form.
	+       <rev>~[<n>], e.g. HEAD~, master~3
	+           A suffix ~ to a revision parameter means the first parent of that
	+           commit object. A suffix ~<n> to a revision parameter means the
	+           commit object that is the <n>th generation ancestor of the named
	+           commit object, following only the first parents. I.e.  <rev>~3 is
	+           equivalent to <rev>^^^ which is equivalent to <rev>^1^1^1. See
	+           below for an illustration of the usage of this form.
	 
			<rev>^{<type>}, e.g. v0.99.8^{commit}
				A suffix ^ followed by an object type name enclosed in brace pair

That being said, this is a typo on my part and it should really say {tilde}.

Show 6 quoted lines
> 
> > +  A suffix '{tilde}' to a revision parameter means the first parent of
> > +  that commit object.
> >    A suffix '{tilde}<n>' to a revision parameter means the commit
> >    object that is the <n>th generation ancestor of the named
> >    commit object, following only the first parents.  I.e. '<rev>{tilde}3' is
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 16 in “revisions.txt: mention <rev>~ form”
  1. revisions.txt: mention <rev>~ formDenton Liu, Apr 22, 2019
  2. Junio C HamanoApr 22, 2019
  3. Denton LiuApr 22, 2019
  4. Junio C HamanoApr 22, 2019
  5. Duy NguyenApr 22, 2019
  6. Junio C HamanoApr 24, 2019
  7. Andreas HeidukApr 26, 2019
  8. Denton LiuApr 26, 2019
  9. 0/3 cleanup revisions.txtDenton Liu, Apr 27, 2019
  10. 1/3 revisions.txt: change "rev" to "<rev>"Denton Liu, Apr 27, 2019
  11. 2/3 revisions.txt: mark optional rev arguments with []Denton Liu, Apr 27, 2019
  12. Andreas HeidukMay 3, 2019
  13. Andreas HeidukMay 3, 2019
  14. 3/3 revisions.txt: mention <rev>~ formDenton Liu, Apr 27, 2019
  15. Andreas HeidukMay 3, 2019
  16. Denton LiuMay 3, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.