Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64ec0b1

Browse files
authored
Merge pull request#1881 from EliahKagan/doc-types-tags
Clarify how tag objects are usually tree-ish and commit-ish
2 parents4fb6d24 +838eb92 commit64ec0b1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎git/types.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,37 +75,39 @@
7575
"""
7676

7777
Tree_ish=Union["Commit","Tree","TagObject"]
78-
"""Union of :class:`~git.objects.base.Object`-based types that aresometimes tree-ish.
78+
"""Union of :class:`~git.objects.base.Object`-based types that aretypically tree-ish.
7979
8080
See :manpage:`gitglossary(7)` on "tree-ish":
8181
https://git-scm.com/docs/gitglossary#def_tree-ish
8282
8383
:note:
8484
:class:`~git.objects.tree.Tree` and :class:`~git.objects.commit.Commit` are the
8585
classes whose instances are all tree-ish. This union includes them, but also
86-
:class:`~git.objects.tag.TagObject`, only **some** of whose instances are tree-ish.
86+
:class:`~git.objects.tag.TagObject`, only **most** of whose instances are tree-ish.
8787
Whether a particular :class:`~git.objects.tag.TagObject` peels (recursively
8888
dereferences) to a tree or commit, rather than a blob, can in general only be known
89-
at runtime.
89+
at runtime. In practice, git tag objects are nearly always used for tagging commits,
90+
and such tags are tree-ish because commits are tree-ish.
9091
9192
:note:
9293
See also the :class:`AnyGitObject` union of all four classes corresponding to git
9394
object types.
9495
"""
9596

9697
Commit_ish=Union["Commit","TagObject"]
97-
"""Union of :class:`~git.objects.base.Object`-based types that aresometimes commit-ish.
98+
"""Union of :class:`~git.objects.base.Object`-based types that aretypically commit-ish.
9899
99100
See :manpage:`gitglossary(7)` on "commit-ish":
100101
https://git-scm.com/docs/gitglossary#def_commit-ish
101102
102103
:note:
103104
:class:`~git.objects.commit.Commit` is the only class whose instances are all
104105
commit-ish. This union type includes :class:`~git.objects.commit.Commit`, but also
105-
:class:`~git.objects.tag.TagObject`, only **some** of whose instances are
106+
:class:`~git.objects.tag.TagObject`, only **most** of whose instances are
106107
commit-ish. Whether a particular :class:`~git.objects.tag.TagObject` peels
107108
(recursively dereferences) to a commit, rather than a tree or blob, can in general
108-
only be known at runtime.
109+
only be known at runtime. In practice, git tag objects are nearly always used for
110+
tagging commits, and such tags are of course commit-ish.
109111
110112
:note:
111113
See also the :class:`AnyGitObject` union of all four classes corresponding to git

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp