@@ -192,7 +192,7 @@ def repository_default_branch(repository)
192
192
# @return [String] the tag name
193
193
#
194
194
# @raise [ArgumentError] if the commit_ish is a string starting with a hyphen
195
- #
195
+ #
196
196
def describe ( commit_ish = nil , opts = { } )
197
197
assert_args_are_not_options ( 'commit-ish object' , commit_ish )
198
198
@@ -218,7 +218,37 @@ def describe(commit_ish = nil, opts = {})
218
218
return command ( 'describe' , *arr_opts )
219
219
end
220
220
221
- def log_commits ( opts = { } )
221
+ # Return the commits that are within the given revision range
222
+ #
223
+ # @see https://git-scm.com/docs/git-log git-log
224
+ #
225
+ # @param opts [Hash] the given options
226
+ #
227
+ # @option opts :count [Integer] the maximum number of commits to return (maps to max-count)
228
+ # @option opts :all [Boolean]
229
+ # @option opts :cherry [Boolean]
230
+ # @option opts :since [String]
231
+ # @option opts :until [String]
232
+ # @option opts :grep [String]
233
+ # @option opts :author [String]
234
+ # @option opts :between [Array<String>] an array of two commit-ish strings to specify a revision range
235
+ #
236
+ # Only :between or :object options can be used, not both.
237
+ #
238
+ # @option opts :object [String] the revision range for the git log command
239
+ #
240
+ # Only :between or :object options can be used, not both.
241
+ #
242
+ # @option opts :path_limiter [Array<String>, String] only include commits that impact files from the specified paths
243
+ #
244
+ # @return [Array<String>] the log output
245
+ #
246
+ # @raise [ArgumentError] if the resulting revision range is a string starting with a hyphen
247
+ #
248
+ def log_commits ( opts = { } )
249
+ assert_args_are_not_options ( 'between' , opts [ :between ] &.first )
250
+ assert_args_are_not_options ( 'object' , opts [ :object ] )
251
+
222
252
arr_opts = log_common_options ( opts )
223
253
224
254
arr_opts << '--pretty=oneline'
@@ -228,7 +258,47 @@ def log_commits(opts={})
228
258
command_lines ( 'log' , *arr_opts ) . map { |l | l . split . first }
229
259
end
230
260
231
- def full_log_commits ( opts = { } )
261
+ # Return the commits that are within the given revision range
262
+ #
263
+ # @see https://git-scm.com/docs/git-log git-log
264
+ #
265
+ # @param opts [Hash] the given options
266
+ #
267
+ # @option opts :count [Integer] the maximum number of commits to return (maps to max-count)
268
+ # @option opts :all [Boolean]
269
+ # @option opts :cherry [Boolean]
270
+ # @option opts :since [String]
271
+ # @option opts :until [String]
272
+ # @option opts :grep [String]
273
+ # @option opts :author [String]
274
+ # @option opts :between [Array<String>] an array of two commit-ish strings to specify a revision range
275
+ #
276
+ # Only :between or :object options can be used, not both.
277
+ #
278
+ # @option opts :object [String] the revision range for the git log command
279
+ #
280
+ # Only :between or :object options can be used, not both.
281
+ #
282
+ # @option opts :path_limiter [Array<String>, String] only include commits that impact files from the specified paths
283
+ # @option opts :skip [Integer]
284
+ #
285
+ # @return [Array<Hash>] the log output parsed into an array of hashs for each commit
286
+ #
287
+ # Each hash contains the following keys:
288
+ # * 'sha' [String] the commit sha
289
+ # * 'author' [String] the author of the commit
290
+ # * 'message' [String] the commit message
291
+ # * 'parent' [Array<String>] the commit shas of the parent commits
292
+ # * 'tree' [String] the tree sha
293
+ # * 'author' [String] the author of the commit and timestamp of when the changes were created
294
+ # * 'committer' [String] the committer of the commit and timestamp of when the commit was applied
295
+ #
296
+ # @raise [ArgumentError] if the revision range (specified with :between or :object) is a string starting with a hyphen
297
+ #
298
+ def full_log_commits ( opts = { } )
299
+ assert_args_are_not_options ( 'between' , opts [ :between ] &.first )
300
+ assert_args_are_not_options ( 'object' , opts [ :object ] )
301
+
232
302
arr_opts = log_common_options ( opts )
233
303
234
304
arr_opts << '--pretty=raw'
0 commit comments