pivotal-github 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -101,13 +101,13 @@ In addition, the `--log` option puts the commit messages from the individual com
101
101
 
102
102
  Because of the way options are chained, passing `--ff` or `--no-log` to `git story-merge` will override the `--no-ff` or `--log` flags (respectively) and thus restore the default behavior of `git merge`.
103
103
 
104
- Finally, experience shows that it's easy to forget to mark a story finished when making the final commit. As a reminder, the `git story-merge` command exits with a warning if the most recent commit doesn't contain 'Finishes' or 'Delivers' (or 'Finished', 'Delivered', 'Fixes', or 'Fixed'). This behavior can be overriden with the `--run` option. (I wanted to use `-f` and `--force`, but those interact badly with the default `git merge` options.)
104
+ Finally, experience shows that it's easy to forget to mark a story finished when making the final commit. As a reminder, the `git story-merge` command exits with a warning if the most recent commit doesn't contain 'Finishes' or 'Delivers' (or 'Finished', 'Delivered', 'Fixes', or 'Fixed'). This behavior can be overriden with the `--force` option.
105
105
 
106
106
  #### Options
107
107
 
108
108
  Usage: git story-merge [options]
109
109
  -d, --development BRANCH development branch (defaults to master)
110
- -r, --run run without marking story finished
110
+ -f, --force override unfinished story warning
111
111
  -h, --help this usage guide
112
112
 
113
113
  Additionally, `git story-merge` accepts any options valid for `git merge`.
@@ -125,7 +125,7 @@ As with `git story-merge`, by default `git story-pull-request` exits with a warn
125
125
  #### Options
126
126
 
127
127
  Usage: git story-pull-request [options]
128
- -r, --run run without marking story finished
128
+ -f, --force override unfinished story warning
129
129
  -s, --skip skip `git story-push`
130
130
  -h, --help this usage guide
131
131
 
@@ -12,6 +12,12 @@ module Options
12
12
  unknown = []
13
13
  recursive_parse = Proc.new do |arg_list|
14
14
  begin
15
+ # Hack to handle an unknown '-ff' argument
16
+ # The issue here is that OptParse interprets '-ff' as a '-f' option
17
+ # applied twice. This is sort-of a feature, as it allows, e.g., '-am'
18
+ # to set both the '-a' and '-m' options, but it interacts badly
19
+ # with '-ff' (as used by 'git merge') when '-f' is one of the options.
20
+ unknown << arg_list.delete('-ff') if arg_list.include?('-ff')
15
21
  parser.parse!(arg_list)
16
22
  rescue OptionParser::InvalidOption => e
17
23
  unknown.concat(e.args)
@@ -10,10 +10,7 @@ class StoryMerge < FinishedCommand
10
10
  "development branch (defaults to master)") do |opt|
11
11
  self.options.development = opt
12
12
  end
13
- # I wanted to use '-f' and '--force', but those interact
14
- # badly with the default `git merge` options.
15
- opts.on("-r", "--run",
16
- "run without marking story finished") do |opt|
13
+ opts.on("-f", "--force", "override unfinished story warning") do |opt|
17
14
  self.options.run = opt
18
15
  end
19
16
  opts.on_tail("-h", "--help", "this usage guide") do
@@ -6,8 +6,7 @@ class StoryPullRequest < FinishedCommand
6
6
  def parser
7
7
  OptionParser.new do |opts|
8
8
  opts.banner = "Usage: git story-pull-request [options]"
9
- opts.on("-r", "--run",
10
- "run without marking story finished") do |opt|
9
+ opts.on("-f", "--force", "override unfinished story warning") do |opt|
11
10
  self.options.run = opt
12
11
  end
13
12
  opts.on("-s", "--skip", "skip `git story-push`") do |opt|
@@ -1,5 +1,5 @@
1
1
  module Pivotal
2
2
  module Github
3
- VERSION = "0.6.6"
3
+ VERSION = "0.6.7"
4
4
  end
5
5
  end
File without changes
@@ -9,14 +9,14 @@ describe Options do
9
9
  OptionParser.new do |opts|
10
10
  opts.banner = "Usage: git record [options]"
11
11
  opts.on("-m", "--message MESSAGE",
12
- "add a commit message (with ticket #)") do |m|
13
- options.message = m
12
+ "add a commit message (with ticket #)") do |opt|
13
+ options.message = opt
14
14
  end
15
- opts.on("-a", "--all", "commit all changed files") do |a|
16
- options.all = a
15
+ opts.on("-a", "--all", "commit all changed files") do |opt|
16
+ options.all = opt
17
17
  end
18
- opts.on("-f", "--finish", "mark story as finished") do |f|
19
- options.finish = f
18
+ opts.on("-f", "--finish", "mark story as finished") do |opt|
19
+ options.finish = opt
20
20
  end
21
21
  opts.on_tail("-h", "--help", "this usage guide") do
22
22
  puts opts.to_s; exit 0
@@ -24,7 +24,9 @@ describe Options do
24
24
  end
25
25
  end
26
26
 
27
- let(:args) { ['-a', '-m', '"A message"', '--finish', '-z', '--foo', 'b ar'] }
27
+ # The presence of '-ff' in this list is important to test the custom
28
+ # handling of the interaction of '-ff' and '-f'.
29
+ let(:args) { ['-a', '-m', '"A message"', '--finish', '-ff', '--foo', 'b ar'] }
28
30
 
29
31
  it { should respond_to(:unknown_options) }
30
32
  it { should respond_to(:known_options) }
@@ -32,7 +34,7 @@ describe Options do
32
34
  describe '#unknown_options' do
33
35
  subject { Options::unknown_options(parser, args) }
34
36
 
35
- it { should include('-z') }
37
+ it { should include('-ff') }
36
38
  it { should include('--foo') }
37
39
  it { should include('b ar') }
38
40
  it { should_not include('-a') }
@@ -44,7 +46,7 @@ describe Options do
44
46
  describe '#known_options' do
45
47
  subject { Options::known_options(parser, args) }
46
48
 
47
- it { should_not include('-z') }
49
+ it { should_not include('-ff') }
48
50
  it { should_not include('--foo') }
49
51
  it { should_not include('b ar') }
50
52
  it { should include('-a') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -48,15 +48,14 @@ files:
48
48
  - lib/pivotal-github/story_push.rb
49
49
  - lib/pivotal-github/version.rb
50
50
  - pivotal-github.gemspec
51
- - spec/commands/FinishedCommand.rb
52
51
  - spec/commands/command_spec.rb
53
52
  - spec/commands/story_commit_spec.rb
54
53
  - spec/commands/story_merge_spec.rb
55
54
  - spec/commands/story_open_spec.rb
56
55
  - spec/commands/story_pull_request_spec.rb
56
+ - spec/commands/story_pull_spec.rb
57
57
  - spec/commands/story_push_spec.rb
58
58
  - spec/options/options_spec.rb
59
- - spec/options/story_pull_spec.rb
60
59
  - spec/spec_helper.rb
61
60
  homepage: https://github.com/mhartl/pivotal-github
62
61
  licenses: []
@@ -83,13 +82,12 @@ signing_key:
83
82
  specification_version: 3
84
83
  summary: See the README for full documentation
85
84
  test_files:
86
- - spec/commands/FinishedCommand.rb
87
85
  - spec/commands/command_spec.rb
88
86
  - spec/commands/story_commit_spec.rb
89
87
  - spec/commands/story_merge_spec.rb
90
88
  - spec/commands/story_open_spec.rb
91
89
  - spec/commands/story_pull_request_spec.rb
90
+ - spec/commands/story_pull_spec.rb
92
91
  - spec/commands/story_push_spec.rb
93
92
  - spec/options/options_spec.rb
94
- - spec/options/story_pull_spec.rb
95
93
  - spec/spec_helper.rb
File without changes