Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1232f339a0 | ||
|
|
3cc6418048 | ||
|
|
a4f93feb7d | ||
|
|
b0be9f8b06 | ||
|
|
aeaec739f5 | ||
|
|
bf27187dd3 | ||
|
|
0e0295645d | ||
|
|
b2fac89ec1 | ||
|
|
947163426b | ||
|
|
2900025f6f | ||
|
|
802fb44d38 | ||
|
|
8b299a0394 | ||
|
|
111931a958 | ||
|
|
5a47a075e2 | ||
|
|
a35d08f6c7 | ||
|
|
c2e73edc29 | ||
|
|
045dff7cbc | ||
|
|
7c85082e7d | ||
|
|
cc65da5153 | ||
|
|
c22f8b4a31 | ||
|
|
2c46d32531 | ||
|
|
e822ddfc98 | ||
|
|
25a9490a07 | ||
|
|
92a39a4107 | ||
|
|
583021b474 | ||
|
|
961aa20138 | ||
|
|
396622bec0 | ||
|
|
eba475ee76 |
20
CHANGELOG.md
20
CHANGELOG.md
@@ -1,5 +1,25 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.3.9](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.9) (2015-03-06)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.8...1.3.9)
|
||||||
|
|
||||||
|
**Implemented enhancements:**
|
||||||
|
|
||||||
|
- Improve method of detecting owner and repository [\#63](https://github.com/skywinder/Github-Changelog-Generator/issues/63)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/Github-Changelog-Generator/pull/65) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
|
## [1.3.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.8) (2015-03-05)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.6...1.3.8)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Fix `git remote` parsing in case, when script running without parameters inside destination directory [\#61](https://github.com/skywinder/Github-Changelog-Generator/pull/61) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
|
## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
|
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -62,8 +62,8 @@ Changelog generation has never been so easy.
|
|||||||
github_changelog_generator
|
github_changelog_generator
|
||||||
|
|
||||||
- or from anywhere:
|
- or from anywhere:
|
||||||
|
- `github_changelog_generator -u github_username -p github_project`
|
||||||
github_changelog_generator -u github_username -p github_project
|
- `github_changelog_generator github_username/github_project`
|
||||||
|
|
||||||
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
||||||
|
|
||||||
@@ -116,19 +116,19 @@ It's time to create this token or wait for 1 hour before GitHub reset the counte
|
|||||||
|
|
||||||
##Features and advantages of this project
|
##Features and advantages of this project
|
||||||
- Generate canonical change log file, followed by [keepachangelog.com guidlines](http://keepachangelog.com/)
|
- Generate canonical change log file, followed by [keepachangelog.com guidlines](http://keepachangelog.com/)
|
||||||
- Simply add links for all closed issues and merged pull requests
|
|
||||||
- Possible to generate **Unreleased** changes (closed issues that have not released yet)
|
- Possible to generate **Unreleased** changes (closed issues that have not released yet)
|
||||||
- Flexible format customisation:
|
- **GitHub Enterprise support** via command line options!
|
||||||
- Customize issues, that should be added to changelog
|
- Flexible format **customisation**:
|
||||||
- Custom date format supported
|
- **Customize** issues, that **should be added** to changelog
|
||||||
|
- **Custom date format** supported
|
||||||
- Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version
|
- Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version
|
||||||
- Ability to exclude specific issues from change log (by labels)
|
- Ability to **exclude specific issues** from change log (by labels)
|
||||||
- Automatically exclude "questions" - issues marked as `question` labels (and other issues, that shouldn't be in change log file: with `duplicate invalid wontfix` labels)
|
- **Automatically exclude "questions"** - issues marked as `question` labels (and other issues, that shouldn't be in change log file: with `duplicate invalid wontfix` labels)
|
||||||
- Distinguish bug fixes, enchantments, and closed issues according labels.
|
- **Distinguish** bug fixes, enchantments, and closed issues **according labels**.
|
||||||
- **Issues** (closed issues w/o any labels)
|
- Issues (closed issues w/o any labels)
|
||||||
- **Merged pull-requests** (all merged pull-requests)
|
- Merged pull-requests (all merged pull-requests)
|
||||||
- **Bug-fixes** (by label `bug` in issue)
|
- Bug-fixes (by label `bug` in issue)
|
||||||
- **Enhancements** (by label `enhancement` in issue)
|
- Enhancements (by label `enhancement` in issue)
|
||||||
|
|
||||||
###Alternatives
|
###Alternatives
|
||||||
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But no one was satisfy my requirements.
|
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But no one was satisfy my requirements.
|
||||||
@@ -139,7 +139,7 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
|
|||||||
### Projects using this library
|
### Projects using this library
|
||||||
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
|
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
|
||||||
|
|
||||||
*If you are using `github_changelog_generator` for generation change log in your project or know of project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
|
*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
|
||||||
|
|
||||||
## Am I missed some essential feature?
|
## Am I missed some essential feature?
|
||||||
|
|
||||||
|
|||||||
@@ -2,16 +2,28 @@
|
|||||||
|
|
||||||
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
|
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...HEAD)
|
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.3...HEAD)
|
||||||
|
|
||||||
**Merged pull requests:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
|
- Add automatically generated change log file. [\#5](https://github.com/skywinder/changelog_test/pull/5) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
|
## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- fix \#3. hotfix. Should appear in v0.0.3 [\#4](https://github.com/skywinder/changelog_test/pull/4) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
|
## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
|
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
|
||||||
|
|
||||||
|
**Merged pull requests:**
|
||||||
|
|
||||||
|
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
|
||||||
|
|
||||||
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
|
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
if @options[:pulls]
|
if @options[:pulls]
|
||||||
@pull_requests = self.get_filtered_pull_requests
|
@pull_requests = self.get_filtered_pull_requests
|
||||||
self.fetch_merged_at_pull_requests
|
|
||||||
else
|
else
|
||||||
@pull_requests = []
|
@pull_requests = []
|
||||||
end
|
end
|
||||||
@@ -138,12 +137,12 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
def get_filtered_pull_requests
|
def get_filtered_pull_requests
|
||||||
|
|
||||||
pull_requests = @pull_requests
|
self.fetch_merged_at_pull_requests
|
||||||
filtered_pull_requests = pull_requests
|
|
||||||
|
|
||||||
|
filtered_pull_requests = @pull_requests.select {|pr| pr[:merged_at] != nil }
|
||||||
|
|
||||||
unless @options[:include_labels].nil?
|
unless @options[:include_labels].nil?
|
||||||
filtered_pull_requests = pull_requests.select { |issue|
|
filtered_pull_requests = @pull_requests.select { |issue|
|
||||||
#add all labels from @options[:incluse_labels] array
|
#add all labels from @options[:incluse_labels] array
|
||||||
(issue.labels.map { |label| label.name } & @options[:include_labels]).any?
|
(issue.labels.map { |label| label.name } & @options[:include_labels]).any?
|
||||||
}
|
}
|
||||||
@@ -157,7 +156,7 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
if @options[:add_issues_wo_labels]
|
if @options[:add_issues_wo_labels]
|
||||||
issues_wo_labels = pull_requests.select {
|
issues_wo_labels = @pull_requests.select {
|
||||||
# add issues without any labels
|
# add issues without any labels
|
||||||
|issue| !issue.labels.map { |label| label.name }.any?
|
|issue| !issue.labels.map { |label| label.name }.any?
|
||||||
}
|
}
|
||||||
@@ -332,7 +331,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
if filtered_issues.empty? && filtered_pull_requests.empty? && newer_tag.nil?
|
if filtered_issues.empty? && filtered_pull_requests.empty? && newer_tag.nil?
|
||||||
# do not generate empty unreleased section
|
# do not generate empty unreleased section
|
||||||
return nil
|
return ''
|
||||||
end
|
end
|
||||||
|
|
||||||
self.create_log(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name)
|
self.create_log(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name)
|
||||||
@@ -593,38 +592,35 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Async fetching events:
|
# Async fetching events:
|
||||||
threads = []
|
|
||||||
|
|
||||||
i = 0
|
fetch_events_async(@issues + @pull_requests)
|
||||||
|
|
||||||
@issues.each { |issue|
|
|
||||||
threads << Thread.new {
|
|
||||||
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
|
|
||||||
issue[:events] = obj.body
|
|
||||||
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
|
|
||||||
i +=1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@pull_requests.each { |pull_request|
|
|
||||||
threads << Thread.new {
|
|
||||||
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: pull_request['number']
|
|
||||||
pull_request[:events] = obj.body
|
|
||||||
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
|
|
||||||
i +=1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
threads.each { |thr| thr.join }
|
|
||||||
|
|
||||||
#to clear line from prev print
|
#to clear line from prev print
|
||||||
print " \r"
|
print " \r"
|
||||||
|
|
||||||
if @options[:verbose]
|
if @options[:verbose]
|
||||||
puts "Fetching events for issues and PR: Done! #{i}/#{@issues.count + @pull_requests.count}"
|
puts 'Fetching events for issues and PR: Done!'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def fetch_events_async(issues)
|
||||||
|
i = 0
|
||||||
|
max_thread_number = 50
|
||||||
|
threads = []
|
||||||
|
issues.each_slice(max_thread_number) { |issues_slice|
|
||||||
|
issues_slice.each { |issue|
|
||||||
|
threads << Thread.new {
|
||||||
|
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
|
||||||
|
issue[:events] = obj.body
|
||||||
|
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
|
||||||
|
i +=1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
threads.each { |thr| thr.join }
|
||||||
|
threads = []
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if __FILE__ == $0
|
if __FILE__ == $0
|
||||||
|
|||||||
@@ -129,17 +129,20 @@ module GitHubChangelogGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
if !options[:user] && !options[:project]
|
if !options[:user] && !options[:project]
|
||||||
remote = `git remote -vv`.split("\n")
|
remote = `git config --get remote.#{options[:branch]}.url`
|
||||||
# try to find repo in format: origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch)
|
# try to find repo in format:
|
||||||
remote.select { |v| v.include? options[:branch] }
|
# origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch)
|
||||||
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote[0])
|
# git@github.com:skywinder/Github-Changelog-Generator.git
|
||||||
|
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote)
|
||||||
|
|
||||||
if match && match[1] && match[2]
|
if match && match[1] && match[2]
|
||||||
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||||
options[:user], options[:project] = match[1], match[2]
|
options[:user], options[:project] = match[1], match[2]
|
||||||
else
|
else
|
||||||
# try to find repo in format: origin https://github.com/skywinder/ChangelogMerger (fetch)
|
# try to find repo in format:
|
||||||
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote[0])
|
# origin https://github.com/skywinder/ChangelogMerger (fetch)
|
||||||
|
# https://github.com/skywinder/ChangelogMerger
|
||||||
|
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote)
|
||||||
if match && match[1] && match[2]
|
if match && match[1] && match[2]
|
||||||
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||||
options[:user], options[:project] = match[1], match[2]
|
options[:user], options[:project] = match[1], match[2]
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
VERSION = '1.3.8'
|
VERSION = '1.3.10'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user