git-scripts 0.6.1 → 0.7.0
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 +4 -4
- data/bin/feature +4 -0
- data/lib/git.rb +15 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c03345b7998972584353482802e1bd1b59763a83
|
4
|
+
data.tar.gz: 6dc96d3d9d55d0806b7efa227fe07a293005ae1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d4a6188c2d098f1e38056485d9d42458f56ea5c772b735f0f974f76cf255baac67a28c9845c188beee0ab86521149a5afbb6f85c6a937724d03192af39df202
|
7
|
+
data.tar.gz: 70cf7e14f2f25b15d990330cb7e172c0341e5cd833eb4c5ad11ca636c43801ec28d1041cf6d5e6fe7167f653143f5049e54afcd6cea63d5dbfa13f29e00e7a3f
|
data/bin/feature
CHANGED
@@ -236,6 +236,8 @@ when 'switch'
|
|
236
236
|
|
237
237
|
feature = ARGV[1]
|
238
238
|
|
239
|
+
Plugins.invoke :before_switch, :feature, feature
|
240
|
+
|
239
241
|
if ARGV[1] == '-n'
|
240
242
|
feature = get_branch_name_from_number(ARGV[2])
|
241
243
|
end
|
@@ -244,6 +246,8 @@ when 'switch'
|
|
244
246
|
|
245
247
|
optional_pull
|
246
248
|
|
249
|
+
Plugins.invoke :after_switch, :feature, feature
|
250
|
+
|
247
251
|
when 'url'
|
248
252
|
require_argument(:feature, :url, min=1, max=2)
|
249
253
|
feature = ARGV[1] || Git::current_branch
|
data/lib/git.rb
CHANGED
@@ -111,6 +111,21 @@ module Git
|
|
111
111
|
ref.split('/').last
|
112
112
|
end
|
113
113
|
|
114
|
+
# Deletes the current branch. For cleaning up after errors.
|
115
|
+
def self.delete_current_branch()
|
116
|
+
devBranch = get_branch('development')
|
117
|
+
branch = Git::current_branch
|
118
|
+
|
119
|
+
if branch == devBranch
|
120
|
+
puts "Cannot remove development branch"
|
121
|
+
exit 1
|
122
|
+
end
|
123
|
+
|
124
|
+
Git::switch_branch(devBranch)
|
125
|
+
|
126
|
+
`git branch -d #{branch}`.strip
|
127
|
+
end
|
128
|
+
|
114
129
|
# Returns the SHA1 hash that the specified branch or symbol points to
|
115
130
|
def self.branch_hash(branch)
|
116
131
|
`git rev-parse --verify --quiet "#{branch}" 2>/dev/null`.strip
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Beardsley
|
8
8
|
- James Pearson
|
9
9
|
- Tim Asp
|
10
|
+
- Chris Opperwall
|
10
11
|
- Robin Choudhury
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2017-
|
15
|
+
date: 2017-09-15 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: bundler
|
@@ -33,14 +34,14 @@ dependencies:
|
|
33
34
|
requirements:
|
34
35
|
- - "~>"
|
35
36
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
37
|
+
version: 4.0.0
|
37
38
|
type: :runtime
|
38
39
|
prerelease: false
|
39
40
|
version_requirements: !ruby/object:Gem::Requirement
|
40
41
|
requirements:
|
41
42
|
- - "~>"
|
42
43
|
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
+
version: 4.0.0
|
44
45
|
- !ruby/object:Gem::Dependency
|
45
46
|
name: highline
|
46
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +75,7 @@ email:
|
|
74
75
|
- daniel@ifixit.com
|
75
76
|
- james@ifixit.com
|
76
77
|
- tim@ifixit.com
|
78
|
+
- copperwall@gmail.com
|
77
79
|
- robin@ifixit.com
|
78
80
|
executables:
|
79
81
|
- feature
|