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

Re: [PATCH] glossary: add definitions for dereference & peel

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 10, 2023, 00:22 UTC
Message-ID
<xmqq1qcyxxri.fsf@gitster.g>
In-Reply-To
<pull.1610.git.1699574277143.gitgitgadget@gmail.com>
"Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 16 quoted lines
> @@ -125,6 +124,24 @@ to point at the new commit.
>  	dangling object has no references to it from any
>  	reference or <<def_object,object>> in the <<def_repository,repository>>.
>  
> +[[def_dereference]]dereference::
> +	Referring to a <<def_symref,symbolic ref>>: the action of accessing the
> +	<<def_ref,reference>> pointed at by a symbolic ref. Recursive
> +	dereferencing involves repeating the aforementioned process on the
> +	resulting ref until a non-symbolic reference is found.
> ++
> +Referring to a <<def_tag_object,tag object>>: the action of accessing the
> +<<def_object,object>> a tag points at. Tags are recursively dereferenced by
> +repeating the operation on the result object until the result has either a
> +specified <<def_object_type,object type>> (where applicable) or any non-"tag"
> +object type.
> ++
All of the above makes sense.

I would casually mention "peeling" here with cross reference, if I were writing this section. There already is enough cross reference in the other direction pointing this way.

> +Referring to a <<def_commit_object,commit object>>: the action of accessing
> +the commit's tree object. Commits cannot be dereferenced recursively.

I personally consider this is weird misuse of the verb and is rarely used, but we see it in the description of tree-ish below.

> +Unless otherwise specified, "dereferencing" as it used in the context of Git
> +commands or protocols is implicitly recursive.
Nice to see this spelled out like this.
Show 9 quoted lines
> @@ -444,6 +461,12 @@ exclude;;
>  	of the logical predecessor(s) in the line of development, i.e. its
>  	parents.
>  
> +[[def_peel]]peel::
> +	Synonym for object <<def_dereference,dereference>>. Most commonly used
> +	in the context of tags, where it refers to the process of recursively
> +	dereferencing a <<def_tag_object,tag object>> until the result object's
> +	<<def_object_type,type>> is something other than "tag".

"object dereference" is not defined anywhere (yet). "Most commonly used in the context of tags" implies that objects other than tags can be "peeled" and "object dereference" is a word to refer to peeling either "commit" or "tag", but we would want to be a bit more clear and explicit. Let's either define "object dereference", or better yet, avoid saying "object dereference" here and instead say something like: "Synonym for dereference when used on tags and commits".

I've never seen "peel" used for commits, though. So another improvement might be to say "peel" is "an act of dereferencing a tag" here.

Thanks.
Previous: Victoria Dye via GitGitGadgetNext: Junio C Hamano
Message 2 of 6 in “glossary: add definitions for dereference & peel”
  1. glossary: add definitions for dereference & peelVictoria Dye via GitGitGadget, Nov 9, 2023
  2. Junio C HamanoNov 10, 2023
  3. Junio C HamanoNov 10, 2023
  4. Kristoffer HaugsbakkNov 10, 2023
  5. glossary: add definitions for dereference & peelVictoria Dye via GitGitGadget, Nov 13, 2023
  6. Junio C HamanoNov 14, 2023

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.