From 1af8e18f9ff0c3f92506d195efac65fb3f1ef9c5 Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Tue, 11 Nov 2014 11:00:34 +0200 Subject: [PATCH 1/2] update --- README.md | 62 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 9909e73..24377a6 100644 --- a/README.md +++ b/README.md @@ -11,48 +11,56 @@ This script automatically generate change-log from your tags and merged pull-req [sudo] gem install github_changelog_generator ## Usage +**It's really simple**: - github_changelog_generator -u github-username -p github-project +- `cd` to your Project folder with configured git and just type: -In output you will get `CHANGELOG.md` file with *pretty Markdown-formatted* changelogs in your current directory. + github_changelog_generator -### Params: -See `github_changelog_generator --help` for detailed usage. +- from anywhere: - Usage: changelog_generator --user username --project project_name [options] - -u, --user [USER] Username of the owner of target GitHub repo (required) - -p, --project [PROJECT] Name of project on GitHub (required) - -t, --token [TOKEN] To make more than 50 requests this script required your OAuth token for GitHub. You can generate it on https://github.com/settings/applications - -h, --help Displays Help - -v, --[no-]verbose Run verbosely - --[no-]issues Include closed issues to changelog. Default is true - --[no-]pull-requests Include pull-requests to changelog. Default is true - -l, --last-changes Generate log between last 2 tags only - -f, --date-format [FORMAT] Date format. Default is %d/%m/%y - -o, --output [NAME] Output file. Default is CHANGELOG.md - --labels x,y,z List of labels. Issues with that labels will be included to changelog. Default is 'bug,enhancement'a + github_changelog_generator -u github-username -p github-project + +As output you will get `CHANGELOG.md` file with *pretty Markdown-formatted* changelog. + +## Params: +Type `github_changelog_generator --help` for detailed usage. + + Usage: changelog_generator [options] + -u, --user [USER] Username of the owner of target GitHub repo + -p, --project [PROJECT] Name of project on GitHub + -t, --token [TOKEN] To make more than 50 requests this script required your OAuth token for GitHub. You can generate it on https://github.com/settings/applications + -h, --help Displays Help + -v, --[no-]verbose Run verbosely. Default is true + --[no-]issues Include closed issues to changelog. Default is true + --[no-]issues-without-labels Include closed issues without any labels to changelog. Default is true + --[no-]pull-requests Include pull-requests to changelog. Default is true + -l, --last-changes Generate log between last 2 tags only + -f, --date-format [FORMAT] Date format. Default is %d/%m/%y + -o, --output [NAME] Output file. Default is CHANGELOG.md + --labels x,y,z List of labels. Issues with that labels will be included to changelog. Default is 'bug,enhancement' ## Examples: -Look at changelog in this project! -### This changelog: [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) +- Look at changelog for **[CHANGELOG.md](https://github.com/skywinder/Github-Changelog-Generator/blob/master/CHANGELOG.md)** for this project +- This changelog: [ActionSheetPicker-3.0/CHANGELOG.md](https://github.com/skywinder/ActionSheetPicker-3.0/blob/master/CHANGELOG.md) was generated by command: -Was generated by command: - - github_changelog_generator -u skywinder -p ActionSheetPicker-3.0 + github_changelog_generator -u skywinder -p ActionSheetPicker-3.0 ## FAQ: Since GitHub allow to make only 50 requests without authentication it's recommended to run this scrip with key `-t [your-16-digit-token]` that you can easily **[generate it here](https://github.com/settings/applications)**. So, if you got error like this: ->! /Library/Ruby/Gems/2.0.0/gems/github_api-0.12.2/lib/github_api/response/raise_error.rb:14:in `on_complete': GET https://api.github.com/repos/skywinder/ActionSheetPicker-3.0/git/commits/89678f7d7f66873c858e6cb07bf697192aca6768: 403 API rate limit exceeded for 195.88.177.9. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) (Github::Error::Forbidden) +>! /Library/Ruby/Gems/2.0.0/gems/github_api-0.12.2/lib/github_api/response/raise_error.rb:14:in `on_complete' -It's time to generate this token or wait for 1 hour before GitHub reset counter for your IP. +It's time to create this token or wait for 1 hour before GitHub reset the counter for your IP. -## License +## Am I missed some essential feature? -Github the Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT). +**Nothing is impossible!** Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's get this generator better together! + +*Bug reports, feature requests, patches, well-wishes are always welcome!* ## Contributing @@ -63,6 +71,6 @@ Github the Generator is released under the [MIT License](http://www.opensource.o 5. Push to the branch (`git push origin my-new-feature`) 6. Create a new Pull Request -**Bug reports, feature requests, patches, well-wishes, and rap demo tapes are always welcome!** +## License -*Improvements more than welcome - they are kindly requested! :)* +Github Changelog Generator is released under the [MIT License](http://www.opensource.org/licenses/MIT). \ No newline at end of file From 1357b3980de244818ddaaf63f87fe2b6ccf1e9ec Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Tue, 11 Nov 2014 18:01:28 +0200 Subject: [PATCH 2/2] Fix bug with auto-detect project name, when there is dot signs in project name add fix for username also --- lib/github_changelog_generator/parser.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 61a4c0a..b24889b 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -56,9 +56,9 @@ class Parser if !options[:user] && !options[:project] remote = `git remote -vv`.split("\n") - match = /.*(?:[:\/])(\w*)\/((?:-|\w)*)\.git.*/.match(remote[0]) + match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)\.git.*/.match(remote[0]) - if match[1] && match[2] + if match && match[1] && match[2] puts "Detected user:#{match[1]}, project:#{match[2]}" options[:user], options[:project] = match[1], match[2] end