Skip to content

Commit

Permalink
Merge pull request #22 from chubchenko/hotfix/add-reverse-order-befor…
Browse files Browse the repository at this point in the history
…e-build-each-message

Add a reverse order for a `git log ...`
  • Loading branch information
chubchenko authored May 9, 2022
2 parents 50de210 + 6f70445 commit 5f9c065
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Add a reverse order for a `git log ...`. ([@chubchenko][])

## [0.2.1] - 2022-05-02
### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/slacky/command/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def call
:git, :log, "--oneline", "--first-parent", "#{previous}..#{current}"
).split("\n")

log.map.with_index(1) do |line, index|
log.reverse.map.with_index(1) do |line, index|
sha, commit = line.match(/^(\w+) (.*+?)/).captures

if /^Merge pull request/.match?(commit)
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/slacky/facade/changelog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def call
)
end

difference.reverse.map do |message|
difference.map do |message|
::Capistrano::Slacky::Block::Context.new(
*message.to_a
)
Expand Down
8 changes: 4 additions & 4 deletions spec/capistrano/slacky/command/diff_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
[
[
":one:",
"<https://github.com/chubchenko/capistrano-slacky/commit/02c4c96|02c4c96>",
"Update changelog & dependency version"
"<https://github.com/chubchenko/capistrano-slacky/commit/837d7a1|837d7a1>",
"Bump rspec from 3.7.1 to 4.0.1"
],
[
":two:",
Expand All @@ -57,8 +57,8 @@
],
[
":three:",
"<https://github.com/chubchenko/capistrano-slacky/commit/837d7a1|837d7a1>",
"Bump rspec from 3.7.1 to 4.0.1"
"<https://github.com/chubchenko/capistrano-slacky/commit/02c4c96|02c4c96>",
"Update changelog & dependency version"
]
]
)
Expand Down
4 changes: 2 additions & 2 deletions spec/capistrano/slacky/messaging/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
{
type: :context,
elements: [
{type: :mrkdwn, text: ":two:"},
{type: :mrkdwn, text: ":one:"},
{type: :mrkdwn, text: "<https://github.com/chubchenko/capistrano-slacky/commit/705253c|705253c>"},
{type: :mrkdwn, text: "Build initial version of the gem (#1)"}
]
},
{
type: :context,
elements: [
{type: :mrkdwn, text: ":one:"},
{type: :mrkdwn, text: ":two:"},
{type: :mrkdwn, text: "<https://github.com/chubchenko/capistrano-slacky/commit/02c4c96|02c4c96>"},
{type: :mrkdwn, text: "Update changelog & dependency version"}
]
Expand Down

0 comments on commit 5f9c065

Please sign in to comment.