create_changelog 1.3.2 → 1.4.1
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.
- checksums.yaml +4 -4
- data/{CHANGELOG.md → NEWS.md} +23 -6
- data/README.md +26 -29
- data/lib/changelog.rb +1 -1
- data/lib/git.rb +1 -1
- data/lib/version.rb +1 -1
- data/lib/version.rb~ +1 -1
- metadata +6 -27
- data/bin/ccl~ +0 -134
- data/features/changelog_only_recent_changes.feature~ +0 -51
- data/features/changelog_without_recent_changes.feature~ +0 -50
- data/features/commandline.feature~ +0 -21
- data/features/complete_changelog.feature~ +0 -51
- data/features/create_changelog.feature~ +0 -19
- data/features/decorate_output.feature~ +0 -30
- data/features/prepare_release.feature~ +0 -26
- data/features/step_definitions/git_steps.rb~ +0 -74
- data/features/step_definitions/stdout_steps.rb~ +0 -10
- data/features/support/assertions.rb~ +0 -7
- data/features/support/env.rb~ +0 -6
- data/lib/array.rb~ +0 -18
- data/lib/changelog.rb~ +0 -124
- data/lib/changelog_filter.rb~ +0 -58
- data/lib/commit_changelog.rb~ +0 -64
- data/lib/git.rb~ +0 -147
- data/lib/tag.rb~ +0 -50
- data/lib/tag_list.rb~ +0 -73
- data/test/test_changelog_filter.rb~ +0 -19
- data/test/test_tag_list.rb~ +0 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 045510ceb2accdf99976fceb64343d4ad79a4b43
|
4
|
+
data.tar.gz: 8b2e636aaf4c457fa0760a2399c2a96adb191678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3144d854c54393d680f541a18f42b2c7d52c8b27e066b550df5860af59ae746eb43813da79a4e76cd071597adec3978cffc8b4dee87a3d249ebe53a928b1cc81
|
7
|
+
data.tar.gz: cc89f63ea1dabb8e8210791bef26ef9f5d358fd8636be981ea3fbd929337bfcd28d26eb07c311a4c5ba8fca8caa5416dd6807b6e5ead513e18b8f7847a3d60d8
|
data/{CHANGELOG.md → NEWS.md}
RENAMED
@@ -1,5 +1,22 @@
|
|
1
|
+
Version 1.4.0 (2016-04-03)
|
2
|
+
------------------------------------------------------------------------
|
3
|
+
|
4
|
+
- CHANGED: Output uses second-level rather than first-level headings now.
|
5
|
+
- FIX: Prevent Git error message due to local .gitconfig configuration.
|
6
|
+
|
7
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
8
|
+
|
9
|
+
|
10
|
+
Version 1.3.4 (2015-10-05)
|
11
|
+
------------------------------------------------------------------------
|
12
|
+
|
13
|
+
- NEW: Create Ubuntu package (ppa:bovender/bovender)
|
14
|
+
|
15
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
16
|
+
|
17
|
+
|
1
18
|
Version 1.3.2 (2015-06-24)
|
2
|
-
|
19
|
+
------------------------------------------------------------------------
|
3
20
|
|
4
21
|
- FIX: Properly sort and identify latest tags (tags are sorted as version numbers).
|
5
22
|
|
@@ -7,7 +24,7 @@ Version 1.3.2 (2015-06-24)
|
|
7
24
|
|
8
25
|
|
9
26
|
Version 1.3.1 (2015-06-24)
|
10
|
-
|
27
|
+
------------------------------------------------------------------------
|
11
28
|
|
12
29
|
- CHANGED: Added author and license information to program banner.
|
13
30
|
- FIX: Do not crash on --no-recent if there aren't indeed recent changes.
|
@@ -17,7 +34,7 @@ Version 1.3.1 (2015-06-24)
|
|
17
34
|
|
18
35
|
|
19
36
|
Version 1.3.0 (2015-01-21)
|
20
|
-
|
37
|
+
------------------------------------------------------------------------
|
21
38
|
|
22
39
|
Version 1.3.0 adds a test suite that enables quality control during
|
23
40
|
development, and fixes a number of bugs that appeared during testing.
|
@@ -33,7 +50,7 @@ development, and fixes a number of bugs that appeared during testing.
|
|
33
50
|
|
34
51
|
|
35
52
|
Version 1.2.0 (2015-01-18)
|
36
|
-
|
53
|
+
------------------------------------------------------------------------
|
37
54
|
|
38
55
|
- FIX: Make "-r", "--recent" option actually work.
|
39
56
|
- FIX: Prevent combining -n and -r switch irrespective of order.
|
@@ -43,7 +60,7 @@ Version 1.2.0 (2015-01-18)
|
|
43
60
|
|
44
61
|
|
45
62
|
Version 1.1.0 (2015-01-18)
|
46
|
-
|
63
|
+
------------------------------------------------------------------------
|
47
64
|
|
48
65
|
- CHANGED: Accept dashes in addition to asterisks in changelog lines.
|
49
66
|
- NEW: Create gem.
|
@@ -52,7 +69,7 @@ Version 1.1.0 (2015-01-18)
|
|
52
69
|
|
53
70
|
|
54
71
|
Version 1.0.0 (2015-01-18)
|
55
|
-
|
72
|
+
------------------------------------------------------------------------
|
56
73
|
|
57
74
|
|
58
75
|
|
data/README.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
[](http://badge.fury.io/rb/create_changelog)
|
2
2
|
|
3
|
-
|
3
|
+
create-changelog
|
4
4
|
================
|
5
5
|
|
6
|
+
## Description
|
7
|
+
|
6
8
|
Ruby program with command-line interface that creates a changelog from
|
7
|
-
log lines in a
|
9
|
+
log lines in a Git repository that can be read and understood by end
|
8
10
|
users.
|
9
11
|
|
10
|
-
There are several approaches to creating changelog files from
|
12
|
+
There are several approaches to creating changelog files from Git
|
11
13
|
commits (e.g., [gitchangelog][], [gitlog-to-changelog][gl2cl] and many
|
12
14
|
more). None of these quite fit my needs, so I decided to create my own
|
13
15
|
tool.
|
@@ -29,14 +31,13 @@ The reason why I chose to have special changelog lines rather than
|
|
29
31
|
commit subjects is that commits are rather technical, but I want to have
|
30
32
|
a changelog that can be read by 'normal' end users.
|
31
33
|
|
32
|
-
|
34
|
+
create-changelog assumes that each tag in the repository represents a
|
33
35
|
release version. The changelog for a version consists of the tag's name,
|
34
36
|
the tag's annotation, and the unique combined, filtered changelog lines
|
35
37
|
of the tag annotation and all commits since the previous tag.
|
36
38
|
|
37
39
|
|
38
|
-
Usage
|
39
|
-
-----
|
40
|
+
## Usage
|
40
41
|
|
41
42
|
### Creating log entries
|
42
43
|
|
@@ -69,7 +70,7 @@ changelog entries.
|
|
69
70
|
### Generating the log
|
70
71
|
|
71
72
|
To generate a complete change log, simply run the tool in the directory
|
72
|
-
of the
|
73
|
+
of the Git repository, or indicate a working directory:
|
73
74
|
|
74
75
|
ccl -d /home/me/my/repository
|
75
76
|
|
@@ -78,7 +79,7 @@ process it using tools like [pandoc][] for example. Of course, it is
|
|
78
79
|
also possible to incorporate the command in the content files for a
|
79
80
|
static site generator such as [nanoc][].
|
80
81
|
|
81
|
-
If you want to track your log in the
|
82
|
+
If you want to track your log in the Git repository, you will not yet
|
82
83
|
have an annotated tag for the version you are preparing at the time when
|
83
84
|
you generate the changelog. In this case, the tool will use "Unpublished
|
84
85
|
changes" as the heading for the latest changes. To rather use the
|
@@ -110,8 +111,7 @@ annotation. For example, using the Vim text editor, issue:
|
|
110
111
|
The tool will make sure that no changelog lines are duplicated.
|
111
112
|
|
112
113
|
|
113
|
-
Changelog format
|
114
|
-
----------------
|
114
|
+
## Changelog format
|
115
115
|
|
116
116
|
The changelog format resembles the [suggestions][kacl] made by Olivier
|
117
117
|
Lacan, but it does not fully comply with Olivier's specification. I have
|
@@ -119,44 +119,41 @@ not yet have the time to implement automatic generation of subheadings.
|
|
119
119
|
Maybe I'll add the feature in the future.
|
120
120
|
|
121
121
|
|
122
|
-
To do
|
123
|
-
-----
|
122
|
+
## To do
|
124
123
|
|
125
124
|
- Add automatic subheadings
|
126
125
|
- Add ability to handle multi-line change log entries
|
127
126
|
- Add to-do list feature
|
128
127
|
|
129
128
|
|
130
|
-
|
131
|
-
------------
|
129
|
+
## Example
|
132
130
|
|
133
|
-
<http://xltoolbox.
|
131
|
+
<http://xltoolbox.net/changelog-ng>
|
134
132
|
|
135
133
|
... or of course [CHANGELOG.md][] in this repository.
|
136
134
|
|
137
135
|
|
138
|
-
Code
|
139
|
-
----
|
136
|
+
## Code
|
140
137
|
|
141
138
|
The code is documented in [Yard][] style. The `doc` subdirectory is
|
142
139
|
git-ignored so you can safely generate the docs.
|
143
140
|
|
144
141
|
|
145
|
-
License
|
146
|
-
|
142
|
+
## License
|
143
|
+
|
144
|
+
Copyright 2015 Daniel Kraus <bovender@bovender.de>
|
147
145
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
You may obtain a copy of the License at
|
146
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
147
|
+
you may not use this file except in compliance with the License.
|
148
|
+
You may obtain a copy of the License at
|
152
149
|
|
153
|
-
|
150
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
154
151
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
152
|
+
Unless required by applicable law or agreed to in writing, software
|
153
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
154
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
155
|
+
See the License for the specific language governing permissions and
|
156
|
+
limitations under the License.
|
160
157
|
|
161
158
|
[gitchangelog]: https://pypi.python.org/pypi/gitchangelog
|
162
159
|
[gl2cl]: https://github.com/manuelbua/gitver/blob/master/gitlog-to-changelog
|
data/lib/changelog.rb
CHANGED
@@ -107,7 +107,7 @@ class Changelog
|
|
107
107
|
tag.heading = @recent_changes_heading unless tag.heading
|
108
108
|
if tag.heading and (tag.text or combined_changelog)
|
109
109
|
output << tag.heading + " (#{tag.date})\n"
|
110
|
-
output << "
|
110
|
+
output << "-" * 72 + "\n"
|
111
111
|
end
|
112
112
|
output << tag.text.join("\n") if tag.text
|
113
113
|
output << "\n" if tag.heading or tag.text
|
data/lib/git.rb
CHANGED
data/lib/version.rb
CHANGED
data/lib/version.rb~
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: create_changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Kraus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem-man
|
@@ -68,61 +68,40 @@ dependencies:
|
|
68
68
|
version: 0.8.7
|
69
69
|
description: "\t\tRuby program with command-line interface that creates a changelog
|
70
70
|
from log\n\t\tlines in a git repository that can be read and understood by end users.\n"
|
71
|
-
email:
|
71
|
+
email: bovender@bovender.de
|
72
72
|
executables:
|
73
73
|
- ccl
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
-
|
77
|
+
- NEWS.md
|
78
78
|
- README.md
|
79
79
|
- bin/ccl
|
80
|
-
- bin/ccl~
|
81
80
|
- features/changelog_only_recent_changes.feature
|
82
|
-
- features/changelog_only_recent_changes.feature~
|
83
81
|
- features/changelog_without_recent_changes.feature
|
84
|
-
- features/changelog_without_recent_changes.feature~
|
85
|
-
- features/commandline.feature~
|
86
82
|
- features/complete_changelog.feature
|
87
|
-
- features/complete_changelog.feature~
|
88
|
-
- features/create_changelog.feature~
|
89
83
|
- features/decorate_output.feature
|
90
|
-
- features/decorate_output.feature~
|
91
|
-
- features/prepare_release.feature~
|
92
84
|
- features/step_definitions/git_steps.rb
|
93
|
-
- features/step_definitions/git_steps.rb~
|
94
85
|
- features/step_definitions/stdout_steps.rb
|
95
|
-
- features/step_definitions/stdout_steps.rb~
|
96
86
|
- features/support/assertions.rb
|
97
|
-
- features/support/assertions.rb~
|
98
87
|
- features/support/env.rb
|
99
|
-
- features/support/env.rb~
|
100
88
|
- lib/array.rb
|
101
|
-
- lib/array.rb~
|
102
89
|
- lib/changelog.rb
|
103
|
-
- lib/changelog.rb~
|
104
90
|
- lib/changelog_filter.rb
|
105
|
-
- lib/changelog_filter.rb~
|
106
91
|
- lib/commit_changelog.rb
|
107
|
-
- lib/commit_changelog.rb~
|
108
92
|
- lib/git.rb
|
109
|
-
- lib/git.rb~
|
110
93
|
- lib/tag.rb
|
111
|
-
- lib/tag.rb~
|
112
94
|
- lib/tag_list.rb
|
113
|
-
- lib/tag_list.rb~
|
114
95
|
- lib/version.rb
|
115
96
|
- lib/version.rb~
|
116
97
|
- test/test_changelog_filter.rb
|
117
|
-
- test/test_changelog_filter.rb~
|
118
98
|
- test/test_tag_list.rb
|
119
|
-
- test/test_tag_list.rb~
|
120
99
|
homepage: https://github.com/bovender/create-changelog
|
121
100
|
licenses:
|
122
101
|
- Apache License version 2
|
123
102
|
metadata: {}
|
124
103
|
post_install_message: |
|
125
|
-
create_changelog version 1.
|
104
|
+
create_changelog version 1.4.1 has been installed.
|
126
105
|
For usage information, type ccl -h
|
127
106
|
rdoc_options: []
|
128
107
|
require_paths:
|
@@ -139,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
118
|
version: '0'
|
140
119
|
requirements: []
|
141
120
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
121
|
+
rubygems_version: 2.5.1
|
143
122
|
signing_key:
|
144
123
|
specification_version: 4
|
145
124
|
summary: Creates end-user-friendly changelog from git messages.
|
data/bin/ccl~
DELETED
@@ -1,134 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Create-changelog
|
3
|
-
# Copyright 2015 Daniel Kraus
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
# you may not use this file except in compliance with the License.
|
6
|
-
# You may obtain a copy of the License at
|
7
|
-
#
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
#
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
# See the License for the specific language governing permissions and
|
14
|
-
# limitations under the License.
|
15
|
-
|
16
|
-
# Filters the git log of the repository in the current directory
|
17
|
-
# for unique lines that match the pattern
|
18
|
-
# * [KEYWORD]: [DESCRIPTION]
|
19
|
-
# The filtered lines are sorted and written to standard out.
|
20
|
-
|
21
|
-
require 'optparse'
|
22
|
-
require_relative '../lib/changelog.rb'
|
23
|
-
require_relative '../lib/git.rb'
|
24
|
-
require_relative '../lib/version.rb'
|
25
|
-
|
26
|
-
if !Git.is_installed?
|
27
|
-
abort("FATAL: Git is not installed or cannot be executed.")
|
28
|
-
end
|
29
|
-
|
30
|
-
class CreateChangelogCli
|
31
|
-
|
32
|
-
def initialize
|
33
|
-
@action = nil
|
34
|
-
@working_dir = Dir.pwd
|
35
|
-
@exclude_recent = false
|
36
|
-
end
|
37
|
-
|
38
|
-
# Sets the desired action and aborts if an action was previously set.
|
39
|
-
# This serves to exclude conflicting flags on the command line.
|
40
|
-
#
|
41
|
-
# @param [Symbol] action
|
42
|
-
# Desired action
|
43
|
-
def set_action(action)
|
44
|
-
abort "FATAL: Cannot combine these flags: #{action} and #{@action}." if @action
|
45
|
-
@action = action
|
46
|
-
end
|
47
|
-
|
48
|
-
def get_options
|
49
|
-
OptionParser.new do |opts|
|
50
|
-
exe_name = File.basename($PROGRAM_NAME)
|
51
|
-
opts.banner = <<EOF
|
52
|
-
create_changelog version #{CreateChangelog::VERSION} - <https://github.com/bovender/create-changelog>
|
53
|
-
(c) Copyright 2015 Daniel Kraus - distriuted under Apache License Version 2.0
|
54
|
-
Creates changelog from log entries in git log\n
|
55
|
-
Usage: #{exe_name} [options] [current_version]
|
56
|
-
EOF
|
57
|
-
opts.on("-r", "--recent",
|
58
|
-
"Include only most recent changes") do
|
59
|
-
set_action :recent
|
60
|
-
end
|
61
|
-
opts.on("-n", "--no-recent",
|
62
|
-
"Exclude the most recent changes (from untagged commits)") do
|
63
|
-
@exclude_recent = true
|
64
|
-
end
|
65
|
-
opts.on("-d WORKING_DIR", "--dir WORKING_DIR",
|
66
|
-
"Use alternate working directory") do |dir|
|
67
|
-
@working_dir = dir
|
68
|
-
end
|
69
|
-
opts.on("-v", "--version", "Print version information and exit.") do
|
70
|
-
set_action :version
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
# Changes to the repository directory and executes the block, but only
|
76
|
-
# if the directory does contain a Git repository and if the repository
|
77
|
-
# is not empty.
|
78
|
-
#
|
79
|
-
# @param [Block] &block
|
80
|
-
# Code to execute in the repository directory.
|
81
|
-
#
|
82
|
-
def in_repository(&block)
|
83
|
-
abort "FATAL: Directory does not exist" unless Dir.exist?(@working_dir)
|
84
|
-
Dir.chdir(@working_dir) do
|
85
|
-
abort "FATAL: Not a Git repository." unless Git.is_git_repository?
|
86
|
-
yield unless Git.is_empty_repository?
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# Generates a log of most recent changes only (since last tag)
|
91
|
-
#
|
92
|
-
def generate_recent
|
93
|
-
in_repository do
|
94
|
-
change_log = Changelog.new
|
95
|
-
output = change_log.generate_recent
|
96
|
-
puts output if output
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
# Generates a complete changelog
|
101
|
-
#
|
102
|
-
def generate_complete
|
103
|
-
in_repository do
|
104
|
-
change_log = Changelog.new
|
105
|
-
change_log.recent_changes_heading = ARGV[0] unless ARGV.empty?
|
106
|
-
output = change_log.generate(@exclude_recent)
|
107
|
-
puts output.rstrip if output
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
# Main method of the command line application
|
112
|
-
#
|
113
|
-
def main
|
114
|
-
get_options.parse!
|
115
|
-
@action = :complete if @action.nil?
|
116
|
-
if @exclude_recent && @action != :complete
|
117
|
-
abort "FATAL: --no-recent switch does not make sense here"
|
118
|
-
end
|
119
|
-
case @action
|
120
|
-
when :recent
|
121
|
-
generate_recent
|
122
|
-
when :complete
|
123
|
-
generate_complete
|
124
|
-
when :version
|
125
|
-
puts CreateChangelog::VERSION
|
126
|
-
else
|
127
|
-
abort "FATAL: Unknown action '#{@action}'"
|
128
|
-
end
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
CreateChangelogCli.new.main
|
133
|
-
|
134
|
-
# vim: nospell
|