Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
1c489296
Commit
1c489296
authored
Dec 09, 2016
by
Adam Niedzielski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove trailing whitespace when generating changelog entry
parent
aa0a7aa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
bin/changelog
bin/changelog
+8
-3
changelogs/unreleased/nuke-ugly-spaces-in-changelog-generator.yml
...gs/unreleased/nuke-ugly-spaces-in-changelog-generator.yml
+4
-0
No files found.
bin/changelog
View file @
1c489296
...
...
@@ -84,12 +84,15 @@ class ChangelogEntry
end
end
private
def
contents
YAML
.
dump
(
yaml_content
=
YAML
.
dump
(
'title'
=>
title
,
'merge_request'
=>
options
.
merge_request
,
'author'
=>
options
.
author
)
remove_trailing_whitespace
(
yaml_content
)
end
def
write
...
...
@@ -101,8 +104,6 @@ class ChangelogEntry
exec
(
"git commit --amend"
)
end
private
def
fail_with
(
message
)
$stderr
.
puts
"
\e
[31merror
\e
[0m
#{
message
}
"
exit
1
...
...
@@ -160,6 +161,10 @@ class ChangelogEntry
def
branch_name
@branch_name
||=
%x{git symbolic-ref --short HEAD}
.
strip
end
def
remove_trailing_whitespace
(
yaml_content
)
yaml_content
.
gsub
(
/ +$/
,
''
)
end
end
if
$0
==
__FILE__
...
...
changelogs/unreleased/nuke-ugly-spaces-in-changelog-generator.yml
0 → 100644
View file @
1c489296
---
title
:
Remove trailing whitespace when generating changelog entry
merge_request
:
7948
author
:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment