git-releaselog 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +39 -22
- data/lib/git-releaselog/changelog.rb +1 -1
- data/lib/git-releaselog/changelog_helpers.rb +6 -6
- data/lib/git-releaselog/version.rb +1 -1
- data/lib/git-releaselog.rb +8 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9a861d8b2cb5f278d565f6c59660a0e39ebe315
|
4
|
+
data.tar.gz: 8ab4bbf3360885dd2fdf8b3f3f0306745ab3eedf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a871d0473ccb40284d36a40615cc7d8f5afd70661cea4e175e92cdcfc67d0b9b67e6d29f7cba71f3a2923941b752d9fec0a9ffe68f753744c0fcfe317bf2777e
|
7
|
+
data.tar.gz: bf070da9fd4560327f4fefea9c75c08a641d78f2954802ac32b95089703acc3aecfacec76d00a1d90707a426b4aded82d61c1858654ecbb8b042ddf10940ed59
|
data/README.md
CHANGED
@@ -1,21 +1,36 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/git-releaselog.svg)](http://badge.fury.io/rb/git-releaselog)
|
2
|
+
[![Build Status](https://travis-ci.org/iv-mexx/git-releaselog.svg?branch=master)](https://travis-ci.org/iv-mexx/git-releaselog)
|
3
|
+
|
1
4
|
# git-releaselog
|
2
5
|
|
3
|
-
This tool generates release log from a git repository.
|
6
|
+
This tool generates a release log from a git repository.
|
7
|
+
|
8
|
+
Its hard or even impossible to generate good releaselog from an ordinary git log.
|
9
|
+
The git log usually contains very detailed, technical information, targeted at the maintainers of a project.
|
10
|
+
|
11
|
+
In contrast, the releaselog should be targetet at the users of a project and should describe changes relevant to those users at a higher abstraction.
|
12
|
+
|
13
|
+
Thats why this tool does not attempt to build a releaselog from normal commit messages but instead requires special keywords to mark notes that should show up in the releaselog.
|
4
14
|
|
5
|
-
|
6
|
-
from an ordinary git log.
|
7
|
-
The git log usually contains very detailed, technical information, targeted
|
8
|
-
at the maintainers of a project.
|
15
|
+
These [keywords](#markup) can be used in commit messages.
|
9
16
|
|
10
|
-
|
11
|
-
|
17
|
+
As an example, check out [the changelog for this repo][releaselog] which is automatically generated using this tool. Furthermore, the git release messages are also generated with this tool, see [this release](https://github.com/iv-mexx/git-releaselog/releases/tag/0.7.0) for example.
|
18
|
+
|
19
|
+
## Installation
|
20
|
+
|
21
|
+
```
|
22
|
+
gem install git-releaselog
|
23
|
+
```
|
12
24
|
|
13
|
-
|
14
|
-
messages but instead requires special keywords to mark notes that should
|
15
|
-
show up in the releaselog.
|
25
|
+
#### Troubleshooting
|
16
26
|
|
17
|
-
|
18
|
-
|
27
|
+
If you are having problems with installing the [`rugged`](https://github.com/libgit2/rugged) dependency, maybe you need to install `cmake`:
|
28
|
+
|
29
|
+
```
|
30
|
+
brew install cmake
|
31
|
+
```
|
32
|
+
|
33
|
+
Check out the [Install Instructions](https://github.com/libgit2/rugged#install) of the `rugged` gem.
|
19
34
|
|
20
35
|
## Usage
|
21
36
|
|
@@ -34,10 +49,10 @@ Alternatively, you can choose the generate the whole releaselog for the whole re
|
|
34
49
|
|
35
50
|
* `git-releaselog --complete` will search the whole git log and group the changes nicely in sections by existing tags.
|
36
51
|
|
37
|
-
To control the markup of the output, you can use
|
52
|
+
To control the markup of the output, you can use the `--format` option (the default is slack):
|
38
53
|
|
39
|
-
* `--slack` produces output that looks nice when copy/pasted into slack
|
40
|
-
* `--md` produces markdown output in reverse order, e.g this repo's [releaselog]
|
54
|
+
* `--format slack` produces output that looks nice when copy/pasted into slack
|
55
|
+
* `--format md` produces markdown output in reverse order, e.g this repo's [releaselog]
|
41
56
|
|
42
57
|
## Markup
|
43
58
|
|
@@ -91,7 +106,7 @@ This is just what works best for us:
|
|
91
106
|
* Create Merge Requests for merging feature branches back to develop
|
92
107
|
* Feature branch / merge request should address specific features / fixes / ...
|
93
108
|
* The description of the merge request should contain markup for the releaselog
|
94
|
-
* The description of the merge request should be the commit message of the merge commit (done automatically e.g. by gitlab)
|
109
|
+
* The description of the merge request should be the commit message of the merge commit (done automatically e.g. by gitlab, manually for github!)
|
95
110
|
|
96
111
|
The only additional step from our normal workflow is to use special markup for the change log in the description of a merge request.
|
97
112
|
Doing so enables the generation of change logs between arbitrary commits / releases
|
@@ -130,15 +145,17 @@ Date: Tue May 26 12:49:00 2015 +0200
|
|
130
145
|
|
131
146
|
Notice, that commit `1f4abe3399891cfd429e5aa474e6c414f7e2b3b2` has an extra line with a `feat` keyword.
|
132
147
|
The releaselog for these commits looks like this:
|
133
|
-
`git-releaselog fa40cdb d41dac9 --md`
|
134
148
|
|
135
149
|
```
|
136
|
-
|
137
|
-
|
138
|
-
|
150
|
+
git-releaselog d41dac9 fa40cdb --format md
|
151
|
+
```
|
152
|
+
|
153
|
+
```
|
154
|
+
## Unreleased
|
155
|
+
(_26.05.2015_)
|
139
156
|
|
140
|
-
####
|
141
|
-
* use the `--complete` parameter to generate a complete
|
157
|
+
#### Feature
|
158
|
+
* use the `--complete` parameter to generate a complete changelog over all tags
|
142
159
|
```
|
143
160
|
|
144
161
|
[releaselog]: CHANGELOG.md
|
@@ -108,7 +108,7 @@ module Releaselog
|
|
108
108
|
str << commit_info { |ci| ci.empty? ? "" : "(_#{ci}_)\n" }
|
109
109
|
str << sections(
|
110
110
|
changes,
|
111
|
-
-> (header) { "\n
|
111
|
+
-> (header) { "\n#### #{header.capitalize}\n" },
|
112
112
|
-> (field, _index) { "* #{field}\n" }
|
113
113
|
)
|
114
114
|
|
@@ -6,17 +6,17 @@ include Releaselog
|
|
6
6
|
|
7
7
|
# check if the given refString (tag name or commit-hash) exists in the repo
|
8
8
|
def commit(repo, refString, logger)
|
9
|
+
logger.info("Searching for ref #{refString} in repo")
|
10
|
+
|
9
11
|
return unless refString != nil
|
10
12
|
begin
|
11
13
|
repo.lookup(refString)
|
12
14
|
rescue Rugged::OdbError => e
|
13
|
-
|
14
|
-
|
15
|
-
exit
|
15
|
+
logger.error("Searching for commit with ref #{refString} failure: #{e.message}")
|
16
|
+
return nil
|
16
17
|
rescue Exception => e
|
17
|
-
|
18
|
-
|
19
|
-
exit
|
18
|
+
logger.error("Searching for commit with ref #{refString} failure: #{e.message}")
|
19
|
+
return nil
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Releaselog
|
2
|
-
VERSION = "0.7.
|
2
|
+
VERSION = "0.7.1"
|
3
3
|
SUMMARY = "Generate a releaselog from a git repository"
|
4
4
|
DESCRIPTION = "Write your releaselog as part of your usual commit messages. This tool generates a useful releaselog from marked lines in your git commit messages"
|
5
5
|
end
|
data/lib/git-releaselog.rb
CHANGED
@@ -8,8 +8,8 @@ module Releaselog
|
|
8
8
|
class Releaselog
|
9
9
|
def self.generate_releaselog(options = {})
|
10
10
|
repo_path = options.fetch(:repo_path, '.')
|
11
|
-
from_ref_name = options.fetch(:from_ref, nil)
|
12
|
-
to_ref_name = options.fetch(:to_ref, nil)
|
11
|
+
from_ref_name = options.fetch(:from_ref, nil).strip
|
12
|
+
to_ref_name = options.fetch(:to_ref, nil).strip
|
13
13
|
scope = options.fetch(:scope, nil)
|
14
14
|
format = options.fetch(:format, 'slack')
|
15
15
|
generate_complete = options.fetch(:generate_complete, false)
|
@@ -49,7 +49,7 @@ module Releaselog
|
|
49
49
|
sorted_tags = repo.tags.sort { |t1, t2| t1.target.time <=> t2.target.time }
|
50
50
|
changeLogs = []
|
51
51
|
sorted_tags.each_with_index do |tag, index|
|
52
|
-
logger.
|
52
|
+
logger.info("Tag #{tag.name} with date #{tag.target.time}")
|
53
53
|
|
54
54
|
if index == 0
|
55
55
|
# First Interval: Generate from start of Repo to the first Tag
|
@@ -89,15 +89,17 @@ module Releaselog
|
|
89
89
|
end
|
90
90
|
else
|
91
91
|
# From which commit should the log be followed? Will default to the latest tag
|
92
|
-
commit_from = (from_ref && from_ref.target) || commit(repo,
|
92
|
+
commit_from = (from_ref && from_ref.target) || commit(repo, from_ref_name, logger) || latest_tag && (latest_tag.target)
|
93
|
+
logger.info("Commit-From: #{commit_from.oid}")
|
93
94
|
|
94
95
|
# To which commit should the log be followed? Will default to HEAD
|
95
|
-
commit_to = (to_ref && to_ref.target) || commit(repo,
|
96
|
+
commit_to = (to_ref && to_ref.target) || commit(repo, to_ref_name, logger) || repo.head.target
|
97
|
+
logger.info("Commit-To: #{commit_to.oid}")
|
96
98
|
|
97
99
|
|
98
100
|
changes = searchGitLog(repo, commit_from, commit_to, scope, logger)
|
99
101
|
# Create the changelog
|
100
|
-
log = Changelog.new(changes, from_ref, to_ref
|
102
|
+
log = Changelog.new(changes, from_ref, to_ref, commit_from, commit_to)
|
101
103
|
|
102
104
|
# Print the changelog
|
103
105
|
case format
|