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

Commit6126997

Browse files
committed
Improve docstrings about tags
- Fix long-outdated information in the git.objects.tag docstring that seems to have been left over from when there was no such separate module. This module has only a tag-related class, not all classes that derive from git.object.base.Object.- Expand the git.objects.tag docstring to clarify what the module provides, add a git.refs.tag module docstring explaining what that provides, and cross-reference them with an explanation of how they differ (mentioning how this relates to git concepts).- Expand thie git.object.tag.TagObject class docstring to include the term "annotated" (retaining "non-lightweight" in parentheses).
1 parent30f7da5 commit6126997

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

‎git/objects/tag.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# This module is part of GitPython and is released under the
44
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
55

6-
"""Object-based types."""
6+
"""Provides an :class:`git.objects.base.Object`-based type for annotated tags.
7+
8+
This defines the :class:`TagReference` class, which represents annotated tags.
9+
For lightweight tags, see the :mod:`git.refs.tag` module.
10+
"""
711

812
from .importbase
913
from .utilimportget_object_type_by_name,parse_actor_and_date
@@ -25,8 +29,8 @@
2529

2630

2731
classTagObject(base.Object):
28-
"""Non-lightweight tag carrying additional information about an object we are
29-
pointing to."""
32+
"""Annotated (i.e. non-lightweight) tag carrying additional information about an
33+
object we arepointing to."""
3034

3135
type:Literal["tag"]="tag"
3236

‎git/refs/tag.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# This module is part of GitPython and is released under the
22
# 3-Clause BSD License: https://opensource.org/license/bsd-3-clause/
33

4+
"""Provides a :class:`~git.refs.reference.Reference`-based type for lightweight tags.
5+
6+
This defines the :class:`TagReference` class (and its alias :class:`Tag`), which
7+
represents lightweight tags. For annotated tags (which are git objects), see the
8+
:mod:`git.objects.tag` module.
9+
"""
10+
411
from .referenceimportReference
512

613
__all__= ["TagReference","Tag"]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp