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

Commit1530fd2

Browse files
committed
Use phrases like "git object type" where applicable
In some recently introduced or expanded docstrings, I had overusedphrases like "kind of git object" with the hope of avoidingconfusion with the meanings of "type" relevant to Python (i.e.,"class" or "static type"). But this made the relationship to git'sown notion of "object type" less clear than it could be, especiallyin docstrings that also included links to the gitglossary(7) entryfor "object type" (because those links' relevance was less clear).This dials back the use of "kind" to where I am more confident thatit is clarifying or at least not confusing.
1 parent7166703 commit1530fd2

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

‎git/objects/base.py‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838

3939
classObject(LazyMixin):
40-
"""Base class for classes representingkinds ofgitobjects.
40+
"""Base class for classes representing gitobject types.
4141
4242
The following leaf classes represent specific kinds of git objects:
4343
@@ -61,7 +61,7 @@ class Object(LazyMixin):
6161
:note:
6262
:class:`~git.objects.submodule.base.Submodule` is defined under the hierarchy
6363
rooted at this :class:`Object` class, even though submodules are not really a
64-
kind of git object.
64+
type of git object.
6565
6666
"""
6767

@@ -78,7 +78,7 @@ class Object(LazyMixin):
7878
__slots__= ("repo","binsha","size")
7979

8080
type:Union[Lit_commit_ish,None]=None
81-
"""String identifying (a concrete :class:`Object` subtype for) akind ofgit object.
81+
"""String identifying (a concrete :class:`Object` subtype for) a git object type.
8282
8383
The subtypes that this may name correspond to the kinds of git objects that exist,
8484
i.e., the objects that may be present in a git repository.
@@ -87,7 +87,7 @@ class Object(LazyMixin):
8787
Most subclasses represent specific types of git objects and override this class
8888
attribute accordingly. This attribute is ``None`` in the :class:`Object` base
8989
class, as well as the :class:`IndexObject` intermediate subclass, but never
90-
``None`` in concrete leaf subclasses representing specifickinds ofgitobjects.
90+
``None`` in concrete leaf subclasses representing specific gitobject types.
9191
9292
:note:
9393
See also :class:`~git.types.Commit_ish`.
@@ -214,9 +214,10 @@ def stream_data(self, ostream: "OStream") -> "Object":
214214
classIndexObject(Object):
215215
"""Base for all objects that can be part of the index file.
216216
217-
The classes representingkinds ofgitobjects that can be part of the index file are
217+
The classes representing gitobject types that can be part of the index file are
218218
:class:`~git.objects.tree.Tree and :class:`~git.objects.blob.Blob`. In addition,
219-
:class:`~git.objects.submodule.base.Submodule` is also a subclass.
219+
:class:`~git.objects.submodule.base.Submodule`, which is not really a git object
220+
type but can be part of an index file, is also a subclass.
220221
"""
221222

222223
__slots__= ("path","mode")

‎git/types.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
"""
6868

6969
Commit_ish=Union["Commit","TagObject","Blob","Tree"]
70-
"""Union of the :class:`~git.objects.base.Object`-based types that representkinds of
71-
git objects. This union is often usable where a commit-ish is expected, but is not
72-
actuallylimited to types representing commit-ish git objects.
70+
"""Union of the :class:`~git.objects.base.Object`-based types that representgit object
71+
types. This union is often usable where a commit-ish is expected, but is not actually
72+
limited to types representing commit-ish git objects.
7373
7474
See gitglossary(7) on:
7575
@@ -93,7 +93,7 @@
9393

9494
Lit_commit_ish=Literal["commit","tag","blob","tree"]
9595
"""Literal strings identifying concrete :class:`~git.objects.base.Object` subtypes
96-
representingkinds ofgitobjects.
96+
representing gitobject types.
9797
9898
See the :class:`Object.type <git.objects.base.Object.type>` attribute.
9999

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp