git_chain 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/git_chain/runner.rb +35 -12
- data/lib/git_chain/storage.rb +4 -0
- data/lib/git_chain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a22352bffc57cfd0247b473b0d97ba324d6c3615f5aaacb86557256238055da
|
4
|
+
data.tar.gz: 8c53da36caa505cf00b1360e113a80b24eeace3409536229bb1757b4df0b769b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80e8eb067de48b781870c385c13d98188a4d9e793d654c837bcab39a5f1a9c43f8e531df12048b2a91ac5d2ec8909d86d28214fb6af7035b75d97ac18401a401
|
7
|
+
data.tar.gz: 2caad184771ff601caab73286fa4aadac3e6717d1060ef585576b2493a14a6b3f49cac1ce6f3a842b280c47df2ffd7b1329290fca4c2fa7b2eb7dbbbda8d6b4b
|
data/Gemfile.lock
CHANGED
data/lib/git_chain/runner.rb
CHANGED
@@ -9,25 +9,48 @@ class GitChain::Runner
|
|
9
9
|
|
10
10
|
def call(command, *args)
|
11
11
|
case command
|
12
|
+
when 'show'
|
13
|
+
show(branch: args[0])
|
12
14
|
when 'list'
|
13
|
-
|
14
|
-
storage.print
|
15
|
+
list()
|
15
16
|
when 'add'
|
16
|
-
|
17
|
-
child: git.current_branch,
|
18
|
-
parent: args[0],
|
19
|
-
old_base: args[1]
|
20
|
-
)
|
17
|
+
add(parent: args[0], old_base: args[1])
|
21
18
|
when 'rebase'
|
22
|
-
|
23
|
-
chain.rebase_all(git.current_branch)
|
24
|
-
else
|
25
|
-
chain.rebase(git.current_branch)
|
26
|
-
end
|
19
|
+
rebase(sub_command: args.first)
|
27
20
|
else
|
28
21
|
raise "Unknown Command: #{command}"
|
29
22
|
end
|
30
23
|
end
|
31
24
|
|
25
|
+
def show(branch: nil)
|
26
|
+
if branch
|
27
|
+
storage.print_branch(branch: branch)
|
28
|
+
else
|
29
|
+
storage.print_branch(branch: git.current_branch)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def list
|
34
|
+
storage.print
|
35
|
+
end
|
36
|
+
|
37
|
+
def add(parent:, old_base: nil)
|
38
|
+
chain.mark_branch_as_dependent(
|
39
|
+
child: git.current_branch,
|
40
|
+
parent: parent,
|
41
|
+
old_base: old_base
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
def rebase(sub_command: nil)
|
46
|
+
if sub_command == 'all'
|
47
|
+
chain.rebase_all(git.current_branch)
|
48
|
+
else
|
49
|
+
chain.rebase(git.current_branch)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
|
32
55
|
|
33
56
|
end
|
data/lib/git_chain/storage.rb
CHANGED
data/lib/git_chain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_chain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan McGarvey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|