Message ID | pull.1610.git.1699574277143.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | glossary: add definitions for dereference & peel | expand |
"Victoria Dye via GitGitGadget" <gitgitgadget@gmail.com> writes: > @@ -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. > @@ -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.
Junio C Hamano <gitster@pobox.com> writes: > 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. I am reasonably sure I was the one who coined the term "peel", and the picture I had in mind when I used it was to peel an onion, which inherently was about unwrapping many levels repeatedly. I think that is why it felt strange to see "peel" used in the context of using a commit as a tree-ish, which (as your documentation update clearly said) is doable only once.
On Fri, Nov 10, 2023, at 00:57, Victoria Dye via GitGitGadget wrote: > +[[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". As a user I like that this is classified as a synonym. Because if I wanted to ask StackOverflow about how to get to the commit that a tag points to then I would use the term “dereference a tag”.
diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt index 65c89e7b3eb..41dd5721def 100644 --- a/Documentation/glossary-content.txt +++ b/Documentation/glossary-content.txt @@ -98,9 +98,8 @@ to point at the new commit. revision. [[def_commit-ish]]commit-ish (also committish):: - A <<def_commit_object,commit object>> or an - <<def_object,object>> that can be recursively dereferenced to - a commit object. + A <<def_commit_object,commit object>> or an <<def_object,object>> that + can be recursively <<def_dereference,dereferenced>> to a commit object. The following are all commit-ishes: a commit object, a <<def_tag_object,tag object>> that points to a commit @@ -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. ++ +Referring to a <<def_commit_object,commit object>>: the action of accessing +the commit's tree object. Commits cannot be dereferenced recursively. ++ +Unless otherwise specified, "dereferencing" as it used in the context of Git +commands or protocols is implicitly recursive. + [[def_detached_HEAD]]detached HEAD:: Normally the <<def_HEAD,HEAD>> stores the name of a <<def_branch,branch>>, and commands that operate on the @@ -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". + [[def_pickaxe]]pickaxe:: The term <<def_pickaxe,pickaxe>> refers to an option to the diffcore routines that help select changes that add or delete a given text @@ -620,12 +643,11 @@ The most notable example is `HEAD`. copies of) commit objects of the contained submodules. [[def_symref]]symref:: - Symbolic reference: instead of containing the <<def_SHA1,SHA-1>> - id itself, it is of the format 'ref: refs/some/thing' and when - referenced, it recursively dereferences to this reference. - '<<def_HEAD,HEAD>>' is a prime example of a symref. Symbolic - references are manipulated with the linkgit:git-symbolic-ref[1] - command. + Symbolic reference: instead of containing the <<def_SHA1,SHA-1>> id + itself, it is of the format 'ref: refs/some/thing' and when referenced, + it recursively <<def_dereference,dereferences>> to this reference. + '<<def_HEAD,HEAD>>' is a prime example of a symref. Symbolic references + are manipulated with the linkgit:git-symbolic-ref[1] command. [[def_tag]]tag:: A <<def_ref,ref>> under `refs/tags/` namespace that points to an @@ -661,11 +683,11 @@ The most notable example is `HEAD`. <<def_tree,tree>> is equivalent to a <<def_directory,directory>>. [[def_tree-ish]]tree-ish (also treeish):: - A <<def_tree_object,tree object>> or an <<def_object,object>> - that can be recursively dereferenced to a tree object. - Dereferencing a <<def_commit_object,commit object>> yields the - tree object corresponding to the <<def_revision,revision>>'s - top <<def_directory,directory>>. + A <<def_tree_object,tree object>> or an <<def_object,object>> that can + be recursively <<def_dereference,dereferenced>> to a tree object. + Dereferencing a <<def_commit_object,commit object>> yields the tree + object corresponding to the <<def_revision,revision>>'s top + <<def_directory,directory>>. The following are all tree-ishes: a <<def_commit-ish,commit-ish>>, a tree object,