gitx 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/gitx.gemspec +4 -5
- data/lib/gitx/cli/base_command.rb +1 -1
- data/lib/gitx/cli/buildtag_command.rb +2 -1
- data/lib/gitx/cli/cleanup_command.rb +1 -0
- data/lib/gitx/cli/integrate_command.rb +3 -4
- data/lib/gitx/cli/nuke_command.rb +3 -0
- data/lib/gitx/cli/release_command.rb +3 -2
- data/lib/gitx/cli/start_command.rb +4 -5
- data/lib/gitx/executor.rb +1 -0
- data/lib/gitx/github.rb +3 -2
- data/lib/gitx/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 671d64ce9a41a3cd6f6ee6a95601367f71148266eb357068293151ae088a0a01
|
4
|
+
data.tar.gz: 171596d5cb92650991faed668d756c0995241bf6e2d6753de2eddff5d44c876b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac7b82974e53304cab8857268a9fd54985ca5654f161413c785a99ce0de79ea046fde06a079496ad9c27bf7ee789da1c8e7d39602572ce01d0980a33fb5f649c
|
7
|
+
data.tar.gz: 5f59721f300d8f9d74c875e985a81b4dacac6c9ceb15b44609e546e0dc09b3a4fa42ff06e6c577be0d3ed5c2403def965790858b330943a794314b652da0d6b8
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3
|
1
|
+
2.6.3
|
data/gitx.gemspec
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require 'gitx/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'gitx'
|
7
|
-
spec.version = Gitx::VERSION
|
8
7
|
spec.authors = ['Ryan Sonnek']
|
9
8
|
spec.email = ['ryan.sonnek@gmail.com']
|
10
9
|
spec.description = 'Git eXtensions for improved development workflows'
|
@@ -32,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
32
31
|
spec.add_development_dependency 'webmock'
|
33
32
|
|
34
33
|
# configure gem version for continuous integration builds
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
version = Gitx::VERSION
|
35
|
+
version = "#{version}.ci.#{ENV['TRAVIS_JOB_NUMBER']}" if ENV['TRAVIS_JOB_NUMBER']
|
36
|
+
spec.version = version
|
38
37
|
end
|
@@ -13,6 +13,7 @@ module Gitx
|
|
13
13
|
method_option :message, type: :string, aliases: '-m', desc: 'message to attach to the buildtag'
|
14
14
|
def buildtag
|
15
15
|
raise "Branch must be one of the supported taggable branches: #{config.taggable_branches}" unless config.taggable_branch?(branch_name)
|
16
|
+
|
16
17
|
run_git_cmd 'tag', build_tag, '--annotate', '--message', label
|
17
18
|
run_git_cmd 'push', 'origin', build_tag
|
18
19
|
end
|
@@ -28,7 +29,7 @@ module Gitx
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def build_tag
|
31
|
-
@
|
32
|
+
@build_tag ||= [
|
32
33
|
BUILD_TAG_PREFIX,
|
33
34
|
branch_name,
|
34
35
|
utc_timestamp
|
@@ -34,6 +34,7 @@ module Gitx
|
|
34
34
|
|
35
35
|
def pull_request_for_branch(branch)
|
36
36
|
return nil if config.reserved_branch?(branch)
|
37
|
+
|
37
38
|
find_or_create_pull_request(branch)
|
38
39
|
end
|
39
40
|
|
@@ -54,11 +55,9 @@ module Gitx
|
|
54
55
|
end
|
55
56
|
|
56
57
|
def feature_branch_name
|
57
|
-
@
|
58
|
+
@feature_branch_name ||= begin
|
58
59
|
feature_branch = options[:resume] || current_branch.name
|
59
|
-
until local_branch_exists?(feature_branch)
|
60
|
-
feature_branch = ask("#{feature_branch} does not exist. Please select one of the available local branches: #{local_branches}")
|
61
|
-
end
|
60
|
+
feature_branch = ask("#{feature_branch} does not exist. Please select one of the available local branches: #{local_branches}") until local_branch_exists?(feature_branch)
|
62
61
|
feature_branch
|
63
62
|
end
|
64
63
|
end
|
@@ -14,6 +14,7 @@ module Gitx
|
|
14
14
|
|
15
15
|
last_known_good_tag = current_build_tag(good_branch)
|
16
16
|
return unless yes?("Reset #{bad_branch} to #{last_known_good_tag}? (y/n)", :green)
|
17
|
+
|
17
18
|
assert_aggregate_branch!(bad_branch)
|
18
19
|
return if migrations_need_to_be_reverted?(bad_branch, last_known_good_tag)
|
19
20
|
|
@@ -34,6 +35,7 @@ module Gitx
|
|
34
35
|
|
35
36
|
def migrations_need_to_be_reverted?(bad_branch, last_known_good_tag)
|
36
37
|
return false unless File.exist?('db/migrate')
|
38
|
+
|
37
39
|
outdated_migrations = run_git_cmd('diff', "#{last_known_good_tag}...#{bad_branch}", '--name-only', 'db/migrate').split
|
38
40
|
return false if outdated_migrations.empty?
|
39
41
|
|
@@ -49,6 +51,7 @@ module Gitx
|
|
49
51
|
def current_build_tag(branch)
|
50
52
|
last_build_tag = build_tags_for_branch(branch).last
|
51
53
|
raise "No known good tag found for branch: #{branch}. Verify tag exists via `git tag -l`" unless last_build_tag
|
54
|
+
|
52
55
|
last_build_tag
|
53
56
|
end
|
54
57
|
|
@@ -11,9 +11,10 @@ module Gitx
|
|
11
11
|
desc 'release', 'release the current branch to production'
|
12
12
|
method_option :cleanup, type: :boolean, desc: 'cleanup merged branches after release'
|
13
13
|
def release(branch = nil)
|
14
|
-
return unless yes?("Release #{current_branch.name} to #{config.base_branch}? (y/n)", :green)
|
15
|
-
|
16
14
|
branch ||= current_branch.name
|
15
|
+
|
16
|
+
return unless yes?("Release #{branch} to #{config.base_branch}? (y/n)", :green)
|
17
|
+
|
17
18
|
assert_not_protected_branch!(branch, 'release')
|
18
19
|
checkout_branch(branch)
|
19
20
|
run_git_cmd 'update'
|
@@ -6,14 +6,12 @@ module Gitx
|
|
6
6
|
module Cli
|
7
7
|
class StartCommand < BaseCommand
|
8
8
|
EXAMPLE_BRANCH_NAMES = %w[api-fix-invalid-auth desktop-cleanup-avatar-markup share-form-add-edit-link].freeze
|
9
|
-
VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]
|
9
|
+
VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]+$/.freeze
|
10
10
|
|
11
11
|
desc 'start', 'start a new git branch with latest changes from master'
|
12
12
|
method_option :issue, type: :string, aliases: '-i', desc: 'Issue identifier'
|
13
13
|
def start(branch_name = nil)
|
14
|
-
until valid_new_branch_name?(branch_name)
|
15
|
-
branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})")
|
16
|
-
end
|
14
|
+
branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})") until valid_new_branch_name?(branch_name)
|
17
15
|
|
18
16
|
checkout_branch config.base_branch
|
19
17
|
run_git_cmd 'pull'
|
@@ -35,12 +33,13 @@ module Gitx
|
|
35
33
|
|
36
34
|
def valid_new_branch_name?(branch)
|
37
35
|
return false if repo_branches.include?(branch)
|
36
|
+
|
38
37
|
Rugged::Reference.valid_name?("refs/heads/#{branch}")
|
39
38
|
end
|
40
39
|
|
41
40
|
# get list of local and remote branches
|
42
41
|
def repo_branches
|
43
|
-
@
|
42
|
+
@repo_branches ||= repo.branches.each_name.map do |branch|
|
44
43
|
branch.gsub('origin/', '')
|
45
44
|
end
|
46
45
|
end
|
data/lib/gitx/executor.rb
CHANGED
data/lib/gitx/github.rb
CHANGED
@@ -124,7 +124,7 @@ module Gitx
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def github_client
|
127
|
-
@
|
127
|
+
@github_client ||= Octokit::Client.new(access_token: authorization_token)
|
128
128
|
end
|
129
129
|
|
130
130
|
# @return [String] github username (ex: 'wireframe') of the current github.user
|
@@ -132,6 +132,7 @@ module Gitx
|
|
132
132
|
def username
|
133
133
|
username = repo.config['github.user']
|
134
134
|
raise "Github user not configured. Run: `git config --global github.user 'me@email.com'`" unless username
|
135
|
+
|
135
136
|
username
|
136
137
|
end
|
137
138
|
|
@@ -154,7 +155,7 @@ module Gitx
|
|
154
155
|
end
|
155
156
|
|
156
157
|
def global_config
|
157
|
-
@
|
158
|
+
@global_config ||= begin
|
158
159
|
File.exist?(global_config_file) ? YAML.load_file(global_config_file) : {}
|
159
160
|
end
|
160
161
|
end
|
data/lib/gitx/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -281,8 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
281
|
- !ruby/object:Gem::Version
|
282
282
|
version: '0'
|
283
283
|
requirements: []
|
284
|
-
|
285
|
-
rubygems_version: 2.6.6
|
284
|
+
rubygems_version: 3.0.3
|
286
285
|
signing_key:
|
287
286
|
specification_version: 4
|
288
287
|
summary: Utility scripts for Git to increase productivity for common operations
|