git-multi 1.0.10 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87a5098e57c1c0543ff692107ed8f72df532fb3dfdc0695c50611e2f478af8c4
4
- data.tar.gz: 7d26ed3027f6115e335cb88786cc4cab70bf9f94eb184551d13df1d2f5c8a120
3
+ metadata.gz: 78f3a989686451a2c8da7e936efccc3c209a5128c2908650b640eef01f7f5997
4
+ data.tar.gz: 304141ffe253506dfa598a095dd9023e38be5bc8cd9de7c4ff742cada0ccfb2e
5
5
  SHA512:
6
- metadata.gz: 947af0e03bb9bcbb8ee2b22ea976163c5becc4207b3d0787c0be3f9439c9cd64d657f8324fed2ee0e9acd7a2390e464e9d876bc700b21c1e79962b0ac5f2ef77
7
- data.tar.gz: d8e11968d5a6eeba9157a21ff12f49f5a769a261f38a34d593019d150ed2812a1af3aab7f33aab2b4ce0022a7efb50ffb197dc8d2513772d8435794e62b364bc
6
+ metadata.gz: bbb67393419507f66f7c9936af27224d546f2fb3a69c6be00e1683b70ebce029aeaeabd21dce4ea3d2fdeaedd1e3f9214f9a9961f1be1da03b79ca7232969b0a
7
+ data.tar.gz: bd96d42a7982341c95f1f453743f6701107fdb2468f66ce9d5b3532f3ed80dea105a04e775f2d3e223bef98986f51e0032451f725eff22544b754a880f52751e
data/exe/git-multi CHANGED
@@ -4,30 +4,41 @@ lib = File.expand_path('../../lib', __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'git/multi'
6
6
 
7
- case (command = ARGV.shift)
7
+ if (command = ARGV.shift).start_with? '++'
8
+ 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 --check to list all known multi repos)'
15
+ end
16
+ end
17
+
18
+ case (command ||= ARGV.shift)
8
19
  when /\A--/
9
20
  case command
21
+ when '--version' then Git::Multi::Commands.version
10
22
  when '--help' then Git::Multi::Commands.help
11
23
  when '--html' then Git::Multi::Commands.html
12
24
  when '--check' then Git::Multi::Commands.check
13
- when '--version' then Git::Multi::Commands.version
14
- when '--refresh' then Git::Multi::Commands.refresh
15
- when '--json' then Git::Multi::Commands.json
16
25
  when '--count' then Git::Multi::Commands.count
17
- when '--list' then Git::Multi::Commands.list
18
- when '--archived'then Git::Multi::Commands.archived
19
- when '--forked' then Git::Multi::Commands.forked
20
- when '--private' then Git::Multi::Commands.private
21
- when '--paths' then Git::Multi::Commands.paths
22
- when '--spurious'then Git::Multi::Commands.spurious
23
- when '--missing' then Git::Multi::Commands.missing
24
- when '--stale' then Git::Multi::Commands.stale
25
- when '--excess' then Git::Multi::Commands.excess
26
- when '--clone' then Git::Multi::Commands.clone
27
- when '--query' then Git::Multi::Commands.query(ARGV)
28
- when '--find' then Git::Multi::Commands.find(ARGV)
29
- when '--eval' then Git::Multi::Commands.eval(ARGV)
30
- when '--raw' then Git::Multi::Commands.raw(ARGV)
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)
31
42
  else
32
43
  abort \
33
44
  "Unknown 'git multi' command: #{command}\n\n" \
@@ -36,8 +47,8 @@ when /\A--/
36
47
  when nil, '', '-h'
37
48
  Git::Multi::Commands.help
38
49
  else
39
- Git::Multi::Commands.report
40
- Git::Multi::Commands.exec command, ARGV
50
+ Git::Multi::Commands.report(multi_repo)
51
+ Git::Multi::Commands.exec(command, ARGV, multi_repo)
41
52
  end
42
53
 
43
54
  # That's all Folks!
@@ -8,6 +8,14 @@ module Git
8
8
  puts Git::Multi::LONG_VERSION
9
9
  end
10
10
 
11
+ def help
12
+ Kernel.exec "man #{Git::Multi::MAN_PAGE}"
13
+ end
14
+
15
+ def html
16
+ Kernel.exec "open #{Git::Multi::HTML_PAGE}"
17
+ end
18
+
11
19
  def check
12
20
  # Settings.user_status(Git::Multi::USER)
13
21
  # Settings.organization_status(Git::Multi::ORGANIZATIONS)
@@ -19,55 +27,6 @@ module Git
19
27
  # Settings.file_status(Git::Multi::REPOSITORIES)
20
28
  end
21
29
 
22
- def help
23
- Kernel.exec "man #{Git::Multi::MAN_PAGE}"
24
- end
25
-
26
- def html
27
- Kernel.exec "open #{Git::Multi::HTML_PAGE}"
28
- end
29
-
30
- def report
31
- (missing_repos = Git::Multi.missing_repositories).any? &&
32
- notify(missing_repos.map(&:full_name), subtitle: "#{missing_repos.count} missing repos")
33
- end
34
-
35
- def list
36
- puts Git::Multi.repositories.map(&:full_name)
37
- end
38
-
39
- def archived
40
- puts Git::Multi.archived_repositories.map(&:full_name)
41
- end
42
-
43
- def forked
44
- puts Git::Multi.forked_repositories.map(&:full_name)
45
- end
46
-
47
- def private
48
- puts Git::Multi.private_repositories.map(&:full_name)
49
- end
50
-
51
- def paths
52
- puts Git::Multi.repositories.map(&:local_path)
53
- end
54
-
55
- def missing
56
- puts Git::Multi.missing_repositories.map(&:full_name)
57
- end
58
-
59
- def excess
60
- puts Git::Multi.excess_repositories.map(&:full_name)
61
- end
62
-
63
- def stale
64
- puts Git::Multi.stale_repositories.map(&:full_name)
65
- end
66
-
67
- def spurious
68
- puts Git::Multi.spurious_repositories.map(&:full_name)
69
- end
70
-
71
30
  def count
72
31
  # https://developer.github.com/v3/repos/#list-user-repositories
73
32
  Git::Multi::USERS.each do |user|
@@ -87,12 +46,36 @@ module Git
87
46
  Git::Multi.refresh_repositories
88
47
  end
89
48
 
90
- def json
91
- puts Git::Multi.repositories.to_json
49
+ def json(multi_repo = nil)
50
+ puts Git::Multi.repositories_for(multi_repo).to_json
51
+ end
52
+
53
+ def list(multi_repo = nil)
54
+ puts Git::Multi.repositories_for(multi_repo).map(&:full_name)
55
+ end
56
+
57
+ def archived(multi_repo = nil)
58
+ puts Git::Multi.archived_repositories_for(multi_repo).map(&:full_name)
59
+ end
60
+
61
+ def forked(multi_repo = nil)
62
+ puts Git::Multi.forked_repositories_for(multi_repo).map(&:full_name)
63
+ end
64
+
65
+ def private(multi_repo = nil)
66
+ puts Git::Multi.private_repositories_for(multi_repo).map(&:full_name)
67
+ end
68
+
69
+ def paths(multi_repo = nil)
70
+ puts Git::Multi.repositories_for(multi_repo).map(&:local_path)
71
+ end
72
+
73
+ def missing(multi_repo = nil)
74
+ puts Git::Multi.missing_repositories_for(multi_repo).map(&:full_name)
92
75
  end
93
76
 
94
- def clone
95
- Git::Multi.missing_repositories.each do |repo|
77
+ def clone(multi_repo = nil)
78
+ Git::Multi.missing_repositories_for(multi_repo).each do |repo|
96
79
  FileUtils.mkdir_p repo.parent_dir
97
80
  repo.just_do_it(
98
81
  ->(project) {
@@ -107,8 +90,20 @@ module Git
107
90
  end
108
91
  end
109
92
 
110
- def query(args = [])
111
- Git::Multi.repositories.each do |repo|
93
+ def stale(multi_repo = nil)
94
+ puts Git::Multi.stale_repositories_for(multi_repo).map(&:full_name)
95
+ end
96
+
97
+ def excess(multi_repo = nil)
98
+ puts Git::Multi.excess_repositories_for(multi_repo).map(&:full_name)
99
+ end
100
+
101
+ def spurious(multi_repo = nil)
102
+ puts Git::Multi.spurious_repositories_for(multi_repo).map(&:full_name)
103
+ end
104
+
105
+ def query(args = [], multi_repo = nil)
106
+ Git::Multi.repositories_for(multi_repo).each do |repo|
112
107
  repo.just_do_it(
113
108
  ->(project) {
114
109
  args.each do |attribute|
@@ -123,33 +118,8 @@ module Git
123
118
  end
124
119
  end
125
120
 
126
- def system(args = [])
127
- cmd = args.map!(&:shellescape).join(' ')
128
- Git::Multi.cloned_repositories.each do |repo|
129
- repo.just_do_it(
130
- ->(_project) {
131
- Kernel.system cmd
132
- },
133
- ->(project) {
134
- Kernel.system "#{cmd} 2>&1 | sed -e 's#^##{project.full_name.shellescape}: #'"
135
- },
136
- in: 'local_path'
137
- )
138
- end
139
- end
140
-
141
- def raw(args)
142
- args.unshift ['sh', '-c']
143
- system args.flatten
144
- end
145
-
146
- def exec(command, args = [])
147
- args.unshift ['git', '--no-pager', command]
148
- system args.flatten
149
- end
150
-
151
- def find(commands)
152
- Git::Multi.cloned_repositories.each do |repo|
121
+ def find(commands, multi_repo = nil)
122
+ Git::Multi.cloned_repositories_for(multi_repo).each do |repo|
153
123
  Dir.chdir(repo.local_path) do
154
124
  if repo.instance_eval(commands.join(' && '))
155
125
  repo.just_do_it(
@@ -164,8 +134,8 @@ module Git
164
134
  end
165
135
  end
166
136
 
167
- def eval(commands)
168
- Git::Multi.cloned_repositories.each do |repo|
137
+ def eval(commands, multi_repo)
138
+ Git::Multi.cloned_repositories_for(multi_repo).each do |repo|
169
139
  Dir.chdir(repo.local_path) do
170
140
  repo.instance_eval(commands.join(' ; '))
171
141
  rescue Octokit::NotFound
@@ -175,6 +145,41 @@ module Git
175
145
  end
176
146
  end
177
147
 
148
+ def raw(args, multi_repo = nil)
149
+ args.unshift ['sh', '-c']
150
+ system(args.flatten, multi_repo)
151
+ end
152
+
153
+ def report(multi_repo = nil)
154
+ (missing = Git::Multi.missing_repositories_for(multi_repo)).any? &&
155
+ notify(
156
+ missing.map(&:full_name),
157
+ subtitle: "#{missing.count} missing repos"
158
+ )
159
+ end
160
+
161
+ def exec(command, args = [], multi_repo = nil)
162
+ args.unshift ['git', '--no-pager', command]
163
+ system(args.flatten, multi_repo)
164
+ end
165
+
166
+ def system(args = [], multi_repo = nil)
167
+ cmd = args.map!(&:shellescape).join(' ')
168
+ Git::Multi.cloned_repositories_for(multi_repo).each do |repo|
169
+ repo.just_do_it(
170
+ ->(_project) {
171
+ Kernel.system cmd
172
+ },
173
+ ->(project) {
174
+ Kernel.system "#{cmd} 2>&1 | sed -e 's#^##{project.full_name.shellescape}: #'"
175
+ },
176
+ in: 'local_path'
177
+ )
178
+ end
179
+ end
180
+
181
+ private_class_method :system
182
+
178
183
  end
179
184
  end
180
185
  end
@@ -6,7 +6,7 @@ require 'addressable'
6
6
  module Git
7
7
  module Multi
8
8
  NAME = 'git-multi'.freeze
9
- VERSION = '1.0.10'.freeze
9
+ VERSION = '1.1.0'.freeze
10
10
 
11
11
  DEPENDENCY_VERSIONS = [
12
12
  "octokit.rb v#{Octokit::VERSION}",
data/lib/git/multi.rb CHANGED
@@ -43,6 +43,14 @@ module Git
43
43
 
44
44
  module_function
45
45
 
46
+ #
47
+ # multi-repo support
48
+ #
49
+
50
+ def valid?(multi_repo)
51
+ (USERS + ORGANIZATIONS).include? multi_repo
52
+ end
53
+
46
54
  #
47
55
  # local repositories (in WORKAREA)
48
56
  #
@@ -56,23 +64,61 @@ module Git
56
64
  }
57
65
 
58
66
  def local_repositories
59
- (
67
+ @local_repositories ||= (
60
68
  USERS.map { |user| @local_user_repositories[user] } +
61
69
  ORGANIZATIONS.map { |org| @local_org_repositories[org] }
62
70
  ).flatten
63
71
  end
64
72
 
73
+ def local_repositories_for(multi_repo = nil)
74
+ case (owner = multi_repo)
75
+ when nil
76
+ local_repositories
77
+ when *USERS
78
+ @local_user_repositories[owner]
79
+ when *ORGANIZATIONS
80
+ @local_org_repositories[owner]
81
+ else
82
+ raise "Unknown multi repo: #{multi_repo}"
83
+ end
84
+ end
85
+
65
86
  #
66
87
  # remote repositories (on GitHub)
67
88
  #
68
89
 
90
+ @github_user_repositories = Hash.new { |repos, user|
91
+ repos[user] = Git::Hub.user_repositories(user)
92
+ }
93
+
94
+ @github_org_repositories = Hash.new { |repos, org|
95
+ repos[org] = Git::Hub.org_repositories(org)
96
+ }
97
+
69
98
  def github_repositories
70
99
  @github_repositories ||= (
71
- USERS.map { |user| Git::Hub.user_repositories(user) } +
72
- ORGANIZATIONS.map { |org| Git::Hub.org_repositories(org) }
100
+ USERS.map { |user| @github_user_repositories[user] } +
101
+ ORGANIZATIONS.map { |org| @github_org_repositories[org] }
73
102
  ).flatten
74
103
  end
75
104
 
105
+ def github_repositories_for(multi_repo = nil)
106
+ case (owner = multi_repo)
107
+ when nil
108
+ github_repositories
109
+ when *USERS
110
+ @github_user_repositories[owner]
111
+ when *ORGANIZATIONS
112
+ @github_org_repositories[owner]
113
+ else
114
+ raise "Unknown multi repo: #{multi_repo}"
115
+ end
116
+ end
117
+
118
+ #
119
+ # manage the local repository cache
120
+ #
121
+
76
122
  def refresh_repositories
77
123
  File.directory?(CACHE) || FileUtils.mkdir_p(CACHE)
78
124
 
@@ -132,42 +178,56 @@ module Git
132
178
  end
133
179
  end
134
180
 
181
+ #
182
+ # lists of repos for a given multi-repo
183
+ #
184
+
185
+ def repositories_for(multi_repo = nil)
186
+ if multi_repo.nil?
187
+ repositories
188
+ else
189
+ repositories.find_all { |repository|
190
+ repository.owner.login == multi_repo
191
+ }
192
+ end
193
+ end
194
+
135
195
  #
136
196
  # lists of repositories with a given state
137
197
  #
138
198
 
139
- def archived_repositories
140
- repositories.find_all(&:archived)
199
+ def archived_repositories_for(multi_repo = nil)
200
+ repositories_for(multi_repo).find_all(&:archived)
141
201
  end
142
202
 
143
- def forked_repositories
144
- repositories.find_all(&:fork)
203
+ def forked_repositories_for(multi_repo = nil)
204
+ repositories_for(multi_repo).find_all(&:fork)
145
205
  end
146
206
 
147
- def private_repositories
148
- repositories.find_all(&:private)
207
+ def private_repositories_for(multi_repo = nil)
208
+ repositories_for(multi_repo).find_all(&:private)
149
209
  end
150
210
 
151
211
  #
152
212
  # derived lists of repositories
153
213
  #
154
214
 
155
- def excess_repositories
156
- repository_full_names = repositories.map(&:full_name)
157
- local_repositories.reject { |project|
215
+ def excess_repositories_for(multi_repo = nil)
216
+ repository_full_names = repositories_for(multi_repo).map(&:full_name)
217
+ local_repositories_for(multi_repo).reject { |project|
158
218
  repository_full_names.include? project.full_name
159
219
  }
160
220
  end
161
221
 
162
- def stale_repositories
163
- repository_full_names = github_repositories.map(&:full_name)
164
- repositories.reject { |project|
222
+ def stale_repositories_for(multi_repo = nil)
223
+ repository_full_names = github_repositories_for(multi_repo).map(&:full_name)
224
+ repositories_for(multi_repo).reject { |project|
165
225
  repository_full_names.include? project.full_name
166
226
  }
167
227
  end
168
228
 
169
- def spurious_repositories
170
- cloned_repositories.find_all { |project|
229
+ def spurious_repositories_for(multi_repo = nil)
230
+ cloned_repositories_for(multi_repo).find_all { |project|
171
231
  origin_url = `git -C #{project.local_path} config --get remote.origin.url`.chomp
172
232
  ![
173
233
  project.clone_url,
@@ -179,14 +239,14 @@ module Git
179
239
  }
180
240
  end
181
241
 
182
- def missing_repositories
183
- repositories.find_all { |project|
242
+ def missing_repositories_for(multi_repo = nil)
243
+ repositories_for(multi_repo).find_all { |project|
184
244
  !File.directory? project.local_path
185
245
  }
186
246
  end
187
247
 
188
- def cloned_repositories
189
- repositories.find_all { |project|
248
+ def cloned_repositories_for(multi_repo = nil)
249
+ repositories_for(multi_repo).find_all { |project|
190
250
  File.directory? project.local_path
191
251
  }
192
252
  end
data/man/git-multi.1 CHANGED
@@ -2,12 +2,12 @@
2
2
  .\" Title: git-multi
3
3
  .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4
4
  .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
5
- .\" Date: 11/01/2018
5
+ .\" Date: 11/09/2018
6
6
  .\" Manual: Git Manual
7
7
  .\" Source: Git 2.19.1.542.gc4df23f792.dirty
8
8
  .\" Language: English
9
9
  .\"
10
- .TH "GIT\-MULTI" "1" "11/01/2018" "Git 2\&.19\&.1\&.542\&.gc4df23" "Git Manual"
10
+ .TH "GIT\-MULTI" "1" "11/09/2018" "Git 2\&.19\&.1\&.542\&.gc4df23" "Git Manual"
11
11
  .\" -----------------------------------------------------------------
12
12
  .\" * Define some portability stuff
13
13
  .\" -----------------------------------------------------------------
@@ -31,13 +31,13 @@
31
31
  git-multi \- execute the same git command in multiple repositories
32
32
  .SH "VERSION"
33
33
  .sp
34
- This is \fBv1\&.0\&.10\fR of \fIgit multi\fR \&... hooray!
34
+ This is \fBv1\&.1\&.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:
38
38
  .sp
39
39
  .nf
40
- \fIgit multi\fR <dash_dash_option> [<option_arguments>]
40
+ \fIgit multi\fR \-\-<option> [<option_arguments>]
41
41
  .fi
42
42
  .sp
43
43
  .sp
@@ -47,11 +47,34 @@ To execute the same git command in multiple repositories, the invocation is as f
47
47
  \fIgit multi\fR <git_command> [<git_command_arguments>]
48
48
  .fi
49
49
  .sp
50
+ .sp
51
+ Both ways of running \fBgit multi\fR take an optional, so\-called "multi repo" argument to limit the operation to the list of repositories in the referenced "multi repo", ie\&. a single GitHub user or a single GitHub organization:
52
+ .sp
53
+ .nf
54
+ \fIgit multi\fR ++<multi_repo> \-\-<option> [<option_arguments>]
55
+ .fi
56
+ .sp
57
+ .sp
58
+ and\&...
59
+ .sp
60
+ .nf
61
+ \fIgit multi\fR ++<multi_repo> <git_command> [<git_command_arguments>]
62
+ .fi
63
+ .sp
50
64
  .SH "DESCRIPTION"
51
65
  .sp
52
- Convenient way to execute the same git command in a set of related repos, currently the repositories of a GitHub user, incl\&. the organizations they are a member of; the repo list is determined via a GitHub API v3 call, and cached locally \fI(in binary format)\fR for performance and offline usage\&.
66
+ Convenient way to execute the same git command in a set of related repos, currently the repositories of a GitHub user, incl\&. the organizations they are a member of\&.
67
+ .sp
68
+ The list of repositories is determined via a GitHub API v3 call, and cached locally \fI(in binary format)\fR for performance and offline usage\&.
69
+ .sp
70
+ By default, \fBgit multi\fR operates on all repositories for all configured users and all configured organizations\&. To limit the operation to a single user or a single organization, the optional \fB++<multi_repo>\fR argument can be used\&.
53
71
  .SH "OPTIONS"
54
72
  .PP
73
+ \-\-version
74
+ .RS 4
75
+ print out this script\(cqs version number
76
+ .RE
77
+ .PP
55
78
  \-\-help
56
79
  .RS 4
57
80
  you\(cqre looking at it: show the man page
@@ -67,9 +90,9 @@ open the HTML version of the man page
67
90
  checks all the required settings and configurations
68
91
  .RE
69
92
  .PP
70
- \-\-version
93
+ \-\-count
71
94
  .RS 4
72
- print out this script\(cqs version number
95
+ print out the count of repos (per type)
73
96
  .RE
74
97
  .PP
75
98
  \-\-refresh
@@ -82,11 +105,6 @@ refresh the list of user & organization repos
82
105
  output repository details to JSON
83
106
  .RE
84
107
  .PP
85
- \-\-count
86
- .RS 4
87
- print out the count of repos (per type)
88
- .RE
89
- .PP
90
108
  \-\-list
91
109
  .RS 4
92
110
  print out the names of all repos
@@ -112,14 +130,16 @@ print out the names of all repos
112
130
  print out the full path for each repos
113
131
  .RE
114
132
  .PP
115
- \-\-spurious
133
+ \-\-missing
116
134
  .RS 4
117
- list cloned repos whose remote doesn\(cqt match a github\&.com origin
135
+ print out names of repos that haven\(cqt been cloned
118
136
  .RE
119
137
  .PP
120
- \-\-missing
138
+ \-\-clone
121
139
  .RS 4
122
- print out names of repos that haven\(cqt been cloned
140
+ clones missing repositories into
141
+ \fB${HOME}/Workarea\fR
142
+ (by default)
123
143
  .RE
124
144
  .PP
125
145
  \-\-stale
@@ -132,11 +152,9 @@ list repos that have been deleted on github\&.com
132
152
  list repos that don\(cqt exist on github\&.com
133
153
  .RE
134
154
  .PP
135
- \-\-clone
155
+ \-\-spurious
136
156
  .RS 4
137
- clones missing repositories into
138
- \fB${HOME}/Workarea\fR
139
- (by default)
157
+ list cloned repos whose remote doesn\(cqt match a github\&.com origin
140
158
  .RE
141
159
  .PP
142
160
  \-\-query (args)
data/man/git-multi.erb CHANGED
@@ -18,7 +18,7 @@ There are some options for `git multi` itself, in which case it
18
18
  is invoked as follows:
19
19
 
20
20
  [verse]
21
- 'git multi' <dash_dash_option> [<option_arguments>]
21
+ 'git multi' --<option> [<option_arguments>]
22
22
 
23
23
  To execute the same git command in multiple repositories, the
24
24
  invocation is as follows:
@@ -26,17 +26,38 @@ invocation is as follows:
26
26
  [verse]
27
27
  'git multi' <git_command> [<git_command_arguments>]
28
28
 
29
+ Both ways of running `git multi` take an optional, so-called "multi repo"
30
+ argument to limit the operation to the list of repositories in the referenced
31
+ "multi repo", ie. a single GitHub user or a single GitHub organization:
32
+
33
+ [verse]
34
+ 'git multi' ++<multi_repo> --<option> [<option_arguments>]
35
+
36
+ and...
37
+
38
+ [verse]
39
+ 'git multi' ++<multi_repo> <git_command> [<git_command_arguments>]
40
+
29
41
  DESCRIPTION
30
42
  -----------
31
43
 
32
44
  Convenient way to execute the same git command in a set of related repos,
33
45
  currently the repositories of a GitHub user, incl. the organizations they
34
- are a member of; the repo list is determined via a GitHub API v3 call, and
46
+ are a member of.
47
+
48
+ The list of repositories is determined via a GitHub API v3 call, and
35
49
  cached locally '(in binary format)' for performance and offline usage.
36
50
 
51
+ By default, `git multi` operates on all repositories for all configured users
52
+ and all configured organizations. To limit the operation to a single user or
53
+ a single organization, the optional `++<multi_repo>` argument can be used.
54
+
37
55
  OPTIONS
38
56
  -------
39
57
 
58
+ --version::
59
+ print out this script's version number
60
+
40
61
  --help::
41
62
  you're looking at it: show the man page
42
63
 
@@ -46,8 +67,8 @@ OPTIONS
46
67
  --check::
47
68
  checks all the required settings and configurations
48
69
 
49
- --version::
50
- print out this script's version number
70
+ --count::
71
+ print out the count of repos (per type)
51
72
 
52
73
  --refresh::
53
74
  refresh the list of user & organization repos
@@ -55,9 +76,6 @@ OPTIONS
55
76
  --json::
56
77
  output repository details to JSON
57
78
 
58
- --count::
59
- print out the count of repos (per type)
60
-
61
79
  --list::
62
80
  print out the names of all repos
63
81
 
@@ -73,20 +91,20 @@ OPTIONS
73
91
  --paths::
74
92
  print out the full path for each repos
75
93
 
76
- --spurious::
77
- list cloned repos whose remote doesn't match a github.com origin
78
-
79
94
  --missing::
80
95
  print out names of repos that haven't been cloned
81
96
 
97
+ --clone::
98
+ clones missing repositories into `${HOME}/Workarea` (by default)
99
+
82
100
  --stale::
83
101
  list repos that have been deleted on github.com
84
102
 
85
103
  --excess::
86
104
  list repos that don't exist on github.com
87
105
 
88
- --clone::
89
- clones missing repositories into `${HOME}/Workarea` (by default)
106
+ --spurious::
107
+ list cloned repos whose remote doesn't match a github.com origin
90
108
 
91
109
  --query (args)::
92
110
  query GitHub repo metadata for each repository
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>v1.0.10</code> of <em>git multi</em> &#8230; hooray!</p></div>
751
+ <div class="paragraph"><p>This is <code>v1.1.0</code> of <em>git multi</em> &#8230; hooray!</p></div>
752
752
  </div>
753
753
  </div>
754
754
  <div class="sect1">
@@ -757,7 +757,7 @@ git-multi(1) Manual Page
757
757
  <div class="paragraph"><p>There are some options for <code>git multi</code> itself, in which case it
758
758
  is invoked as follows:</p></div>
759
759
  <div class="verseblock">
760
- <pre class="content"><em>git multi</em> &lt;dash_dash_option&gt; [&lt;option_arguments&gt;]</pre>
760
+ <pre class="content"><em>git multi</em> --&lt;option&gt; [&lt;option_arguments&gt;]</pre>
761
761
  <div class="attribution">
762
762
  </div></div>
763
763
  <div class="paragraph"><p>To execute the same git command in multiple repositories, the
@@ -766,6 +766,18 @@ invocation is as follows:</p></div>
766
766
  <pre class="content"><em>git multi</em> &lt;git_command&gt; [&lt;git_command_arguments&gt;]</pre>
767
767
  <div class="attribution">
768
768
  </div></div>
769
+ <div class="paragraph"><p>Both ways of running <code>git multi</code> take an optional, so-called "multi repo"
770
+ argument to limit the operation to the list of repositories in the referenced
771
+ "multi repo", ie. a single GitHub user or a single GitHub organization:</p></div>
772
+ <div class="verseblock">
773
+ <pre class="content"><em>git multi</em> ++&lt;multi_repo&gt; --&lt;option&gt; [&lt;option_arguments&gt;]</pre>
774
+ <div class="attribution">
775
+ </div></div>
776
+ <div class="paragraph"><p>and&#8230;</p></div>
777
+ <div class="verseblock">
778
+ <pre class="content"><em>git multi</em> ++&lt;multi_repo&gt; &lt;git_command&gt; [&lt;git_command_arguments&gt;]</pre>
779
+ <div class="attribution">
780
+ </div></div>
769
781
  </div>
770
782
  </div>
771
783
  <div class="sect1">
@@ -773,8 +785,12 @@ invocation is as follows:</p></div>
773
785
  <div class="sectionbody">
774
786
  <div class="paragraph"><p>Convenient way to execute the same git command in a set of related repos,
775
787
  currently the repositories of a GitHub user, incl. the organizations they
776
- are a member of; the repo list is determined via a GitHub API v3 call, and
788
+ are a member of.</p></div>
789
+ <div class="paragraph"><p>The list of repositories is determined via a GitHub API v3 call, and
777
790
  cached locally <em>(in binary format)</em> for performance and offline usage.</p></div>
791
+ <div class="paragraph"><p>By default, <code>git multi</code> operates on all repositories for all configured users
792
+ and all configured organizations. To limit the operation to a single user or
793
+ a single organization, the optional <code>++&lt;multi_repo&gt;</code> argument can be used.</p></div>
778
794
  </div>
779
795
  </div>
780
796
  <div class="sect1">
@@ -782,6 +798,14 @@ cached locally <em>(in binary format)</em> for performance and offline usage.</p
782
798
  <div class="sectionbody">
783
799
  <div class="dlist"><dl>
784
800
  <dt class="hdlist1">
801
+ --version
802
+ </dt>
803
+ <dd>
804
+ <p>
805
+ print out this script&#8217;s version number
806
+ </p>
807
+ </dd>
808
+ <dt class="hdlist1">
785
809
  --help
786
810
  </dt>
787
811
  <dd>
@@ -806,11 +830,11 @@ cached locally <em>(in binary format)</em> for performance and offline usage.</p
806
830
  </p>
807
831
  </dd>
808
832
  <dt class="hdlist1">
809
- --version
833
+ --count
810
834
  </dt>
811
835
  <dd>
812
836
  <p>
813
- print out this script&#8217;s version number
837
+ print out the count of repos (per type)
814
838
  </p>
815
839
  </dd>
816
840
  <dt class="hdlist1">
@@ -830,14 +854,6 @@ cached locally <em>(in binary format)</em> for performance and offline usage.</p
830
854
  </p>
831
855
  </dd>
832
856
  <dt class="hdlist1">
833
- --count
834
- </dt>
835
- <dd>
836
- <p>
837
- print out the count of repos (per type)
838
- </p>
839
- </dd>
840
- <dt class="hdlist1">
841
857
  --list
842
858
  </dt>
843
859
  <dd>
@@ -878,19 +894,19 @@ cached locally <em>(in binary format)</em> for performance and offline usage.</p
878
894
  </p>
879
895
  </dd>
880
896
  <dt class="hdlist1">
881
- --spurious
897
+ --missing
882
898
  </dt>
883
899
  <dd>
884
900
  <p>
885
- list cloned repos whose remote doesn&#8217;t match a github.com origin
901
+ print out names of repos that haven&#8217;t been cloned
886
902
  </p>
887
903
  </dd>
888
904
  <dt class="hdlist1">
889
- --missing
905
+ --clone
890
906
  </dt>
891
907
  <dd>
892
908
  <p>
893
- print out names of repos that haven&#8217;t been cloned
909
+ clones missing repositories into <code>${HOME}/Workarea</code> (by default)
894
910
  </p>
895
911
  </dd>
896
912
  <dt class="hdlist1">
@@ -910,11 +926,11 @@ cached locally <em>(in binary format)</em> for performance and offline usage.</p
910
926
  </p>
911
927
  </dd>
912
928
  <dt class="hdlist1">
913
- --clone
929
+ --spurious
914
930
  </dt>
915
931
  <dd>
916
932
  <p>
917
- clones missing repositories into <code>${HOME}/Workarea</code> (by default)
933
+ list cloned repos whose remote doesn&#8217;t match a github.com origin
918
934
  </p>
919
935
  </dd>
920
936
  <dt class="hdlist1">
@@ -1184,7 +1200,7 @@ the <code>jq</code> command-line utility:
1184
1200
  <div id="footer">
1185
1201
  <div id="footer-text">
1186
1202
  Last updated
1187
- 2018-11-01 16:32:39 GMT
1203
+ 2018-11-09 14:11:04 GMT
1188
1204
  </div>
1189
1205
  </div>
1190
1206
  </body>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-multi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-01 00:00:00.000000000 Z
11
+ date: 2018-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit