github-changelog-generator/man/git-generate-changelog.html
Eric Putnam 587557e1ac
Refactor generation code and allow custom sections
There's a lot in this PR.
- Added a Section class to more easily make the other changes and
  hopefully add flexibility for the future
- Added an option called `configure_sections` that allows you create
  your own custom sections. It blows away all other sections and uses
only the ones you give it.
- Added an option called `add_sections` that allows you to add_sections
  to the default section set
- Added an option called `include_merged` that can be used when
  configure_sections is defined. Configure sections blows away any and
all default sections so to get this one back, you have to set this
option.
- Added tests for this stuff

@HAIL9000 was a co-author. Because of a little git snafu, I accidentally
squashed all of our work into one so it looks like it was just me.

---

Refactor details:

Before this change, the code in generator.rb and generator_generation.rb was conflated and
method call flow went back and forth between the two files seemingly
randomly. They also both defined the exact same class, which is
un-ruby-ish. I tried to separate methods used for the whole changelog
generation from methods used for specific parts of the changelog and
move them into specific classes.

I reasoned that a changelog is a series of "entries" of all tagged
releases plus an extra entry for the unreleased entry. Each entry is
comprised of a header and a series of "sections" for that entry. Each
section is comprized of a list of issues and/or pull requests for that
entry. So the log contains entries, entries contain sections, and
sections contain issues & prs. I have structured the classes around this idea.

- lib/github_changelog_generator/generator/generator.rb is for code
related to generating the entire changelog.
- lib/github_changelog_generator/generator/entry.rb is for code related
to generating entries.
- lib/github_changelog_generator/generator/section.rb is for code
relating to geneating entry sections.

Issues and PRs are already special objects, so it doesn't make sense to
break those out into their own class.
2017-12-14 16:13:41 -08:00

271 lines
8.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>git-generate-changelog(1) - Generate changelog from github</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
<a href="#SEE-ALSO">SEE ALSO</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>git-generate-changelog(1)</li>
<li class='tc'></li>
<li class='tr'>git-generate-changelog(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>git-generate-changelog</code> - <span class="man-whatis">Generate changelog from github</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p><code>git generate-changelog</code> [-h|--help] [-u|--user] [-p|--project]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>Automatically generate changelog from your tags, issues, labels and pull requests on GitHub.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<p> -u, --user [USER]</p>
<p> Username of the owner of target GitHub repo</p>
<p> -p, --project [PROJECT]</p>
<p> Name of project on GitHub</p>
<p> -t, --token [TOKEN]</p>
<p> To make more than 50 requests per hour your GitHub token is required. You can generate it at: https://github.com/settings/tokens/new</p>
<p> -f, --date-format [FORMAT]</p>
<p> Date format. Default is %Y-%m-%d</p>
<p> -o, --output [NAME]</p>
<p> Output file. Default is CHANGELOG.md</p>
<p> -b, --base [NAME]</p>
<p> Optional base file to append generated changes to.</p>
<p> --bugs-label [LABEL]</p>
<p> Setup custom label for bug-fixes section. Default is "<strong>Fixed bugs:</strong></p>
<p> --enhancement-label [LABEL]</p>
<p> Setup custom label for enhancements section. Default is "<strong>Implemented enhancements:</strong>"</p>
<p> --issues-label [LABEL]</p>
<p> Setup custom label for closed-issues section. Default is "<strong>Closed issues:</strong>"</p>
<p> --header-label [LABEL]</p>
<p> Setup custom header label. Default is "# Changelog"</p>
<p> --pr-label [LABEL]</p>
<p> Setup custom label for pull requests section. Default is "<strong>Merged pull requests:</strong>"</p>
<p> --[no-]issues</p>
<p> Include closed issues in changelog. Default is true</p>
<p> --[no-]issues-wo-labels</p>
<p> Include closed issues without labels in changelog. Default is true</p>
<p> --[no-]pr-wo-labels</p>
<p> Include pull requests without labels in changelog. Default is true</p>
<p> --[no-]pull-requests</p>
<p> Include pull-requests in changelog. Default is true</p>
<p> --[no-]filter-by-milestone</p>
<p> Use milestone to detect when issue was resolved. Default is true</p>
<p> --[no-]author</p>
<p> Add author of pull-request in the end. Default is true</p>
<p> --unreleased-only</p>
<p> Generate log from unreleased closed issues only.</p>
<p> --[no-]unreleased</p>
<p> Add to log unreleased closed issues. Default is true</p>
<p> --unreleased-label [label]</p>
<p> Add to log unreleased closed issues. Default is true</p>
<p> --[no-]compare-link</p>
<p> Include compare link (Full Changelog) between older version and newer version. Default is true</p>
<p> --include-labels x,y,z</p>
<p> Only issues with the specified labels will be included in the changelog.</p>
<p> --exclude-labels x,y,z</p>
<p> Issues with the specified labels will be always excluded from changelog. Default is 'duplicate,question,invalid,wontfix'</p>
<p> --bug-labels x,y,z</p>
<p> Issues with the specified labels will be always added to "Fixed bugs" section. Default is 'bug,Bug'</p>
<p> --enhancement-labels x,y,z</p>
<p> Issues with the specified labels will be always added to "Implemented enhancements" section. Default is 'enhancement,Enhancement'</p>
<p> --exclude-tags x,y,z</p>
<p> Changelog will exclude specified tags</p>
<p> --since-tag x</p>
<p> Changelog will start after specified tag</p>
<p> --due-tag x</p>
<p> Changelog will end before specified tag</p>
<p> --max-issues [NUMBER]</p>
<p> Max number of issues to fetch from GitHub. Default is unlimited</p>
<p> --release-url [URL]</p>
<p> The URL to point to for release links, in printf format (with the tag as variable).</p>
<p> --github-site [URL]</p>
<p> The Enterprise Github site on which your project is hosted.</p>
<p> --github-api [URL]</p>
<p> The enterprise endpoint to use for your Github API.</p>
<p> --simple-list</p>
<p> Create simple list from issues and pull requests. Default is false.</p>
<p> --future-release [RELEASE-VERSION]</p>
<p> Put the unreleased changes in the specified release number.</p>
<p> --configure-sections [HASH, STRING]</p>
<p> Define your own set of sections which overrides all default sections") do |v|</p>
<p> --add-sections [HASH, STRING]</p>
<p> Add new sections but keep the default sections"</p>
<p> --include-merged</p>
<p> If configure_sections is set, use this to restore the merged pull requests sections</p>
<p> --[no-]verbose</p>
<p> Run verbosely. Default is true</p>
<p> -v, --version</p>
<p> Print version number</p>
<p> -h, --help</p>
<p> Displays Help</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<h2 id="AUTHOR">AUTHOR</h2>
<p>Written by Petr Korolev sky4winder@gmail.com</p>
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
<p>&lt;<a href="https://github.com/skywinder/github-changelog-generator/issues" data-bare-link="true">https://github.com/skywinder/github-changelog-generator/issues</a>&gt;</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<p>&lt;<a href="https://github.com/skywinder/github-changelog-generator/" data-bare-link="true">https://github.com/skywinder/github-changelog-generator/</a>&gt;</p>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>October 2015</li>
<li class='tr'>git-generate-changelog(1)</li>
</ol>
</div>
</body>
</html>