Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6406168b15 | ||
|
|
7b38f0f56a | ||
|
|
7704dc9ecd | ||
|
|
25ee41bc8c | ||
|
|
219f4b9748 | ||
|
|
de33edd3ce | ||
|
|
6db717a5ee | ||
|
|
5fb5832cf5 | ||
|
|
a55b938ccf | ||
|
|
d1b3e09da3 | ||
|
|
4d094ba211 | ||
|
|
3d7aa0b7c5 | ||
|
|
ada6f13de5 | ||
|
|
9479979fed | ||
|
|
30e9ab0ec3 | ||
|
|
8d5bdbcca7 | ||
|
|
a514224625 | ||
|
|
4162bc8659 | ||
|
|
06d49a1e44 | ||
|
|
dbb385d049 | ||
|
|
abe19eedbe | ||
|
|
32149b8a2c | ||
|
|
e5f6670a07 | ||
|
|
83e406ca5f | ||
|
|
8c7f1a7390 | ||
|
|
f248e1c718 | ||
|
|
fdcf5ccf7e | ||
|
|
2b46ba2a11 | ||
|
|
f6388903b7 | ||
|
|
e51bceda05 | ||
|
|
165e8d4e9f | ||
|
|
79f16947b7 | ||
|
|
432f12af70 | ||
|
|
a1b19044c2 | ||
|
|
70e8c287f5 | ||
|
|
78ca34ff7c | ||
|
|
2f3e754a6b | ||
|
|
8c20913af4 | ||
|
|
f14b081126 | ||
|
|
315a92b7b3 | ||
|
|
cca51aa19f | ||
|
|
56b1398081 | ||
|
|
1232f339a0 | ||
|
|
3cc6418048 | ||
|
|
a4f93feb7d | ||
|
|
b0be9f8b06 | ||
|
|
aeaec739f5 | ||
|
|
bf27187dd3 | ||
|
|
0e0295645d | ||
|
|
b2fac89ec1 | ||
|
|
947163426b | ||
|
|
2900025f6f | ||
|
|
802fb44d38 | ||
|
|
8b299a0394 | ||
|
|
111931a958 | ||
|
|
5a47a075e2 | ||
|
|
a35d08f6c7 | ||
|
|
c2e73edc29 | ||
|
|
045dff7cbc | ||
|
|
7c85082e7d | ||
|
|
cc65da5153 | ||
|
|
c22f8b4a31 | ||
|
|
2c46d32531 | ||
|
|
e822ddfc98 | ||
|
|
25a9490a07 | ||
|
|
92a39a4107 | ||
|
|
583021b474 | ||
|
|
961aa20138 | ||
|
|
396622bec0 | ||
|
|
06575c9ab2 | ||
|
|
eba475ee76 | ||
|
|
aa88122d48 | ||
|
|
a69c2b5343 | ||
|
|
7fc862a100 | ||
|
|
87f95140d9 | ||
|
|
75ae6f4a3a | ||
|
|
31c13e8d1d | ||
|
|
a46fe7470b | ||
|
|
27fa9e8e02 | ||
|
|
b15f6b2837 | ||
|
|
0706f89c02 | ||
|
|
419e7e78ad | ||
|
|
6159ebba2f | ||
|
|
3a200e943c | ||
|
|
4dc5a094d2 | ||
|
|
07d52c9465 | ||
|
|
02b0f95ab0 | ||
|
|
0b1f0319db | ||
|
|
c20529bf32 | ||
|
|
26c393c2cc | ||
|
|
f8f887093a | ||
|
|
63bf4a59d4 | ||
|
|
af189dc66f | ||
|
|
917041424b | ||
|
|
2e5099efee | ||
|
|
fb6b3dad5b | ||
|
|
049599a0a4 | ||
|
|
98cdd685b9 |
146
CHANGELOG.md
146
CHANGELOG.md
@@ -1,13 +1,73 @@
|
||||
# Change Log
|
||||
|
||||
## [1.3.10](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.10) (2015-03-18)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.9...1.3.10)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Exclude closed PR's from changelog. [\#69](https://github.com/skywinder/Github-Changelog-Generator/issues/69)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix termination in case of empty unreleased section with `--unreleased-only` option. [\#70](https://github.com/skywinder/Github-Changelog-Generator/pull/70) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.3.9](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.9) (2015-03-06)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.8...1.3.9)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Improve method of detecting owner and repository [\#63](https://github.com/skywinder/Github-Changelog-Generator/issues/63)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Resolved concurrency problem in case of issues \> 2048 [\#65](https://github.com/skywinder/Github-Changelog-Generator/pull/65) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.3.8](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.8) (2015-03-05)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.6...1.3.8)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix `git remote` parsing in case, when script running without parameters inside destination directory [\#61](https://github.com/skywinder/Github-Changelog-Generator/pull/61) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
|
||||
|
||||
## [1.3.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.5) (2015-03-04)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.4...1.3.5)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Pull Requests in Wrong Tag [\#60](https://github.com/skywinder/Github-Changelog-Generator/issues/60)
|
||||
|
||||
## [1.3.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.4) (2015-03-03)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.3...1.3.4)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- --no-issues appears to break PRs [\#59](https://github.com/skywinder/Github-Changelog-Generator/issues/59)
|
||||
|
||||
## [1.3.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.3) (2015-03-03)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.2...1.3.3)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Add \# character to encapsulate list. [\#58](https://github.com/skywinder/Github-Changelog-Generator/issues/58)
|
||||
|
||||
## [1.3.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.2) (2015-03-03)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.1...1.3.2)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- generation failed if github commit api return `404 Not Found` [\#57](https://github.com/skywinder/Github-Changelog-Generator/issues/57)
|
||||
|
||||
## [1.3.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.1) (2015-02-27)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.0...1.3.1)
|
||||
@@ -16,6 +76,20 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.8...1.3.0)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Do not show `Unreleased` section, when it's empty. [\#55](https://github.com/skywinder/Github-Changelog-Generator/issues/55)
|
||||
|
||||
- Separate list exclude and include labels [\#52](https://github.com/skywinder/Github-Changelog-Generator/issues/52)
|
||||
|
||||
- Unreleased issues in separate section [\#47](https://github.com/skywinder/Github-Changelog-Generator/issues/47)
|
||||
|
||||
- Separate by lists: Enhancements, Bugs, Pull requests. [\#31](https://github.com/skywinder/Github-Changelog-Generator/issues/31)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Test pull request with invalid label \(\#26\) in changelog appeared. [\#44](https://github.com/skywinder/Github-Changelog-Generator/issues/44)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Implement filtering of Pull Requests by milestones [\#50](https://github.com/skywinder/Github-Changelog-Generator/pull/50) ([skywinder](https://github.com/skywinder))
|
||||
@@ -24,6 +98,10 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.7...1.2.8)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Bugs, that closed simultaneously with push not appeared in correct version. [\#37](https://github.com/skywinder/Github-Changelog-Generator/issues/37)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Feature/fix 37 [\#49](https://github.com/skywinder/Github-Changelog-Generator/pull/49) ([skywinder](https://github.com/skywinder))
|
||||
@@ -50,6 +128,14 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
||||
@@ -60,22 +146,40 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4)
|
||||
|
||||
**Merged pull requests:**
|
||||
**Fixed bugs:**
|
||||
|
||||
- Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder))
|
||||
- Sometimes user is NULL during merges [\#41](https://github.com/skywinder/Github-Changelog-Generator/issues/41)
|
||||
|
||||
- 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) (2014-12-16)
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38)
|
||||
|
||||
- Detailed output [\#33](https://github.com/skywinder/Github-Changelog-Generator/issues/33)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [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)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef))
|
||||
@@ -84,6 +188,10 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder))
|
||||
@@ -106,6 +214,10 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- 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)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder))
|
||||
@@ -136,23 +248,39 @@
|
||||
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12)
|
||||
|
||||
- Markdown formating in the last line wrong [\#9](https://github.com/skywinder/Github-Changelog-Generator/issues/9)
|
||||
|
||||
## [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 requests:**
|
||||
|
||||
- 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)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Add support for fixed issues and implemented enchanments. [\#6](https://github.com/skywinder/Github-Changelog-Generator/issues/6)
|
||||
|
||||
- Implement option to specify output filename [\#4](https://github.com/skywinder/Github-Changelog-Generator/issues/4)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
|
||||
- Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder))
|
||||
- Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0) (2014-11-07)
|
||||
|
||||
@@ -160,6 +288,8 @@
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Fix parsing date of pull request [\#3](https://github.com/skywinder/Github-Changelog-Generator/pull/3) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- 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))
|
||||
|
||||
98
README.md
98
README.md
@@ -1,8 +1,7 @@
|
||||
|
||||
[](http://badge.fury.io/rb/github_changelog_generator)
|
||||
[](https://travis-ci.org/skywinder/Github-Changelog-Generator)
|
||||
[](https://travis-ci.org/skywinder/github-changelog-generator)
|
||||
|
||||
GitHub Changelog Generator
|
||||
GitHub Changelog Generator 
|
||||
==================
|
||||
|
||||
- [Installation](#installation)
|
||||
@@ -13,14 +12,23 @@ GitHub Changelog Generator
|
||||
- [Features and advantages of this project](#features-and-advantages-of-this-project)
|
||||
- [Alternatives](#alternatives)
|
||||
- [Projects using this library](#projects-using-this-library)
|
||||
- [Am I missed some essential feature?](#am-i-missed-some-essential-feature)
|
||||
- [Am I missing some essential feature?](#am-i-missing-some-essential-feature)
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
|
||||
Changelog generation has never been so easy.
|
||||
### Changelog generation has never been so easy:
|
||||
|
||||
**Fully automate changelog generation** - This gem generate change log file based on tags, issues and merged pull requests from **Github issue tracker**. This generator complies all [change log format guidelines](http://keepachangelog.com/).
|
||||
**Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according labels) from :octocat: GitHub Issue Tracker.
|
||||
|
||||
Since now you don't have to fill your `CHANGELOG.md` manually: just run the script, relax and take a cup of :coffee: before your next release! :tada:
|
||||
|
||||
>### *What’s the point of a change log?*
|
||||
To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
|
||||
### *Why should I care?*
|
||||
Because software tools are for people. If you don’t care, why are you contributing to open source? Surely, there must be a kernel (ha!) of care somewhere in that lovely little brain of yours.
|
||||
|
||||
> :copyright: *[http://keepachangelog.com](http://keepachangelog.com/)*
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -57,13 +65,13 @@ Changelog generation has never been so easy.
|
||||
## Usage
|
||||
**It's really simple**:
|
||||
|
||||
- If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder and run:
|
||||
- If your **git remote** `origin` refers to your GitHub repo, then just go to your project folder and run:
|
||||
|
||||
github_changelog_generator
|
||||
|
||||
- or from anywhere:
|
||||
|
||||
github_changelog_generator -u github_username -p github_project
|
||||
- `github_changelog_generator -u github_username -p github_project`
|
||||
- `github_changelog_generator github_username/github_project`
|
||||
|
||||
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
||||
|
||||
@@ -96,7 +104,7 @@ Type `github_changelog_generator --help` for detailed usage.
|
||||
|
||||
### GitHub token
|
||||
|
||||
Since GitHub allow to make only 50 requests without authentication it's recommended to run this script with token
|
||||
Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
|
||||
|
||||
**You can easily [generate it here](https://github.com/settings/applications)**.
|
||||
|
||||
@@ -115,23 +123,27 @@ 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
|
||||
- Generate canonical change log file, followed by [keepachangelog.com guidlines](http://keepachangelog.com/)
|
||||
- Simply add links for all closed issues and merged pull requests
|
||||
- Possible to generate **Unreleased** changes (closed issues that have not released yet)
|
||||
- Flexible format customisation:
|
||||
- Customize issues, that should be added to changelog
|
||||
- Custom date format supported
|
||||
- Ability to manually specify in which version issue was fixed (in case, when closed date is not match) by setting `milestone` of issue the same name as tag of required version
|
||||
- Ability to exclude specific issues from change log (by labels)
|
||||
- Automatically exclude "questions" - issues marked as `question` labels (and other issues, that shouldn't be in change log file: with `duplicate invalid wontfix` labels)
|
||||
- Distinguish bug fixes, enchantments, and closed issues according labels.
|
||||
- **Issues** (closed issues w/o any labels)
|
||||
- **Merged pull-requests** (all merged pull-requests)
|
||||
- **Bug-fixes** (by label `bug` in issue)
|
||||
- **Enhancements** (by label `enhancement` in issue)
|
||||
- Generate canonical, neat change log file, followed by [basic change log guidlines](http://keepachangelog.com/) :gem:
|
||||
- Possible to generate **Unreleased** changes (closed issues that have not released yet) :dizzy:
|
||||
- **GitHub Enterprise support** via command line options! :factory:
|
||||
- Flexible format **customisation**:
|
||||
- **Customize** issues, that **should be added** to changelog :eight_spoked_asterisk:
|
||||
- **Custom date format** supported (but get in mind [ISO 8601](http://xkcd.com/1179/) ) :date:
|
||||
- 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 :pushpin:
|
||||
- Automatically **exclude specific issues**, not-related to change log (any issue, that has label `question` `duplicate` `invalid` `wontfix`by default) :scissors:
|
||||
- **Distinguish** issues **according labels**. :mag_right:
|
||||
- Merged pull requests (all `merged` pull-requests) :twisted_rightwards_arrows:
|
||||
- Bug fixes (by label `bug` in issue) :beetle:
|
||||
- Enhancements (by label `enhancement` in issue) :star2:
|
||||
- Issues (closed issues `w/o any labels`) :non-potable_water:
|
||||
|
||||
- You can manually set which labels should be included/excluded. :wrench:
|
||||
- Apply a lot of other customisations, to fit changelog for your personal style :tophat:
|
||||
(*look `github_changelog_generator --help` for details)*
|
||||
|
||||
|
||||
###Alternatives
|
||||
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But no one was satisfy my requirements.
|
||||
Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Changelog-Generator/wiki/Alternatives), that I found. But none satisfied my requirements.
|
||||
|
||||
*If you know other projects - feel free to edit this Wiki page!*
|
||||
|
||||
@@ -139,15 +151,40 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
|
||||
### 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 change log in your project or know of project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
|
||||
*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
|
||||
|
||||
## Am I missed some essential feature?
|
||||
## Am I missing some essential feature?
|
||||
|
||||
**Nothing is impossible!**
|
||||
- **Nothing is impossible!**
|
||||
|
||||
Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
|
||||
- Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
|
||||
|
||||
*Bug reports, feature requests, patches, well-wishes are always welcome!*
|
||||
- *Bug reports, feature requests, patches, well-wishes are always welcome* :heavy_exclamation_mark:
|
||||
|
||||
## FAQ
|
||||
|
||||
- ***I already use GitHub Releases. Why do I need this?***
|
||||
|
||||
GitHub Releases is a very good thing. And it's very good practice to maintain it (not so much people using it yet)! :congratulations:
|
||||
|
||||
*BDW: I would like to support GitHub Releases in [next releases](https://github.com/skywinder/github-changelog-generator/issues/56) ;)*
|
||||
|
||||
I'm not try to compare quality of auto-generated and manually generated logs.. but:
|
||||
|
||||
The auto generated Changelog really helps even if you manually fill Releases notes!
|
||||
|
||||
For example:
|
||||
|
||||
When I found a closed bug - it's very useful to understand, in which release it was fixed. In that case you can easily find this issue by \# in `CHANGELOG.md`.
|
||||
|
||||
- it's not so quite easy to find it in manually filled Releases notes.
|
||||
- this file can also help you to build your Release note and not miss features in manually-filled list.
|
||||
|
||||
In the end:
|
||||
|
||||
I think, that GitHub Releases is more for end-users.
|
||||
But `CHANGELOG.md` could stay in the repo for developers with detailed list of changes.
|
||||
And it's nothing bad to combine GitHub Releases and `CHANGELOG.md` file together in that manner.
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -157,6 +194,7 @@ Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/n
|
||||
4. Commit your changes (`git commit -am 'Add some feature'`)
|
||||
5. Push to the branch (`git push origin my-new-feature`)
|
||||
6. Create a new Pull Request
|
||||
7. Profit! :white_check_mark:
|
||||
|
||||
## License
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
||||
spec.email = %q{sky4winder+github_changelog_generator@gmail.com}
|
||||
spec.date = `date +"%Y-%m-%d"`.strip!
|
||||
spec.summary = %q{Script, that automatically generate changelog from your tags, issues, labels and pull requests.}
|
||||
spec.description = %q{Script, that automatically generate changelog from your tags, issues, labels and pull requests.}
|
||||
spec.description = %q{Changelog generation has never been so easy. Fully automate changelog generation - this gem generate change log file based on tags, issues and merged pull requests from Github issue tracker.}
|
||||
spec.homepage = %q{https://github.com/skywinder/Github-Changelog-Generator}
|
||||
spec.license = "MIT"
|
||||
|
||||
|
||||
BIN
images/logo.jpg
Normal file
BIN
images/logo.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
@@ -1,24 +1,30 @@
|
||||
# Change Log
|
||||
|
||||
## [Unreleased](https://github.com/nantas/changelog_test/tree/HEAD) (2015-03-03)
|
||||
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
|
||||
|
||||
[Full Changelog](https://github.com/nantas/changelog_test/compare/v0.0.1...HEAD)
|
||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.3...HEAD)
|
||||
|
||||
**Fixed bugs:**
|
||||
**Merged pull requests:**
|
||||
|
||||
- test issue closed by a commit that will be gone [\#3](https://github.com/nantas/changelog_test/issues/3)
|
||||
- Add automatically generated change log file. [\#5](https://github.com/skywinder/changelog_test/pull/5) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
**Closed issues:**
|
||||
## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
|
||||
|
||||
- test issue that will be closed in another repo [\#4](https://github.com/nantas/changelog_test/issues/4)
|
||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
|
||||
|
||||
## [v0.0.1](https://github.com/nantas/changelog_test/tree/v0.0.1) (2015-03-02)
|
||||
**Merged pull requests:**
|
||||
|
||||
**Fixed bugs:**
|
||||
- fix \#3. hotfix. Should appear in v0.0.3 [\#4](https://github.com/skywinder/changelog_test/pull/4) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- test issue that will be closed by a commit [\#2](https://github.com/nantas/changelog_test/issues/2)
|
||||
## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
|
||||
|
||||
- test issue that will close normally [\#1](https://github.com/nantas/changelog_test/issues/1)
|
||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,20 +20,18 @@ module GitHubChangelogGenerator
|
||||
|
||||
@options = Parser.parse_options
|
||||
|
||||
if options[:verbose]
|
||||
puts 'Input options:'
|
||||
pp options
|
||||
puts ''
|
||||
end
|
||||
|
||||
github_token
|
||||
fetch_github_token
|
||||
|
||||
github_options = {per_page: PER_PAGE_NUMBER}
|
||||
github_options[:oauth_token] = @github_token unless @github_token.nil?
|
||||
github_options[:endpoint] = options[:github_endpoint] unless options[:github_endpoint].nil?
|
||||
github_options[:site] = options[:github_endpoint] unless options[:github_site].nil?
|
||||
|
||||
@github = Github.new github_options
|
||||
begin
|
||||
@github = Github.new github_options
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
|
||||
@generator = Generator.new(@options)
|
||||
|
||||
@@ -42,19 +40,18 @@ module GitHubChangelogGenerator
|
||||
|
||||
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)
|
||||
detect_actual_closed_dates
|
||||
else
|
||||
@issues = []
|
||||
end
|
||||
|
||||
fetch_event_for_issues_and_pr
|
||||
detect_actual_closed_dates
|
||||
@tag_times_hash = {}
|
||||
end
|
||||
|
||||
@@ -65,11 +62,18 @@ module GitHubChangelogGenerator
|
||||
end
|
||||
|
||||
threads = []
|
||||
|
||||
@issues.each { |issue|
|
||||
threads << Thread.new {
|
||||
find_closed_date_by_commit(issue)
|
||||
}
|
||||
}
|
||||
|
||||
@pull_requests.each { |pull_request|
|
||||
threads << Thread.new {
|
||||
find_closed_date_by_commit(pull_request)
|
||||
}
|
||||
}
|
||||
threads.each { |thr| thr.join }
|
||||
|
||||
if @options[:verbose]
|
||||
@@ -79,14 +83,20 @@ module GitHubChangelogGenerator
|
||||
|
||||
def find_closed_date_by_commit(issue)
|
||||
unless issue['events'].nil?
|
||||
#if it's PR -> then find "merged event", in case of usual issue -> fond closed date
|
||||
compare_string = issue[:merged_at].nil? ? 'closed' : 'merged'
|
||||
# reverse! - to find latest closed event. (event goes in date order)
|
||||
issue['events'].reverse!.each { |event|
|
||||
if event[:event].eql? 'closed'
|
||||
if event[:event].eql? compare_string
|
||||
if event[:commit_id].nil?
|
||||
issue[:actual_date] = issue[:closed_at]
|
||||
else
|
||||
begin
|
||||
commit = @github.git_data.commits.get @options[:user], @options[:project], event[:commit_id]
|
||||
begin
|
||||
commit = @github.git_data.commits.get @options[:user], @options[:project], event[:commit_id]
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
issue[:actual_date] = commit[:author][:date]
|
||||
rescue
|
||||
puts "Warning: can't fetch commit #{event[:commit_id]} probably it referenced from another repo."
|
||||
@@ -104,30 +114,27 @@ module GitHubChangelogGenerator
|
||||
puts JSON.pretty_generate(json)
|
||||
end
|
||||
|
||||
def exec_command(cmd)
|
||||
exec_cmd = "cd #{$project_path} and #{cmd}"
|
||||
%x[#{exec_cmd}]
|
||||
end
|
||||
|
||||
def fetch_merged_at_pull_requests
|
||||
if @options[:verbose]
|
||||
print "Fetching pull requests...\r"
|
||||
print "Fetching merged dates...\r"
|
||||
end
|
||||
response = @github.pull_requests.list @options[:user], @options[:project], :state => 'closed'
|
||||
|
||||
pull_requests = []
|
||||
page_i = 0
|
||||
response.each_page do |page|
|
||||
page_i += PER_PAGE_NUMBER
|
||||
count_pages = response.count_pages
|
||||
print "Fetching pull requests... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
|
||||
pull_requests.concat(page)
|
||||
end
|
||||
print " \r"
|
||||
begin
|
||||
response = @github.pull_requests.list @options[:user], @options[:project], :state => 'closed'
|
||||
page_i = 0
|
||||
response.each_page do |page|
|
||||
page_i += PER_PAGE_NUMBER
|
||||
count_pages = response.count_pages
|
||||
print "Fetching merged dates... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
|
||||
pull_requests.concat(page)
|
||||
end
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
|
||||
if @options[:verbose]
|
||||
puts "Received pull requests: #{pull_requests.count}"
|
||||
end
|
||||
|
||||
|
||||
print " \r"
|
||||
|
||||
@pull_requests.each { |pr|
|
||||
fetched_pr = pull_requests.find { |fpr|
|
||||
@@ -135,16 +142,21 @@ module GitHubChangelogGenerator
|
||||
pr[:merged_at] = fetched_pr[:merged_at]
|
||||
pull_requests.delete(fetched_pr)
|
||||
}
|
||||
|
||||
if @options[:verbose]
|
||||
puts 'Fetching merged dates... Done!'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def get_filtered_pull_requests
|
||||
|
||||
pull_requests = @pull_requests
|
||||
filtered_pull_requests = pull_requests
|
||||
self.fetch_merged_at_pull_requests
|
||||
|
||||
filtered_pull_requests = @pull_requests.select {|pr| pr[:merged_at] != nil }
|
||||
|
||||
unless @options[:include_labels].nil?
|
||||
filtered_pull_requests = pull_requests.select { |issue|
|
||||
filtered_pull_requests = @pull_requests.select { |issue|
|
||||
#add all labels from @options[:incluse_labels] array
|
||||
(issue.labels.map { |label| label.name } & @options[:include_labels]).any?
|
||||
}
|
||||
@@ -158,7 +170,7 @@ module GitHubChangelogGenerator
|
||||
end
|
||||
|
||||
if @options[:add_issues_wo_labels]
|
||||
issues_wo_labels = pull_requests.select {
|
||||
issues_wo_labels = @pull_requests.select {
|
||||
# add issues without any labels
|
||||
|issue| !issue.labels.map { |label| label.name }.any?
|
||||
}
|
||||
@@ -171,43 +183,6 @@ module GitHubChangelogGenerator
|
||||
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
|
||||
@@ -267,7 +242,7 @@ module GitHubChangelogGenerator
|
||||
|
||||
log = ''
|
||||
|
||||
if @options[:unreleased]
|
||||
if @options[:unreleased] && @all_tags.count != 0
|
||||
unreleased_log = self.generate_log_between_tags(self.all_tags[0], nil)
|
||||
if unreleased_log
|
||||
log += unreleased_log
|
||||
@@ -277,8 +252,9 @@ module GitHubChangelogGenerator
|
||||
(1 ... self.all_tags.size).each { |index|
|
||||
log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1])
|
||||
}
|
||||
|
||||
log += generate_log_between_tags(nil, self.all_tags.last)
|
||||
if @all_tags.count != 0
|
||||
log += generate_log_between_tags(nil, self.all_tags.last)
|
||||
end
|
||||
|
||||
log
|
||||
end
|
||||
@@ -314,7 +290,11 @@ module GitHubChangelogGenerator
|
||||
end
|
||||
|
||||
def is_megred(number)
|
||||
@github.pull_requests.merged? @options[:user], @options[:project], number
|
||||
begin
|
||||
@github.pull_requests.merged? @options[:user], @options[:project], number
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
end
|
||||
|
||||
def get_all_tags
|
||||
@@ -323,30 +303,32 @@ module GitHubChangelogGenerator
|
||||
print "Fetching tags...\r"
|
||||
end
|
||||
|
||||
response = @github.repos.tags @options[:user], @options[:project]
|
||||
|
||||
tags = []
|
||||
page_i = 0
|
||||
count_pages = response.count_pages
|
||||
response.each_page do |page|
|
||||
page_i += PER_PAGE_NUMBER
|
||||
print "Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
|
||||
tags.concat(page)
|
||||
end
|
||||
print " \r"
|
||||
if @options[:verbose]
|
||||
puts "Found #{tags.count} tags"
|
||||
end
|
||||
|
||||
begin
|
||||
response = @github.repos.tags @options[:user], @options[:project]
|
||||
page_i = 0
|
||||
count_pages = response.count_pages
|
||||
response.each_page do |page|
|
||||
page_i += PER_PAGE_NUMBER
|
||||
print "Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}\r"
|
||||
tags.concat(page)
|
||||
end
|
||||
print " \r"
|
||||
if @options[:verbose]
|
||||
puts "Found #{tags.count} tags"
|
||||
end
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
|
||||
|
||||
|
||||
tags
|
||||
end
|
||||
|
||||
def github_token
|
||||
if @options[:token]
|
||||
return @github_token ||= @options[:token]
|
||||
end
|
||||
|
||||
env_var = ENV.fetch 'CHANGELOG_GITHUB_TOKEN', nil
|
||||
def fetch_github_token
|
||||
env_var = @options[:token] ? @options[:token] : (ENV.fetch 'CHANGELOG_GITHUB_TOKEN', nil)
|
||||
|
||||
unless env_var
|
||||
puts "Warning: No token provided (-t option) and variable $CHANGELOG_GITHUB_TOKEN was not found.".yellow
|
||||
@@ -359,7 +341,7 @@ module GitHubChangelogGenerator
|
||||
|
||||
def generate_log_between_tags(older_tag, newer_tag)
|
||||
# older_tag nil - means it's first tag, newer_tag nil - means it unreleased section
|
||||
filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, older_tag, newer_tag)
|
||||
filtered_pull_requests = delete_by_time(@pull_requests, :actual_date, older_tag, newer_tag)
|
||||
filtered_issues = delete_by_time(@issues, :actual_date, older_tag, newer_tag)
|
||||
|
||||
newer_tag_name = newer_tag.nil? ? nil : newer_tag['name']
|
||||
@@ -373,7 +355,7 @@ module GitHubChangelogGenerator
|
||||
|
||||
if filtered_issues.empty? && filtered_pull_requests.empty? && newer_tag.nil?
|
||||
# do not generate empty unreleased section
|
||||
return nil
|
||||
return ''
|
||||
end
|
||||
|
||||
self.create_log(filtered_pull_requests, filtered_issues, newer_tag, older_tag_name)
|
||||
@@ -416,7 +398,7 @@ module GitHubChangelogGenerator
|
||||
|
||||
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?)
|
||||
raise 'At least one 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)
|
||||
@@ -554,7 +536,11 @@ module GitHubChangelogGenerator
|
||||
return @tag_times_hash[tag_name['name']]
|
||||
end
|
||||
|
||||
github_git_data_commits_get = @github.git_data.commits.get @options[:user], @options[:project], tag_name['commit']['sha']
|
||||
begin
|
||||
github_git_data_commits_get = @github.git_data.commits.get @options[:user], @options[:project], tag_name['commit']['sha']
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
time_string = github_git_data_commits_get['committer']['date']
|
||||
@tag_times_hash[tag_name['name']] = Time.parse(time_string)
|
||||
end
|
||||
@@ -600,17 +586,22 @@ module GitHubChangelogGenerator
|
||||
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
|
||||
|
||||
begin
|
||||
response = @github.issues.list user: @options[:user], repo: @options[:project], state: 'closed', filter: 'all', labels: nil
|
||||
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
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
|
||||
|
||||
|
||||
print " \r"
|
||||
|
||||
@@ -628,30 +619,45 @@ module GitHubChangelogGenerator
|
||||
return issues_wo_pr, pull_requests
|
||||
end
|
||||
|
||||
def fetch_event_for_issues(filtered_issues)
|
||||
def fetch_event_for_issues_and_pr
|
||||
if @options[:verbose]
|
||||
print "Fetching events for issues: 0/#{filtered_issues.count}\r"
|
||||
print "Fetching events for issues and PR: 0/#{@issues.count + @pull_requests.count}\r"
|
||||
end
|
||||
|
||||
# Async fetching events:
|
||||
threads = []
|
||||
|
||||
i = 0
|
||||
filtered_issues.each { |issue|
|
||||
threads << Thread.new {
|
||||
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
|
||||
issue[:events] = obj.body
|
||||
print "Fetching events for issues: #{i+1}/#{filtered_issues.count}\r"
|
||||
i +=1
|
||||
}
|
||||
}
|
||||
threads.each { |thr| thr.join }
|
||||
fetch_events_async(@issues + @pull_requests)
|
||||
|
||||
#to clear line from prev print
|
||||
print " \r"
|
||||
|
||||
if @options[:verbose]
|
||||
puts "Fetching events for issues: Done!"
|
||||
puts 'Fetching events for issues and PR: Done!'
|
||||
end
|
||||
end
|
||||
|
||||
def fetch_events_async(issues)
|
||||
i = 0
|
||||
max_thread_number = 50
|
||||
threads = []
|
||||
issues.each_slice(max_thread_number) { |issues_slice|
|
||||
issues_slice.each { |issue|
|
||||
threads << Thread.new {
|
||||
begin
|
||||
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
|
||||
rescue
|
||||
puts "Warning: GitHub API rate limit exceed (5000 per hour), change log may not contain some issues.".yellow
|
||||
end
|
||||
issue[:events] = obj.body
|
||||
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
|
||||
i +=1
|
||||
}
|
||||
}
|
||||
threads.each { |thr| thr.join }
|
||||
threads = []
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if __FILE__ == $0
|
||||
|
||||
@@ -6,8 +6,8 @@ require_relative 'version'
|
||||
module GitHubChangelogGenerator
|
||||
class Parser
|
||||
def self.parse_options
|
||||
# :include_labels => %w(bug enhancement),
|
||||
hash = {
|
||||
|
||||
options = {
|
||||
:tag1 => nil,
|
||||
:tag2 => nil,
|
||||
:format => '%Y-%m-%d',
|
||||
@@ -26,12 +26,12 @@ module GitHubChangelogGenerator
|
||||
:filter_issues_by_milestone => true,
|
||||
:compare_link => true,
|
||||
:unreleased => true,
|
||||
:unreleased_label => 'Unreleased'
|
||||
:unreleased_label => 'Unreleased',
|
||||
:branch => 'origin'
|
||||
}
|
||||
options = hash
|
||||
|
||||
parser = OptionParser.new { |opts|
|
||||
opts.banner = 'Usage: changelog_generator [options]'
|
||||
opts.banner = 'Usage: github_changelog_generator [options]'
|
||||
opts.on('-u', '--user [USER]', 'Username of the owner of target GitHub repo') do |last|
|
||||
options[:user] = last
|
||||
end
|
||||
@@ -129,12 +129,24 @@ module GitHubChangelogGenerator
|
||||
end
|
||||
|
||||
if !options[:user] && !options[:project]
|
||||
remote = `git remote -vv`.split("\n")
|
||||
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)?(?:\.git).*/.match(remote[0])
|
||||
remote = `git config --get remote.#{options[:branch]}.url`
|
||||
# try to find repo in format:
|
||||
# origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch)
|
||||
# git@github.com:skywinder/Github-Changelog-Generator.git
|
||||
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote)
|
||||
|
||||
if match && match[1] && match[2]
|
||||
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||
options[:user], options[:project] = match[1], match[2]
|
||||
else
|
||||
# try to find repo in format:
|
||||
# origin https://github.com/skywinder/ChangelogMerger (fetch)
|
||||
# https://github.com/skywinder/ChangelogMerger
|
||||
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote)
|
||||
if match && match[1] && match[2]
|
||||
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||
options[:user], options[:project] = match[1], match[2]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -149,6 +161,12 @@ module GitHubChangelogGenerator
|
||||
options[:tag2] = ARGV[1]
|
||||
end
|
||||
|
||||
if options[:verbose]
|
||||
puts 'Performing task with options:'
|
||||
pp options
|
||||
puts ''
|
||||
end
|
||||
|
||||
options
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module GitHubChangelogGenerator
|
||||
VERSION = '1.3.4'
|
||||
VERSION = '1.3.11'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user