Skip to content

Commit

Permalink
order pull request changelog in ascending chronological order
Browse files Browse the repository at this point in the history
  • Loading branch information
wireframe committed Oct 3, 2014
1 parent 1199733 commit 4f0762f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/thegarage/gitx/github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def create_pull_request(branch)
end

def pull_request_body(branch)
changelog = run_cmd "git log #{Thegarage::Gitx::BASE_BRANCH}...#{branch} --no-merges --pretty=format:'* %s%n%b'"
changelog = run_cmd("git log #{Thegarage::Gitx::BASE_BRANCH}...#{branch} --reverse --no-merges --pretty=format:'* %s%n%b'")
description = options[:description]

description_template = []
Expand Down
2 changes: 1 addition & 1 deletion spec/thegarage/gitx/cli/integrate_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
expect(cli).to receive(:run_cmd).with("git push origin HEAD").ordered
expect(cli).to receive(:run_cmd).with("git checkout feature-branch").ordered

expect(cli).to receive(:run_cmd).with("git log master...feature-branch --no-merges --pretty=format:'* %s%n%b'").and_return("2013-01-01 did some stuff").ordered
expect(cli).to receive(:run_cmd).with("git log master...feature-branch --reverse --no-merges --pretty=format:'* %s%n%b'").and_return("2013-01-01 did some stuff").ordered

stub_request(:post, 'https://api.github.com/repos/thegarage/thegarage-gitx/pulls').to_return(:status => 201, :body => new_pull_request.to_json, :headers => {'Content-Type' => 'application/json'})
stub_request(:post, 'https://api.github.com/repos/thegarage/thegarage-gitx/issues/10/comments').to_return(:status => 201)
Expand Down
2 changes: 1 addition & 1 deletion spec/thegarage/gitx/cli/release_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

expect(cli).to receive(:yes?).and_return(true)

expect(cli).to receive(:run_cmd).with("git log master...feature-branch --no-merges --pretty=format:'* %s%n%b'").and_return("2013-01-01 did some stuff").ordered
expect(cli).to receive(:run_cmd).with("git log master...feature-branch --reverse --no-merges --pretty=format:'* %s%n%b'").and_return("2013-01-01 did some stuff").ordered
expect(cli).to receive(:run_cmd).with("git checkout master").ordered
expect(cli).to receive(:run_cmd).with("git pull origin master").ordered
expect(cli).to receive(:run_cmd).with("git merge --no-ff feature-branch").ordered
Expand Down
3 changes: 2 additions & 1 deletion spec/thegarage/gitx/cli/review_command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
expect(Thegarage::Gitx::Cli::UpdateCommand).to receive(:new).and_return(fake_update_command)

allow(cli).to receive(:authorization_token).and_return(authorization_token)
expect(cli).to receive(:run_cmd).with("git log master...feature-branch --no-merges --pretty=format:'* %s%n%b'").and_return("2013-01-01 did some stuff").ordered
expect(cli).to receive(:run_cmd).with("git log master...feature-branch --reverse --no-merges --pretty=format:'* %s%n%b'").and_return("* old commit\n\n* new commit").ordered
expect(cli).to receive(:ask_editor).with("### Changelog\n* old commit\n\n* new commit\n#{Thegarage::Gitx::Cli::Github::PULL_REQUEST_FOOTER}", anything).and_return('description')

stub_request(:post, 'https://api.github.com/repos/thegarage/thegarage-gitx/pulls').to_return(:status => 201, :body => new_pull_request.to_json, :headers => {'Content-Type' => 'application/json'})
VCR.use_cassette('pull_request_does_not_exist') do
Expand Down

0 comments on commit 4f0762f

Please sign in to comment.