@@ -11,36 +11,36 @@ class Commit(LazyMixin):
1111 def __init__ (self , repo , ** kwargs ):
1212 """
1313 Instantiate a new Commit
14-
14+
1515 ``id``
1616 is the id of the commit
17-
17+
1818 ``parents``
1919 is a list of commit ids (will be converted into Commit instances)
20-
20+
2121 ``tree``
2222 is the correspdonding tree id (will be converted into a Tree object)
23-
23+
2424 ``author``
2525 is the author string
26-
26+
2727 ``authored_date``
2828 is the authored DateTime
29-
29+
3030 ``committer``
3131 is the committer string
32-
33- ``committed_date``
32+
33+ ``committed_date``
3434 is the committed DateTime
35-
35+
3636 ``message``
3737 is the first line of the commit message
38-
39- Returns
38+
39+ Returns
4040 GitPython.Commit
4141 """
4242 LazyMixin .__init__ (self )
43-
43+
4444 self .repo = repo
4545 self .id = None
4646 self .tree = None
@@ -50,10 +50,10 @@ def __init__(self, repo, **kwargs):
5050 self .committed_date = None
5151 self .message = None
5252 self .parents = None
53-
53+
5454 for k , v in kwargs .items ():
5555 setattr (self , k , v )
56-
56+
5757 if self .id :
5858 if 'parents' in kwargs :
5959 self .parents = map (lambda p : Commit (repo , ** {'id' : p }), kwargs ['parents' ])
@@ -73,18 +73,18 @@ def __bake__(self):
7373 @property
7474 def id_abbrev (self ):
7575 return self .id [0 :7 ]
76-
76+
7777 @classmethod
7878 def count (cls , repo , ref ):
7979 """
8080 Count the number of commits reachable from this ref
81-
81+
8282 ``repo``
8383 is the Repo
84-
84+
8585 ``ref``
8686 is the ref from which to begin (SHA1 or name)
87-
87+
8888 Returns
8989 int
9090 """
@@ -96,79 +96,79 @@ def find_all(cls, repo, ref, **kwargs):
9696 Find all commits matching the given criteria.
9797 ``repo``
9898 is the Repo
99-
99+
100100 ``ref``
101101 is the ref from which to begin (SHA1 or name)
102-
102+
103103 ``options``
104104 is a Hash of optional arguments to git where
105105 ``max_count`` is the maximum number of commits to fetch
106106 ``skip`` is the number of commits to skip
107-
107+
108108 Returns
109109 GitPython.Commit[]
110110 """
111111 options = {'pretty' : 'raw' }
112112 options .update (kwargs )
113-
113+
114114 output = repo .git .rev_list (ref , ** options )
115115 return cls .list_from_string (repo , output )
116116
117117 @classmethod
118118 def list_from_string (cls , repo , text ):
119119 """
120120 Parse out commit information into a list of Commit objects
121-
121+
122122 ``repo``
123123 is the Repo
124-
124+
125125 ``text``
126126 is the text output from the git command (raw format)
127127
128128 Returns
129129 GitPython.Commit[]
130130 """
131131 lines = [l for l in text .splitlines () if l .strip ()]
132-
132+
133133 commits = []
134-
134+
135135 while lines :
136136 id = lines .pop (0 ).split ()[- 1 ]
137137 tree = lines .pop (0 ).split ()[- 1 ]
138-
138+
139139 parents = []
140140 while lines and re .search (r'^parent' , lines [0 ]):
141141 parents .append (lines .pop (0 ).split ()[- 1 ])
142142 author , authored_date = cls .actor (lines .pop (0 ))
143143 committer , committed_date = cls .actor (lines .pop (0 ))
144-
144+
145145 messages = []
146146 while lines and re .search (r'^ {4}' , lines [0 ]):
147147 messages .append (lines .pop (0 ).strip ())
148-
148+
149149 message = messages and messages [0 ] or ''
150-
150+
151151 commits .append (Commit (repo , id = id , parents = parents , tree = tree , author = author , authored_date = authored_date ,
152152 committer = committer , committed_date = committed_date , message = message ))
153-
153+
154154 return commits
155-
155+
156156 @classmethod
157157 def diff (cls , repo , a , b = None , paths = []):
158158 """
159159 Show diffs between two trees:
160-
160+
161161 ``repo``
162162 is the Repo
163-
163+
164164 ``a``
165165 is a named commit
166-
166+
167167 ``b``
168- is an optional named commit. Passing a list assumes you
169- wish to omit the second named commit and limit the diff to the
168+ is an optional named commit. Passing a list assumes you
169+ wish to omit the second named commit and limit the diff to the
170170 given paths.
171-
171+
172172 ``paths``
173173 is a list of paths to limit the diff.
174174
@@ -178,10 +178,10 @@ def diff(cls, repo, a, b = None, paths = []):
178178 if isinstance (b , list ):
179179 paths = b
180180 b = None
181-
181+
182182 if paths :
183183 paths .insert (0 , "--" )
184-
184+
185185 if b :
186186 paths .insert (0 , b )
187187 paths .insert (0 , a )
@@ -200,8 +200,8 @@ def diffs(self):
200200 d = ''
201201 return diff .Diff .list_from_string (self .repo , d )
202202 else :
203- return self .diff (self .repo , self .parents [0 ].id , self .id )
204-
203+ return self .diff (self .repo , self .parents [0 ].id , self .id )
204+
205205 @property
206206 def stats (self ):
207207 if not self .parents :
@@ -214,14 +214,14 @@ def stats(self):
214214 else :
215215 text = self .repo .git .diff (self .parents [0 ].id , self .id , ** {'numstat' : True })
216216 return stats .Stats .list_from_string (self .repo , text )
217-
217+
218218 def __str__ (self ):
219219 """ Convert commit to string which is SHA1 """
220220 return self .id
221-
221+
222222 def __repr__ (self ):
223223 return '<GitPython.Commit "%s">' % self .id
224-
224+
225225 @classmethod
226226 def actor (cls , line ):
227227 """
0 commit comments