@@ -100,13 +100,16 @@ def tags(self):
100100 """
101101 return Tag .find_all (self )
102102
103- def commits (self , start = 'master' , max_count = 10 , skip = 0 ):
103+ def commits (self , start = 'master' , path = '' , max_count = 10 , skip = 0 ):
104104 """
105105 A list of Commit objects representing the history of a given ref/commit
106106
107107 ``start``
108108 is the branch/commit name (default 'master')
109109
110+ ``path``
111+ is an optional path
112+
110113 ``max_count``
111114 is the maximum number of commits to return (default 10)
112115
@@ -119,9 +122,9 @@ def commits(self, start = 'master', max_count = 10, skip = 0):
119122 options = {'max_count' : max_count ,
120123 'skip' : skip }
121124
122- return Commit .find_all (self , start , ** options )
125+ return Commit .find_all (self , start , path , ** options )
123126
124- def commits_between (self , frm , to ):
127+ def commits_between (self , frm , to , path = '' ):
125128 """
126129 The Commits objects that are reachable via ``to`` but not via ``frm``
127130 Commits are returned in chronological order.
@@ -132,19 +135,25 @@ def commits_between(self, frm, to):
132135 ``to``
133136 is the branch/commit name of the older item
134137
138+ ``path``
139+ is an optinal path
140+
135141 Returns
136142 ``git.Commit[]``
137143 """
138- return Commit .find_all (self , "%s..%s" % (frm , to )).reverse ()
144+ return Commit .find_all (self , "%s..%s" % (frm , to ), path ).reverse ()
139145
140- def commits_since (self , start = 'master' , since = '1970-01-01' ):
146+ def commits_since (self , start = 'master' , path = '' , since = '1970-01-01' ):
141147 """
142148 The Commits objects that are newer than the specified date.
143149 Commits are returned in chronological order.
144150
145151 ``start``
146152 is the branch/commit name (default 'master')
147153
154+ ``path``
155+ is an optinal path
156+
148157 ``since``
149158 is a string represeting a date/time
150159
@@ -153,33 +162,39 @@ def commits_since(self, start = 'master', since = '1970-01-01'):
153162 """
154163 options = {'since' : since }
155164
156- return Commit .find_all (self , start , ** options )
165+ return Commit .find_all (self , start , path , ** options )
157166
158- def commit_count (self , start = 'master' ):
167+ def commit_count (self , start = 'master' , path = '' ):
159168 """
160169 The number of commits reachable by the given branch/commit
161170
162171 ``start``
163172 is the branch/commit name (default 'master')
164173
174+ ``path``
175+ is an optinal path
176+
165177 Returns
166178 int
167179 """
168- return Commit .count (self , start )
180+ return Commit .count (self , start , path )
169181
170- def commit (self , id ):
182+ def commit (self , id , path = '' ):
171183 """
172184 The Commit object for the specified id
173185
174186 ``id``
175187 is the SHA1 identifier of the commit
176188
189+ ``path``
190+ is an optinal path
191+
177192 Returns
178193 git.Commit
179194 """
180195 options = {'max_count' : 1 }
181196
182- commits = Commit .find_all (self , id , ** options )
197+ commits = Commit .find_all (self , id , path , ** options )
183198
184199 if not commits :
185200 raise ValueError , 'Invalid identifier %s' % id
0 commit comments