gitx 3.2.0 → 4.0.0.ci.234.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/README.md +2 -2
- data/lib/gitx/cli/cleanup_command.rb +1 -1
- data/lib/gitx/cli/start_command.rb +1 -1
- data/lib/gitx/cli/update_command.rb +1 -1
- data/lib/gitx/defaults.yml +3 -3
- data/lib/gitx/version.rb +1 -1
- data/spec/gitx/cli/buildtag_command_spec.rb +8 -8
- data/spec/gitx/cli/cleanup_command_spec.rb +3 -3
- data/spec/gitx/cli/integrate_command_spec.rb +7 -7
- data/spec/gitx/cli/nuke_command_spec.rb +26 -26
- data/spec/gitx/cli/release_command_spec.rb +24 -24
- data/spec/gitx/cli/review_command_spec.rb +3 -3
- data/spec/gitx/cli/start_command_spec.rb +16 -16
- data/spec/gitx/cli/update_command_spec.rb +4 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 865f45d8b67f17251857964c9e221594a5af7c555d021c74c5dce5c6b6b13efb
|
4
|
+
data.tar.gz: feaabe22e3c7c06b514e3aa5df94d7cbed5138007afaa328d202a383118ef500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa461ad0101bf43313841ddebc566b2a852d066e27d339ef2bbc3afaa836dad9634a7cff5a792ff54c9e40abaea57f0a6dbe8799037e9f9ca4173b6cdee03baa
|
7
|
+
data.tar.gz: fb165b4e392c6551db6755f53b7787798d55ef0d0d4282e94631b4cb6c0ce613c4cde07a15de0fff8f99831150094f6456373695546895c02bb972cc3e5dbead
|
data/CONTRIBUTING.md
CHANGED
@@ -25,7 +25,7 @@ Use [Test Driven Development](http://en.wikipedia.org/wiki/Test-driven_developme
|
|
25
25
|
* Follow [best practices](http://robots.thoughtbot.com/post/48933156625/5-useful-tips-for-a-better-commit-message) for git commit messages to communicate your changes.
|
26
26
|
* Add [ticket references to commits to automatically trigger product management workflows](http://help.sprint.ly/knowledgebase/articles/108139-available-scm-vcs-commands)
|
27
27
|
* Only write the **minimal** amount of code necessary to accomplish the given task.
|
28
|
-
* Ensure branch stays up-to-date with latest changes that are merged into
|
28
|
+
* Ensure branch stays up-to-date with latest changes that are merged into main by using: `$ git update`
|
29
29
|
* Changes that are not directly related to the current feature should be cherry-picked into their own branch and merged separately.
|
30
30
|
|
31
31
|
### Testing Protips™
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/wireframe/gitx.png?branch=
|
1
|
+
[![Build Status](https://travis-ci.org/wireframe/gitx.png?branch=main)](https://travis-ci.org/wireframe/gitx)
|
2
2
|
[![Code Coverage](https://coveralls.io/repos/wireframe/gitx/badge.png)](https://coveralls.io/r/wireframe/gitx)
|
3
3
|
[![Code Climate](https://codeclimate.com/github/wireframe/gitx.png)](https://codeclimate.com/github/wireframe/gitx)
|
4
4
|
|
@@ -47,7 +47,7 @@ This setting is cleared when a reviewer approves or rejects the pull request.
|
|
47
47
|
|
48
48
|
## git release <feature_branch_name (optional, default: current_branch)
|
49
49
|
|
50
|
-
release the feature branch to the base branch (by default,
|
50
|
+
release the feature branch to the base branch (by default, main). This operation will perform the following:
|
51
51
|
|
52
52
|
* pull latest code from remote feature branch
|
53
53
|
* pull latest code from the base branch
|
@@ -5,7 +5,7 @@ require 'gitx/cli/base_command'
|
|
5
5
|
module Gitx
|
6
6
|
module Cli
|
7
7
|
class CleanupCommand < BaseCommand
|
8
|
-
desc 'cleanup', 'Cleanup branches that have been merged into
|
8
|
+
desc 'cleanup', 'Cleanup branches that have been merged into main from the repo'
|
9
9
|
def cleanup
|
10
10
|
update_base_branch
|
11
11
|
say 'Deleting local and remote branches that have been merged into '
|
@@ -8,7 +8,7 @@ module Gitx
|
|
8
8
|
EXAMPLE_BRANCH_NAMES = %w[api-fix-invalid-auth desktop-cleanup-avatar-markup share-form-add-edit-link].freeze
|
9
9
|
VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]+$/.freeze
|
10
10
|
|
11
|
-
desc 'start', 'start a new git branch with latest changes from
|
11
|
+
desc 'start', 'start a new git branch with latest changes from main'
|
12
12
|
method_option :issue, type: :string, aliases: '-i', desc: 'Issue identifier'
|
13
13
|
def start(branch_name = nil)
|
14
14
|
branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})") until valid_new_branch_name?(branch_name)
|
@@ -5,7 +5,7 @@ require 'gitx/cli/base_command'
|
|
5
5
|
module Gitx
|
6
6
|
module Cli
|
7
7
|
class UpdateCommand < BaseCommand
|
8
|
-
desc 'update', 'Update the current branch with latest changes from the remote feature branch and
|
8
|
+
desc 'update', 'Update the current branch with latest changes from the remote feature branch and main'
|
9
9
|
def update
|
10
10
|
say 'Updating '
|
11
11
|
say "#{current_branch.name} ", :green
|
data/lib/gitx/defaults.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
# default base branch
|
3
|
-
base_branch:
|
3
|
+
base_branch: main
|
4
4
|
|
5
5
|
# Label to use for releasing a pull request, if this is set a label will be
|
6
6
|
# added to the PR rather than merging to the base branch
|
@@ -14,14 +14,14 @@ aggregate_branches:
|
|
14
14
|
# list of branches that should not be deleted when cleaning up
|
15
15
|
reserved_branches:
|
16
16
|
- HEAD
|
17
|
-
-
|
17
|
+
- main
|
18
18
|
- next_release
|
19
19
|
- staging
|
20
20
|
- prototype
|
21
21
|
|
22
22
|
# list of supported branches for generating buildtags
|
23
23
|
taggable_branches:
|
24
|
-
-
|
24
|
+
- main
|
25
25
|
- staging
|
26
26
|
|
27
27
|
# list of commands to execute after releasing feature branch
|
data/lib/gitx/version.rb
CHANGED
@@ -23,7 +23,7 @@ describe Gitx::Cli::BuildtagCommand do
|
|
23
23
|
expect { cli.buildtag }.to raise_error(/Branch must be one of the supported taggable branches/)
|
24
24
|
end
|
25
25
|
end
|
26
|
-
context 'when options[:branch] is NOT
|
26
|
+
context 'when options[:branch] is NOT main or staging' do
|
27
27
|
let(:options) do
|
28
28
|
{
|
29
29
|
branch: 'feature-branch'
|
@@ -33,16 +33,16 @@ describe Gitx::Cli::BuildtagCommand do
|
|
33
33
|
expect { cli.buildtag }.to raise_error(/Branch must be one of the supported taggable branches/)
|
34
34
|
end
|
35
35
|
end
|
36
|
-
context 'when options[:branch] is
|
36
|
+
context 'when options[:branch] is main' do
|
37
37
|
let(:options) do
|
38
38
|
{
|
39
|
-
branch: '
|
39
|
+
branch: 'main'
|
40
40
|
}
|
41
41
|
end
|
42
42
|
before do
|
43
43
|
Timecop.freeze(Time.utc(2013, 10, 30, 10, 21, 28)) do
|
44
|
-
expect(executor).to receive(:execute).with('git', 'tag', 'builds/
|
45
|
-
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'builds/
|
44
|
+
expect(executor).to receive(:execute).with('git', 'tag', 'builds/main/2013-10-30-10-21-28', '--annotate', '--message', '[gitx] buildtag for main').ordered
|
45
|
+
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'builds/main/2013-10-30-10-21-28').ordered
|
46
46
|
cli.buildtag
|
47
47
|
end
|
48
48
|
end
|
@@ -53,14 +53,14 @@ describe Gitx::Cli::BuildtagCommand do
|
|
53
53
|
context 'when options[:message] is passed' do
|
54
54
|
let(:options) do
|
55
55
|
{
|
56
|
-
branch: '
|
56
|
+
branch: 'main',
|
57
57
|
message: 'custom git commit message'
|
58
58
|
}
|
59
59
|
end
|
60
60
|
before do
|
61
61
|
Timecop.freeze(Time.utc(2013, 10, 30, 10, 21, 28)) do
|
62
|
-
expect(executor).to receive(:execute).with('git', 'tag', 'builds/
|
63
|
-
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'builds/
|
62
|
+
expect(executor).to receive(:execute).with('git', 'tag', 'builds/main/2013-10-30-10-21-28', '--annotate', '--message', 'custom git commit message').ordered
|
63
|
+
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'builds/main/2013-10-30-10-21-28').ordered
|
64
64
|
cli.buildtag
|
65
65
|
end
|
66
66
|
end
|
@@ -38,7 +38,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
38
38
|
before do
|
39
39
|
allow(cli).to receive(:say)
|
40
40
|
|
41
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
41
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
42
42
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
43
43
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
44
44
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', 'merged-local-feature').ordered
|
@@ -58,7 +58,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
58
58
|
before do
|
59
59
|
allow(cli).to receive(:say)
|
60
60
|
|
61
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
61
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
62
62
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
63
63
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
64
64
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'merged-remote-feature').ordered
|
@@ -78,7 +78,7 @@ describe Gitx::Cli::CleanupCommand do
|
|
78
78
|
before do
|
79
79
|
allow(cli).to receive(:say)
|
80
80
|
|
81
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
81
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
82
82
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
83
83
|
expect(executor).to receive(:execute).with('git', 'remote', 'prune', 'origin').ordered
|
84
84
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'merged-remote-feature/review').ordered
|
@@ -47,18 +47,18 @@ describe Gitx::Cli::IntegrateCommand do
|
|
47
47
|
should meet_expectations
|
48
48
|
end
|
49
49
|
end
|
50
|
-
context 'when current_branch ==
|
51
|
-
let(:current_branch) { double('fake branch', name: '
|
52
|
-
let(:local_branch_names) { ['
|
50
|
+
context 'when current_branch == main' do
|
51
|
+
let(:current_branch) { double('fake branch', name: 'main', head?: true) }
|
52
|
+
let(:local_branch_names) { ['main'] }
|
53
53
|
let(:remote_branch_names) { ['origin/staging'] }
|
54
54
|
before do
|
55
55
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
56
56
|
expect(executor).to receive(:execute).with('git', 'fetch', 'origin').ordered
|
57
57
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', '--force', 'staging').ordered
|
58
58
|
expect(executor).to receive(:execute).with('git', 'checkout', 'staging').ordered
|
59
|
-
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', '[gitx] Integrate
|
59
|
+
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', '[gitx] Integrate main into staging', 'main').ordered
|
60
60
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
61
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
61
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
62
62
|
|
63
63
|
cli.integrate
|
64
64
|
end
|
@@ -85,7 +85,7 @@ describe Gitx::Cli::IntegrateCommand do
|
|
85
85
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
86
86
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
87
87
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
88
|
-
expect(executor).to receive(:execute).with('git', 'log', 'origin/
|
88
|
+
expect(executor).to receive(:execute).with('git', 'log', 'origin/main...feature-branch', '--reverse', '--no-merges', '--pretty=format:* %B').and_return(changelog).ordered
|
89
89
|
expect(executor).to receive(:execute).with('git', 'fetch', 'origin').ordered
|
90
90
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', '--force', 'staging').ordered
|
91
91
|
expect(executor).to receive(:execute).with('git', 'checkout', 'staging').ordered
|
@@ -109,7 +109,7 @@ describe Gitx::Cli::IntegrateCommand do
|
|
109
109
|
context 'when staging branch does not exist remotely' do
|
110
110
|
let(:remote_branch_names) { [] }
|
111
111
|
before do
|
112
|
-
expect(repo).to receive(:create_branch).with('staging', '
|
112
|
+
expect(repo).to receive(:create_branch).with('staging', 'main')
|
113
113
|
|
114
114
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
115
115
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'staging:staging').ordered
|
@@ -22,26 +22,26 @@ describe Gitx::Cli::NukeCommand do
|
|
22
22
|
end
|
23
23
|
|
24
24
|
describe '#nuke' do
|
25
|
-
context 'when target branch == prototype and --destination ==
|
25
|
+
context 'when target branch == prototype and --destination == main' do
|
26
26
|
let(:options) do
|
27
27
|
{
|
28
28
|
destination: good_branch
|
29
29
|
}
|
30
30
|
end
|
31
|
-
let(:good_branch) { '
|
31
|
+
let(:good_branch) { 'main' }
|
32
32
|
let(:bad_branch) { 'prototype' }
|
33
|
-
let(:buildtag) { double(:tag, name: 'builds/
|
33
|
+
let(:buildtag) { double(:tag, name: 'builds/main/2013-10-01-01') }
|
34
34
|
let(:tags) { [buildtag] }
|
35
35
|
before do
|
36
36
|
expect(cli).to receive(:yes?).and_return(true)
|
37
37
|
|
38
38
|
expect(executor).to receive(:execute).with('git', 'fetch', '--tags').ordered
|
39
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
39
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
40
40
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', '--force', 'prototype').ordered
|
41
41
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'prototype').ordered
|
42
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '-b', 'prototype', 'builds/
|
42
|
+
expect(executor).to receive(:execute).with('git', 'checkout', '-b', 'prototype', 'builds/main/2013-10-01-01').ordered
|
43
43
|
expect(executor).to receive(:execute).with('git', 'share').ordered
|
44
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
44
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
45
45
|
|
46
46
|
cli.nuke bad_branch
|
47
47
|
end
|
@@ -50,21 +50,21 @@ describe Gitx::Cli::NukeCommand do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
context 'when target branch == prototype and destination prompt == nil' do
|
53
|
-
let(:good_branch) { '
|
53
|
+
let(:good_branch) { 'main' }
|
54
54
|
let(:bad_branch) { 'prototype' }
|
55
|
-
let(:buildtag) { double(:tag, name: 'builds/
|
55
|
+
let(:buildtag) { double(:tag, name: 'builds/main/2013-10-01-01') }
|
56
56
|
let(:tags) { [buildtag] }
|
57
57
|
before do
|
58
58
|
expect(cli).to receive(:ask).and_return(good_branch)
|
59
59
|
expect(cli).to receive(:yes?).and_return(true)
|
60
60
|
|
61
61
|
expect(executor).to receive(:execute).with('git', 'fetch', '--tags').ordered
|
62
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
62
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
63
63
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', '--force', 'prototype').ordered
|
64
64
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'prototype').ordered
|
65
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '-b', 'prototype', 'builds/
|
65
|
+
expect(executor).to receive(:execute).with('git', 'checkout', '-b', 'prototype', 'builds/main/2013-10-01-01').ordered
|
66
66
|
expect(executor).to receive(:execute).with('git', 'share').ordered
|
67
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
67
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
68
68
|
|
69
69
|
cli.nuke 'prototype'
|
70
70
|
end
|
@@ -73,14 +73,14 @@ describe Gitx::Cli::NukeCommand do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
context 'when user does not confirm nuking the target branch' do
|
76
|
-
let(:buildtag) { double(:tag, name: 'builds/
|
76
|
+
let(:buildtag) { double(:tag, name: 'builds/main/2013-10-01-01') }
|
77
77
|
let(:tags) { [buildtag] }
|
78
78
|
before do
|
79
|
-
expect(cli).to receive(:ask).and_return('
|
79
|
+
expect(cli).to receive(:ask).and_return('main')
|
80
80
|
expect(cli).to receive(:yes?).and_return(false)
|
81
81
|
|
82
82
|
expect(executor).to receive(:execute).with('git', 'fetch', '--tags').ordered
|
83
|
-
expect(executor).to_not receive(:execute).with('git', 'checkout', '
|
83
|
+
expect(executor).to_not receive(:execute).with('git', 'checkout', 'main').ordered
|
84
84
|
|
85
85
|
cli.nuke 'prototype'
|
86
86
|
end
|
@@ -94,7 +94,7 @@ describe Gitx::Cli::NukeCommand do
|
|
94
94
|
destination: good_branch
|
95
95
|
}
|
96
96
|
end
|
97
|
-
let(:good_branch) { '
|
97
|
+
let(:good_branch) { 'main' }
|
98
98
|
let(:bad_branch) { 'prototype' }
|
99
99
|
let(:buildtags) { '' }
|
100
100
|
it 'raises error' do
|
@@ -103,9 +103,9 @@ describe Gitx::Cli::NukeCommand do
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
context 'when database migrations exist and user cancels operation' do
|
106
|
-
let(:buildtag) { double(:tag, name: 'builds/
|
106
|
+
let(:buildtag) { double(:tag, name: 'builds/main/2013-10-01-01') }
|
107
107
|
let(:tags) { [buildtag] }
|
108
|
-
let(:good_branch) { '
|
108
|
+
let(:good_branch) { 'main' }
|
109
109
|
let(:bad_branch) { 'prototype' }
|
110
110
|
let(:migrations) do
|
111
111
|
%w[db/migrate/20140715194946_create_users.rb db/migrate/20140730063034_update_user_account.rb].join("\n")
|
@@ -115,8 +115,8 @@ describe Gitx::Cli::NukeCommand do
|
|
115
115
|
|
116
116
|
expect(executor).to receive(:execute).with('git', 'fetch', '--tags').ordered
|
117
117
|
expect(cli).to receive(:ask).and_return(good_branch)
|
118
|
-
expect(cli).to receive(:yes?).with('Reset prototype to builds/
|
119
|
-
expect(executor).to receive(:execute).with('git', 'diff', 'builds/
|
118
|
+
expect(cli).to receive(:yes?).with('Reset prototype to builds/main/2013-10-01-01? (y/n)', :green).and_return(true)
|
119
|
+
expect(executor).to receive(:execute).with('git', 'diff', 'builds/main/2013-10-01-01...prototype', '--name-only', 'db/migrate').and_return(migrations)
|
120
120
|
expect(cli).to receive(:yes?).with('Are you sure you want to nuke prototype? (y/n) ', :green).and_return(false)
|
121
121
|
|
122
122
|
cli.nuke 'prototype'
|
@@ -129,9 +129,9 @@ describe Gitx::Cli::NukeCommand do
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
context 'when database migrations exist and user approves operation' do
|
132
|
-
let(:buildtag) { double(:tag, name: 'builds/
|
132
|
+
let(:buildtag) { double(:tag, name: 'builds/main/2013-10-01-01') }
|
133
133
|
let(:tags) { [buildtag] }
|
134
|
-
let(:good_branch) { '
|
134
|
+
let(:good_branch) { 'main' }
|
135
135
|
let(:bad_branch) { 'prototype' }
|
136
136
|
let(:migrations) do
|
137
137
|
%w[db/migrate/20140715194946_create_users.rb db/migrate/20140730063034_update_user_account.rb].join("\n")
|
@@ -140,17 +140,17 @@ describe Gitx::Cli::NukeCommand do
|
|
140
140
|
FileUtils.mkdir_p('db/migrate')
|
141
141
|
|
142
142
|
expect(cli).to receive(:ask).and_return(good_branch)
|
143
|
-
expect(cli).to receive(:yes?).with('Reset prototype to builds/
|
144
|
-
expect(executor).to receive(:execute).with('git', 'diff', 'builds/
|
143
|
+
expect(cli).to receive(:yes?).with('Reset prototype to builds/main/2013-10-01-01? (y/n)', :green).and_return(true)
|
144
|
+
expect(executor).to receive(:execute).with('git', 'diff', 'builds/main/2013-10-01-01...prototype', '--name-only', 'db/migrate').and_return(migrations)
|
145
145
|
expect(cli).to receive(:yes?).with('Are you sure you want to nuke prototype? (y/n) ', :green).and_return(true)
|
146
146
|
|
147
147
|
expect(executor).to receive(:execute).with('git', 'fetch', '--tags').ordered
|
148
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
148
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
149
149
|
expect(executor).to receive(:execute).with('git', 'branch', '--delete', '--force', 'prototype').ordered
|
150
150
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', '--delete', 'prototype').ordered
|
151
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '-b', 'prototype', 'builds/
|
151
|
+
expect(executor).to receive(:execute).with('git', 'checkout', '-b', 'prototype', 'builds/main/2013-10-01-01').ordered
|
152
152
|
expect(executor).to receive(:execute).with('git', 'share').ordered
|
153
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
153
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
154
154
|
|
155
155
|
cli.nuke 'prototype'
|
156
156
|
end
|
@@ -36,14 +36,14 @@ describe Gitx::Cli::ReleaseCommand do
|
|
36
36
|
before do
|
37
37
|
expect(repo).to receive(:workdir).and_return(temp_dir)
|
38
38
|
|
39
|
-
expect(cli).to receive(:yes?).with('Release feature-branch to
|
39
|
+
expect(cli).to receive(:yes?).with('Release feature-branch to main? (y/n)', :green).and_return(true)
|
40
40
|
expect(cli).to receive(:yes?).with('Branch status is currently: failure. Proceed with release? (y/n)', :red).and_return(false)
|
41
41
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
42
42
|
|
43
43
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
44
|
-
expect(executor).to_not receive(:execute).with('git', 'checkout', '
|
45
|
-
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', '
|
46
|
-
expect(executor).to_not receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
44
|
+
expect(executor).to_not receive(:execute).with('git', 'checkout', 'main')
|
45
|
+
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', 'main')
|
46
|
+
expect(executor).to_not receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch')
|
47
47
|
expect(executor).to_not receive(:execute).with('git', 'push', 'origin', 'HEAD')
|
48
48
|
|
49
49
|
VCR.use_cassette('pull_request_does_exist_with_failure_status') do
|
@@ -64,9 +64,9 @@ describe Gitx::Cli::ReleaseCommand do
|
|
64
64
|
|
65
65
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
66
66
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
67
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
68
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
69
|
-
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
67
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
68
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
69
|
+
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
70
70
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
71
71
|
expect(executor).to receive(:execute).with('git integrate').ordered
|
72
72
|
|
@@ -94,9 +94,9 @@ describe Gitx::Cli::ReleaseCommand do
|
|
94
94
|
|
95
95
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
96
96
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
97
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
98
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
99
|
-
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
97
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
98
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
99
|
+
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
100
100
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
101
101
|
expect(executor).to receive(:execute).with('echo hello').ordered
|
102
102
|
|
@@ -117,9 +117,9 @@ describe Gitx::Cli::ReleaseCommand do
|
|
117
117
|
|
118
118
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
119
119
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
120
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
121
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
122
|
-
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
120
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
121
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
122
|
+
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
123
123
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
124
124
|
expect(executor).to receive(:execute).with('git integrate').ordered
|
125
125
|
|
@@ -147,17 +147,17 @@ describe Gitx::Cli::ReleaseCommand do
|
|
147
147
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
148
148
|
allow(cli).to receive(:ask_editor).and_return('description')
|
149
149
|
|
150
|
-
expect(cli).to receive(:yes?).with('Release feature-branch to
|
150
|
+
expect(cli).to receive(:yes?).with('Release feature-branch to main? (y/n)', :green).and_return(true)
|
151
151
|
expect(cli).to receive(:yes?).with('Branch status is currently: pending. Proceed with release? (y/n)', :red).and_return(true)
|
152
152
|
|
153
153
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
154
154
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
155
155
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
156
156
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
157
|
-
expect(executor).to receive(:execute).with('git', 'log', 'origin/
|
158
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
159
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
160
|
-
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
157
|
+
expect(executor).to receive(:execute).with('git', 'log', 'origin/main...feature-branch', '--reverse', '--no-merges', '--pretty=format:* %B').and_return('2013-01-01 did some stuff').ordered
|
158
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
159
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
160
|
+
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
161
161
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
162
162
|
expect(executor).to receive(:execute).with('git integrate').ordered
|
163
163
|
|
@@ -187,9 +187,9 @@ describe Gitx::Cli::ReleaseCommand do
|
|
187
187
|
|
188
188
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
189
189
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
190
|
-
expect(executor).to receive(:execute).with('git', 'checkout', '
|
191
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
192
|
-
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
190
|
+
expect(executor).to receive(:execute).with('git', 'checkout', 'main').ordered
|
191
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
192
|
+
expect(executor).to receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch').ordered
|
193
193
|
expect(executor).to receive(:execute).with('git', 'push', 'origin', 'HEAD').ordered
|
194
194
|
expect(executor).to receive(:execute).with('git integrate').ordered
|
195
195
|
expect(executor).to receive(:execute).with('git cleanup').ordered
|
@@ -218,9 +218,9 @@ describe Gitx::Cli::ReleaseCommand do
|
|
218
218
|
expect(cli).to receive(:label_pull_request).with(having_attributes(number: 10), 'release-me').and_call_original
|
219
219
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
220
220
|
|
221
|
-
expect(executor).to_not receive(:execute).with('git', 'checkout', '
|
222
|
-
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', '
|
223
|
-
expect(executor).to_not receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to
|
221
|
+
expect(executor).to_not receive(:execute).with('git', 'checkout', 'main')
|
222
|
+
expect(executor).to_not receive(:execute).with('git', 'pull', 'origin', 'main')
|
223
|
+
expect(executor).to_not receive(:execute).with('git', 'merge', '--no-ff', '--message', "[gitx] Release feature-branch to main\n\nConnected to #10", 'feature-branch')
|
224
224
|
expect(executor).to_not receive(:execute).with('git', 'push', 'origin', 'HEAD')
|
225
225
|
|
226
226
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
@@ -46,7 +46,7 @@ describe Gitx::Cli::ReviewCommand do
|
|
46
46
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
47
47
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
48
48
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
49
|
-
expect(executor).to receive(:execute).with('git', 'log', 'origin/
|
49
|
+
expect(executor).to receive(:execute).with('git', 'log', 'origin/main...feature-branch', '--reverse', '--no-merges', '--pretty=format:* %B').and_return(changelog).ordered
|
50
50
|
expect(cli).to receive(:ask_editor).with(changelog, hash_including(footer: Gitx::Github::PULL_REQUEST_FOOTER)).and_return('description')
|
51
51
|
|
52
52
|
stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls').to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
|
@@ -82,11 +82,11 @@ describe Gitx::Cli::ReviewCommand do
|
|
82
82
|
allow(cli).to receive(:authorization_token).and_return(authorization_token)
|
83
83
|
expect(executor).to receive(:execute).with('git', 'checkout', 'feature-branch').ordered
|
84
84
|
expect(executor).to receive(:execute).with('git', 'update').ordered
|
85
|
-
expect(executor).to receive(:execute).with('git', 'log', 'origin/
|
85
|
+
expect(executor).to receive(:execute).with('git', 'log', 'origin/main...feature-branch', '--reverse', '--no-merges', '--pretty=format:* %B').and_return(changelog).ordered
|
86
86
|
expect(cli).to receive(:ask_editor).with(changelog, hash_including(footer: Gitx::Github::PULL_REQUEST_FOOTER)).and_return(pull_request_description)
|
87
87
|
|
88
88
|
stub_request(:post, 'https://api.github.com/repos/wireframe/gitx/pulls')
|
89
|
-
.with(body: { base: '
|
89
|
+
.with(body: { base: 'main', head: 'feature-branch', title: 'feature branch', body: pull_request_description }.to_json)
|
90
90
|
.to_return(status: 201, body: new_pull_request.to_json, headers: { 'Content-Type' => 'application/json' })
|
91
91
|
|
92
92
|
VCR.use_cassette('pull_request_does_not_exist') do
|
@@ -16,9 +16,9 @@ describe Gitx::Cli::StartCommand do
|
|
16
16
|
describe '#start' do
|
17
17
|
context 'when user inputs branch that is valid' do
|
18
18
|
before do
|
19
|
-
expect(cli).to receive(:checkout_branch).with('
|
19
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
20
20
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
21
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
21
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
22
22
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
23
23
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
24
24
|
|
@@ -30,9 +30,9 @@ describe Gitx::Cli::StartCommand do
|
|
30
30
|
end
|
31
31
|
context 'when user inputs branch with slash' do
|
32
32
|
before do
|
33
|
-
expect(cli).to receive(:checkout_branch).with('
|
33
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
34
34
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
35
|
-
expect(repo).to receive(:create_branch).with('foo/ryan', '
|
35
|
+
expect(repo).to receive(:create_branch).with('foo/ryan', 'main').ordered
|
36
36
|
expect(cli).to receive(:checkout_branch).with('foo/ryan').ordered
|
37
37
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on foo/ryan').ordered
|
38
38
|
|
@@ -46,9 +46,9 @@ describe Gitx::Cli::StartCommand do
|
|
46
46
|
before do
|
47
47
|
expect(cli).to receive(:ask).and_return('new-branch')
|
48
48
|
|
49
|
-
expect(cli).to receive(:checkout_branch).with('
|
49
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
50
50
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
51
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
51
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
52
52
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
53
53
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
54
54
|
|
@@ -62,9 +62,9 @@ describe Gitx::Cli::StartCommand do
|
|
62
62
|
before do
|
63
63
|
expect(cli).to receive(:ask).and_return('new-branch')
|
64
64
|
|
65
|
-
expect(cli).to receive(:checkout_branch).with('
|
65
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
66
66
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
67
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
67
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
68
68
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
69
69
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
70
70
|
|
@@ -81,9 +81,9 @@ describe Gitx::Cli::StartCommand do
|
|
81
81
|
|
82
82
|
expect(cli).to receive(:ask).and_return('new-branch')
|
83
83
|
|
84
|
-
expect(cli).to receive(:checkout_branch).with('
|
84
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
85
85
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
86
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
86
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
87
87
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
88
88
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
89
89
|
|
@@ -100,9 +100,9 @@ describe Gitx::Cli::StartCommand do
|
|
100
100
|
|
101
101
|
expect(cli).to receive(:ask).and_return('new-branch')
|
102
102
|
|
103
|
-
expect(cli).to receive(:checkout_branch).with('
|
103
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
104
104
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
105
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
105
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
106
106
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
107
107
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', '[gitx] Start work on new-branch').ordered
|
108
108
|
|
@@ -119,9 +119,9 @@ describe Gitx::Cli::StartCommand do
|
|
119
119
|
}
|
120
120
|
end
|
121
121
|
before do
|
122
|
-
expect(cli).to receive(:checkout_branch).with('
|
122
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
123
123
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
124
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
124
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
125
125
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
126
126
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', "[gitx] Start work on new-branch\n\nConnected to #10").ordered
|
127
127
|
|
@@ -138,9 +138,9 @@ describe Gitx::Cli::StartCommand do
|
|
138
138
|
}
|
139
139
|
end
|
140
140
|
before do
|
141
|
-
expect(cli).to receive(:checkout_branch).with('
|
141
|
+
expect(cli).to receive(:checkout_branch).with('main').ordered
|
142
142
|
expect(executor).to receive(:execute).with('git', 'pull').ordered
|
143
|
-
expect(repo).to receive(:create_branch).with('new-branch', '
|
143
|
+
expect(repo).to receive(:create_branch).with('new-branch', 'main').ordered
|
144
144
|
expect(cli).to receive(:checkout_branch).with('new-branch').ordered
|
145
145
|
expect(executor).to receive(:execute).with('git', 'commit', '--allow-empty', '--message', "[gitx] Start work on new-branch\n\nConnected to FOO-123").ordered
|
146
146
|
|
@@ -28,7 +28,7 @@ describe Gitx::Cli::UpdateCommand do
|
|
28
28
|
allow(cli).to receive(:say)
|
29
29
|
|
30
30
|
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').ordered
|
31
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
31
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
32
32
|
expect(executor).to receive(:execute).with('git', 'share').ordered
|
33
33
|
|
34
34
|
cli.update
|
@@ -49,12 +49,12 @@ describe Gitx::Cli::UpdateCommand do
|
|
49
49
|
should meet_expectations
|
50
50
|
end
|
51
51
|
end
|
52
|
-
context 'when merge conflicts occur when pulling remote
|
52
|
+
context 'when merge conflicts occur when pulling remote main branch' do
|
53
53
|
before do
|
54
54
|
allow(cli).to receive(:say)
|
55
55
|
|
56
56
|
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'feature-branch').ordered
|
57
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
57
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').and_raise(Gitx::Executor::ExecutionError).ordered
|
58
58
|
|
59
59
|
expect { cli.update }.to raise_error(Gitx::Cli::BaseCommand::MergeError, 'Merge conflict occurred. Please fix merge conflict and rerun the command')
|
60
60
|
end
|
@@ -68,7 +68,7 @@ describe Gitx::Cli::UpdateCommand do
|
|
68
68
|
allow(cli).to receive(:say)
|
69
69
|
|
70
70
|
expect(executor).not_to receive(:execute).with('git', 'pull', 'origin', 'feature-branch')
|
71
|
-
expect(executor).to receive(:execute).with('git', 'pull', 'origin', '
|
71
|
+
expect(executor).to receive(:execute).with('git', 'pull', 'origin', 'main').ordered
|
72
72
|
|
73
73
|
cli.update
|
74
74
|
end
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0.ci.234.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2021-04-12 00:00:00.000000000 Z
|
@@ -267,7 +267,7 @@ homepage: ''
|
|
267
267
|
licenses:
|
268
268
|
- MIT
|
269
269
|
metadata: {}
|
270
|
-
post_install_message:
|
270
|
+
post_install_message:
|
271
271
|
rdoc_options: []
|
272
272
|
require_paths:
|
273
273
|
- lib
|
@@ -278,12 +278,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
278
278
|
version: 2.6.7
|
279
279
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
280
|
requirements:
|
281
|
-
- - "
|
281
|
+
- - ">"
|
282
282
|
- !ruby/object:Gem::Version
|
283
|
-
version:
|
283
|
+
version: 1.3.1
|
284
284
|
requirements: []
|
285
|
-
rubygems_version: 3.
|
286
|
-
signing_key:
|
285
|
+
rubygems_version: 3.0.8
|
286
|
+
signing_key:
|
287
287
|
specification_version: 4
|
288
288
|
summary: Utility scripts for Git to increase productivity for common operations
|
289
289
|
test_files:
|