hoe-git 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG.rdoc +11 -0
  3. data/README.rdoc +7 -4
  4. data/lib/hoe/git.rb +66 -17
  5. metadata +60 -17
  6. metadata.gz.sig +3 -0
Binary file
@@ -1,3 +1,14 @@
1
+ === 1.4.0 / 2011-05-16
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Exported all the other git functions so that other rake tasks can benefit.
6
+ * Updated git:changelog to support annotated commit messages.
7
+
8
+ * 1 bug fix:
9
+
10
+ * Fix shell escaping on Windows. [Gordon Thiesfeld]
11
+
1
12
  === 1.3.0 / 2009-07-27
2
13
 
3
14
  * Add a git:manifest task. [Phil Hagelb0rg]
@@ -24,12 +24,15 @@ This takes all the commit messages since your last release and formats
24
24
  'em into a nice RDoc fragment. If you specify <tt>VERSION</tt>, it'll
25
25
  be used in the changelog fragment. If you specify <tt>FROM</tt>, it'll
26
26
  be used as a starting point for the changelog instead of your last
27
- release.
27
+ tagged release.
28
28
 
29
- Commits that weren't made by a project developer will be attributed,
30
- like this:
29
+ The rdoc is automatically formatted into sections by using "annotated
30
+ commit messages" by using a simple format for multi-line commit messages:
31
31
 
32
- * Did a thing with the stuff. [I R Contributor]
32
+ ! major change description.
33
+ + minor change description.
34
+ - bug fix description.
35
+ un-logged description (for minor stuff like re-formatting).
33
36
 
34
37
  === Generating the Manifest
35
38
 
@@ -20,7 +20,7 @@ class Hoe #:nodoc:
20
20
  module Git
21
21
 
22
22
  # Duh.
23
- VERSION = "1.3.0"
23
+ VERSION = "1.4.0"
24
24
 
25
25
  # What do you want at the front of your release tags?
26
26
  # [default: <tt>"v"</tt>]
@@ -42,31 +42,51 @@ class Hoe #:nodoc:
42
42
 
43
43
  desc "Print the current changelog."
44
44
  task "git:changelog" do
45
- tags = git_tags
46
- tag = ENV["FROM"] || tags.last
45
+ tag = ENV["FROM"] || git_tags.last
47
46
  range = [tag, "HEAD"].compact.join ".."
48
- cmd = "git log #{range} '--format=tformat:%s|||%aN|||%aE'"
47
+ cmd = "git log #{range} '--format=tformat:%B|||%aN|||%aE|||'"
49
48
  now = Time.new.strftime "%Y-%m-%d"
50
49
 
51
- changes = `#{cmd}`.split("\n").map do |line|
52
- msg, author, email = line.split("|||").map { |e| e.empty? ? nil : e }
53
-
54
- developer = self.author.include?(author) ||
55
- self.email.include?(email)
56
-
57
- msg << " [#{author || email}]" unless developer
58
- msg
50
+ changes = `#{cmd}`.split(/\|\|\|/).each_slice(3).map do |msg, author, email|
51
+ msg.split(/\n/).reject { |s| s.empty? }
59
52
  end
60
53
 
54
+ changes = changes.flatten
55
+
61
56
  next if changes.empty?
62
57
 
58
+ $changes = Hash.new { |h,k| h[k] = [] }
59
+
60
+ codes = {
61
+ "!" => :major,
62
+ "+" => :minor,
63
+ "*" => :minor,
64
+ "-" => :bug,
65
+ "?" => :unknown,
66
+ }
67
+
68
+ codes_re = Regexp.escape codes.keys.join
69
+
70
+ changes.each do |change|
71
+ if change =~ /^\s*([#{codes_re}])\s*(.*)/ then
72
+ code, line = codes[$1], $2
73
+ else
74
+ code, line = codes["?"], change.chomp
75
+ end
76
+
77
+ $changes[code] << line
78
+ end
79
+
63
80
  puts "=== #{ENV['VERSION'] || 'NEXT'} / #{now}"
64
81
  puts
65
-
66
- changes.each { |change| puts "* #{change}" }
82
+ changelog_section :major
83
+ changelog_section :minor
84
+ changelog_section :bug
85
+ changelog_section :unknown
67
86
  puts
68
87
  end
69
88
 
89
+
70
90
  desc "Update the manifest with Git's file list. Use Hoe's excludes."
71
91
  task "git:manifest" do
72
92
  with_config do |config, _|
@@ -103,10 +123,12 @@ class Hoe #:nodoc:
103
123
  end
104
124
 
105
125
  def git_tag_and_push tag
126
+ msg = "Tagging #{tag}."
127
+
106
128
  if git_svn?
107
- sh "git svn tag #{tag} -m 'Tagging #{tag} release.'"
129
+ sh "git svn tag #{tag} -m '#{msg}'"
108
130
  else
109
- sh "git tag -f #{tag}"
131
+ sh "git tag -f #{tag} -m '#{msg}'"
110
132
  git_remotes.each { |remote| sh "git push -f #{remote} tag #{tag}" }
111
133
  end
112
134
  end
@@ -125,8 +147,35 @@ class Hoe #:nodoc:
125
147
  collect { |t| t.strip }.
126
148
  select { |t| t =~ %r{^#{prefix}/#{git_release_tag_prefix}} }
127
149
  else
128
- `git tag -l '#{git_release_tag_prefix}*'`.split "\n"
150
+ flags = "--date-order --simplify-by-decoration --pretty=format:%H"
151
+ hashes = `git log #{flags}`.split(/\n/).reverse
152
+ names = `git name-rev #{hashes.join " "}`.split(/\n/)
153
+ names = names.map { |s| s[/tags\/(v.+)/, 1] }.compact
154
+ names.select { |t| t =~ %r{^#{git_release_tag_prefix}} }
155
+ end
156
+ end
157
+
158
+ def changelog_section code
159
+ name = {
160
+ :major => "major enhancement",
161
+ :minor => "minor enhancement",
162
+ :bug => "bug fix",
163
+ :unknown => "unknown",
164
+ }[code]
165
+
166
+ changes = $changes[code]
167
+ count = changes.size
168
+ name += "s" if count > 1
169
+ name.sub!(/fixs/, 'fixes')
170
+
171
+ return if count < 1
172
+
173
+ puts "* #{count} #{name}:"
174
+ puts
175
+ changes.sort.each do |line|
176
+ puts " * #{line}"
129
177
  end
178
+ puts
130
179
  end
131
180
  end
132
181
  end
metadata CHANGED
@@ -1,37 +1,75 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ hash: 7
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 4
9
+ - 0
10
+ version: 1.4.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - John Barnette
8
14
  autorequire:
9
15
  bindir: bin
10
- cert_chain: []
16
+ cert_chain:
17
+ - |
18
+ -----BEGIN CERTIFICATE-----
19
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwE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23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
36
+ FBHgymkyj/AOSqKRIpXPhjC6
37
+ -----END CERTIFICATE-----
11
38
 
12
- date: 2009-07-27 00:00:00 -07:00
13
- default_executable:
39
+ date: 2011-05-17 00:00:00 Z
14
40
  dependencies:
15
41
  - !ruby/object:Gem::Dependency
16
42
  name: hoe
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
43
+ prerelease: false
44
+ requirement: &id001 !ruby/object:Gem::Requirement
45
+ none: false
20
46
  requirements:
21
47
  - - ">="
22
48
  - !ruby/object:Gem::Version
49
+ hash: 7
50
+ segments:
51
+ - 2
52
+ - 2
53
+ - 0
23
54
  version: 2.2.0
24
- version:
55
+ type: :runtime
56
+ version_requirements: *id001
25
57
  - !ruby/object:Gem::Dependency
26
58
  name: hoe
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
59
+ prerelease: false
60
+ requirement: &id002 !ruby/object:Gem::Requirement
61
+ none: false
30
62
  requirements:
31
63
  - - ">="
32
64
  - !ruby/object:Gem::Version
33
- version: 2.3.2
34
- version:
65
+ hash: 35
66
+ segments:
67
+ - 2
68
+ - 9
69
+ - 4
70
+ version: 2.9.4
71
+ type: :development
72
+ version_requirements: *id002
35
73
  description: |-
36
74
  A set of Hoe plugins for tighter Git integration. Provides tasks to
37
75
  automate release tagging and pushing and changelog generation. I
@@ -53,7 +91,6 @@ files:
53
91
  - README.rdoc
54
92
  - Rakefile
55
93
  - lib/hoe/git.rb
56
- has_rdoc: true
57
94
  homepage: http://github.com/jbarnette/hoe-git
58
95
  licenses: []
59
96
 
@@ -64,21 +101,27 @@ rdoc_options:
64
101
  require_paths:
65
102
  - lib
66
103
  required_ruby_version: !ruby/object:Gem::Requirement
104
+ none: false
67
105
  requirements:
68
106
  - - ">="
69
107
  - !ruby/object:Gem::Version
108
+ hash: 3
109
+ segments:
110
+ - 0
70
111
  version: "0"
71
- version:
72
112
  required_rubygems_version: !ruby/object:Gem::Requirement
113
+ none: false
73
114
  requirements:
74
115
  - - ">="
75
116
  - !ruby/object:Gem::Version
117
+ hash: 3
118
+ segments:
119
+ - 0
76
120
  version: "0"
77
- version:
78
121
  requirements: []
79
122
 
80
123
  rubyforge_project: hoe-git
81
- rubygems_version: 1.3.5
124
+ rubygems_version: 1.8.2
82
125
  signing_key:
83
126
  specification_version: 3
84
127
  summary: A set of Hoe plugins for tighter Git integration
@@ -0,0 +1,3 @@
1
+ ����'*P�*�xm�8:P%�|� -��1�˥���Oc\ԯ����Q5�<o�"9({��;�zZ.�J*�� U�+�1Go�&����D���Ų=:���� �w����ڪk���=󦧼�ܾL#���:#�D���Q�S&;��q�(�k
2
+ 3���@���(�s$���5�so�m!&�l�3�!��6�X�(L��@HFVG�{���~��C�ư��5����� �u+#�k�_ٍ\�A
3
+ ����%�u�q