git-multi 3.0.3 → 4.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bbda5e1ba22c2d331f886ccd77aae27f25baca6
4
- data.tar.gz: 5cca3a47979b935abe8fc3de6ac80ca85364357f
3
+ metadata.gz: ae3ea0db8c3ed8b96a4c03075a8fc03776e263dc
4
+ data.tar.gz: f5bc88dda1be61636658ecdb265afed9059d81de
5
5
  SHA512:
6
- metadata.gz: c4af9895f8ceb2ab9894cf566063ad0a4d73224748b322f366633ac1be02517905d8734af8e92f4e4640d3ddb90e865b791b9e3c2418b0ecaddf716c42b7c176
7
- data.tar.gz: 9f684fc838ee48023a9c5eb5e155cb731ddebf7fe57fbbf842524b2e8cb3287c7eb61a8f1deed970e0660932957a91f045bde3d272b0f5a1fa607df2e69df7f0
6
+ metadata.gz: ae0f27414bc44b20290191c1e126bea2a75fb248bbf64a0f361ffc606a0b55d6fd3f916185874ad6afdb24821972002adbd95c9b05aea47a09e19278c76f881f
7
+ data.tar.gz: 94649a8d55edbcc6a4ef5e90313d6e46c9357ac87117036e555c17abba1a0609f64d1e5b79d1734b42797cf163e90482c21676fc4ea6daeae4495b327e04a931
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-multi (3.0.3)
4
+ git-multi (4.0.0)
5
5
  faraday (>= 0.9)
6
6
  octokit (~> 4)
7
7
 
data/exe/git-multi CHANGED
@@ -4,51 +4,58 @@ lib = File.expand_path('../lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'git/multi'
6
6
 
7
- if (command = ARGV.shift)&.start_with? '++'
7
+ multi_repo = command = nil
8
+
9
+ if !STDIN.tty?
10
+ # read list of repo full names from STDIN (~pseudo multi repo)
11
+ multi_repo = STDIN.readlines.map(&:strip).map(&:freeze).freeze
12
+ # reopen STDIN (to ensure all `Kernel.system` based cmds work)
13
+ STDIN.reopen('/dev/tty')
14
+ elsif (command = ARGV.shift)&.start_with? '++'
8
15
  multi_repo = command[2..-1]
9
- if Git::Multi.valid?(multi_repo)
10
- command = nil
11
- else
12
- abort \
13
- "Unknown multi repo: #{multi_repo}\n\n" \
14
- '(use --report to list all known multi repos)'
15
- end
16
+ command = nil
16
17
  end
17
18
 
18
- case (command ||= ARGV.shift)
19
- when /\A--/
20
- case command
21
- when '--version' then Git::Multi::Commands.version
22
- when '--help' then Git::Multi::Commands.help
23
- when '--html' then Git::Multi::Commands.html
24
- when '--report' then Git::Multi::Commands.report(multi_repo)
25
- when '--count' then Git::Multi::Commands.count
26
- when '--refresh' then Git::Multi::Commands.refresh
27
- when '--json' then Git::Multi::Commands.json(multi_repo)
28
- when '--list' then Git::Multi::Commands.list(multi_repo)
29
- when '--archived'then Git::Multi::Commands.archived(multi_repo)
30
- when '--forked' then Git::Multi::Commands.forked(multi_repo)
31
- when '--private' then Git::Multi::Commands.private(multi_repo)
32
- when '--paths' then Git::Multi::Commands.paths(multi_repo)
33
- when '--missing' then Git::Multi::Commands.missing(multi_repo)
34
- when '--clone' then Git::Multi::Commands.clone(multi_repo)
35
- when '--stale' then Git::Multi::Commands.stale(multi_repo)
36
- when '--excess' then Git::Multi::Commands.excess(multi_repo)
37
- when '--spurious'then Git::Multi::Commands.spurious(multi_repo)
38
- when '--query' then Git::Multi::Commands.query(ARGV, multi_repo)
39
- when '--find' then Git::Multi::Commands.find(ARGV, multi_repo)
40
- when '--eval' then Git::Multi::Commands.eval(ARGV, multi_repo)
41
- when '--raw' then Git::Multi::Commands.raw(ARGV, multi_repo)
42
- when '--shell' then Git::Multi::Commands.shell(ARGV, multi_repo)
19
+ begin
20
+ case (command ||= ARGV.shift)
21
+ when /\A--/
22
+ case command
23
+ when '--version' then Git::Multi::Commands.version
24
+ when '--help' then Git::Multi::Commands.help
25
+ when '--html' then Git::Multi::Commands.html
26
+ when '--report' then Git::Multi::Commands.report(multi_repo)
27
+ when '--count' then Git::Multi::Commands.count
28
+ when '--refresh' then Git::Multi::Commands.refresh
29
+ when '--json' then Git::Multi::Commands.json(multi_repo)
30
+ when '--list' then Git::Multi::Commands.list(multi_repo)
31
+ when '--archived'then Git::Multi::Commands.archived(multi_repo)
32
+ when '--forked' then Git::Multi::Commands.forked(multi_repo)
33
+ when '--private' then Git::Multi::Commands.private(multi_repo)
34
+ when '--paths' then Git::Multi::Commands.paths(multi_repo)
35
+ when '--missing' then Git::Multi::Commands.missing(multi_repo)
36
+ when '--clone' then Git::Multi::Commands.clone(multi_repo)
37
+ when '--stale' then Git::Multi::Commands.stale(multi_repo)
38
+ when '--excess' then Git::Multi::Commands.excess(multi_repo)
39
+ when '--spurious'then Git::Multi::Commands.spurious(multi_repo)
40
+ when '--query' then Git::Multi::Commands.query(ARGV, multi_repo)
41
+ when '--find' then Git::Multi::Commands.find(ARGV, multi_repo)
42
+ when '--eval' then Git::Multi::Commands.eval(ARGV, multi_repo)
43
+ when '--raw' then Git::Multi::Commands.raw(ARGV, multi_repo)
44
+ when '--shell' then Git::Multi::Commands.shell(ARGV, multi_repo)
45
+ else
46
+ abort \
47
+ "Unknown 'git multi' command: #{command}\n\n" \
48
+ '(use --help/-h to list all available commands)'
49
+ end
50
+ when nil, '', '-h'
51
+ Git::Multi::Commands.help
43
52
  else
44
- abort \
45
- "Unknown 'git multi' command: #{command}\n\n" \
46
- '(use --help/-h to list all available commands)'
53
+ Git::Multi::Commands.exec(command, ARGV, multi_repo)
47
54
  end
48
- when nil, '', '-h'
49
- Git::Multi::Commands.help
50
- else
51
- Git::Multi::Commands.exec(command, ARGV, multi_repo)
55
+ rescue ArgumentError
56
+ abort \
57
+ "Unknown multi repo: #{$ERROR_INFO.message}\n\n" \
58
+ '(use `git multi --report` to list all known multi repos)'
52
59
  end
53
60
 
54
61
  # That's all Folks!
data/lib/git/multi.rb CHANGED
@@ -216,20 +216,21 @@ module Git
216
216
  #
217
217
 
218
218
  def repositories_for(multi_repo = nil)
219
- case (owner = superproject = multi_repo)
219
+ case (owner = superproject = full_names = multi_repo)
220
220
  when nil
221
221
  repositories # all of them
222
+ when Array
223
+ repositories.find_all { |repository|
224
+ full_names.include?(repository.full_name)
225
+ }
222
226
  when *USERS, *ORGANIZATIONS
223
227
  repositories.find_all { |repository|
224
228
  repository.owner.login == owner
225
229
  }
226
230
  when *SUPERPROJECTS
227
- full_names = full_names_for(superproject)
228
- repositories.find_all { |repository|
229
- full_names.include?(repository.full_name)
230
- }
231
+ repositories_for(full_names_for(superproject))
231
232
  else
232
- raise "Unknown multi repo: #{multi_repo}"
233
+ raise ArgumentError, multi_repo
233
234
  end
234
235
  end
235
236
 
@@ -33,7 +33,7 @@ module Git
33
33
  when *MULTI_REPOS
34
34
  Report.for(multi_repo)
35
35
  else
36
- raise "Unknown multi repo: #{multi_repo}"
36
+ raise ArgumentError, multi_repo
37
37
  end
38
38
  end
39
39
 
@@ -66,7 +66,7 @@ module Git
66
66
  when *SUPERPROJECTS
67
67
  project_status("superproject \"#{project}\"", project)
68
68
  else
69
- raise "Unknown multi repo: #{multi_repo}"
69
+ raise ArgumentError, multi_repo
70
70
  end
71
71
  end
72
72
  end
@@ -1,7 +1,7 @@
1
1
  module Git
2
2
  module Multi
3
3
  NAME = 'git-multi'.freeze
4
- VERSION = '3.0.3'.freeze
4
+ VERSION = '4.0.0'.freeze
5
5
 
6
6
  def self.version
7
7
  "#{NAME} v#{VERSION}"
data/man/git-multi.1 CHANGED
@@ -31,7 +31,7 @@
31
31
  git-multi \- execute the same git command in multiple repositories
32
32
  .SH "VERSION"
33
33
  .sp
34
- This is \fBv3\&.0\&.3\fR of \fIgit multi\fR \&... hooray!
34
+ This is \fBv4\&.0\&.0\fR of \fIgit multi\fR \&... hooray!
35
35
  .SH "SYNOPSIS"
36
36
  .sp
37
37
  There are some options for \fBgit multi\fR itself, in which case it is invoked as follows:
data/man/git-multi.html CHANGED
@@ -748,7 +748,7 @@ git-multi(1) Manual Page
748
748
  <div class="sect1">
749
749
  <h2 id="_version">VERSION</h2>
750
750
  <div class="sectionbody">
751
- <div class="paragraph"><p>This is <code>v3.0.3</code> of <em>git multi</em> &#8230; hooray!</p></div>
751
+ <div class="paragraph"><p>This is <code>v4.0.0</code> of <em>git multi</em> &#8230; hooray!</p></div>
752
752
  </div>
753
753
  </div>
754
754
  <div class="sect1">
@@ -1222,7 +1222,7 @@ the <code>jq</code> command-line utility:
1222
1222
  <div id="footer">
1223
1223
  <div id="footer-text">
1224
1224
  Last updated
1225
- 2020-01-25 07:45:42 GMT
1225
+ 2020-01-25 11:55:56 GMT
1226
1226
  </div>
1227
1227
  </div>
1228
1228
  </body>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-multi
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk