Skip to content

Commit a2bedb3

Browse files
committed
Remove blank lines from merged commits before generating merge commit message
1 parent 96a0c37 commit a2bedb3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1919
- The `config` command groups configuration settings by a command.
2020
- The `changelog` command will show actually used app version instead of `Unreleased` word, when used version isn't mentioned in a changelog.
2121
- The executed SVN command idle timeout changed from 20 minutes to 3 minutes.
22+
- The `commit` command remove empty lines of merged commits, when building grouped merge commit message.
2223

2324
### Fixed
2425
- The non-merged revision table was shown after a successful auto-commit, when merge conflict was resolved.

src/SVNBuddy/Repository/CommitMessage/GroupByBugMergeTemplate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ protected function generateGroupBody($path, array $revisions, $repository_url, $
4949
$bug_title_added = false;
5050

5151
foreach ( $bug_revisions as $revision ) {
52-
$commit_message_parts = explode(PHP_EOL, rtrim($revisions_data[$revision]['msg']), 2);
52+
$commit_message_parts = explode(PHP_EOL, $revisions_data[$revision]['msg']);
53+
$commit_message_parts = array_filter($commit_message_parts); // Removes empty lines.
54+
5355
$bug_title = array_shift($commit_message_parts);
5456
$commit_message = $commit_message_parts ? implode(PHP_EOL, $commit_message_parts) : '(no details)';
5557

0 commit comments

Comments
 (0)