thicket 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/thicket/log.rb +11 -1
- data/lib/thicket/option_parser.rb +5 -0
- data/lib/thicket/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1eb22740e372653621cb4cfc8725d08a6d32c25c2c038ea814c313a2e402fe2
|
4
|
+
data.tar.gz: f54050ce5287fe08e34eecda262a306432d0cc5fbe349e93a010fee7e59dd64c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92289582964876fa96921d9da58ddbc1a952cb4bdbcd00fe0305f70c1047209b68e51bb5624fa409b454e742f23133e4c253c26f393833ccbed02a5a89137904
|
7
|
+
data.tar.gz: faea2aaa37e7b6bb45c7ab50df1c9fee6df2e672c6baeecded45703665116aa2b5b42603ba1c3ecee2164b9c0cae38adc88c39c056bb6750abfe494bf48686ba
|
data/lib/thicket/log.rb
CHANGED
@@ -9,6 +9,7 @@ module Thicket
|
|
9
9
|
|
10
10
|
def initialize(options)
|
11
11
|
@options = options
|
12
|
+
@count_parsed = 0
|
12
13
|
end
|
13
14
|
|
14
15
|
# Gets a printable version of the log for purposes of printing to a
|
@@ -16,7 +17,15 @@ module Thicket
|
|
16
17
|
# the user.
|
17
18
|
def print
|
18
19
|
FileUtils.cd(git_working_directory)
|
19
|
-
`#{git_log_command}`.split("\n").each
|
20
|
+
`#{git_log_command}`.split("\n").each do |l|
|
21
|
+
puts process_git_log_line(l)
|
22
|
+
|
23
|
+
next unless @options[:limit] && @count_parsed >= @options[:limit]
|
24
|
+
|
25
|
+
puts "..."
|
26
|
+
puts "Stopped after #{@options[:limit]} commits. More commit history exists."
|
27
|
+
exit
|
28
|
+
end
|
20
29
|
rescue Errno::EPIPE, SystemExit, Interrupt
|
21
30
|
exit
|
22
31
|
end
|
@@ -32,6 +41,7 @@ module Thicket
|
|
32
41
|
process_date_time(matcher[1], line, matcher[3])
|
33
42
|
process_message_prefix(matcher[4], line) if @options[:color_prefixes]
|
34
43
|
process_author_name(matcher[2], line)
|
44
|
+
@count_parsed += 1
|
35
45
|
end
|
36
46
|
|
37
47
|
line
|
@@ -37,6 +37,11 @@ module Thicket
|
|
37
37
|
@options[:project_directory] = File.expand_path(project_directory)
|
38
38
|
end
|
39
39
|
|
40
|
+
opts.on("-n", "--commit-limit LIMIT", Integer, "Number of commits to parse before stopping") do |limit|
|
41
|
+
args.name = limit
|
42
|
+
@options[:limit] = limit
|
43
|
+
end
|
44
|
+
|
40
45
|
opts.on("-a", "--all", TrueClass, "Displays all branches on all remotes.") do |all|
|
41
46
|
args.name = all
|
42
47
|
@options[:all] = all
|
data/lib/thicket/version.rb
CHANGED