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

Commit4251bd5

Browse files
committed
Improved head and tag object documentation slightly
1 parent451561c commit4251bd5

File tree

3 files changed

+26
-24
lines changed

3 files changed

+26
-24
lines changed

‎lib/git/commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ def find_all(cls, repo, ref, path='', **kwargs):
136136
is an optinal path, if set only Commits that include the path
137137
will be considered
138138
139-
``options``
140-
is a Hash ofoptional arguments to git where
139+
``kwargs``
140+
optional keyword arguments to git where
141141
``max_count`` is the maximum number of commits to fetch
142142
``skip`` is the number of commits to skip
143143

‎lib/git/head.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,33 @@ class Head(object):
2828

2929
def__init__(self,name,commit):
3030
"""
31-
Instantiate anew Head
31+
Initialize anewly instanced Head
3232
3333
`name`
3434
is the name of the head
3535
3636
`commit`
37-
is the Commit that the head points to
38-
39-
Returns
40-
git.Head
37+
is the Commit object that the head points to
4138
"""
4239
self.name=name
4340
self.commit=commit
4441

4542
@classmethod
4643
deffind_all(cls,repo,**kwargs):
4744
"""
48-
Find all Heads
45+
Find all Heads in the repository
4946
5047
`repo`
5148
is the Repo
5249
5350
`kwargs`
54-
is a dict of options
51+
Additional options given as keyword arguments, will be passed
52+
to git-for-each-ref
5553
5654
Returns
5755
git.Head[]
56+
57+
List is sorted by committerdate
5858
"""
5959

6060
options= {'sort':"committerdate",
@@ -67,12 +67,12 @@ def find_all(cls, repo, **kwargs):
6767
@classmethod
6868
deflist_from_string(cls,repo,text):
6969
"""
70-
Parse out head information intoan array of baked head objects
70+
Parse out head information intoa list of head objects
7171
7272
``repo``
7373
is the Repo
7474
``text``
75-
is the text output from the git command
75+
is the text output from the git-for-each-ref command
7676
7777
Returns
7878
git.Head[]
@@ -95,7 +95,8 @@ def from_string(cls, repo, line):
9595
``line``
9696
is the formatted head information
9797
98-
Format
98+
Format::
99+
99100
name: [a-zA-Z_/]+
100101
<null byte>
101102
id: [0-9A-Fa-f]{40}

‎lib/git/tag.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,33 @@
99
classTag(object):
1010
def__init__(self,name,commit):
1111
"""
12-
Instantiate anew Tag
12+
Initialize anewly instantiated Tag
1313
1414
``name``
1515
is the name of the head
1616
1717
``commit``
1818
is the Commit that the head points to
19-
20-
Returns
21-
``git.Tag``
2219
"""
2320
self.name=name
2421
self.commit=commit
2522

2623
@classmethod
2724
deffind_all(cls,repo,**kwargs):
2825
"""
29-
Find all Tags
26+
Find all Tags in the repository
3027
3128
``repo``
3229
is the Repo
3330
3431
``kwargs``
35-
is a dict of options
32+
Additional options given as keyword arguments, will be passed
33+
to git-for-each-ref
3634
3735
Returns
3836
``git.Tag[]``
37+
38+
List is sorted by committerdate
3939
"""
4040
options= {'sort':"committerdate",
4141
'format':"%(refname)%00%(objectname)"}
@@ -47,16 +47,16 @@ def find_all(cls, repo, **kwargs):
4747
@classmethod
4848
deflist_from_string(cls,repo,text):
4949
"""
50-
Parse out tag information into an array ofbakedTag objects
50+
Parse out tag information into an array of Tag objects
5151
5252
``repo``
5353
is the Repo
5454
5555
``text``
56-
is the text output from the git command
56+
is the text output from the git-for-each command
5757
5858
Returns
59-
``git.Tag[]``
59+
git.Tag[]
6060
"""
6161
tags= []
6262
forlineintext.splitlines():
@@ -74,13 +74,14 @@ def from_string(cls, repo, line):
7474
``line``
7575
is the formatted tag information
7676
77-
Format
77+
Format::
78+
7879
name: [a-zA-Z_/]+
7980
<null byte>
8081
id: [0-9A-Fa-f]{40}
81-
82+
8283
Returns
83-
``git.Tag``
84+
git.Tag
8485
"""
8586
full_name,ids=line.split("\x00")
8687
name=full_name.split("/")[-1]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp