git-process 0.9.7 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -0,0 +1,20 @@
1
+ # CHANGELOG - 1.0.1 #
2
+
3
+ ### Since 0.9.7 ###
4
+
5
+ * Adds --keep option to git-to-master
6
+ * Fixes problem trying to add/remove an empty list of files
7
+ * Documentation updates
8
+
9
+ ### Since 0.9.6 ###
10
+
11
+ * Cleans up Gem dependencies
12
+
13
+ ### Since 0.9.5 ###
14
+
15
+ * Cleans up some error messages
16
+ * Improved documentation
17
+ * Adds support for spaces and renames in Status
18
+ * No longer complains if it can't find _parking_
19
+ * Prompts to remove the local version of the integration branch
20
+ * Adds help for handling changed files
data/README.md CHANGED
@@ -11,6 +11,8 @@ See the F.A.Q. for a much more complete explanation for the thoughts and assumpt
11
11
 
12
12
  $ sudo gem install git-process
13
13
 
14
+ Some older operating systems (such as OSX 10.6) are using an old version of RubyGems, which can cause installation problems. Do "`sudo gem update --system`" to fix.
15
+
14
16
 
15
17
  # Overview #
16
18
 
@@ -82,14 +84,24 @@ $ git to-master # 6
82
84
  ```
83
85
 
84
86
 
87
+ ## Configurables ##
88
+
89
+ (See Notes for more details)
90
+
91
+ * `gitProcess.integrationBranch` : The name of the integration branch. Defaults to `master`, but can be set to `develop` or other.
92
+ * `gitProcess.keepLocalIntegrationBranch` : Controls asking about removing the local integration branch. Defaults to 'false' (i.e., do not assume the branch should be there).
93
+
94
+
85
95
  # Assumptions #
86
96
 
87
97
  * You should **_never_** do any work directly on "`master`" (or whatever you define the mainline branch as): everything is done on a feature branch. This is a much safer and more flexible practice than doing everything on the same branch, but may seem odd to people used to old VCSs. In addition to being a much better way of working in general (see the F.A.Q. for more information), it is also a requirement to take advantage of Pull Request functionality.
88
98
  * When working on a branch, you should be integrating with "`master`" as often as possible.
89
- * "`git sync`" makes it extremely easy for you to get any changes that are made in "`master`" into your branch so you can react to it immediately. "`git to-master`" then makes it easy to cleanly integrate the changes you have made, along with encouraging code-review/sign-off, and doing various house-keeping duties.
99
+ * "`git sync`" makes it extremely easy for you to get any changes that are made in "`master`" into your branch so you can react to it immediately.
100
+ * "`git to-master`" then makes it easy to cleanly integrate the changes you have made. If you need to keep the current branch open, use the `--keep` option. Otherwise it closes the branch along with various other house-keeping duties.
90
101
  * The process that you use should be essentially the same, regardless of whether you are working alone, or on a large distributed team.
91
102
  * The exception here is "`git pull-request`" since you do not use pull requests when working solo or when pair-programming.
92
103
 
104
+
93
105
  # Notes #
94
106
 
95
107
  * After publishing changes to the main integration branch (i.e., "`git to-master`") the old feature branch is removed as part of cleanup. Git is then "parked" on a "`_parking_`" branch until a new feature branch is created. Work is not expected to be done on this branch, but any that is done is brought over to a newly created feature branch (i.e., "`git new-fb`").
@@ -138,23 +150,24 @@ If you have ever seen an "active" project that uses a process like "git-flow" th
138
150
  This project is trying to promote clear communication about reality as it applies to the code, over micro-management over no-longer-relevant history. Thus rational for the judicious use of rebase.
139
151
 
140
152
 
141
- ## Configurables ##
142
- See notes for more details
143
-
144
- * GitHub authentication token
145
- * The name of the integration branch (defaults to `origin/master`, but can be set to `develop` or other)
146
-
147
153
  # Contributing #
148
154
 
149
155
  ## Coding Setup ##
150
156
 
151
157
  1. Fork it
152
- 2. Create your feature branch (`git checkout -b my-new-feature`)
153
- 3. Commit your changes (`git commit -am 'Added some feature'`)
158
+ 2. Create your feature branch (`git checkout -b my-new-feature origin/master`)
159
+ 3. Commit your changes (`git commit`)
154
160
  4. Push to the branch (`git push origin my-new-feature`)
155
161
  5. Create new Pull Request
156
162
 
157
- The tests are written for RSpec 2.
163
+ or, if using these scripts:
164
+
165
+ 1. Fork it
166
+ 2. `git new-fb my-new-feature
167
+ 3. `git commit`
168
+ 4. `git sync`
169
+ 5. `git pull-request`
170
+
158
171
 
159
172
  ## License ##
160
173
 
data/bin/git-to-master CHANGED
@@ -20,7 +20,8 @@ the integration branch, pushes to the integration branch, then does \
20
20
  housecleaning.
21
21
 
22
22
  If there is a problem, such as a merge conflict, this tries to \
23
- resolve it automatically. If it can not do so in an automated way, \
23
+ resolve it automatically (including responding appropriately to
24
+ "rerere" merges). If it can not do so in an automated way, \
24
25
  if tells you the steps involved for doing so manually.
25
26
 
26
27
  "Housecleaning" includes such things as closing any \
@@ -28,7 +29,7 @@ Pull Request that may exist for the branch, removing the (now obsolete) \
28
29
  local and remote feature branches, and then "parking" on the \
29
30
  special "_parking_" branch.
30
31
 
31
- Work is not expected to be done on the "parking" branch, but any that is \
32
+ Work is not expected to be done on the "_parking_" branch, but any that is \
32
33
  done is brought over to a newly created feature branch when you do \
33
34
  "git new-fb".
34
35
 
@@ -46,10 +47,12 @@ for you:
46
47
  $ git rebase origin/master
47
48
  $ git push origin interesting_changes:master
48
49
  # close pull request
49
- $ git co -b _parking_ origin/master
50
+ $ git checkout -b _parking_ origin/master
50
51
  $ git branch -d interesting_changes
51
52
  $ git push origin :interesting_changes
52
53
 
54
+ If you use the --keep option, then the process stops after the first "push".
55
+
53
56
  NOTES
54
57
 
55
58
  * If you want to use a different integration branch other than "master",
@@ -59,6 +62,13 @@ NOTES
59
62
  DESC
60
63
  end
61
64
 
65
+
66
+ def extend_opts(parser)
67
+ parser.opt :keep, "Don't do any \"cleanup.\" It keeps the current local "+
68
+ "and remote branches, and does not close any "+
69
+ "outstanding pull requests.", :short => :k, :default => false
70
+ end
71
+
62
72
  end
63
73
 
64
74
  GitProc::RebaseToMaster.new('.', ToMasterOptions.new.parse_cli(File.basename(__FILE__), ARGV)).run
@@ -54,8 +54,11 @@ module GitProc
54
54
  if not stat.modified.empty? or not stat.added.empty? or not stat.deleted.empty?
55
55
  resp = ask_how_to_handle_changed_files(stat)
56
56
  if resp == :commit
57
- add((stat.added + stat.modified - stat.deleted).sort.uniq)
58
- remove(stat.deleted)
57
+ changed_files = (stat.added + stat.modified - stat.deleted).sort.uniq
58
+
59
+ add(changed_files) unless changed_files.empty?
60
+ remove(stat.deleted) unless stat.deleted.empty?
61
+
59
62
  commit(nil)
60
63
  else
61
64
  stash_save
@@ -22,6 +22,12 @@ module GitProc
22
22
 
23
23
  class RebaseToMaster < Process
24
24
 
25
+ def initialize(dir, opts)
26
+ @keep = opts[:keep]
27
+ super
28
+ end
29
+
30
+
25
31
  def verify_preconditions
26
32
  super
27
33
 
@@ -35,8 +41,11 @@ module GitProc
35
41
  fetch(server_name)
36
42
  proc_rebase(integration_branch)
37
43
  push(server_name, branches.current, master_branch)
38
- close_pull_request
39
- remove_feature_branch
44
+
45
+ if not @keep
46
+ close_pull_request
47
+ remove_feature_branch
48
+ end
40
49
  else
41
50
  proc_rebase(integration_branch)
42
51
  end
@@ -12,9 +12,9 @@
12
12
 
13
13
  module GitProc
14
14
  module Version
15
- MAJOR = 0
16
- MINOR = 9
17
- PATCH = 7
15
+ MAJOR = 1
16
+ MINOR = 0
17
+ PATCH = 1
18
18
  BUILD = nil
19
19
 
20
20
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -88,6 +88,7 @@ describe GitProc::ChangeFileHelper do
88
88
  change_file_and_commit('modified file.txt', 'start')
89
89
  change_file_and_commit('modified file2.txt', 'start')
90
90
  change_file_and_commit('modified file3.txt', 'start')
91
+ change_file_and_commit('modified file4.txt', 'start')
91
92
  change_file_and_commit('removed file.txt', 'content')
92
93
  change_file_and_add('added file.txt', '')
93
94
  change_file('modified file.txt', 'modified')
@@ -95,6 +96,7 @@ describe GitProc::ChangeFileHelper do
95
96
  change_file_and_add('modified file3.txt', 'modified')
96
97
  change_file('modified file2.txt', 'modified again')
97
98
  change_file_and_add('removed file2.txt', 'content')
99
+ change_file_and_add('modified file4.txt', 'content')
98
100
  File.delete(File.join(gitprocess.workdir, 'removed file.txt'))
99
101
  File.delete(File.join(gitprocess.workdir, 'removed file2.txt'))
100
102
  File.delete(File.join(gitprocess.workdir, 'modified file3.txt'))
@@ -104,6 +106,7 @@ describe GitProc::ChangeFileHelper do
104
106
  # M "modified file.txt"
105
107
  # MM "modified file2.txt"
106
108
  # MD "modified file3.txt"
109
+ # M "modified file4.txt"
107
110
  # D "removed file.txt"
108
111
  # AD "removed file2.txt"
109
112
 
@@ -113,7 +116,7 @@ describe GitProc::ChangeFileHelper do
113
116
 
114
117
  it 'should ask about modified files, then commit them' do
115
118
  gitprocess.stub(:ask).and_return('c')
116
- gitprocess.should_receive(:add).with(["added file.txt", "modified file.txt", "modified file2.txt"])
119
+ gitprocess.should_receive(:add).with(["added file.txt", "modified file.txt", "modified file2.txt", "modified file4.txt"])
117
120
  gitprocess.should_receive(:remove).with(["modified file3.txt", "removed file.txt", "removed file2.txt"])
118
121
  gitprocess.should_receive(:commit).with(nil)
119
122
 
@@ -132,7 +135,7 @@ describe GitProc::ChangeFileHelper do
132
135
 
133
136
  stat = gitprocess.status
134
137
  stat.added.should == ["added file.txt", "removed file2.txt"]
135
- stat.modified.should == ["modified file.txt", "modified file2.txt"]
138
+ stat.modified.should == ["modified file.txt", "modified file2.txt", "modified file4.txt"]
136
139
  stat.deleted.should == ["modified file3.txt", "removed file.txt"]
137
140
  end
138
141
 
@@ -297,4 +297,19 @@ describe GitProc::RebaseToMaster do
297
297
 
298
298
  end
299
299
 
300
+
301
+ describe ":keep option" do
302
+
303
+ it "should not try to close a pull request or remove remote branch" do
304
+ gitprocess.branch('fb', :base_branch => 'master')
305
+
306
+ rtm = GitProc::RebaseToMaster.new(clone('fb').workdir, {:log_level => log_level, :keep => true})
307
+ rtm.should_receive(:fetch)
308
+ rtm.should_receive(:push).with('origin', rtm.branches.current, 'master')
309
+ rtm.should_not_receive(:push).with('origin', nil, nil, :delete => 'fb')
310
+ rtm.runner
311
+ end
312
+
313
+ end
314
+
300
315
  end
metadata CHANGED
@@ -3,10 +3,10 @@ name: git-process
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
+ - 1
6
7
  - 0
7
- - 9
8
- - 7
9
- version: 0.9.7
8
+ - 1
9
+ version: 1.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jim Moore
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-07-26 00:00:00 -06:00
17
+ date: 2012-08-21 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency