Repository navigation
pr-2282/jvns/object-name-id-v1
tagged this
26 Oct 13:06
From: Julia Evans <julia@jvns.ca>
Currently in the glossary "object name" is used as the canonical term to
refer to an object's SHA-1 (or SHA-256) identifier. However, in several
places in the documentation, "object name" is used with a different
meaning, for example:
from git-rev-parse.adoc:
Usually the object names are output in SHA-1 form (with possible
^ prefix); this option makes them output in a form as close to the
original input as possible.
from gitrevisions.adoc:
Here are various ways to spell object names.
(lists <refname>, HEAD, etc)
from git-describe.adoc:
`<commit-ish>...`::
Commit-ish object names to describe. Defaults to `HEAD`
if omitted.
Especially in the `git-rev-parse.adoc` usage, it's clear that "master"
is considered to be an object name, which is not what the glossary entry
says.
It's important for the documentation to be precise, and it's useful to
have a way to unambiguously refer to an object's SHA-1 identifier.
For example, the term "object ID" is used many places in the
documentation already, and there are places which say "object name" and
mean "object ID", for example:
from diff-generate-patch.adoc:
The index line includes the blob object names before and
after the change.
from gitformat-pack.adoc:
The base object name or offset is not included in the size
computation.
Update the glossary to use "object ID" to refer to the ID, and warn
readers that "object name" does not always have the same meaning. If we
ever reach a point where the term is used consistently, we can remove
the warning.
This leaves us without an obvious term to use to refer to "a name for
an object", but since that's already the case it's better to at least
clearly acknowledge the issue.
As a bonus, this aligns Git's documentation better with how the terms
"ID" and "name" are normally used in the broader industry, where an "ID"
is normally understood to be something that's interpreted by computers,
and a "name" is for humans.
This is similar to a patch Junio suggested in 2020:
https://lore.kernel.org/git/xmqqft4zn2f7.fsf@gitster.c.googlers.com/
Signed-off-by: Julia Evans <julia@jvns.ca>
Submitted-As: https://lore.kernel.org/git/pull.2282.git.1793019999896.gitgitgadget@gmail.com