vclog 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.rdoc +10 -0
- data/README.rdoc +58 -2
- data/VERSION +3 -3
- data/lib/vclog/adapters/abstract.rb +3 -2
- data/lib/vclog/adapters/git.rb +28 -15
- data/lib/vclog/cli/abstract.rb +4 -3
- data/lib/vclog/formatter.rb +1 -1
- data/lib/vclog/heuristics.rb +17 -7
- data/lib/vclog/heuristics/default.rb +12 -8
- data/lib/vclog/history.rb +0 -1
- metadata +5 -5
data/HISTORY.rdoc
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
= RELEASE HISTORY
|
2
2
|
|
3
|
+
== 1.7.0 / 2010-06-27
|
4
|
+
|
5
|
+
In this release the heuristics interface has changed such that the block is passed the commit message and the matchdata, instead of the previous matchdata splat. The rule can alos return either the sybolic label or a two element array of label and new message, which allows the rule to "massage" the message as needed. This release also improves the git log parser to be much more robust.
|
6
|
+
|
7
|
+
Changes:
|
8
|
+
|
9
|
+
* Pass message and matchadata to heuristics rule interface.
|
10
|
+
* Improve git log parser, which should handle all possible cases now.
|
11
|
+
|
12
|
+
|
3
13
|
== 1.6.1 / 2010-06-23
|
4
14
|
|
5
15
|
This release repairs the Atom feed format and adds an RSS feed format. Both formats are nearly conformant with strict validations --only a couple minor issues remain to iron out (such as embedded feed url). Ragardless, they should work fine with feed readers (which are not as strict).
|
data/README.rdoc
CHANGED
@@ -12,17 +12,73 @@ It currently supports Git, Hg and (limited) Subversion.
|
|
12
12
|
|
13
13
|
== SYNOPSIS
|
14
14
|
|
15
|
-
|
15
|
+
=== Creating Changelogs
|
16
|
+
|
17
|
+
The default output is a ANSI colored GNU-like changelog.
|
16
18
|
From a repository's root directory try:
|
17
19
|
|
18
20
|
$ vclog
|
19
21
|
|
20
|
-
|
22
|
+
The is the same as specifying 'changelog' or 'log'.
|
23
|
+
|
24
|
+
$ vclog log
|
25
|
+
|
26
|
+
To generate an a different format use -f:
|
21
27
|
|
22
28
|
$ vclog -f xml
|
23
29
|
|
30
|
+
=== Creating Release Histories
|
31
|
+
|
32
|
+
To get a release history specify 'history' or 'release' as the subcommand.
|
33
|
+
|
34
|
+
$ vclog history
|
35
|
+
|
36
|
+
Again the default format is a ANSI colored GNU-like text style.
|
37
|
+
|
38
|
+
Unlike Changelogs, Histories group changes by tags. The tag message is
|
39
|
+
used as the release note. If the underlying SCM doesn't support
|
40
|
+
tag messages that the last commit message before the tag is used.
|
41
|
+
|
24
42
|
See 'vclog help' for more options.
|
25
43
|
|
44
|
+
=== Bumping Versions
|
45
|
+
|
46
|
+
VCLog can also be used to intelligently bump versions. To see the current
|
47
|
+
tag version:
|
48
|
+
|
49
|
+
$ vclog version
|
50
|
+
1.1.0
|
51
|
+
|
52
|
+
To see the next reasonable version based on current changes:
|
53
|
+
|
54
|
+
$ vclog bump
|
55
|
+
1.2.0
|
56
|
+
|
57
|
+
VCLog can determine the appropriate version based on commit level. Any
|
58
|
+
commit with a level greater than 1 will bump the major number, while any
|
59
|
+
commit with a level of 0 or 1 will bump the minor number. All lower
|
60
|
+
level only bump the patch level.
|
61
|
+
|
62
|
+
=== Writing Heuristics
|
63
|
+
|
64
|
+
In your projects .vclog/rules.rb or .config/vclog/rules.rb file, you
|
65
|
+
can create rules for labeling commit messages bassed on commit message.
|
66
|
+
|
67
|
+
on /updated? (README|VERSION|MANIFEST)/ do
|
68
|
+
:admin
|
69
|
+
end
|
70
|
+
|
71
|
+
These rules can a also "massage" the commit message for output.
|
72
|
+
|
73
|
+
on /^admin:/ do |matchdata|
|
74
|
+
[:admin, matchdate.post_match]
|
75
|
+
end
|
76
|
+
|
77
|
+
Labels are used to categorize and assign levels to commits. Use #set in
|
78
|
+
the rules.rb to specify the level and description of a commit label.
|
79
|
+
|
80
|
+
set :admin, -2, "Administrative Adjustment"
|
81
|
+
|
26
82
|
|
27
83
|
== NOTE ABOUT SUBVSERION
|
28
84
|
|
data/VERSION
CHANGED
@@ -38,15 +38,16 @@ module Adapters
|
|
38
38
|
end
|
39
39
|
|
40
40
|
#
|
41
|
+
# TODO: possbile to move heuristics lookup into Change class?
|
41
42
|
def changes
|
42
43
|
@changes ||= (
|
43
44
|
changes = []
|
44
45
|
extract_changes.each do |c|
|
45
46
|
raise "how did this happen?" if Change == c
|
46
47
|
rev, date, who, msg = *c
|
47
|
-
type, level, label = *heuristics.lookup(msg)
|
48
|
+
type, level, label, nmsg = *heuristics.lookup(msg)
|
48
49
|
next if level < self.level
|
49
|
-
changes << Change.new(rev, date, who, msg, type, level, label)
|
50
|
+
changes << Change.new(rev, date, who, nmsg||msg, type, level, label)
|
50
51
|
end
|
51
52
|
changes
|
52
53
|
)
|
data/lib/vclog/adapters/git.rb
CHANGED
@@ -11,8 +11,8 @@ module Adapters
|
|
11
11
|
#
|
12
12
|
def extract_changes
|
13
13
|
list = []
|
14
|
-
changelog = `git log --pretty=format:"
|
15
|
-
changes = changelog.split("
|
14
|
+
changelog = `git log --pretty=format:"\036|||%ci|~|%aN|~|%H|~|%s"`.strip
|
15
|
+
changes = changelog.split("\036|||")
|
16
16
|
#changes = changelog.split(/^commit/m)
|
17
17
|
changes.shift # throw the first (empty) entry away
|
18
18
|
changes.each do |entry|
|
@@ -40,21 +40,34 @@ module Adapters
|
|
40
40
|
tags = `git tag -l`
|
41
41
|
tags.split(/\s+/).each do |tag|
|
42
42
|
next unless version_tag?(tag) # only version tags
|
43
|
+
who, date, rev, msg = nil, nil, nil, nil
|
43
44
|
info = `git show #{tag}`
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
info, *_ = info.split(/^(commit|diff|----)/)
|
46
|
+
if /\Atag/ =~ info
|
47
|
+
msg = ''
|
48
|
+
info.lines.to_a[1..-1].each do |line|
|
49
|
+
case line
|
50
|
+
when /^Tagger:/
|
51
|
+
who = $'
|
52
|
+
when /^Date:/
|
53
|
+
date = $'
|
54
|
+
else
|
55
|
+
msg << line
|
56
|
+
end
|
57
|
+
end
|
58
|
+
msg = msg.strip
|
59
|
+
info = `git show #{tag}^ --pretty=format:"%ci|~|%H|~|"`
|
60
|
+
date, rev, *_ = *info.split('|~|')
|
61
|
+
else
|
62
|
+
info = `git show #{tag} --pretty=format:"%cn|~|%ce|~|%ci|~|%H|~|%s|~|"`
|
63
|
+
who, email, date, rev, msg, *_ = *info.split('|~|')
|
64
|
+
who = who + ' ' + email
|
65
|
+
end
|
49
66
|
|
50
|
-
|
51
|
-
date, rev,
|
52
|
-
|
53
|
-
#
|
54
|
-
#_who, _date, *_msg = *md[2].split(/\n/)
|
55
|
-
#_who = _who.split(':')[1].strip
|
56
|
-
#_date = _date[_date.index(':')+1..-1].strip
|
57
|
-
#_msg = _msg.join("\n")
|
67
|
+
#if $DEBUG
|
68
|
+
# p who, date, rev, msg
|
69
|
+
# puts
|
70
|
+
#end
|
58
71
|
|
59
72
|
list << [tag, rev, date, who, msg]
|
60
73
|
end
|
data/lib/vclog/cli/abstract.rb
CHANGED
@@ -22,9 +22,10 @@ module CLI
|
|
22
22
|
[name.split('::').last.downcase]
|
23
23
|
end
|
24
24
|
|
25
|
-
#
|
25
|
+
# TODO: change +extra+ to +summarize+ and reverse boolean value.
|
26
26
|
def initialize
|
27
27
|
@options = OpenStruct.new
|
28
|
+
@options.extra = true
|
28
29
|
end
|
29
30
|
|
30
31
|
#
|
@@ -65,8 +66,8 @@ module CLI
|
|
65
66
|
parser.on('--title', '-t TITLE', "document title") do |string|
|
66
67
|
options.title = string
|
67
68
|
end
|
68
|
-
parser.on('--
|
69
|
-
options.extra =
|
69
|
+
parser.on('--summarize', '-s', "produce summary output") do
|
70
|
+
options.extra = false
|
70
71
|
end
|
71
72
|
parser.on('--id', "include revision id") do
|
72
73
|
options.revision = true
|
data/lib/vclog/formatter.rb
CHANGED
data/lib/vclog/heuristics.rb
CHANGED
@@ -27,17 +27,18 @@ module VCLog
|
|
27
27
|
|
28
28
|
#
|
29
29
|
def lookup(message)
|
30
|
-
|
31
|
-
@rules.find{
|
30
|
+
type_msg = nil
|
31
|
+
@rules.find{|rule| type_msg = rule.call(message)}
|
32
|
+
type, msg = *type_msg
|
32
33
|
if type
|
33
34
|
type = type.to_sym
|
34
35
|
if @labels.key?(type)
|
35
|
-
@labels[type].to_a
|
36
|
+
@labels[type].to_a + [msg || message]
|
36
37
|
else
|
37
|
-
[type, 0, "#{type.to_s.capitalize} Enhancements"]
|
38
|
+
[type, 0, "#{type.to_s.capitalize} Enhancements", msg || message]
|
38
39
|
end
|
39
40
|
else
|
40
|
-
[nil, 0, 'General Enhancements']
|
41
|
+
[nil, 0, 'General Enhancements', msg || message]
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
@@ -74,14 +75,23 @@ module VCLog
|
|
74
75
|
|
75
76
|
#
|
76
77
|
class Rule
|
78
|
+
#
|
77
79
|
def initialize(pattern, &block)
|
78
80
|
@pattern = pattern
|
79
81
|
@block = block
|
80
82
|
end
|
81
83
|
|
84
|
+
# Process the rule.
|
82
85
|
def call(message)
|
83
|
-
if
|
84
|
-
@block.
|
86
|
+
if matchdata = @pattern.match(message)
|
87
|
+
case @block.arity
|
88
|
+
when 0
|
89
|
+
@block.call
|
90
|
+
when 1
|
91
|
+
@block.call(matchdata)
|
92
|
+
else
|
93
|
+
@block.call(message, matchdata)
|
94
|
+
end
|
85
95
|
else
|
86
96
|
nil
|
87
97
|
end
|
@@ -1,20 +1,24 @@
|
|
1
1
|
set :major, 1, "Major Enhancements"
|
2
|
+
set :bug, 0, "Bug Fixes"
|
2
3
|
set :minor, -1, "Minor Enhancements"
|
4
|
+
set :doc, -1, "Documentation Changes"
|
3
5
|
set :admin, -2, "Administrative Changes"
|
4
6
|
|
5
|
-
on
|
6
|
-
|
7
|
+
on /^(\w+):/ do |msg, md|
|
8
|
+
word = md[1]
|
9
|
+
[word.to_sym, md.post_match]
|
7
10
|
end
|
8
11
|
|
9
|
-
on
|
10
|
-
|
12
|
+
on /\[(\w+)\]\s*$/ do |msg, md|
|
13
|
+
word = md[1]
|
14
|
+
[word.to_sym, md.pre_match]
|
11
15
|
end
|
12
16
|
|
13
|
-
on
|
14
|
-
|
17
|
+
on /updated? (README|PROFILE|PACKAGE|VERSION|MANIFEST)/ do
|
18
|
+
:admin
|
15
19
|
end
|
16
20
|
|
17
|
-
on
|
18
|
-
|
21
|
+
on /(bump|bumped|prepare) version/ do
|
22
|
+
:admin
|
19
23
|
end
|
20
24
|
|
data/lib/vclog/history.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vclog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 7
|
9
|
+
- 0
|
10
|
+
version: 1.7.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Thomas Sawyer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-27 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|