githole 1.3.0 → 1.3.1

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: a4220029e0085bbb52488e09c867c56a8dd76df3
4
- data.tar.gz: ce110439df62ef66ca010bdc0d62ac9bd0e8a555
3
+ metadata.gz: cf9e813cda8dd4a093678ce4daa99c0264a6f44b
4
+ data.tar.gz: 10b2641ad26cc0eb3936cc176a993fa2e92246a5
5
5
  SHA512:
6
- metadata.gz: 69b7acad7b219d42b4d40abc1539b495af1c5413f7950aaf5229eefcdfce102603aabd44d96a62b0639619a05786cf17cc5e305b084331e385a5db310a6670b3
7
- data.tar.gz: 31202a814481262714e8a1c04942170ec7b5dd28c1a93557223de327b7aa83e6eabcaa0f943041c0d106f6583bfc5974e4d9371df9aecd9be81d1ca08a697bc6
6
+ metadata.gz: 01a840bc71e8b286656a6c34639d7503af51a3e8bc955750266985771e2eba559aec2de285d884a3d4054c94e7cec483b5c073a48a35ae39cdb04bdffe2ca082
7
+ data.tar.gz: 31644ef0660500851f7e9c037636089cb5af43ecd7083536ac366627849fea316714960a52b2bee6bad21a5f3b25083da6875a18f6e2cdee27570aa69088a6ca
data/README.md CHANGED
@@ -24,7 +24,7 @@ branches are rolled into one. In other words, every remote branch (other than
24
24
  master) reflects the bleeding edge relevant to the version after which that
25
25
  branch is named.
26
26
 
27
- ### 2: No Merging to Master
27
+ ### 2: No Committing to Master
28
28
 
29
29
  There should be no commits to the master branch. Ever.
30
30
 
@@ -42,9 +42,10 @@ To bring a feature branch up to date (required before you merge into version
42
42
  branch), you need to bring in changes from master and the remote version branch
43
43
  that you might not have.
44
44
 
45
- Instead of *merging* these branches, I *rebase* them. This keeps your commit
46
- history nice and clean (it's not littered with all these *Merged branch ...*
47
- commits).
45
+ To keep history clean, we *rebase* the version branch onto the feature branch.
46
+ Unfortunately, to keep a consistent point in history, we need to *merge*
47
+ updates from master onto the version branch (at least that's worked the best at
48
+ the moment).
48
49
 
49
50
  Installation
50
51
  ----------------
@@ -93,12 +94,25 @@ This creates a *version branch* -- `v1.4.1` -- and a *local feature branch* --
93
94
  > branches. You only merge into them after you have rebased them to your loacl
94
95
  > branch.**
95
96
 
96
- This command runs the following commands:
97
+ If the remote branch already exists, then we run the following commands:
97
98
 
98
99
  ```text
100
+ $ git checkout master
101
+ $ git fetch
102
+ $ git checkout -b v1.4.1 origin/v1.4.1
103
+ $ git pull origin v1.4.1
104
+ $ git checkout -b local-v1.4.1
105
+ ```
106
+
107
+ If the remote branch doesn't exist at the origin, we need to create it and push
108
+ it.
109
+
110
+ ```text
111
+ $ git checkout master
112
+ $ git fetch
99
113
  $ git checkout -b v1.4.1
100
- $ git pull origin v1.4.1 # if remote branch already exists
101
114
  $ git push origin v1.4.1
115
+ $ git branch -u origin/v1.4.1
102
116
  $ git checkout -b local-v1.4.1
103
117
  ```
104
118
 
@@ -117,15 +131,14 @@ you begin a dev session.
117
131
  $ githole update v1.4.1
118
132
  ```
119
133
 
120
- This runs the following commands
134
+ This runs the following commands:
121
135
 
122
136
  ```text
123
137
  $ git checkout master
124
138
  $ git pull origin master
125
- $ git checkout local-v1.4.1
126
- $ git rebase master
127
139
  $ git checkout v1.4.1
128
140
  $ git pull origin v1.4.1
141
+ $ git merge master
129
142
  $ git checkout local-v1.4.1
130
143
  $ git rebase v1.4.1
131
144
  ```
@@ -217,6 +230,15 @@ $ git push origin release
217
230
  $ git checkout master
218
231
  ```
219
232
 
233
+ ### Count
234
+
235
+ This is the only action that doesn't require a version argument. It simply
236
+ gives you the total number of commits in the current branch.
237
+
238
+ ```text
239
+ $ githole count
240
+ ```
241
+
220
242
  Contributing
221
243
  ----------------
222
244
 
data/bin/githole CHANGED
@@ -8,7 +8,7 @@ version = ARGV[1]
8
8
  if cmd.nil? || cmd == ''
9
9
  puts "Please specify your command."
10
10
  exit
11
- elsif version.nil? || version == ''
11
+ elsif cmd != 'count' && (version.nil? || version == '')
12
12
  puts "Please specify the version you are working with."
13
13
  else
14
14
  githole = Githole::Git.new(version)
data/lib/githole/git.rb CHANGED
@@ -6,29 +6,35 @@ module Githole
6
6
  end
7
7
 
8
8
  def respond_to?(cmd)
9
- ['add','update','push','remove', 'tag','release'].include?(cmd)
9
+ ['add','update','push','remove','tag','release','count'].include?(cmd)
10
10
  end
11
11
 
12
12
  def add
13
13
  checkout master
14
14
  fetch
15
- create remote
16
- pull remote if branch_exists?("remotes/origin/#{remote}")
17
- git_push remote
15
+ if branch_exists?("remotes/origin/#{remote}")
16
+ git "checkout -b #{remote} origin/#{remote}"
17
+ pull remote
18
+ else
19
+ create remote
20
+ git_push remote
21
+ git "branch -u origin/#{remote}"
22
+ end
18
23
  create local
19
24
  end
20
25
 
21
26
  def update
22
27
  verify remote
23
28
  verify local
24
- # rebase master onto local
29
+ # update master
25
30
  checkout master
26
31
  pull master
27
- checkout local
28
- rebase master
29
- # rebase remote onto local
32
+ # update remote
30
33
  checkout remote
31
34
  pull remote
35
+ # merge master into remote
36
+ merge master
37
+ # rebase remote onto local
32
38
  checkout local
33
39
  rebase remote
34
40
  end
@@ -63,6 +69,10 @@ module Githole
63
69
  checkout master
64
70
  end
65
71
 
72
+ def count
73
+ git "rev-list HEAD --count"
74
+ end
75
+
66
76
  private
67
77
 
68
78
  def git(cmd)
@@ -1,3 +1,3 @@
1
1
  module Githole
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githole
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean C Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-10 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project:
80
- rubygems_version: 2.2.0
80
+ rubygems_version: 2.4.6
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: A simple git workflow to help develop for multiple releases.