git-bundle 1.0.16 → 1.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -3
- data/git-bundle.gemspec +3 -3
- data/lib/git_bundle/branch_config.rb +21 -3
- data/lib/git_bundle/commands/checkout.rb +34 -21
- data/lib/git_bundle/commands/generate.rb +1 -1
- data/lib/git_bundle/version.rb +1 -1
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 863b8414db95b8fac7f015027b77d76ac56566b44c5d2666543fd881ea0f6e86
|
4
|
+
data.tar.gz: 70dfb3f91242a1262e6a0fa24d283d3381c7ebade58f05a3f397cc0e661981f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 659b2bd1f1390e5f2332dc6764fc07fe21ee53194ea2acfca92fbc80e12abdf104b061a3eff8f7addde4062ce8a15633a12d910874886be76fcef1d1df5cf943
|
7
|
+
data.tar.gz: aed803f26f4b3ad1195e5be1eac230cce5cede1b7a7b5b669075bc7073a42e9877ea567b2b6bddce7ef408ac0c1fdc704d5a8e7301dfb14262a5639496b7e3f1
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
git-bundle (1.0.
|
4
|
+
git-bundle (1.0.19)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -11,8 +11,8 @@ PLATFORMS
|
|
11
11
|
ruby
|
12
12
|
|
13
13
|
DEPENDENCIES
|
14
|
-
bundler (~>
|
14
|
+
bundler (~> 2.4.19)
|
15
15
|
git-bundle!
|
16
16
|
|
17
17
|
BUNDLED WITH
|
18
|
-
|
18
|
+
2.4.19
|
data/git-bundle.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'git_bundle/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'git-bundle'
|
8
8
|
spec.version = GitBundle::VERSION
|
9
|
-
spec.authors = ['Pierre Pretorius']
|
10
|
-
spec.email = ['pierre@labs.epiuse.com']
|
9
|
+
spec.authors = ['Pierre Pretorius', 'Divan Burger']
|
10
|
+
spec.email = ['pierre@labs.epiuse.com', 'divan@labs.epiuse.com']
|
11
11
|
spec.summary = %q{Simplifies working with gems from git repositories in combination with local overrides.}
|
12
12
|
spec.description = %q{Simplifies working with gems from git repositories in combination with local overrides.
|
13
13
|
See the github page for more detail.}
|
@@ -18,5 +18,5 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = 'gitb'
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler', '~>
|
21
|
+
spec.add_development_dependency 'bundler', '~> 2.4.19'
|
22
22
|
end
|
@@ -18,8 +18,26 @@ module GitBundle
|
|
18
18
|
@current = read
|
19
19
|
end
|
20
20
|
|
21
|
+
def remote(repo_name)
|
22
|
+
source = current[repo_name]
|
23
|
+
if source.include?(' ')
|
24
|
+
source.split(' ').first
|
25
|
+
else
|
26
|
+
nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def branch(repo_name)
|
31
|
+
source = current[repo_name]
|
32
|
+
if source.include?(' ')
|
33
|
+
source.split(' ').last
|
34
|
+
else
|
35
|
+
source
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
21
39
|
def read
|
22
|
-
File.
|
40
|
+
File.exist?(path) ? YAML.load_file(path) || {} : nil
|
23
41
|
end
|
24
42
|
|
25
43
|
def changed?
|
@@ -28,8 +46,8 @@ module GitBundle
|
|
28
46
|
|
29
47
|
def save
|
30
48
|
if changed?
|
31
|
-
File.open(path, 'w') {|file| file.write(current.to_yaml.lines[1..-1].join)}
|
32
|
-
if File.
|
49
|
+
File.open(path, 'w') { |file| file.write(current.to_yaml.lines[1..-1].join) }
|
50
|
+
if File.exist?(path)
|
33
51
|
puts "\t#{colorize('update', 34, bold: true)}\t#{filename}"
|
34
52
|
else
|
35
53
|
puts "\t#{colorize('create', 32, bold: true)}\t#{filename}"
|
@@ -10,55 +10,68 @@ module GitBundle
|
|
10
10
|
|
11
11
|
def invoke
|
12
12
|
@project.load_dependant_repositories
|
13
|
+
remaining_args = @args.dup
|
14
|
+
flag = remaining_args.first&.chars&.first == "-" ? remaining_args.shift : nil
|
15
|
+
branch = remaining_args.shift
|
13
16
|
|
14
|
-
if
|
15
|
-
|
17
|
+
if remaining_args.any? || (flag && branch.nil?)
|
18
|
+
puts_error "Invalid arguments for checkout. Usage: \n\tgitb checkout\n\tgitb checkout <branch>\n\tgitb checkout <remote/branch>\n\tgitb checkout -b <new branch>\n\tgitb checkout -a <force branch all repositories>"
|
19
|
+
return
|
20
|
+
end
|
16
21
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
elsif @args.size == 2 && @args.first == '-b'
|
22
|
-
if checkout(@project.main_repository, @args.last, create_new: true, force: true)
|
23
|
-
@project.dependant_repositories.each {|r| checkout(r, @args.last, create_new: true)}
|
22
|
+
case
|
23
|
+
when flag == "-a" || flag == "--all"
|
24
|
+
if checkout(@project.main_repository, branch)
|
25
|
+
@project.dependant_repositories.each { |r| checkout(r, branch) }
|
24
26
|
end
|
25
27
|
@project.branch_config.save if @project.branch_config.changed?
|
26
|
-
|
27
|
-
if checkout(@project.main_repository,
|
28
|
-
@project.dependant_repositories.each {|r| checkout(r,
|
28
|
+
when flag == "-b"
|
29
|
+
if checkout(@project.main_repository, branch, create_new: true, force: true)
|
30
|
+
@project.dependant_repositories.each { |r| checkout(r, branch, create_new: true) }
|
29
31
|
end
|
30
32
|
@project.branch_config.save if @project.branch_config.changed?
|
33
|
+
when branch.nil?
|
34
|
+
checkout_parallel(@project.dependant_repositories, fallback_branch: @project.main_repository.branch)
|
31
35
|
else
|
32
|
-
|
36
|
+
if checkout(@project.main_repository, branch)
|
37
|
+
checkout_parallel(@project.dependant_repositories, fallback_branch: branch)
|
38
|
+
end
|
33
39
|
end
|
34
40
|
end
|
35
41
|
|
36
42
|
def checkout(repo, branch, create_new: false, force: false)
|
43
|
+
args = ['checkout']
|
37
44
|
if create_new
|
38
45
|
unless force
|
39
46
|
puts_repo_heading(repo)
|
40
47
|
puts_prompt("Create #{branch}? (Y/N)")
|
41
48
|
return unless STDIN.getch.upcase == 'Y'
|
42
49
|
end
|
43
|
-
args
|
44
|
-
else
|
45
|
-
args = ['checkout', branch]
|
50
|
+
args << '-b'
|
46
51
|
end
|
52
|
+
args << branch
|
47
53
|
|
48
54
|
output = repo.execute_git(args, color: true)
|
49
55
|
success = $?.exitstatus == 0
|
50
56
|
repo.refresh_branch
|
51
57
|
puts_repo_heading(repo) unless create_new && !force
|
52
|
-
success
|
53
|
-
|
54
|
-
|
58
|
+
if success && !repo.main && create_new && @project.branch_config.current
|
59
|
+
old_remote = @project.branch_config.remote(repo.name)
|
60
|
+
if old_remote
|
61
|
+
@project.branch_config.current[repo.name] = "#{old_remote} #{branch}"
|
62
|
+
else
|
63
|
+
@project.branch_config.current[repo.name] = branch
|
64
|
+
end
|
65
|
+
puts(output)
|
66
|
+
else
|
67
|
+
puts_error(output)
|
55
68
|
end
|
56
69
|
success
|
57
70
|
end
|
58
71
|
|
59
|
-
def checkout_parallel(repositories, fallback_branch)
|
72
|
+
def checkout_parallel(repositories, fallback_branch: nil)
|
60
73
|
parallel(repositories) do |repo|
|
61
|
-
output = repo.execute_git(['checkout', @project.branch_config.
|
74
|
+
output = repo.execute_git(['checkout', @project.branch_config.branch(repo.name) || fallback_branch], color: true)
|
62
75
|
repo.refresh_branch
|
63
76
|
ExecutionResult.new($?.exitstatus != 0, output)
|
64
77
|
end
|
data/lib/git_bundle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-bundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Pretorius
|
8
|
-
|
8
|
+
- Divan Burger
|
9
|
+
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
+
date: 2023-09-12 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: bundler
|
@@ -16,19 +17,20 @@ dependencies:
|
|
16
17
|
requirements:
|
17
18
|
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
+
version: 2.4.19
|
20
21
|
type: :development
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
25
|
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
+
version: 2.4.19
|
27
28
|
description: |-
|
28
29
|
Simplifies working with gems from git repositories in combination with local overrides.
|
29
30
|
See the github page for more detail.
|
30
31
|
email:
|
31
32
|
- pierre@labs.epiuse.com
|
33
|
+
- divan@labs.epiuse.com
|
32
34
|
executables:
|
33
35
|
- gitb
|
34
36
|
extensions: []
|
@@ -59,7 +61,7 @@ homepage: https://github.com/EPI-USE-Labs/git-bundle
|
|
59
61
|
licenses:
|
60
62
|
- MIT
|
61
63
|
metadata: {}
|
62
|
-
post_install_message:
|
64
|
+
post_install_message:
|
63
65
|
rdoc_options: []
|
64
66
|
require_paths:
|
65
67
|
- lib
|
@@ -74,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
76
|
- !ruby/object:Gem::Version
|
75
77
|
version: '0'
|
76
78
|
requirements: []
|
77
|
-
rubygems_version: 3.
|
78
|
-
signing_key:
|
79
|
+
rubygems_version: 3.4.10
|
80
|
+
signing_key:
|
79
81
|
specification_version: 4
|
80
82
|
summary: Simplifies working with gems from git repositories in combination with local
|
81
83
|
overrides.
|