Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add customer formatting option to BranchChangelog #514

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/Command/Branch/BranchChangelogCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ protected function configure()
'Regex pattern to use for searching',
['/#(?P<id>[0-9]+)/i']
)
->addOption(
'format',
'p',
InputOption::VALUE_REQUIRED,
'Pattern to use for lines default is: #id Title url'
)
->setHelp(
<<<EOF
Reports what got fixed or closed since the last release on the given branch.
Expand All @@ -61,6 +67,21 @@ protected function configure()
To learn more about composing your own regex patterns see:
http://php.net/manual/reference.pcre.pattern.syntax.php
http://www.regular-expressions.info/

The default display format of a changelog is: #id Title url, you can customize this
to your desired format using the <comment>--format</comment> option with the following
pattern options:

* %id: ID of the closed issue (like #00 or JIRA-00)
* %an: Issue author-name
* %nn: Issue author-nickname (displayed as @name)
* %ts: Issue title in short (72 chars max)
* %tf: Issue title in full
* %wc: Web URL to the issue
* %ms: Full description (message) of the issue

Note: Because of how the changelog gets formatted each issue is only listed once,
even if it is matched in multiple commits.
EOF
)
;
Expand Down