Expand docs of classes representing Git objects · gitpython-developers/GitPython@f3b9a69 · GitHub
Skip to content

Commit f3b9a69

Browse files
committed
Expand docs of classes representing Git objects
This expands the docstrings of the Object base class, as well as the four leaf subclasses that represent git objects (Blob, Commit, TagObject, and Tree) to clarify those classes' relationship to git objects in general and specific types of git objects, to each other, and where applicable to types defined in git.types. This includes links to specific sections of the gitglossary(7) manpage (as hosted online), where directly applicable.
1 parent 3bd8177 commit f3b9a69

5 files changed

Lines changed: 65 additions & 10 deletions

File tree

git/objects/base.py

Lines changed: 47 additions & 6 deletions

git/objects/blob.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313

1414
class Blob(base.IndexObject):
15-
"""A Blob encapsulates a git blob object."""
15+
"""A Blob encapsulates a git blob object.
16+
17+
See gitglossary(7) on "blob": https://git-scm.com/docs/gitglossary#def_blob_object
18+
"""
1619

1720
DEFAULT_MIME_TYPE = "text/plain"
1821
type: Literal["blob"] = "blob"

git/objects/commit.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@
6060
class Commit(base.Object, TraversableIterableObj, Diffable, Serializable):
6161
"""Wraps a git commit object.
6262
63-
This class will act lazily on some of its attributes and will query the value on
64-
demand only if it involves calling the git binary.
63+
See gitglossary(7) on "commit object":
64+
https://git-scm.com/docs/gitglossary#def_commit_object
65+
66+
:note:
67+
This class will act lazily on some of its attributes and will query the value on
68+
demand only if it involves calling the git binary.
6569
"""
6670

6771
# ENVIRONMENT VARIABLES

git/objects/tag.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030

3131
class TagObject(base.Object):
3232
"""Annotated (i.e. non-lightweight) tag carrying additional information about an
33-
object we are pointing to."""
33+
object we are pointing to.
34+
35+
See gitglossary(7) on "tag object":
36+
https://git-scm.com/docs/gitglossary#def_tag_object
37+
"""
3438

3539
type: Literal["tag"] = "tag"
3640

git/objects/tree.py

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)