git_pretty_accept 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 301fb377312331048a8fbc82097fb708ebbccae1
4
- data.tar.gz: e39af5ebd744e927e3ae52893c5857e1018ba705
3
+ metadata.gz: 2469b255e1c0e2d603c2b8f4e887635aa8ea1e8a
4
+ data.tar.gz: 56f5aae9dbbffdde6787fd106013bb216c02ae7e
5
5
  SHA512:
6
- metadata.gz: 43d47927d2a8b3657efc1827d4e6f87d3975b66cc345662fc081363d6aaea07c1e39eda586de33b10e4084d2bf61f55a281bb74c9740707de9e91f6a78f12658
7
- data.tar.gz: fa5da0797101ef3d8990234e842f8968df95b8f3d103ee0b5de03530f7ce33142975b571e1c26e25ec47abfbb03c298b5641c9204e04a2d4eb2ad8f1b7193d9f
6
+ metadata.gz: a9281aba1323f9126f53cbe01292edd744aa64d53c0b48d9b2df2d23dabb8a7e5012d56d62b239d52f41c9839d0ed86467cdfb4224df86915315db08dbcdf934
7
+ data.tar.gz: 7d140366f1643b73d0f163b48b47a3addfaa5c0009265bbbbdbae205f71f30c6ce046ef2cf0ad37f97e974daef4494bfaac5161c6b02f50cdf86d0fdc2c5d697
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,9 @@
1
+ ## Master (unreleased)
2
+
3
+ ## 0.5.0 - 2015-03-20
4
+
5
+ * Enable autosquash mode when rebasing by default.
6
+
1
7
  ## 0.4.0 - 2014-02-20
2
8
 
3
9
  * Prevent merging when the target branch is different from origin. Prevents
data/README.md CHANGED
@@ -12,8 +12,7 @@ For more information, check out
12
12
  * [Best Way To Merge A (GitHub) Pull Request](http://differential.io/blog/best-way-to-merge-a-github-pull-request)
13
13
 
14
14
  `git-pretty-accept` also automatically deletes the local and remote branch
15
- of the pull request once it's merged to master. I may add an option later on
16
- to disable this by default.
15
+ of the pull request once it's merged to master.
17
16
 
18
17
  ## Installation
19
18
 
@@ -53,10 +52,12 @@ script
53
52
  once the pull request is merged.
54
53
  1. Complains if you accidentally try to accept the master branch to a feature
55
54
  branch.
55
+ 1. Rebases the local branch in interactive mode so that it can run
56
+ autosquash(See `--autosquash` under http://git-scm.com/docs/git-rebase#_options).
56
57
 
57
58
  ## Known to be working on
58
59
 
59
- * git 1.7.9
60
+ * git 2.3.3
60
61
  * ruby 2.0.0
61
62
 
62
63
  ## Contributing
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'pry'
34
34
  spec.add_development_dependency 'rdoc'
35
35
  spec.add_development_dependency 'rake'
36
- spec.add_development_dependency 'rspec'
37
- spec.add_development_dependency 'rspec-example_steps'
36
+ spec.add_development_dependency 'rspec', '~> 2.14.0'
37
+ spec.add_development_dependency 'rspec-example_steps', '~> 0.2.5'
38
38
  end
@@ -11,13 +11,16 @@ module GitPrettyAccept
11
11
  exit!
12
12
  else
13
13
  options[:edit] = true if options[:edit].nil?
14
- Transaction.new(branch, options[:edit]).call
14
+ options[:autosquash] = true if options[:autosquash].nil?
15
+
16
+ Transaction.new(branch, options).call
15
17
  end
16
18
  end
17
19
 
18
20
  description "Accept pull requests, the pretty way"
19
21
 
20
22
  on "--[no-]edit", "Edit merge message before committing. (Default: --edit)"
23
+ on "--[no-]autosquash", "Toggle autosquash when rebasing. (Default: --autosquash)"
21
24
 
22
25
  arg :branch
23
26
 
@@ -2,11 +2,12 @@ module GitPrettyAccept
2
2
  class Transaction
3
3
  include Methadone::CLILogging
4
4
 
5
- attr_reader :branch, :let_user_edit_message
5
+ attr_reader :branch, :let_user_edit_message, :enable_autosquash
6
6
 
7
- def initialize(branch, let_user_edit_message = true)
7
+ def initialize(branch, options = {})
8
8
  @branch = branch
9
- @let_user_edit_message = let_user_edit_message
9
+ @let_user_edit_message = options[:edit]
10
+ @enable_autosquash = options[:autosquash]
10
11
  end
11
12
 
12
13
  def commands
@@ -17,7 +18,7 @@ module GitPrettyAccept
17
18
  "test `git rev-parse HEAD` = `git rev-parse origin/#{source_branch}`",
18
19
  "git checkout #{branch}",
19
20
  "git rebase origin/#{branch}",
20
- "git rebase origin/#{source_branch}",
21
+ "git rebase origin/#{source_branch} #{autosquash_params}",
21
22
  "git push --force origin #{branch}",
22
23
  "git checkout #{source_branch}",
23
24
  MergeCommand.new(branch, let_user_edit_message).to_s,
@@ -44,5 +45,11 @@ module GitPrettyAccept
44
45
  our = Git.open('.')
45
46
  @source_branch = our.branches.find(&:current).to_s
46
47
  end
48
+
49
+ private
50
+
51
+ def autosquash_params
52
+ enable_autosquash ? '-i --autosquash' : ''
53
+ end
47
54
  end
48
55
  end
@@ -1,3 +1,3 @@
1
1
  module GitPrettyAccept
2
- VERSION = "0.4.0"
2
+ VERSION = '0.5.0'
3
3
  end
@@ -98,7 +98,7 @@ describe GitPrettyAccept::App do
98
98
  end
99
99
 
100
100
  When 'I run `git pretty-accept master`' do
101
- command = "bundle exec #{project_path}/bin/git-pretty-accept --no-edit master"
101
+ command = "bundle exec #{project_path}/bin/git-pretty-accept --no-edit --no-autosquash master"
102
102
  FileUtils.cd(our_path) do
103
103
  @result = system(command, err: '/tmp/err.log')
104
104
  end
@@ -238,7 +238,7 @@ describe GitPrettyAccept::App do
238
238
 
239
239
  When 'I run `git pretty-accept PR_BRANCH`' do
240
240
  command =
241
- "bundle exec #{project_path}/bin/git-pretty-accept --no-edit #{pr_branch}"
241
+ "bundle exec #{project_path}/bin/git-pretty-accept --no-edit --no-autosquash #{pr_branch}"
242
242
 
243
243
  FileUtils.cd(our_path) do
244
244
  @result = system(command, err: '/tmp/err.log')
@@ -44,7 +44,7 @@ class LocalRepo
44
44
 
45
45
  def git_pretty_accept(branch)
46
46
  FileUtils.cd(path) do
47
- puts `bundle exec #{project_path}/bin/git-pretty-accept --no-edit #{branch}`
47
+ puts `bundle exec #{project_path}/bin/git-pretty-accept --no-edit --no-autosquash #{branch}`
48
48
  end
49
49
  end
50
50
 
metadata CHANGED
@@ -1,158 +1,158 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_pretty_accept
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Love With Food, George Mendoza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2015-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: methadone
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.3.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.3.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: guard
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rdoc
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rspec
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: 2.14.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: 2.14.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec-example_steps
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 0.2.5
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
153
- description: ' `git-pretty-accept` is a script that rebases a pull request before
152
+ version: 0.2.5
153
+ description: " `git-pretty-accept` is a script that rebases a pull request before
154
154
  merging to master. Pull requests are _always_ merged recursively. The result is
155
- a linear history with merge bubbles indicating pull requests. In short, pretty. '
155
+ a linear history with merge bubbles indicating pull requests. In short, pretty. "
156
156
  email:
157
157
  - george@lovewithfood.com
158
158
  executables:
@@ -160,8 +160,8 @@ executables:
160
160
  extensions: []
161
161
  extra_rdoc_files: []
162
162
  files:
163
- - .gitignore
164
- - .travis.yml
163
+ - ".gitignore"
164
+ - ".travis.yml"
165
165
  - CHANGELOG.markdown
166
166
  - Gemfile
167
167
  - Guardfile
@@ -189,12 +189,12 @@ require_paths:
189
189
  - lib
190
190
  required_ruby_version: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - '>='
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - '>='
197
+ - - ">="
198
198
  - !ruby/object:Gem::Version
199
199
  version: '0'
200
200
  requirements: []