git-bundle 1.0.6 → 1.0.7
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/lib/git_bundle/commands/push.rb +19 -10
- data/lib/git_bundle/repository.rb +14 -3
- data/lib/git_bundle/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc213a9a96e4df28ae91c20989a06431fd3202ce
|
4
|
+
data.tar.gz: 7be0ca2bca7c8d53a275b8d5ecd2fcfc63cd5951
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23105fce66785c11cbd80adf4635251a77db4e5aaa4326f635cc739a1a141c01a2f6837cc25203655aa633ab7a857d1e6e3f1b8775f28f378a8385a5f3aa3ba7
|
7
|
+
data.tar.gz: 9b8e0e887bc405c619015524b4a5038b89df568ccbbdebdb855b0f8dc189d3b797711b4bafd58cbeba949d7704b24de48f1f3b7067c607b1e45fb7624bc60073
|
@@ -12,7 +12,10 @@ module GitBundle
|
|
12
12
|
return false unless prompt_confirm
|
13
13
|
|
14
14
|
lockfile = Bundler.default_lockfile.basename.to_s
|
15
|
-
|
15
|
+
stale_repos = @repositories.select { |repo| !repo.main && repo.stale? }
|
16
|
+
stale_commits_message = stale_repos.map { |repo| "#{repo.name}(#{repo.stale_commits_count})" }.join(', ')
|
17
|
+
|
18
|
+
if stale_repos.any?
|
16
19
|
puts "Local gems were updated. Building new #{lockfile} with bundle install."
|
17
20
|
unless build_gemfile_lock
|
18
21
|
puts_error 'Bundle install failed. Please run it manually before trying to push changes.'
|
@@ -20,8 +23,19 @@ module GitBundle
|
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
23
|
-
|
24
|
-
|
26
|
+
if main_repository.file_changed?(lockfile)
|
27
|
+
main_repository.add_file(lockfile)
|
28
|
+
if stale_commits_message.empty?
|
29
|
+
message = 'Updated Gemfile.lock.'
|
30
|
+
else
|
31
|
+
message = "Gemfile.lock includes new commits of: #{stale_commits_message}."
|
32
|
+
end
|
33
|
+
|
34
|
+
main_repository.commit(message, lockfile)
|
35
|
+
puts message
|
36
|
+
end
|
37
|
+
|
38
|
+
@repositories.select { |repo| !repo.main && repo.commits_not_pushed_count > 0 }.each do |repo|
|
25
39
|
puts_repo_heading(repo)
|
26
40
|
unless repo.push(@args)
|
27
41
|
puts_error "Failed to push changes of #{repo.name}. Try pulling the latest changes or resolve conflicts first."
|
@@ -30,11 +44,6 @@ module GitBundle
|
|
30
44
|
end
|
31
45
|
|
32
46
|
puts_repo_heading(main_repository)
|
33
|
-
if main_repository.file_changed?(lockfile)
|
34
|
-
main_repository.add_file(lockfile)
|
35
|
-
main_repository.commit("Updated Gemfile.lock to include changes: #{combined_messages}", lockfile)
|
36
|
-
end
|
37
|
-
|
38
47
|
unless main_repository.push(@args)
|
39
48
|
puts_error "Failed to push changes of #{main_repository.name}. Try pulling the latest changes or resolve conflicts first."
|
40
49
|
end
|
@@ -82,7 +91,7 @@ module GitBundle
|
|
82
91
|
end
|
83
92
|
|
84
93
|
def gemfile_lock_stale?
|
85
|
-
@repositories.any? { |repo| repo.
|
94
|
+
@repositories.any? { |repo| repo.stale? }
|
86
95
|
end
|
87
96
|
|
88
97
|
def build_gemfile_lock
|
@@ -93,4 +102,4 @@ module GitBundle
|
|
93
102
|
end
|
94
103
|
end
|
95
104
|
end
|
96
|
-
end
|
105
|
+
end
|
@@ -36,13 +36,24 @@ module GitBundle
|
|
36
36
|
@locked_revision || revision
|
37
37
|
end
|
38
38
|
|
39
|
+
def stale?
|
40
|
+
revision != locked_revision
|
41
|
+
end
|
42
|
+
|
43
|
+
def stale_commits
|
44
|
+
execute_git('rev-list', '--pretty=oneline', '--abbrev-commit', "#{locked_revision}..#{revision}")
|
45
|
+
end
|
46
|
+
|
47
|
+
def stale_commits_count
|
48
|
+
execute_git('rev-list', '--pretty=oneline', '--abbrev-commit', '--count', "#{locked_revision}..#{revision}").to_i
|
49
|
+
end
|
50
|
+
|
39
51
|
def commits_not_pushed
|
40
52
|
execute_git('rev-list', '--pretty=oneline', '--abbrev-commit', "origin/#{branch}..#{branch}")
|
41
53
|
end
|
42
54
|
|
43
|
-
def
|
44
|
-
|
45
|
-
count.times.map { |num| execute_git('rev-list', '--pretty=oneline', "--skip=#{num}", '--max-count=1', "origin/#{branch}..#{branch}").sub(/\h*\s/, '').strip }
|
55
|
+
def commits_not_pushed_count
|
56
|
+
execute_git('rev-list', '--pretty=oneline', '--abbrev-commit', '--count', "origin/#{branch}..#{branch}").to_i
|
46
57
|
end
|
47
58
|
|
48
59
|
def push(args)
|
data/lib/git_bundle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Pretorius
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -75,4 +75,3 @@ specification_version: 4
|
|
75
75
|
summary: Simplifies working with gems from git repositories in combination with local
|
76
76
|
overrides.
|
77
77
|
test_files: []
|
78
|
-
has_rdoc:
|