From 9483c5edcb6365698c7beebf819d86c1f7e5aeeb Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 9 May 2016 15:27:44 +0300 Subject: [PATCH 1/9] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a473be1..261c5a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## [1.12.1](https://github.com/skywinder/github-changelog-generator/tree/1.12.1) (2016-05-09) [Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.12.0...1.12.1) +**Fixed bugs:** + +- github\_changelog\_generator/generator/generator\_tags.rb:61:in `detect\_since\_tag': undefined method `\[\]' for nil:NilClass \(NoMethodError\) [\#351](https://github.com/skywinder/github-changelog-generator/issues/351) + **Closed issues:** - Add a LICENSE file [\#369](https://github.com/skywinder/github-changelog-generator/issues/369) From 8bd4578e443b503ab34a5447b5b0c33b20750f1e Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 6 Jun 2016 10:23:38 +0300 Subject: [PATCH 2/9] check that page is not nil --- lib/github_changelog_generator/fetcher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github_changelog_generator/fetcher.rb b/lib/github_changelog_generator/fetcher.rb index f375119..4db61b9 100644 --- a/lib/github_changelog_generator/fetcher.rb +++ b/lib/github_changelog_generator/fetcher.rb @@ -71,7 +71,7 @@ module GitHubChangelogGenerator response.each_page do |page| page_i += PER_PAGE_NUMBER print_in_same_line("Fetching tags... #{page_i}/#{count_pages * PER_PAGE_NUMBER}") - tags.concat(page) + tags.concat(page) unless page.nil? end print_empty_line From df31f98ce307bac2f324e81fc42bbaf574bdb998 Mon Sep 17 00:00:00 2001 From: phase Date: Sun, 25 Oct 2015 00:51:11 -0700 Subject: [PATCH 3/9] Use GitHub tags to reference GitHub users This will use @tags to notify the contributor that their contribution is in the changelog. As discussed in https://github.com/github/linguist/pull/2698#issuecomment-150887871 --- .../generator/generator_generation.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_generation.rb b/lib/github_changelog_generator/generator/generator_generation.rb index b22fe40..7f595dd 100644 --- a/lib/github_changelog_generator/generator/generator_generation.rb +++ b/lib/github_changelog_generator/generator/generator_generation.rb @@ -171,11 +171,15 @@ module GitHubChangelogGenerator unless issue.pull_request.nil? if @options[:author] - title_with_number += if issue.user.nil? - " ({Null user})" - else - " ([#{issue.user.login}](#{issue.user.html_url}))" - end + if issue.user.nil? + title_with_number += " ({Null user})" + else + if issue.user.html_url.exclude? "github.com" + title_with_number += " ([#{issue.user.login}](#{issue.user.html_url}))" + else + title_with_number += " (@#{issue.user.login})" + end + end end end title_with_number From 4c737c93739fdbe57f8328e0c1358aecad5c9f30 Mon Sep 17 00:00:00 2001 From: phase Date: Sun, 25 Oct 2015 11:12:16 -0700 Subject: [PATCH 4/9] Extract username tagging --- .../generator/generator_generation.rb | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_generation.rb b/lib/github_changelog_generator/generator/generator_generation.rb index 7f595dd..ef0022e 100644 --- a/lib/github_changelog_generator/generator/generator_generation.rb +++ b/lib/github_changelog_generator/generator/generator_generation.rb @@ -160,7 +160,7 @@ module GitHubChangelogGenerator # Parse issue and generate single line formatted issue line. # # Example output: - # - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) ([skywinder](https://github.com/skywinder)) + # - Add coveralls integration [\#223](https://github.com/skywinder/github-changelog-generator/pull/223) (@skywinder) # # @param [Hash] issue Fetched issue from GitHub # @return [String] Markdown-formatted single issue @@ -168,21 +168,22 @@ module GitHubChangelogGenerator encapsulated_title = encapsulate_string issue[:title] title_with_number = "#{encapsulated_title} [\\##{issue[:number]}](#{issue.html_url})" - - unless issue.pull_request.nil? - if @options[:author] - if issue.user.nil? - title_with_number += " ({Null user})" - else - if issue.user.html_url.exclude? "github.com" - title_with_number += " ([#{issue.user.login}](#{issue.user.html_url}))" - else - title_with_number += " (@#{issue.user.login})" - end - end - end + issue_line_with_user(title_with_number, issue) + end + + private + + def issue_line_with_user(line, issue) + return line if !@options[:author] || issue.pull_request.nil? + + user = issue.user + return "#{line} ({Null user})" unless user + + if user.html_url.include?("github.com") + "#{line} (@#{user.login})" + else + "#{line} ([#{user.login}](#{user.html_url}))" end - title_with_number end end end From 0e671a96dab50d44b8c1b53dc46f3649cd260e7b Mon Sep 17 00:00:00 2001 From: phase Date: Sun, 25 Oct 2015 11:31:48 -0700 Subject: [PATCH 5/9] Remove trailing whitespace --- .../generator/generator_generation.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_generation.rb b/lib/github_changelog_generator/generator/generator_generation.rb index ef0022e..81c7c22 100644 --- a/lib/github_changelog_generator/generator/generator_generation.rb +++ b/lib/github_changelog_generator/generator/generator_generation.rb @@ -170,15 +170,15 @@ module GitHubChangelogGenerator title_with_number = "#{encapsulated_title} [\\##{issue[:number]}](#{issue.html_url})" issue_line_with_user(title_with_number, issue) end - + private - + def issue_line_with_user(line, issue) return line if !@options[:author] || issue.pull_request.nil? - + user = issue.user return "#{line} ({Null user})" unless user - + if user.html_url.include?("github.com") "#{line} (@#{user.login})" else From 59db1c782148ef393f5bc232d7d644f07efaf652 Mon Sep 17 00:00:00 2001 From: phase Date: Thu, 29 Oct 2015 07:37:23 -0700 Subject: [PATCH 6/9] CLI option for GitHub tags Not actually implemented yet --- lib/github_changelog_generator/parser.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 75a846e..83e9400 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -92,6 +92,9 @@ module GitHubChangelogGenerator opts.on("--[no-]author", "Add author of pull-request in the end. Default is true") do |author| options[:author] = author end + opts.on("--usernames-as-github-logins", "Use GitHub tags instead of links for the author of an issue or pull-request.") do |v| + options[:usernames_as_github_logins] = v + end opts.on("--unreleased-only", "Generate log from unreleased closed issues only.") do |v| options[:unreleased_only] = v end From 58bfa047c4e3b7b1e0d402561fbd00f0a388e818 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Sat, 2 Jul 2016 17:19:54 +0200 Subject: [PATCH 7/9] Option usernames_as_github_logins: Mention Markdown --- lib/github_changelog_generator/parser.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 83e9400..cdd673e 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -92,7 +92,7 @@ module GitHubChangelogGenerator opts.on("--[no-]author", "Add author of pull-request in the end. Default is true") do |author| options[:author] = author end - opts.on("--usernames-as-github-logins", "Use GitHub tags instead of links for the author of an issue or pull-request.") do |v| + opts.on("--usernames-as-github-logins", "Use GitHub tags instead of Markdown links for the author of an issue or pull-request.") do |v| options[:usernames_as_github_logins] = v end opts.on("--unreleased-only", "Generate log from unreleased closed issues only.") do |v| From 3962474e9fa2f7fa5e7280004f8943bd339b264a Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Sat, 2 Jul 2016 17:20:31 +0200 Subject: [PATCH 8/9] usernames_as_github_logins: Use option --- .../generator/generator_generation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github_changelog_generator/generator/generator_generation.rb b/lib/github_changelog_generator/generator/generator_generation.rb index 81c7c22..44df8df 100644 --- a/lib/github_changelog_generator/generator/generator_generation.rb +++ b/lib/github_changelog_generator/generator/generator_generation.rb @@ -179,7 +179,7 @@ module GitHubChangelogGenerator user = issue.user return "#{line} ({Null user})" unless user - if user.html_url.include?("github.com") + if @options[:usernames_as_github_logins] "#{line} (@#{user.login})" else "#{line} ([#{user.login}](#{user.html_url}))" From 55fba0f47955de3dee4d3365dc5024d8264a773b Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Mon, 4 Jul 2016 11:12:42 +0300 Subject: [PATCH 9/9] Update changelog for version 1.13.0 --- CHANGELOG.md | 11 +++++++---- Gemfile.lock | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 261c5a1..86164ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## [1.13.0](https://github.com/skywinder/github-changelog-generator/tree/1.13.0) (2016-07-04) +[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.12.1...1.13.0) + +**Merged pull requests:** + +- Carry PR \#301: usernames\_as\_github\_logins [\#392](https://github.com/skywinder/github-changelog-generator/pull/392) ([olleolleolle](https://github.com/olleolleolle)) + ## [1.12.1](https://github.com/skywinder/github-changelog-generator/tree/1.12.1) (2016-05-09) [Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.12.0...1.12.1) @@ -509,10 +516,6 @@ - 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)) - ## [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) diff --git a/Gemfile.lock b/Gemfile.lock index 0cae2f4..f8c6a1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - github_changelog_generator (1.12.1) + github_changelog_generator (1.13.0) colorize (~> 0.7) github_api (~> 0.12) rake (>= 10.0) @@ -105,4 +105,4 @@ DEPENDENCIES simplecov (~> 0.10) BUNDLED WITH - 1.12.0.rc.2 + 1.12.5