Merge branch 'develop'

This commit is contained in:
Petr Korolev 2015-02-18 23:37:35 +02:00
commit 39a4ef3f3f
4 changed files with 319 additions and 189 deletions

View File

@ -1,25 +1,32 @@
# Changelog # 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) [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:* 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) - *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) [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)) - *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) [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)) - *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) [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:* 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)) - *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) - *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) [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)) - *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:* 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) - *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) [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)) - *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:* 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) - *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) [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)) - *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) - *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) [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:* 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)) - *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) - *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) [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:* 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)) - *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) [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)) - *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) - *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) [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 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)) - *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) [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:* 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:* 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)) - *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) [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) - *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:* 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) - *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) [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)) - *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) [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:* 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)) - *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) - *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) [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 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)) - *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) [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) ## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06)
#### 06/11/14
\* *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)*

View File

@ -1,18 +1,32 @@
# Changelog # Changelog
## [1.2.7](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.7) ## [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)
- *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)
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.6...1.2.7) [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)) - *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) [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)) - *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) [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:* 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)) - *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))
@ -21,91 +35,91 @@
- *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32) - *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) [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)) - *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:* 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) - *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) [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) - *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) - *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) [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)) - *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) - *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) [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:* 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)) - *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) - *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) [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:* 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)) - *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) [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)) - *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) - *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) [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 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)) - *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) [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:* 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:* 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)) - *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) [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) - *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:* 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) - *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) [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1)
#### 10/11/14
## [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:* 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)
- *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:* 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)) - *Merged pull-request:* Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder))
@ -116,18 +130,18 @@
- *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5) - *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) [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 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)) - *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) [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) ## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1) (2014-11-06)
#### 06/11/14
\* *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)*

View File

@ -38,9 +38,17 @@ module GitHubChangelogGenerator
@generator = Generator.new(@options) @generator = Generator.new(@options)
@all_tags = self.get_all_tags @all_tags = self.get_all_tags
@issues, @pull_requests = self.fetch_issues_and_pull_requests
if @options[:pulls]
@pull_requests = self.get_filtered_pull_requests @pull_requests = self.get_filtered_pull_requests
self.fetch_merged_at_pull_requests
else
@pull_requests = []
end
if @options[:issues] if @options[:issues]
@issues = self.get_all_issues @issues = self.get_filtered_issues
fetch_event_for_issues(@issues) fetch_event_for_issues(@issues)
detect_actual_closed_dates detect_actual_closed_dates
else else
@ -57,7 +65,7 @@ module GitHubChangelogGenerator
end end
threads = [] threads = []
@issues.each{|issue| @issues.each { |issue|
threads << Thread.new { threads << Thread.new {
find_closed_date_by_commit(issue) find_closed_date_by_commit(issue)
} }
@ -72,7 +80,7 @@ module GitHubChangelogGenerator
def find_closed_date_by_commit(issue) def find_closed_date_by_commit(issue)
unless issue['events'].nil? unless issue['events'].nil?
# reverse! - to find latest closed event. (event goes in date order) # 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[:event].eql? 'closed'
if event[:commit_id].nil? if event[:commit_id].nil?
issue[:actual_date] = issue[:closed_at] issue[:actual_date] = issue[:closed_at]
@ -96,7 +104,7 @@ module GitHubChangelogGenerator
%x[#{exec_cmd}] %x[#{exec_cmd}]
end end
def get_all_closed_pull_requests def fetch_merged_at_pull_requests
if @options[:verbose] if @options[:verbose]
print "Fetching pull requests...\r" print "Fetching pull requests...\r"
end end
@ -116,54 +124,93 @@ module GitHubChangelogGenerator
puts "Received pull requests: #{pull_requests.count}" puts "Received pull requests: #{pull_requests.count}"
end 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 end
def get_filtered_pull_requests def get_filtered_pull_requests
pull_requests = self.get_all_closed_pull_requests pull_requests = @pull_requests
filtered_pull_requests = pull_requests
unless @options[:pull_request_labels].nil?
if @options[:verbose] unless @options[:include_labels].nil?
puts 'Filter all pull requests by labels.' filtered_pull_requests = pull_requests.select { |issue|
end #add all labels from @options[:incluse_labels] array
(issue.labels.map { |label| label.name } & @options[:include_labels]).any?
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
} }
end
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 |= issues_wo_labels
end
if @options[:verbose] if @options[:verbose]
puts "Filtered pull requests with specified labels and w/o labels: #{filtered_pull_requests.count}" puts "Filtered pull requests: #{filtered_pull_requests.count}"
end
return filtered_pull_requests
end end
pull_requests 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 end
def compund_changelog def compund_changelog
log = "# Changelog\n\n" log = "# Changelog\n\n"
if @options[:last] if @options[:unreleased_only]
log += self.generate_log_between_tags(self.all_tags[0], self.all_tags[1]) log += self.generate_log_between_tags(self.all_tags[0], nil)
elsif @options[:tag1] and @options[:tag2] elsif @options[:tag1] and @options[:tag2]
tag1 = @options[:tag1] tag1 = @options[:tag1]
tag2 = @options[:tag2] tag2 = @options[:tag2]
@ -192,8 +239,8 @@ module GitHubChangelogGenerator
output_filename = "#{@options[:output]}" output_filename = "#{@options[:output]}"
File.open(output_filename, 'w') { |file| file.write(log) } File.open(output_filename, 'w') { |file| file.write(log) }
puts 'Done!'
puts "Done! Generated log placed in #{`pwd`.strip!}/#{output_filename}" puts "Generated log placed in #{`pwd`.strip!}/#{output_filename}"
end end
@ -201,17 +248,32 @@ module GitHubChangelogGenerator
log = '' log = ''
if @options[:verbose] if @options[:verbose]
puts "Fetching tags dates.." print "Fetching tags dates..\r"
end end
# Async fetching tags: # Async fetching tags:
threads = [] threads = []
i = 0
all = @all_tags.count
@all_tags.each { |tag| @all_tags.each { |tag|
# explicit set @tag_times_hash to write data safety. # 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]
print "Fetching tags dates: #{i+1}/#{all}\r"
i+=1
end
} }
}
print " \r"
threads.each { |thr| thr.join } threads.each { |thr| thr.join }
if @options[:verbose]
puts 'Fetching tags: Done!'
end
if @options[:verbose] if @options[:verbose]
puts "Sorting tags.." puts "Sorting tags.."
end end
@ -222,6 +284,10 @@ module GitHubChangelogGenerator
puts "Generating log.." puts "Generating log.."
end end
if @options[:unreleased]
log += self.generate_log_between_tags(self.all_tags[0], nil)
end
(1 ... self.all_tags.size).each { |index| (1 ... self.all_tags.size).each { |index|
log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1]) log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1])
} }
@ -278,36 +344,37 @@ module GitHubChangelogGenerator
def generate_log_between_tags(older_tag, newer_tag) def generate_log_between_tags(older_tag, newer_tag)
if newer_tag.nil? filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, older_tag, newer_tag)
puts "Can't find tag -> terminate" filtered_issues = delete_by_time(@issues, :actual_date, older_tag, newer_tag)
exit 1
end
newer_tag_time = self.get_time_of_tag(newer_tag) newer_tag_name = newer_tag.nil? ? nil : newer_tag['name']
newer_tag_name = newer_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] if @options[:filter_issues_by_milestone]
#delete excess irrelevant issues (according milestones) #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']
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| filtered_issues.select! { |issue|
# leave issues without milestones
if issue.milestone.nil? if issue.milestone.nil?
true true
else else
#check, that this milestone in tag list: #check, that this milestone in tag list:
milestone_is_tag = @all_tags.find { |tag| @all_tags.find { |tag| tag.name == issue.milestone.title }.nil?
tag.name == issue.milestone.title
}
milestone_is_tag.nil?
end end
} }
unless newer_tag_name.nil?
#add missed issues (according milestones) #add missed issues (according milestones)
issues_to_add = @issues.select { |issue| issues_to_add = src_array.select { |issue|
if issue.milestone.nil? if issue.milestone.nil?
false false
else else
@ -326,13 +393,14 @@ module GitHubChangelogGenerator
filtered_issues |= issues_to_add filtered_issues |= issues_to_add
end end
filtered_issues
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time, older_tag_name)
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) older_tag_time = self.get_time_of_tag(older_tag)
array.select { |req| array.select { |req|
@ -345,7 +413,12 @@ module GitHubChangelogGenerator
tag_in_range_old = t > older_tag_time tag_in_range_old = t > older_tag_time
end end
if newer_tag_time.nil?
tag_in_range_new = true
else
tag_in_range_new = t <= newer_tag_time tag_in_range_new = t <= newer_tag_time
end
tag_in_range = (tag_in_range_old) && (tag_in_range_new) tag_in_range = (tag_in_range_old) && (tag_in_range_new)
@ -358,27 +431,36 @@ module GitHubChangelogGenerator
# @param [Array] pull_requests # @param [Array] pull_requests
# @param [Array] issues # @param [Array] issues
# @param [String] newer_tag_name
# @param [String] newer_tag_time
# @param [String] older_tag_name # @param [String] older_tag_name
# @return [String] # @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' github_site = options[:github_site] || 'https://github.com'
project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}" project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}"
# Generate tag name and link if newer_tag.nil?
log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name})\n" newer_tag_name = 'Unreleased'
newer_tag_name2 = 'HEAD'
if @options[:compare_link] && older_tag_name newer_tag_time = Time.new
# Generate compare link else
log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n" newer_tag_name2 = newer_tag_name
end end
#Generate date string: #Generate date string:
time_string = newer_tag_time.strftime @options[:format] time_string = newer_tag_time.strftime @options[:format]
log += "#### #{time_string}\n"
# Generate tag name and link
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_name2})\n\n"
else
log += "\n"
end
if @options[:pulls] if @options[:pulls]
# Generate pull requests: # Generate pull requests:
@ -435,6 +517,7 @@ module GitHubChangelogGenerator
log += "- #{merge}" log += "- #{merge}"
} }
end end
log log
end end
@ -453,8 +536,44 @@ module GitHubChangelogGenerator
@tag_times_hash[tag_name['name']] = Time.parse(time_string) @tag_times_hash[tag_name['name']] = Time.parse(time_string)
end end
def get_all_issues def get_filtered_issues
issues = @issues
filtered_issues = 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 {
# add issues without any labels
|issue| !issue.labels.map { |label| label.name }.any?
}
filtered_issues |= issues_wo_labels
end
if @options[:verbose]
puts "Filtered issues: #{filtered_issues.count}"
end
filtered_issues
end
def fetch_issues_and_pull_requests
if @options[:verbose] if @options[:verbose]
print "Fetching closed issues...\r" print "Fetching closed issues...\r"
end end
@ -477,31 +596,13 @@ module GitHubChangelogGenerator
end end
# remove pull request from issues: # remove pull request from issues:
issues.select! { |x| issues_wo_pr = issues.select { |x|
x.pull_request == nil x.pull_request == nil
} }
pull_requests = issues.select { |x|
filtered_issues = issues.select { |issue| x.pull_request != nil
#compare is there any labels from @options[:labels] array
(issue.labels.map { |label| label.name } & @options[:labels]).any?
} }
return issues_wo_pr, pull_requests
if @options[:add_issues_wo_labels]
issues_wo_labels = issues.select {
# add issues without any labels
|issue| !issue.labels.map { |label| label.name }.any?
}
filtered_issues.concat(issues_wo_labels)
end
if @options[:verbose]
puts "Filtered issues with labels #{@options[:labels]}#{@options[:add_issues_wo_labels] ? ' and w/o labels' : ''}: #{filtered_issues.count}"
end
filtered_issues
end end
def fetch_event_for_issues(filtered_issues) def fetch_event_for_issues(filtered_issues)

View File

@ -6,7 +6,8 @@ require_relative 'version'
module GitHubChangelogGenerator module GitHubChangelogGenerator
class Parser class Parser
def self.parse_options 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} # :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| parser = OptionParser.new { |opts|
opts.banner = 'Usage: changelog_generator [options]' opts.banner = 'Usage: changelog_generator [options]'
@ -31,9 +32,12 @@ module GitHubChangelogGenerator
opts.on('--[no-]issues', 'Include closed issues to changelog. Default is true') do |v| opts.on('--[no-]issues', 'Include closed issues to changelog. Default is true') do |v|
options[:issues] = v options[:issues] = v
end 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 options[:add_issues_wo_labels] = v
end 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| opts.on('--[no-]pull-requests', 'Include pull-requests to changelog. Default is true') do |v|
options[:pulls] = v options[:pulls] = v
end end
@ -41,16 +45,22 @@ module GitHubChangelogGenerator
options[:filter_issues_by_milestone] = last options[:filter_issues_by_milestone] = last
end end
opts.on('--[no-]author', 'Add author of pull-request in the end. Default is true') do |author| 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-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 end
opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v| opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v|
options[:compare_link] = v options[:compare_link] = v
end end
opts.on('--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[:labels] = list options[:include_labels] = list
end 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| 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[:pull_request_labels] = list options[:exclude_labels] = list
end end
opts.on('--github-site [URL]', 'The Enterprise Github site on which your project is hosted.') do |last| opts.on('--github-site [URL]', 'The Enterprise Github site on which your project is hosted.') do |last|
options[:github_site] = last options[:github_site] = last