From f8a59643cadb1626b7fb7b2f22959a48711185e6 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 01:11:25 +0200 Subject: [PATCH 01/17] update chlg --- lib/CHANGELOG.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index e291b16..ca50b6e 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) +#### 17/02/15 +- *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) + ## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) #### 26/01/15 @@ -28,13 +33,13 @@ - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) -- *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) - - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) ## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) #### 16/12/14 +- *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) + - *Implemented enhancement:* Detailed output [\#33](https://github.com/skywinder/Github-Changelog-Generator/issues/33) - *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30) @@ -101,11 +106,11 @@ ## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) #### 10/11/14 +- *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) + ## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) #### 07/11/14 -- *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) - - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder)) From bcae8048092b122e7a3fd7d6e72bb8e79822d3cb Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 01:24:51 +0200 Subject: [PATCH 02/17] Add filtering of Pull Requests by milestones --- lib/CHANGELOG.md | 6 ++- lib/github_changelog_generator.rb | 69 +++++++++++++++++-------------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index ca50b6e..82c4e60 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -3,6 +3,8 @@ ## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) #### 17/02/15 +- *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) + - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) ## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) @@ -29,8 +31,6 @@ ## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) #### 16/12/14 -- *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) - - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) @@ -38,6 +38,8 @@ ## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) #### 16/12/14 +- *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) + - *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) - *Implemented enhancement:* Detailed output [\#33](https://github.com/skywinder/Github-Changelog-Generator/issues/33) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 49d611b..18f7d95 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -293,44 +293,49 @@ module GitHubChangelogGenerator if @options[:filter_issues_by_milestone] #delete excess irrelevant issues (according milestones) - filtered_issues.select! { |issue| - if issue.milestone.nil? - true - else - #check, that this milestone in tag list: - milestone_is_tag = @all_tags.find { |tag| - tag.name == issue.milestone.title - } - milestone_is_tag.nil? - end - - } - - #add missed issues (according milestones) - issues_to_add = @issues.select { |issue| - if issue.milestone.nil? - false - else - #check, that this milestone in tag list: - milestone_is_tag = @all_tags.find { |tag| - tag.name == issue.milestone.title - } - - if milestone_is_tag.nil? - false - else - issue.milestone.title == newer_tag_name - end - end - } - - filtered_issues |= issues_to_add + filtered_issues = filter_by_milestone(filtered_issues, newer_tag_name, @issues) + filtered_pull_requests = filter_by_milestone(filtered_pull_requests, newer_tag_name, @pull_requests) end self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time, older_tag_name) end + def filter_by_milestone(filtered_issues, newer_tag_name, src_array) + filtered_issues.select! { |issue| + if issue.milestone.nil? + true + else + #check, that this milestone in tag list: + milestone_is_tag = @all_tags.find { |tag| + tag.name == issue.milestone.title + } + milestone_is_tag.nil? + end + + } + + #add missed issues (according milestones) + issues_to_add = src_array.select { |issue| + if issue.milestone.nil? + false + else + #check, that this milestone in tag list: + milestone_is_tag = @all_tags.find { |tag| + tag.name == issue.milestone.title + } + + if milestone_is_tag.nil? + false + else + issue.milestone.title == newer_tag_name + end + end + } + + filtered_issues |= issues_to_add + end + def delete_by_time(array, hash_key, newer_tag_time, older_tag = nil) older_tag_time = self.get_time_of_tag(older_tag) From abebd4c81b8747e3173704b2c2e8f9ab86157d99 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 01:26:38 +0200 Subject: [PATCH 03/17] Fix #50 --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca50b6e..82c4e60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) #### 17/02/15 +- *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) + - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) ## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) @@ -29,8 +31,6 @@ ## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) #### 16/12/14 -- *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) - - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) @@ -38,6 +38,8 @@ ## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) #### 16/12/14 +- *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) + - *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) - *Implemented enhancement:* Detailed output [\#33](https://github.com/skywinder/Github-Changelog-Generator/issues/33) From 3e981bb7411e92d207db1dde56c9642c9315a45f Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 18:34:32 +0200 Subject: [PATCH 04/17] fix: fix date format more info at: http://xkcd.com/1179/ --- lib/CHANGELOG.md | 44 +++++++++++------------- lib/github_changelog_generator/parser.rb | 2 +- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index ebff5f2..98ec6c4 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -2,24 +2,24 @@ ## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) -#### 17/02/15 +#### 2015-02-17 - *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) ## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) -#### 26/01/15 +#### 2015-01-26 - *Merged pull-request:* Add compare link between older version and newer version [\#46](https://github.com/skywinder/Github-Changelog-Generator/pull/46) ([sue445](https://github.com/sue445)) ## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) -#### 21/01/15 +#### 2015-01-21 - *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao)) ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) -#### 15/01/15 +#### 2015-01-15 - *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing)) - *Merged pull-request:* support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett)) @@ -30,16 +30,16 @@ ## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) -#### 16/12/14 +#### 2014-12-16 - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) -- *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) - - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) +- *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) + ## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) -#### 16/12/14 +#### 2014-12-16 - *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) @@ -50,14 +50,14 @@ ## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) -#### 10/12/14 +#### 2014-12-10 - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef)) - *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) ## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) -#### 22/11/14 +#### 2014-11-22 - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder)) @@ -66,7 +66,7 @@ ## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) -#### 19/11/14 +#### 2014-11-19 - *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Test Pull-Request SHOULD NOT APPEAR IN LOG! [\#26](https://github.com/skywinder/Github-Changelog-Generator/pull/26) ([skywinder](https://github.com/skywinder)) @@ -77,21 +77,21 @@ ## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) -#### 18/11/14 +#### 2014-11-18 - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19) ## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) -#### 12/11/14 +#### 2014-11-12 - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder)) ## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) -#### 10/11/14 +#### 2014-11-10 - *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Sort issues by tags [\#14](https://github.com/skywinder/Github-Changelog-Generator/pull/14) ([skywinder](https://github.com/skywinder)) @@ -100,7 +100,7 @@ ## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) -#### 10/11/14 +#### 2014-11-10 - *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11) - *Fixed bug:* Markdown formating in the last line wrong [\#9](https://github.com/skywinder/Github-Changelog-Generator/issues/9) @@ -109,14 +109,12 @@ ## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) -#### 10/11/14 +#### 2014-11-10 - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) ## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) -#### 07/11/14 -- *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) - +#### 2014-11-07 - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder)) @@ -129,16 +127,16 @@ ## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) -#### 07/11/14 +#### 2014-11-07 - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder)) ## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) -#### 06/11/14 +#### 2014-11-06 ## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) -#### 06/11/14 +#### 2014-11-06 -\* *This changelog was generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* +\* *This changelog was generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 6aa4533..784ed2f 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' From 07073ea02c02b4cbde01de2f30fb4f8a0e19a6a4 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 18:43:17 +0200 Subject: [PATCH 05/17] fix: Change CHANGELOG format for date presentation. More info here: https://github.com/olivierlacan/keep-a-changelog/issues/59 and here http://en.wikipedia.org/wiki/ISO_8601 --- lib/CHANGELOG.md | 72 +++++++++++++++---------------- lib/github_changelog_generator.rb | 14 +++--- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index 98ec6c4..9e4cc68 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,25 +1,25 @@ # Changelog -## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) +## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) -#### 2015-02-17 + - *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) -## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) +## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) (2015-01-26) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) -#### 2015-01-26 + - *Merged pull-request:* Add compare link between older version and newer version [\#46](https://github.com/skywinder/Github-Changelog-Generator/pull/46) ([sue445](https://github.com/sue445)) -## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) +## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) (2015-01-21) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) -#### 2015-01-21 + - *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao)) -## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) +## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) -#### 2015-01-15 + - *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing)) - *Merged pull-request:* support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett)) @@ -28,18 +28,18 @@ - *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32) -## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) +## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) (2014-12-16) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) -#### 2014-12-16 + - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) - *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) -## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) +## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) (2014-12-16) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) -#### 2014-12-16 + - *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) @@ -48,25 +48,25 @@ - *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30) -## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) +## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) (2014-12-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) -#### 2014-12-10 + - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef)) - *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) -## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) +## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) (2014-11-22) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) -#### 2014-11-22 + - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder)) - *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20) -## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) +## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) (2014-11-19) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) -#### 2014-11-19 + - *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Test Pull-Request SHOULD NOT APPEAR IN LOG! [\#26](https://github.com/skywinder/Github-Changelog-Generator/pull/26) ([skywinder](https://github.com/skywinder)) @@ -75,46 +75,46 @@ - *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder)) -## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) +## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) (2014-11-18) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) -#### 2014-11-18 + - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19) -## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) +## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) (2014-11-12) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) -#### 2014-11-12 + - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder)) -## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) +## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) (2014-11-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) -#### 2014-11-10 + - *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Sort issues by tags [\#14](https://github.com/skywinder/Github-Changelog-Generator/pull/14) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder)) -## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) +## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) (2014-11-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) -#### 2014-11-10 + - *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11) - *Fixed bug:* Markdown formating in the last line wrong [\#9](https://github.com/skywinder/Github-Changelog-Generator/issues/9) - *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12) -## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) +## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) (2014-11-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) -#### 2014-11-10 + - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) -## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) +## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) (2014-11-07) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) -#### 2014-11-07 + - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder)) @@ -125,18 +125,18 @@ - *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5) -## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) +## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) (2014-11-07) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) -#### 2014-11-07 + - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder)) -## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) +## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) (2014-11-06) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) -#### 2014-11-06 -## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) -#### 2014-11-06 + +## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06) + \* *This changelog was generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 18f7d95..e27325d 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -373,18 +373,20 @@ module GitHubChangelogGenerator project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}" + #Generate date string: + time_string = newer_tag_time.strftime @options[:format] + # Generate tag name and link - log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name})\n" + log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name}) (#{time_string})\n" + if @options[:compare_link] && older_tag_name # Generate compare link - log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n" + log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n\n" + else + log += "\n" end - #Generate date string: - time_string = newer_tag_time.strftime @options[:format] - log += "#### #{time_string}\n" - if @options[:pulls] # Generate pull requests: pull_requests.each { |pull_request| From 454bfb5a868d4d814eef375c82d7e301b5d622ed Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 18:27:57 +0200 Subject: [PATCH 06/17] cm --- lib/CHANGELOG.md | 71 +++++++------- lib/github_changelog_generator.rb | 114 +++++++++++++---------- lib/github_changelog_generator/parser.rb | 5 +- 3 files changed, 104 insertions(+), 86 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index 9e4cc68..e300907 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,24 +1,24 @@ # Changelog -## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) +## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) - 17/02/15 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) - *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) -## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) (2015-01-26) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) +## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) - 26/01/15 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) - *Merged pull-request:* Add compare link between older version and newer version [\#46](https://github.com/skywinder/Github-Changelog-Generator/pull/46) ([sue445](https://github.com/sue445)) -## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) (2015-01-21) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) +## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) - 21/01/15 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) - *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao)) -## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) +## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) - 15/01/15 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) - *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing)) @@ -28,8 +28,8 @@ - *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32) -## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) (2014-12-16) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) +## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) - 16/12/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) @@ -37,8 +37,8 @@ - *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) -## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) (2014-12-16) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) +## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) - 16/12/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) - *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) @@ -48,15 +48,15 @@ - *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30) -## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) (2014-12-10) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) +## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) - 10/12/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef)) - *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) -## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) (2014-11-22) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) +## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) - 22/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder)) @@ -64,8 +64,8 @@ - *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20) -## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) (2014-11-19) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) +## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) - 19/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) - *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) @@ -75,22 +75,22 @@ - *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder)) -## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) (2014-11-18) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) +## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) - 18/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19) -## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) (2014-11-12) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) +## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) - 12/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder)) -## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) (2014-11-10) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) +## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) - 10/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) - *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder)) @@ -98,8 +98,8 @@ - *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder)) -## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) (2014-11-10) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) +## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) - 10/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) - *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11) @@ -107,13 +107,13 @@ - *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12) -## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) (2014-11-10) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) +## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) - 10/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) -## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) (2014-11-07) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) +## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) - 07/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder)) @@ -125,17 +125,18 @@ - *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5) -## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) (2014-11-07) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) +## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) - 07/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder)) -## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) (2014-11-06) -[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) +## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) - 06/11/14 +#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) + +## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) - 06/11/14 -## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index e27325d..b871213 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -57,7 +57,7 @@ module GitHubChangelogGenerator end threads = [] - @issues.each{|issue| + @issues.each { |issue| threads << Thread.new { find_closed_date_by_commit(issue) } @@ -72,7 +72,7 @@ module GitHubChangelogGenerator def find_closed_date_by_commit(issue) unless issue['events'].nil? # reverse! - to find latest closed event. (event goes in date order) - issue['events'].reverse!.each{|event| + issue['events'].reverse!.each { |event| if event[:event].eql? 'closed' if event[:commit_id].nil? issue[:actual_date] = issue[:closed_at] @@ -162,8 +162,8 @@ module GitHubChangelogGenerator log = "# Changelog\n\n" - if @options[:last] - log += self.generate_log_between_tags(self.all_tags[0], self.all_tags[1]) + if @options[:unreleased] + log += self.generate_log_between_tags(self.all_tags[0], nil) elsif @options[:tag1] and @options[:tag2] tag1 = @options[:tag1] tag2 = @options[:tag2] @@ -278,66 +278,67 @@ module GitHubChangelogGenerator def generate_log_between_tags(older_tag, newer_tag) - if newer_tag.nil? - puts "Can't find tag -> terminate" - exit 1 + filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, older_tag, newer_tag) + filtered_issues = delete_by_time(@issues, :actual_date, older_tag, newer_tag) + + unless newer_tag.nil? + newer_tag_name = newer_tag['name'] + + if @options[:filter_issues_by_milestone] + #delete excess irrelevant issues (according milestones) + filtered_issues = filter_by_milestone(filtered_issues, newer_tag_name, @issues) + filtered_pull_requests = filter_by_milestone(filtered_pull_requests, newer_tag_name, @pull_requests) + end end - newer_tag_time = self.get_time_of_tag(newer_tag) - newer_tag_name = newer_tag['name'] + older_tag_name = older_tag.nil? ? nil : older_tag['name'] - filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time, older_tag) - filtered_issues = delete_by_time(@issues, :actual_date, newer_tag_time, older_tag) - - older_tag_name = older_tag.nil? ? nil : older_tag['name'] - - if @options[:filter_issues_by_milestone] - #delete excess irrelevant issues (according milestones) - filtered_issues = filter_by_milestone(filtered_issues, newer_tag_name, @issues) - filtered_pull_requests = filter_by_milestone(filtered_pull_requests, newer_tag_name, @pull_requests) - end - - self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time, older_tag_name) + self.create_log(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name) end def filter_by_milestone(filtered_issues, newer_tag_name, src_array) + + filtered_issues.select! { |issue| + # leave issues without milestones if issue.milestone.nil? true else #check, that this milestone in tag list: - milestone_is_tag = @all_tags.find { |tag| - tag.name == issue.milestone.title - } - milestone_is_tag.nil? + @all_tags.find { |tag| tag.name == issue.milestone.title }.nil? end - } - #add missed issues (according milestones) - issues_to_add = src_array.select { |issue| - if issue.milestone.nil? - false - else - #check, that this milestone in tag list: - milestone_is_tag = @all_tags.find { |tag| - tag.name == issue.milestone.title - } + unless newer_tag_name.nil? - if milestone_is_tag.nil? + #add missed issues (according milestones) + issues_to_add = src_array.select { |issue| + if issue.milestone.nil? false else - issue.milestone.title == newer_tag_name - end - end - } + #check, that this milestone in tag list: + milestone_is_tag = @all_tags.find { |tag| + tag.name == issue.milestone.title + } - filtered_issues |= issues_to_add + if milestone_is_tag.nil? + false + else + issue.milestone.title == newer_tag_name + end + end + } + + filtered_issues |= issues_to_add + end end - def delete_by_time(array, hash_key, newer_tag_time, older_tag = nil) + def delete_by_time(array, hash_key, older_tag = nil, newer_tag = nil) + raise 'At least on of the tags should be not nil!' if (older_tag.nil? && newer_tag.nil?) + + newer_tag_time = self.get_time_of_tag(newer_tag) older_tag_time = self.get_time_of_tag(older_tag) array.select { |req| @@ -350,7 +351,12 @@ module GitHubChangelogGenerator tag_in_range_old = t > older_tag_time end - tag_in_range_new = t <= newer_tag_time + if newer_tag_time.nil? + tag_in_range_new = true + else + tag_in_range_new = t <= newer_tag_time + end + tag_in_range = (tag_in_range_old) && (tag_in_range_new) @@ -363,26 +369,33 @@ module GitHubChangelogGenerator # @param [Array] pull_requests # @param [Array] issues - # @param [String] newer_tag_name - # @param [String] newer_tag_time # @param [String] older_tag_name # @return [String] - def create_log(pull_requests, issues, newer_tag_name, newer_tag_time, older_tag_name = nil) + def create_log(pull_requests, issues, newer_tag, older_tag_name = nil) + + newer_tag_time = newer_tag.nil? ? nil : self.get_time_of_tag(newer_tag) + newer_tag_name = newer_tag.nil? ? nil : newer_tag['name'] github_site = options[:github_site] || 'https://github.com' - project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}" + if newer_tag.nil? + newer_tag_name = 'Unreleased' + newer_tag_name2 = 'HEAD' + newer_tag_time = Time.new + else + newer_tag_name2 = newer_tag_name + end + #Generate date string: time_string = newer_tag_time.strftime @options[:format] # Generate tag name and link - log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name}) (#{time_string})\n" - + log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name2}) (#{time_string})\n" if @options[:compare_link] && older_tag_name # Generate compare link - log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n\n" + log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name2})\n\n" else log += "\n" end @@ -442,6 +455,7 @@ module GitHubChangelogGenerator log += "- #{merge}" } end + log end diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 784ed2f..5ae4cea 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -41,7 +41,10 @@ module GitHubChangelogGenerator options[:filter_issues_by_milestone] = last end opts.on('--[no-]author', 'Add author of pull-request in the end. Default is true') do |author| - options[:last] = author + options[:author] = author + end + opts.on('--unreleased', 'Generate log from unreleased closed issues.') do |v| + options[:unreleased] = v end opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v| options[:compare_link] = v From e6dc367f99605feae8c2fde606c7f1e2f93aff82 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 20:14:39 +0200 Subject: [PATCH 07/17] Add ability to include and exclude Unreleased by keys. Add ability to generate only unreleased changelog --- lib/CHANGELOG.md | 84 ++++++++++++++---------- lib/github_changelog_generator.rb | 6 +- lib/github_changelog_generator/parser.rb | 7 +- 3 files changed, 58 insertions(+), 39 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index e300907..c7d1d44 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,24 +1,37 @@ # Changelog -## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) - 17/02/15 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) +## [Unreleased](https://github.com/skywinder/Github-Changelog-Generator/tree/HEAD) (2015-02-18) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.8...HEAD) + +- *Merged pull-request:* Implement filtering of Pull Requests by milestones [\#50](https://github.com/skywinder/Github-Changelog-Generator/pull/50) ([skywinder](https://github.com/skywinder)) + +- *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) + +- *Merged pull-request:* Prettify output [\#48](https://github.com/skywinder/Github-Changelog-Generator/pull/48) ([skywinder](https://github.com/skywinder)) + +- *Implemented enhancement:* Add support for forked repo \(to extend changelog with parent's changes\) [\#21](https://github.com/skywinder/Github-Changelog-Generator/issues/21) + +- *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) + +## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) - *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) -## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) - 26/01/15 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) +## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) (2015-01-26) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) - *Merged pull-request:* Add compare link between older version and newer version [\#46](https://github.com/skywinder/Github-Changelog-Generator/pull/46) ([sue445](https://github.com/sue445)) -## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) - 21/01/15 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) +## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) (2015-01-21) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) - *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao)) -## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) - 15/01/15 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) +## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) - *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing)) @@ -28,8 +41,8 @@ - *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32) -## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) - 16/12/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) +## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) (2014-12-16) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) @@ -37,8 +50,8 @@ - *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) -## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) - 16/12/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) +## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) (2014-12-16) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) - *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) @@ -48,15 +61,15 @@ - *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30) -## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) - 10/12/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) +## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) (2014-12-10) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef)) - *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) -## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) - 22/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) +## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) (2014-11-22) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder)) @@ -64,8 +77,8 @@ - *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20) -## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) - 19/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) +## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) (2014-11-19) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) - *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) @@ -75,22 +88,22 @@ - *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder)) -## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) - 18/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) +## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) (2014-11-18) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19) -## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) - 12/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) +## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) (2014-11-12) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder)) -## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) - 10/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) +## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) (2014-11-10) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) - *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder)) @@ -98,8 +111,8 @@ - *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder)) -## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) - 10/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) +## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) (2014-11-10) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) - *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11) @@ -107,13 +120,13 @@ - *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12) -## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) - 10/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) +## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) (2014-11-10) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) -## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) - 07/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) +## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) (2014-11-07) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder)) @@ -125,18 +138,17 @@ - *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5) -## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) - 07/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) +## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) (2014-11-07) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder)) -## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) - 06/11/14 -#### [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) - -## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) - 06/11/14 +## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) (2014-11-06) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) +## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index b871213..3bd1bda 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -162,7 +162,7 @@ module GitHubChangelogGenerator log = "# Changelog\n\n" - if @options[:unreleased] + if @options[:unreleased_only] log += self.generate_log_between_tags(self.all_tags[0], nil) elsif @options[:tag1] and @options[:tag2] tag1 = @options[:tag1] @@ -222,6 +222,10 @@ module GitHubChangelogGenerator puts "Generating log.." end + if @options[:unreleased] + log += self.generate_log_between_tags(self.all_tags[0], nil) + end + (1 ... self.all_tags.size).each { |index| log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1]) } diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 5ae4cea..1da43ef 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' @@ -43,7 +43,10 @@ module GitHubChangelogGenerator opts.on('--[no-]author', 'Add author of pull-request in the end. Default is true') do |author| options[:author] = author end - opts.on('--unreleased', 'Generate log from unreleased closed issues.') do |v| + opts.on('--unreleased-only', 'Generate log from unreleased closed issues only.') do |v| + options[:unreleased_only] = v + end + opts.on('--[no-]unreleased', 'Add to log unreleased closed issues. Default is true') do |v| options[:unreleased] = v end opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v| From 9ce7dd736a62b97b8e15de25092839bcb330b47e Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 20:20:57 +0200 Subject: [PATCH 08/17] update readme --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 99c0af0..642984f 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ GitHub Changelog Generator ================== - - [Installation:](#installation) - - [Output example:](#output-example) - - [Usage:](#usage) - - [Params:](#params) + - [Installation](#installation) + - [Output example](#output-example) + - [Usage](#usage) + - [Params](#params) - [GitHub token](#github-token) - - [Features and advantages of this project as compared to other:](#features-and-advantages-of-this-project-as-compared-to-other) - - [Alternatives:](#alternatives) - - [Projects using this library:](#projects-using-this-library) + - [Features and advantages of this project as compared to other](#features-and-advantages-of-this-project-as-compared-to-other) + - [Alternatives](#alternatives) + - [Projects using this library](#projects-using-this-library) - [Am I missed some essential feature?](#am-i-missed-some-essential-feature) - [Contributing](#contributing) - [License](#license) @@ -22,11 +22,11 @@ Changelog generation has never been so easy. **Fully automate changelog generation** - This script automatically generate change-log from your tags, issues and merged pull-requests from your project's **Github issue tracker**. -## Installation: +## Installation [sudo] gem install github_changelog_generator -## Output example: +## Output example - Look at **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project - [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command: @@ -54,7 +54,7 @@ Changelog generation has never been so easy. > - *Closed issue:* No "cancel" button [\#122](https://github.com/skywinder/ActionSheetPicker-3.0/issues/122) -## Usage: +## Usage **It's really simple**: - If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder and run: @@ -67,7 +67,7 @@ Changelog generation has never been so easy. As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog. -### Params: +### Params Type `github_changelog_generator --help` for detailed usage. Usage: changelog_generator [options] @@ -107,8 +107,8 @@ So, if you got error like this: It's time to create this token or wait for 1 hour before GitHub reset the counter for your IP. -##Features and advantages of this project as compared to other: -- Automatically split issues by type: +##Features and advantages of this project as compared to other +- Automatically split issues by type - **Issues** (closed issues w/o any labels) - **Merged pull-requests** (all merged pull-requests) - **Bug-fixes** (by label `bug` in issue) @@ -118,13 +118,13 @@ It's time to create this token or wait for 1 hour before GitHub reset the counte - 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 changelog (by labels) -###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. *If you know other projects - feel free to edit this Wiki page!* -### 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) *If you are using `github_changelog_generator` for generation changelog 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.* From a90c276a9f7f019e3e34d16cd29085df226b6e75 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 21:43:05 +0200 Subject: [PATCH 09/17] Fix milesones support for unreleased issues. Fix #47 --- lib/CHANGELOG.md | 8 ++------ lib/github_changelog_generator.rb | 16 ++++++---------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index c7d1d44..8fa7da4 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -5,19 +5,15 @@ - *Merged pull-request:* Implement filtering of Pull Requests by milestones [\#50](https://github.com/skywinder/Github-Changelog-Generator/pull/50) ([skywinder](https://github.com/skywinder)) -- *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) - -- *Merged pull-request:* Prettify output [\#48](https://github.com/skywinder/Github-Changelog-Generator/pull/48) ([skywinder](https://github.com/skywinder)) - - *Implemented enhancement:* Add support for forked repo \(to extend changelog with parent's changes\) [\#21](https://github.com/skywinder/Github-Changelog-Generator/issues/21) -- *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) - ## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) - *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) +- *Merged pull-request:* Prettify output [\#48](https://github.com/skywinder/Github-Changelog-Generator/pull/48) ([skywinder](https://github.com/skywinder)) + - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) ## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) (2015-01-26) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 3bd1bda..cf04249 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -285,14 +285,12 @@ module GitHubChangelogGenerator filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, older_tag, newer_tag) filtered_issues = delete_by_time(@issues, :actual_date, older_tag, newer_tag) - unless newer_tag.nil? - newer_tag_name = newer_tag['name'] + newer_tag_name = newer_tag.nil? ? nil : newer_tag['name'] - if @options[:filter_issues_by_milestone] - #delete excess irrelevant issues (according milestones) - filtered_issues = filter_by_milestone(filtered_issues, newer_tag_name, @issues) - filtered_pull_requests = filter_by_milestone(filtered_pull_requests, newer_tag_name, @pull_requests) - end + if @options[:filter_issues_by_milestone] + #delete excess irrelevant issues (according milestones) + filtered_issues = filter_by_milestone(filtered_issues, newer_tag_name, @issues) + filtered_pull_requests = filter_by_milestone(filtered_pull_requests, newer_tag_name, @pull_requests) end older_tag_name = older_tag.nil? ? nil : older_tag['name'] @@ -302,8 +300,6 @@ module GitHubChangelogGenerator end def filter_by_milestone(filtered_issues, newer_tag_name, src_array) - - filtered_issues.select! { |issue| # leave issues without milestones if issue.milestone.nil? @@ -313,7 +309,6 @@ module GitHubChangelogGenerator @all_tags.find { |tag| tag.name == issue.milestone.title }.nil? end } - unless newer_tag_name.nil? #add missed issues (according milestones) @@ -336,6 +331,7 @@ module GitHubChangelogGenerator filtered_issues |= issues_to_add end + filtered_issues end def delete_by_time(array, hash_key, older_tag = nil, newer_tag = nil) From 9b8291ab69cb5d58ef46c0a48e264471c5dd464c Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 21:50:33 +0200 Subject: [PATCH 10/17] rename oprion --- lib/github_changelog_generator.rb | 4 ++-- lib/github_changelog_generator/parser.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index cf04249..1955a2e 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -504,7 +504,7 @@ module GitHubChangelogGenerator filtered_issues = issues.select { |issue| #compare is there any labels from @options[:labels] array - (issue.labels.map { |label| label.name } & @options[:labels]).any? + (issue.labels.map { |label| label.name } & @options[:include_labels]).any? } @@ -518,7 +518,7 @@ module GitHubChangelogGenerator if @options[:verbose] - puts "Filtered issues with labels #{@options[:labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count}" + puts "Filtered issues with labels #{@options[:include_labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count}" end filtered_issues diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 1da43ef..db73ef6 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :include_labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' @@ -52,8 +52,8 @@ module GitHubChangelogGenerator opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v| options[:compare_link] = v end - opts.on('--labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list| - options[:labels] = list + opts.on('--include-labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list| + options[:include_labels] = list end opts.on('--labels-pr x,y,z', Array, 'Only pull requests with specified labels will be included to changelog. Default is nil') do |list| options[:pull_request_labels] = list From 48e3a7525193e289810cbd8d6136f776226c4f89 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 22:08:10 +0200 Subject: [PATCH 11/17] implement eclude labels feature. Fix #52. --- lib/CHANGELOG.md | 2 -- lib/github_changelog_generator.rb | 18 ++++++++++++++---- lib/github_changelog_generator/parser.rb | 7 +++++-- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index 8fa7da4..70e44fc 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -5,8 +5,6 @@ - *Merged pull-request:* Implement filtering of Pull Requests by milestones [\#50](https://github.com/skywinder/Github-Changelog-Generator/pull/50) ([skywinder](https://github.com/skywinder)) -- *Implemented enhancement:* Add support for forked repo \(to extend changelog with parent's changes\) [\#21](https://github.com/skywinder/Github-Changelog-Generator/issues/21) - ## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 1955a2e..d9017ac 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -502,11 +502,21 @@ module GitHubChangelogGenerator x.pull_request == nil } - filtered_issues = issues.select { |issue| - #compare is there any labels from @options[:labels] array - (issue.labels.map { |label| label.name } & @options[:include_labels]).any? - } + filtered_issues = [] + unless @options[:include_labels].nil? + filtered_issues = issues.select { |issue| + #add all labels from @options[:incluse_labels] array + (issue.labels.map { |label| label.name } & @options[:include_labels]).any? + } + end + + unless @options[:exclude_labels].nil? + filtered_issues = filtered_issues.select { |issue| + #delete all labels from @options[:exclude_labels] array + !(issue.labels.map { |label| label.name } & @options[:exclude_labels]).any? + } + end if @options[:add_issues_wo_labels] issues_wo_labels = issues.select { diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index db73ef6..487118c 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :include_labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :include_labels => %w(bug enhancement), :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' @@ -52,9 +52,12 @@ module GitHubChangelogGenerator opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v| options[:compare_link] = v end - opts.on('--include-labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list| + opts.on('--include-labels x,y,z', Array, 'Issues only with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list| options[:include_labels] = list end + opts.on('--exclude-labels x,y,z', Array, 'Issues with that labels will be always excluded from changelog. Default is \'duplicate,question,invalid,wontfix\'') do |list| + options[:exclude_labels] = list + end opts.on('--labels-pr x,y,z', Array, 'Only pull requests with specified labels will be included to changelog. Default is nil') do |list| options[:pull_request_labels] = list end From 1d7f09e9bbfa065d91ede4e0eb88bff79c33e194 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 22:11:11 +0200 Subject: [PATCH 12/17] change include to exclude default rule --- lib/github_changelog_generator.rb | 2 +- lib/github_changelog_generator/parser.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index d9017ac..4455c68 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -502,7 +502,7 @@ module GitHubChangelogGenerator x.pull_request == nil } - filtered_issues = [] + filtered_issues = issues unless @options[:include_labels].nil? filtered_issues = issues.select { |issue| diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 487118c..fd27939 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :include_labels => %w(bug enhancement), :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' From 563ddb7f309b375c3f87d495f360437ea82dc409 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 22:21:00 +0200 Subject: [PATCH 13/17] refactoring --- lib/github_changelog_generator.rb | 61 +++++++++++++----------- lib/github_changelog_generator/parser.rb | 7 ++- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 4455c68..3739ab4 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -40,7 +40,7 @@ module GitHubChangelogGenerator @all_tags = self.get_all_tags @pull_requests = self.get_filtered_pull_requests if @options[:issues] - @issues = self.get_all_issues + @issues = self.get_filtered_issues fetch_event_for_issues(@issues) detect_actual_closed_dates else @@ -474,33 +474,9 @@ module GitHubChangelogGenerator @tag_times_hash[tag_name['name']] = Time.parse(time_string) end - def get_all_issues + def get_filtered_issues - if @options[:verbose] - print "Fetching closed issues...\r" - end - - response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil - - issues = [] - page_i = 0 - count_pages = response.count_pages - response.each_page do |page| - page_i += PER_PAGE_NUMBER - print "Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r" - issues.concat(page) - end - - print " \r" - - if @options[:verbose] - puts "Received issues: #{issues.count}" - end - - # remove pull request from issues: - issues.select! { |x| - x.pull_request == nil - } + issues = self.get_all_issues filtered_issues = issues @@ -528,13 +504,42 @@ module GitHubChangelogGenerator if @options[:verbose] - puts "Filtered issues with labels #{@options[:include_labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count}" + puts "Filtered issues: #{filtered_issues.count}" end filtered_issues end + def get_all_issues + if @options[:verbose] + print "Fetching closed issues...\r" + end + + response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil + + issues = [] + page_i = 0 + count_pages = response.count_pages + response.each_page do |page| + page_i += PER_PAGE_NUMBER + print "Fetching issues... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r" + issues.concat(page) + end + + print " \r" + + if @options[:verbose] + puts "Received issues: #{issues.count}" + end + + # remove pull request from issues: + issues.select! { |x| + x.pull_request == nil + } + issues + end + def fetch_event_for_issues(filtered_issues) if @options[:verbose] print "Fetching events for issues: 0/#{filtered_issues.count}\r" diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index fd27939..4b719a5 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :add_pr_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' @@ -31,9 +31,12 @@ module GitHubChangelogGenerator opts.on('--[no-]issues', 'Include closed issues to changelog. Default is true') do |v| options[:issues] = v end - opts.on('--[no-]issues-wo-labels', 'Include closed issues without any labels to changelog. Default is true') do |v| + opts.on('--[no-]issues-wo-labels', 'Include closed issues without labels to changelog. Default is true') do |v| options[:add_issues_wo_labels] = v end + opts.on('--[no-]pr-wo-labels', 'Include pull requests without labels to changelog. Default is true') do |v| + options[:add_pr_wo_labels] = v + end opts.on('--[no-]pull-requests', 'Include pull-requests to changelog. Default is true') do |v| options[:pulls] = v end From c8db84a4a5286218bca8ca9e7ffa48fb5b23e387 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 22:29:30 +0200 Subject: [PATCH 14/17] prettify output: display tag fetching status --- lib/github_changelog_generator.rb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 3739ab4..27c3607 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -192,8 +192,8 @@ module GitHubChangelogGenerator output_filename = "#{@options[:output]}" File.open(output_filename, 'w') { |file| file.write(log) } - - puts "Done! Generated log placed in #{`pwd`.strip!}/#{output_filename}" + puts 'Done!' + puts "Generated log placed in #{`pwd`.strip!}/#{output_filename}" end @@ -201,17 +201,30 @@ module GitHubChangelogGenerator log = '' if @options[:verbose] - puts "Fetching tags dates.." + print "Fetching tags dates..\r" end # Async fetching tags: threads = [] + i = 0 + all = @all_tags.count @all_tags.each { |tag| # explicit set @tag_times_hash to write data safety. - threads << Thread.new { self.get_time_of_tag(tag, @tag_times_hash) } + threads << Thread.new { + self.get_time_of_tag(tag, @tag_times_hash) + if @options[:verbose] + i+=1 + print "Fetching tags dates: #{i+1}/#{all}\r" + end + + } } + threads.each { |thr| thr.join } + if @options[:verbose] + puts 'Fetching tags: Done!' + end if @options[:verbose] puts "Sorting tags.." end From 1dd82cddf4580dc74674d0e43f33fcb3f23fb2ff Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 22:54:12 +0200 Subject: [PATCH 15/17] cm --- lib/github_changelog_generator.rb | 92 ++++++++++++++++-------- lib/github_changelog_generator/parser.rb | 5 +- 2 files changed, 64 insertions(+), 33 deletions(-) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 27c3607..3c497a1 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -122,40 +122,74 @@ module GitHubChangelogGenerator def get_filtered_pull_requests pull_requests = self.get_all_closed_pull_requests + filtered_pull_requests = pull_requests - unless @options[:pull_request_labels].nil? - if @options[:verbose] - puts 'Filter all pull requests by labels.' - end - - filtered_pull_requests = pull_requests.select { |pull_request| - #fetch this issue to get labels array - issue = @github.issues.get @options[:user], @options[:project], pull_request.number - - #compare is there any labels from @options[:labels] array - issue_without_labels = !issue.labels.map { |label| label.name }.any? - - if @options[:verbose] - puts "Filter request \##{issue.number}." - end - - if @options[:pull_request_labels].any? - select_by_label = (issue.labels.map { |label| label.name } & @options[:pull_request_labels]).any? - else - select_by_label = false - end - - select_by_label | issue_without_labels + unless @options[:include_labels].nil? + filtered_pull_requests = pull_requests.select { |issue| + #add all labels from @options[:incluse_labels] array + (issue.labels.map { |label| label.name } & @options[:include_labels]).any? } - - if @options[:verbose] - puts "Filtered pull requests with specified labels and w/o labels: #{filtered_pull_requests.count}" - end - return filtered_pull_requests end - pull_requests + unless @options[:exclude_labels].nil? + filtered_pull_requests = filtered_pull_requests.select { |issue| + #delete all labels from @options[:exclude_labels] array + !(issue.labels.map { |label| label.name } & @options[:exclude_labels]).any? + } + end + + if @options[:add_issues_wo_labels] + issues_wo_labels = pull_requests.select { + # add issues without any labels + |issue| !issue.labels.map { |label| label.name }.any? + } + filtered_pull_requests.concat(issues_wo_labels) + end + + + if @options[:verbose] + puts "Filtered pull requests: #{filtered_pull_requests.count}" + end + + filtered_pull_requests + # + # # + # + # + # unless @options[:pull_request_labels].nil? + # + # if @options[:verbose] + # puts 'Filter all pull requests by labels.' + # end + # + # filtered_pull_requests = filtered_pull_requests.select { |pull_request| + # #fetch this issue to get labels array + # issue = @github.issues.get @options[:user], @options[:project], pull_request.number + # + # #compare is there any labels from @options[:labels] array + # issue_without_labels = !issue.labels.map { |label| label.name }.any? + # + # if @options[:verbose] + # puts "Filter request \##{issue.number}." + # end + # + # if @options[:pull_request_labels].any? + # select_by_label = (issue.labels.map { |label| label.name } & @options[:pull_request_labels]).any? + # else + # select_by_label = false + # end + # + # select_by_label | issue_without_labels + # } + # + # if @options[:verbose] + # puts "Filtered pull requests with specified labels and w/o labels: #{filtered_pull_requests.count}" + # end + # return filtered_pull_requests + # end + # + # filtered_pull_requests end def compund_changelog diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 4b719a5..a22ef1c 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,7 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options - options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :add_pr_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} + options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :add_pr_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| opts.banner = 'Usage: changelog_generator [options]' @@ -61,9 +61,6 @@ module GitHubChangelogGenerator opts.on('--exclude-labels x,y,z', Array, 'Issues with that labels will be always excluded from changelog. Default is \'duplicate,question,invalid,wontfix\'') do |list| options[:exclude_labels] = list end - opts.on('--labels-pr x,y,z', Array, 'Only pull requests with specified labels will be included to changelog. Default is nil') do |list| - options[:pull_request_labels] = list - end opts.on('--github-site [URL]', 'The Enterprise Github site on which your project is hosted.') do |last| options[:github_site] = last end From c4f91f55ffc62f83c82bdbbbcd35620f6eb378c7 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 23:32:40 +0200 Subject: [PATCH 16/17] Fix #44. --- lib/CHANGELOG.md | 2 -- lib/github_changelog_generator.rb | 36 +++++++++++++++++------- lib/github_changelog_generator/parser.rb | 1 + 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index 70e44fc..3514157 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -76,8 +76,6 @@ - *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) -- *Merged pull-request:* Test Pull-Request SHOULD NOT APPEAR IN LOG! [\#26](https://github.com/skywinder/Github-Changelog-Generator/pull/26) ([skywinder](https://github.com/skywinder)) - - *Merged pull-request:* Add ability to insert authors of pull-requests \(--\[no-\]author option\) [\#25](https://github.com/skywinder/Github-Changelog-Generator/pull/25) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder)) diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index 3c497a1..a3e9c47 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -38,7 +38,15 @@ module GitHubChangelogGenerator @generator = Generator.new(@options) @all_tags = self.get_all_tags - @pull_requests = self.get_filtered_pull_requests + @issues, @pull_requests = self.fetch_issues_and_pull_requests + + if @options[:pulls] + @pull_requests = self.get_filtered_pull_requests + self.fetch_merged_at_pull_requests + else + @pull_requests = [] + end + if @options[:issues] @issues = self.get_filtered_issues fetch_event_for_issues(@issues) @@ -96,7 +104,7 @@ module GitHubChangelogGenerator %x[#{exec_cmd}] end - def get_all_closed_pull_requests + def fetch_merged_at_pull_requests if @options[:verbose] print "Fetching pull requests...\r" end @@ -116,12 +124,17 @@ module GitHubChangelogGenerator puts "Received pull requests: #{pull_requests.count}" end - pull_requests + @pull_requests.each{|pr| + fetched_pr = pull_requests.find{ |fpr| + fpr.number == pr.number } + pr[:merged_at] = fetched_pr[:merged_at] + pull_requests.delete(fetched_pr) + } end def get_filtered_pull_requests - pull_requests = self.get_all_closed_pull_requests + pull_requests = @pull_requests filtered_pull_requests = pull_requests @@ -144,7 +157,7 @@ module GitHubChangelogGenerator # add issues without any labels |issue| !issue.labels.map { |label| label.name }.any? } - filtered_pull_requests.concat(issues_wo_labels) + filtered_pull_requests |= issues_wo_labels end @@ -523,7 +536,7 @@ module GitHubChangelogGenerator def get_filtered_issues - issues = self.get_all_issues + issues = @issues filtered_issues = issues @@ -546,7 +559,7 @@ module GitHubChangelogGenerator # add issues without any labels |issue| !issue.labels.map { |label| label.name }.any? } - filtered_issues.concat(issues_wo_labels) + filtered_issues |= issues_wo_labels end @@ -558,7 +571,7 @@ module GitHubChangelogGenerator end - def get_all_issues + def fetch_issues_and_pull_requests if @options[:verbose] print "Fetching closed issues...\r" end @@ -581,10 +594,13 @@ module GitHubChangelogGenerator end # remove pull request from issues: - issues.select! { |x| + issues_wo_pr = issues.select { |x| x.pull_request == nil } - issues + pull_requests = issues.select { |x| + x.pull_request != nil + } + return issues_wo_pr, pull_requests end def fetch_event_for_issues(filtered_issues) diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index a22ef1c..2f21aca 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -6,6 +6,7 @@ require_relative 'version' module GitHubChangelogGenerator class Parser def self.parse_options + # :include_labels => %w(bug enhancement), options = {:tag1 => nil, :tag2 => nil, :format => '%Y-%m-%d', :output => 'CHANGELOG.md', :exclude_labels => %w(duplicate question invalid wontfix), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :add_pr_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :filter_issues_by_milestone => true, :compare_link => true, :unreleased => true} parser = OptionParser.new { |opts| From dd2be24d3bf8f39d3e4b2d679ebc9921908d29b7 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Wed, 18 Feb 2015 23:36:07 +0200 Subject: [PATCH 17/17] format fix --- CHANGELOG.md | 81 ++++++++++++++++--------------- lib/github_changelog_generator.rb | 4 +- 2 files changed, 46 insertions(+), 39 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2bd572..3514157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,25 +1,32 @@ # Changelog -## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) +## [Unreleased](https://github.com/skywinder/Github-Changelog-Generator/tree/HEAD) (2015-02-18) +[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.8...HEAD) + +- *Merged pull-request:* Implement filtering of Pull Requests by milestones [\#50](https://github.com/skywinder/Github-Changelog-Generator/pull/50) ([skywinder](https://github.com/skywinder)) + +## [1.2.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.8) (2015-02-17) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8) -#### 17/02/15 + - *Merged pull-request:* Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder)) +- *Merged pull-request:* Prettify output [\#48](https://github.com/skywinder/Github-Changelog-Generator/pull/48) ([skywinder](https://github.com/skywinder)) + - *Closed issue:* Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37) -## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) +## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) (2015-01-26) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) -#### 26/01/15 + - *Merged pull-request:* Add compare link between older version and newer version [\#46](https://github.com/skywinder/Github-Changelog-Generator/pull/46) ([sue445](https://github.com/sue445)) -## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) +## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6) (2015-01-21) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6) -#### 21/01/15 + - *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao)) -## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) +## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5) -#### 15/01/15 + - *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing)) - *Merged pull-request:* support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett)) @@ -28,18 +35,18 @@ - *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32) -## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) +## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4) (2014-12-16) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4) -#### 16/12/14 + - *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder)) - *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35) - *Fixed bug:* Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41) -## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) +## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3) (2014-12-16) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3) -#### 16/12/14 + - *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38) @@ -48,73 +55,71 @@ - *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30) -## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) +## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2) (2014-12-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2) -#### 10/12/14 + - *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef)) - *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34) -## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) +## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1) (2014-11-22) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1) -#### 22/11/14 + - *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder)) - *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20) -## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) +## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0) (2014-11-19) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0) -#### 19/11/14 -- *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) -- *Merged pull-request:* Test Pull-Request SHOULD NOT APPEAR IN LOG! [\#26](https://github.com/skywinder/Github-Changelog-Generator/pull/26) ([skywinder](https://github.com/skywinder)) +- *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add ability to insert authors of pull-requests \(--\[no-\]author option\) [\#25](https://github.com/skywinder/Github-Changelog-Generator/pull/25) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder)) -## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) +## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4) (2014-11-18) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4) -#### 18/11/14 + - *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder)) - *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19) -## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) +## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2) (2014-11-12) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2) -#### 12/11/14 + - *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder)) -## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) +## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1) (2014-11-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1) -#### 10/11/14 + - *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Sort issues by tags [\#14](https://github.com/skywinder/Github-Changelog-Generator/pull/14) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder)) -## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) +## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0) (2014-11-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0) -#### 10/11/14 + - *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11) - *Fixed bug:* Markdown formating in the last line wrong [\#9](https://github.com/skywinder/Github-Changelog-Generator/issues/9) - *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12) -## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) +## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1) (2014-11-10) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1) -#### 10/11/14 + - *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder)) -## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) +## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0) (2014-11-07) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0) -#### 07/11/14 + - *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder)) @@ -125,18 +130,18 @@ - *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5) -## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) +## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) (2014-11-07) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0) -#### 07/11/14 + - *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder)) - *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder)) -## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) +## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2) (2014-11-06) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2) -#### 06/11/14 -## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) -#### 06/11/14 + +## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06) + \* *This changelog was generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file diff --git a/lib/github_changelog_generator.rb b/lib/github_changelog_generator.rb index a3e9c47..1eb3874 100755 --- a/lib/github_changelog_generator.rb +++ b/lib/github_changelog_generator.rb @@ -260,13 +260,15 @@ module GitHubChangelogGenerator threads << Thread.new { self.get_time_of_tag(tag, @tag_times_hash) if @options[:verbose] - i+=1 print "Fetching tags dates: #{i+1}/#{all}\r" + i+=1 end } } + print " \r" + threads.each { |thr| thr.join } if @options[:verbose]