1
1
# commit.py
2
- # Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
2
+ # Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors
3
3
#
4
4
# This module is part of GitPython and is released under
5
5
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
16
16
class Commit (LazyMixin ):
17
17
"""
18
18
Wraps a git Commit object.
19
-
20
- This class will act lazily on some of its attributes and will query the
19
+
20
+ This class will act lazily on some of its attributes and will query the
21
21
value on demand only if it involves calling the git binary.
22
22
"""
23
23
def __init__ (self ,repo ,id ,tree = None ,author = None ,authored_date = None ,
24
24
committer = None ,committed_date = None ,message = None ,parents = None ):
25
25
"""
26
- Instantiate a new Commit. All keyword arguments taking None as default will
27
- be implicitly set if id names a valid sha.
28
-
26
+ Instantiate a new Commit. All keyword arguments taking None as default will
27
+ be implicitly set if id names a valid sha.
28
+
29
29
The parameter documentation indicates the type of the argument after a colon ':'.
30
30
31
31
``id``
@@ -75,7 +75,7 @@ def __init__(self, repo, id, tree=None, author=None, authored_date=None,
75
75
76
76
def __bake__ (self ):
77
77
"""
78
- Called by LazyMixin superclass when the first uninitialized member needs
78
+ Called by LazyMixin superclass when the first uninitialized member needs
79
79
to be set as it is queried.
80
80
"""
81
81
temp = Commit .find_all (self .repo ,self .id ,max_count = 1 )[0 ]
@@ -133,7 +133,7 @@ def find_all(cls, repo, ref, path='', **kwargs):
133
133
is the ref from which to begin (SHA1 or name)
134
134
135
135
``path``
136
- is an optinal path, if set only Commits that include the path
136
+ is an optinal path, if set only Commits that include the path
137
137
will be considered
138
138
139
139
``kwargs``
@@ -210,9 +210,9 @@ def diff(cls, repo, a, b=None, paths=None):
210
210
211
211
Returns
212
212
git.Diff[]::
213
-
213
+
214
214
between tree and the index if only a is given
215
- between two trees if a and b are given and are commits
215
+ between two trees if a and b are given and are commits
216
216
"""
217
217
paths = paths or []
218
218
@@ -234,7 +234,7 @@ def diffs(self):
234
234
"""
235
235
Returns
236
236
git.Diff[]
237
- Diffs between this commit and its first parent or all changes if this
237
+ Diffs between this commit and its first parent or all changes if this
238
238
commit is the first commit and has no parent.
239
239
"""
240
240
if not self .parents :
@@ -252,9 +252,9 @@ def diffs(self):
252
252
@property
253
253
def stats (self ):
254
254
"""
255
- Create a git stat from changes between this commit and its first parent
255
+ Create a git stat from changes between this commit and its first parent
256
256
or from all changes done if this is the very first commit.
257
-
257
+
258
258
Return
259
259
git.Stats
260
260
"""