gitx 2.17.0.pre.ci.101.1 → 2.18.0.ci.106.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDFjYWU3YzcwNWVkY2Q0NzkwMzYwYTk0YTNlNGM0YmIwNDViYjYzNw==
4
+ NmYxNTRjZGM1NGE1OGE2MmNkZmRmMGQwMTkyNDdhODYzYTVjYWFiOQ==
5
5
  data.tar.gz: !binary |-
6
- MTk1NzhkOWNjY2RhN2VlMDhiOThlOTRjNmFhOGYxNWNlZWYyZDZjMg==
6
+ OWRmNjI3MGQ2ZmY4OTVhNmM1ZWNjODE1MWNlMjczOWEyMjdhODA0NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2RlNTI0OTM4NTYyNGVmNTNiMGNkZTU3ZTU4MzVmNGE3MWY0YmMwODY4MTdi
10
- MTY5NjM5ZjQxZjI0OWZhNTMyNzY3ZGFmOGI5MWFjYjE2Y2U3Yzg5MmNiZjY1
11
- MmRiMGE2MTg4OGQ4OGI1OWUxMGRjZDI4ZjAxMmYzNWY3YWE1NGM=
9
+ YjMzZDZhMmMzMzNlZDFkNTQ3YmZmYjQ2NTlhZjMyOTZlMDA5YjI2MTE3ZjY5
10
+ YWQwY2NkN2Y2MDYxY2UzNDMxYjk5MWI4YWJlOWM5OTQwMDMwNDNjN2Q5NWJl
11
+ NjExNjI3Y2U4N2ZmZjE2YTRiZjk4OTdlYTU0NWJlZjlkNGU4YjQ=
12
12
  data.tar.gz: !binary |-
13
- MmY4OWNlOGRiZGMyZjE4MzUzZTg2NmQ2NWU2NzhiNzg0YjY1YjkwZjBmMjZh
14
- YzEyNzBlMzFkOWVlNWU1ZWViODg0ZWYyYTlhZWQ5ZjZiOTNmZTE0NzZjZmI5
15
- ZTFiYjljNjc4ZjJkYzE1NTE2ZjcwZjQzOTM0MjMxY2JlODA1Mjg=
13
+ YzU2ZTgzM2ZlNDU2ODlmOTIzNmJhMGY0MjczZjk5Zjk4ZmZiMGUzODhmNGE5
14
+ NzViNGVhYzY3MGYxNzc1YjgyNmRmYjVkNzNjMjcxOTNjYTVkN2Y0OWY4ZGYy
15
+ MGY1MjAwOGU3MjQzMjRlOWY5OTE0MmNmYjI3OTcxZDEwZTI2NGM=
data/README.md CHANGED
@@ -17,6 +17,9 @@ so they are available without learning any new commands!
17
17
 
18
18
  update local repository with latest upstream changes and create a new feature branch
19
19
 
20
+ options:
21
+ * `--issue` or `-i` = reference to github issue id this branch is related to
22
+
20
23
  ## git update
21
24
 
22
25
  update the local feature branch with latest remote changes plus upstream released changes.
@@ -9,6 +9,7 @@ module Gitx
9
9
  VALID_BRANCH_NAME_REGEX = /^[A-Za-z0-9\-_]+$/
10
10
 
11
11
  desc 'start', 'start a new git branch with latest changes from master'
12
+ method_option :issue, type: :numeric, aliases: '-i', desc: 'Github issue number'
12
13
  def start(branch_name = nil)
13
14
  until valid_new_branch_name?(branch_name)
14
15
  branch_name = ask("What would you like to name your branch? (ex: #{EXAMPLE_BRANCH_NAMES.sample})")
@@ -18,6 +19,7 @@ module Gitx
18
19
  run_cmd 'git pull'
19
20
  repo.create_branch branch_name, Gitx::BASE_BRANCH
20
21
  checkout_branch branch_name
22
+ run_cmd(%Q(git commit -m "Starting work on #{branch_name} (Issue ##{options[:issue]})" --allow-empty)) if options[:issue]
21
23
  end
22
24
 
23
25
  private
data/lib/gitx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gitx
2
- VERSION = '2.17.0.pre'
2
+ VERSION = '2.18.0'
3
3
  end
@@ -9,7 +9,7 @@ describe Gitx::Cli::StartCommand do
9
9
  pretend: true
10
10
  }
11
11
  end
12
- let(:cli) { Gitx::Cli::StartCommand.new(args, options, config) }
12
+ let(:cli) { described_class.new(args, options, config) }
13
13
  let(:repo) { cli.send(:repo) }
14
14
 
15
15
  describe '#start' do
@@ -92,5 +92,24 @@ describe Gitx::Cli::StartCommand do
92
92
  should meet_expectations
93
93
  end
94
94
  end
95
+ context 'when --issue option is used' do
96
+ let(:options) do
97
+ {
98
+ issue: 10
99
+ }
100
+ end
101
+ before do
102
+ expect(cli).to receive(:checkout_branch).with('master').ordered
103
+ expect(cli).to receive(:run_cmd).with('git pull').ordered
104
+ expect(repo).to receive(:create_branch).with('new-branch', 'master').ordered
105
+ expect(cli).to receive(:checkout_branch).with('new-branch').ordered
106
+ expect(cli).to receive(:run_cmd).with('git commit -m "Starting work on new-branch (Issue #10)" --allow-empty').ordered
107
+
108
+ cli.start 'new-branch'
109
+ end
110
+ it 'creates empty commit with link to issue id' do
111
+ should meet_expectations
112
+ end
113
+ end
95
114
  end
96
115
  end
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: 2.17.0.pre.ci.101.1
4
+ version: 2.18.0.ci.106.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: 2015-08-29 00:00:00.000000000 Z
11
+ date: 2015-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged