git-multi 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/Rakefile +21 -0
- data/exe/git-multi +1 -0
- data/lib/git/multi/commands.rb +5 -10
- data/lib/git/multi/version.rb +1 -1
- data/lib/git/multi.rb +2 -1
- data/man/git-multi.1 +551 -0
- data/{doc/git-multi.txt → man/git-multi.erb} +15 -8
- data/man/git-multi.html +1186 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0340c0b46c0dd30d412c7d464b7711449ef2a2b041c0cd5895f674252580d40d
|
4
|
+
data.tar.gz: 557a9f1f15b6548856b983cca3769e75864030fb183efb0363121bd0de98d1c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b252d77f45fb68e3e0fee7bb7d018ed55482cf4ef1aa5596a8936d7096819d7e97e3246fa88fb041f4f4ef27effecf42052b28f21669d6e6e09ab3c3224ba40
|
7
|
+
data.tar.gz: 495fe401b67a606740f87f5d57cf63e7e1366e8dfcc17e17b419438723fa5a8f0238a8fdafd54c200abb45e7c1cb272397d707148450880393157ef20c430f99
|
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
@@ -25,4 +25,25 @@ end
|
|
25
25
|
|
26
26
|
task :default => :test
|
27
27
|
|
28
|
+
task :documentation => 'man/git-multi.txt'
|
29
|
+
|
30
|
+
require 'git/multi'
|
31
|
+
|
32
|
+
def query_args
|
33
|
+
|
34
|
+
client = Git::Hub.send(:client) # Octokit GitHub API client
|
35
|
+
repo = client.repo('git/git') # random GitHub repository
|
36
|
+
|
37
|
+
# instead of maintaining a list of valid query args in the help-
|
38
|
+
# file, we determine it at runtime... less is more, and all that
|
39
|
+
repo.fields.sort.each_slice(3).map { |foo, bar, qux|
|
40
|
+
format('%-20s %-20s %-20s', foo, bar, qux).rstrip
|
41
|
+
}.join("\n ")
|
42
|
+
end
|
43
|
+
|
44
|
+
file 'man/git-multi.txt' => 'man/git-multi.erb' do |task|
|
45
|
+
require 'erb'
|
46
|
+
File.write(task.name, ERB.new(File.read(task.source)).result)
|
47
|
+
end
|
48
|
+
|
28
49
|
# rubocop:enable Style/HashSyntax
|
data/exe/git-multi
CHANGED
@@ -8,6 +8,7 @@ case (command = ARGV.shift)
|
|
8
8
|
when /\A--/
|
9
9
|
case command
|
10
10
|
when '--help' then Git::Multi::Commands.help
|
11
|
+
when '--html' then Git::Multi::Commands.html
|
11
12
|
when '--check' then Git::Multi::Commands.check
|
12
13
|
when '--version' then Git::Multi::Commands.version
|
13
14
|
when '--refresh' then Git::Multi::Commands.refresh
|
data/lib/git/multi/commands.rb
CHANGED
@@ -20,16 +20,11 @@ module Git
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def help
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
29
|
-
puts File.read(Git::Multi::MAN_PAGE) % {
|
30
|
-
:vv => Git::Multi::VERSION,
|
31
|
-
:query_args => query_args.join("\n "),
|
32
|
-
}
|
23
|
+
Kernel.exec "man #{Git::Multi::MAN_PAGE}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def html
|
27
|
+
Kernel.exec "open #{Git::Multi::HTML_PAGE}"
|
33
28
|
end
|
34
29
|
|
35
30
|
def report
|
data/lib/git/multi/version.rb
CHANGED
data/lib/git/multi.rb
CHANGED
@@ -37,7 +37,8 @@ module Git
|
|
37
37
|
USER = git_option('github.user')
|
38
38
|
ORGANIZATIONS = git_option('github.organizations').split(/\s*,\s*/)
|
39
39
|
|
40
|
-
MAN_PAGE = File.expand_path('../../
|
40
|
+
MAN_PAGE = File.expand_path('../../man/git-multi.1', __dir__)
|
41
|
+
HTML_PAGE = File.expand_path('../../man/git-multi.html', __dir__)
|
41
42
|
|
42
43
|
module_function
|
43
44
|
|
data/man/git-multi.1
ADDED
@@ -0,0 +1,551 @@
|
|
1
|
+
'\" t
|
2
|
+
.\" Title: git-multi
|
3
|
+
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
|
4
|
+
.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
|
5
|
+
.\" Date: 09/21/2018
|
6
|
+
.\" Manual: Git Manual
|
7
|
+
.\" Source: Git 2.19.0.216.g2d3b1c576.dirty
|
8
|
+
.\" Language: English
|
9
|
+
.\"
|
10
|
+
.TH "GIT\-MULTI" "1" "09/21/2018" "Git 2\&.19\&.0\&.216\&.g2d3b1c" "Git Manual"
|
11
|
+
.\" -----------------------------------------------------------------
|
12
|
+
.\" * Define some portability stuff
|
13
|
+
.\" -----------------------------------------------------------------
|
14
|
+
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
15
|
+
.\" http://bugs.debian.org/507673
|
16
|
+
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
17
|
+
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
18
|
+
.ie \n(.g .ds Aq \(aq
|
19
|
+
.el .ds Aq '
|
20
|
+
.\" -----------------------------------------------------------------
|
21
|
+
.\" * set default formatting
|
22
|
+
.\" -----------------------------------------------------------------
|
23
|
+
.\" disable hyphenation
|
24
|
+
.nh
|
25
|
+
.\" disable justification (adjust text to left margin only)
|
26
|
+
.ad l
|
27
|
+
.\" -----------------------------------------------------------------
|
28
|
+
.\" * MAIN CONTENT STARTS HERE *
|
29
|
+
.\" -----------------------------------------------------------------
|
30
|
+
.SH "NAME"
|
31
|
+
git-multi \- execute the same git command in multiple repositories
|
32
|
+
.SH "VERSION"
|
33
|
+
.sp
|
34
|
+
This is \fBv1\&.0\&.3\fR of \fIgit multi\fR \&... hooray!
|
35
|
+
.SH "SYNOPSIS"
|
36
|
+
.sp
|
37
|
+
There are some options for \fBgit multi\fR itself, in which case it is invoked as follows:
|
38
|
+
.sp
|
39
|
+
.nf
|
40
|
+
\fIgit multi\fR <dash_dash_option> [<option_arguments>]
|
41
|
+
.fi
|
42
|
+
.sp
|
43
|
+
.sp
|
44
|
+
To execute the same git command in multiple repositories, the invocation is as follows:
|
45
|
+
.sp
|
46
|
+
.nf
|
47
|
+
\fIgit multi\fR <git_command> [<git_command_arguments>]
|
48
|
+
.fi
|
49
|
+
.sp
|
50
|
+
.SH "DESCRIPTION"
|
51
|
+
.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\&.
|
53
|
+
.SH "OPTIONS"
|
54
|
+
.PP
|
55
|
+
\-\-help
|
56
|
+
.RS 4
|
57
|
+
you\(cqre looking at it: show the man page
|
58
|
+
.RE
|
59
|
+
.PP
|
60
|
+
\-\-html
|
61
|
+
.RS 4
|
62
|
+
open the HTML version of the man page
|
63
|
+
.RE
|
64
|
+
.PP
|
65
|
+
\-\-check
|
66
|
+
.RS 4
|
67
|
+
checks all the required settings and configurations
|
68
|
+
.RE
|
69
|
+
.PP
|
70
|
+
\-\-version
|
71
|
+
.RS 4
|
72
|
+
print out this script\(cqs version number
|
73
|
+
.RE
|
74
|
+
.PP
|
75
|
+
\-\-refresh
|
76
|
+
.RS 4
|
77
|
+
refresh the list of user & organization repos
|
78
|
+
.RE
|
79
|
+
.PP
|
80
|
+
\-\-json
|
81
|
+
.RS 4
|
82
|
+
output repository details to JSON
|
83
|
+
.RE
|
84
|
+
.PP
|
85
|
+
\-\-count
|
86
|
+
.RS 4
|
87
|
+
print out the count of repos (per type)
|
88
|
+
.RE
|
89
|
+
.PP
|
90
|
+
\-\-list
|
91
|
+
.RS 4
|
92
|
+
print out the names of all repos
|
93
|
+
.RE
|
94
|
+
.PP
|
95
|
+
\-\-archived
|
96
|
+
.RS 4
|
97
|
+
print out the names of all repos
|
98
|
+
.RE
|
99
|
+
.PP
|
100
|
+
\-\-forked
|
101
|
+
.RS 4
|
102
|
+
print out the names of all repos
|
103
|
+
.RE
|
104
|
+
.PP
|
105
|
+
\-\-private
|
106
|
+
.RS 4
|
107
|
+
print out the names of all repos
|
108
|
+
.RE
|
109
|
+
.PP
|
110
|
+
\-\-paths
|
111
|
+
.RS 4
|
112
|
+
print out the full path for each repos
|
113
|
+
.RE
|
114
|
+
.PP
|
115
|
+
\-\-spurious
|
116
|
+
.RS 4
|
117
|
+
list cloned repos whose remote doesn\(cqt match a github\&.com origin
|
118
|
+
.RE
|
119
|
+
.PP
|
120
|
+
\-\-missing
|
121
|
+
.RS 4
|
122
|
+
print out names of repos that haven\(cqt been cloned
|
123
|
+
.RE
|
124
|
+
.PP
|
125
|
+
\-\-stale
|
126
|
+
.RS 4
|
127
|
+
list repos that have been deleted on github\&.com
|
128
|
+
.RE
|
129
|
+
.PP
|
130
|
+
\-\-excess
|
131
|
+
.RS 4
|
132
|
+
list repos that don\(cqt exist on github\&.com
|
133
|
+
.RE
|
134
|
+
.PP
|
135
|
+
\-\-clone
|
136
|
+
.RS 4
|
137
|
+
clones missing repositories into
|
138
|
+
\fB${HOME}/Workarea\fR
|
139
|
+
(by default)
|
140
|
+
.RE
|
141
|
+
.PP
|
142
|
+
\-\-query (args)
|
143
|
+
.RS 4
|
144
|
+
query GitHub repo metadata for each repository
|
145
|
+
.RE
|
146
|
+
.PP
|
147
|
+
\-\-find <ruby>
|
148
|
+
.RS 4
|
149
|
+
print out the repos for which the Ruby code evaluates to true
|
150
|
+
.RE
|
151
|
+
.PP
|
152
|
+
\-\-eval <ruby>
|
153
|
+
.RS 4
|
154
|
+
execute the given Ruby code in the context of each repo
|
155
|
+
.RE
|
156
|
+
.PP
|
157
|
+
\-\-raw <cmd>
|
158
|
+
.RS 4
|
159
|
+
execute the given shell command inside each git repository
|
160
|
+
.RE
|
161
|
+
.SH "EXAMPLES"
|
162
|
+
.sp
|
163
|
+
count the number of repos
|
164
|
+
.sp
|
165
|
+
.if n \{\
|
166
|
+
.RS 4
|
167
|
+
.\}
|
168
|
+
.nf
|
169
|
+
git multi \-\-list | wc \-l
|
170
|
+
.fi
|
171
|
+
.if n \{\
|
172
|
+
.RE
|
173
|
+
.\}
|
174
|
+
.sp
|
175
|
+
disk usage of each locally cloned repo
|
176
|
+
.sp
|
177
|
+
.if n \{\
|
178
|
+
.RS 4
|
179
|
+
.\}
|
180
|
+
.nf
|
181
|
+
git multi \-\-paths | xargs \-n 1 du \-hs
|
182
|
+
.fi
|
183
|
+
.if n \{\
|
184
|
+
.RE
|
185
|
+
.\}
|
186
|
+
.sp
|
187
|
+
disk usage using the \fB\-\-raw\fR option
|
188
|
+
.sp
|
189
|
+
.if n \{\
|
190
|
+
.RS 4
|
191
|
+
.\}
|
192
|
+
.nf
|
193
|
+
git multi \-\-raw \*(Aqdu \-hs \&.\*(Aq
|
194
|
+
.fi
|
195
|
+
.if n \{\
|
196
|
+
.RE
|
197
|
+
.\}
|
198
|
+
.sp
|
199
|
+
group and count the repos by GitHub\-determined language
|
200
|
+
.sp
|
201
|
+
.if n \{\
|
202
|
+
.RS 4
|
203
|
+
.\}
|
204
|
+
.nf
|
205
|
+
git multi \-\-query language | cut \-f 2 \-d : | sort | uniq \-c | sort \-n \-r
|
206
|
+
.fi
|
207
|
+
.if n \{\
|
208
|
+
.RE
|
209
|
+
.\}
|
210
|
+
.sp
|
211
|
+
find out the most\-used Ruby versions
|
212
|
+
.sp
|
213
|
+
.if n \{\
|
214
|
+
.RS 4
|
215
|
+
.\}
|
216
|
+
.nf
|
217
|
+
git multi \-\-raw \*(Aq[ \-f \&.ruby\-version ] && cat \&.ruby\-version\*(Aq | cut \-f 2 \-d : | sort | uniq \-c | sort \-n \-r
|
218
|
+
.fi
|
219
|
+
.if n \{\
|
220
|
+
.RE
|
221
|
+
.\}
|
222
|
+
.sp
|
223
|
+
find GitHub repos without a description
|
224
|
+
.sp
|
225
|
+
.if n \{\
|
226
|
+
.RS 4
|
227
|
+
.\}
|
228
|
+
.nf
|
229
|
+
git multi \-\-query description | egrep \*(Aq: *$\*(Aq
|
230
|
+
.fi
|
231
|
+
.if n \{\
|
232
|
+
.RE
|
233
|
+
.\}
|
234
|
+
.sp
|
235
|
+
fetch remote branches for all repos
|
236
|
+
.sp
|
237
|
+
.if n \{\
|
238
|
+
.RS 4
|
239
|
+
.\}
|
240
|
+
.nf
|
241
|
+
git multi fetch \-p
|
242
|
+
.fi
|
243
|
+
.if n \{\
|
244
|
+
.RE
|
245
|
+
.\}
|
246
|
+
.sp
|
247
|
+
print out the local branch for each repo
|
248
|
+
.sp
|
249
|
+
.if n \{\
|
250
|
+
.RS 4
|
251
|
+
.\}
|
252
|
+
.nf
|
253
|
+
git multi rev\-parse \-\-abbrev\-ref=strict HEAD
|
254
|
+
.fi
|
255
|
+
.if n \{\
|
256
|
+
.RE
|
257
|
+
.\}
|
258
|
+
.sp
|
259
|
+
find all repos for which the \fIorigin\fR remote isn\(cqt github\&.com
|
260
|
+
.sp
|
261
|
+
.if n \{\
|
262
|
+
.RS 4
|
263
|
+
.\}
|
264
|
+
.nf
|
265
|
+
git multi config \-\-get remote\&.origin\&.url | fgrep \-v git@github\&.com:
|
266
|
+
.fi
|
267
|
+
.if n \{\
|
268
|
+
.RE
|
269
|
+
.\}
|
270
|
+
.sp
|
271
|
+
a kind of "repository creation" report: count the number of repos created in each quarter
|
272
|
+
.sp
|
273
|
+
.if n \{\
|
274
|
+
.RS 4
|
275
|
+
.\}
|
276
|
+
.nf
|
277
|
+
git multi \-\-eval "class ::Time; def quarter() (month\&.to_f / 3\&.0)\&.ceil; end; end; puts format(\*(Aq%d\-Q%d\*(Aq, created_at\&.year, created_at\&.quarter)" | sort | uniq \-c
|
278
|
+
.fi
|
279
|
+
.if n \{\
|
280
|
+
.RE
|
281
|
+
.\}
|
282
|
+
.sp
|
283
|
+
for each repo, list all remote branches, sorted by the "age" of the last commit on each branch
|
284
|
+
.sp
|
285
|
+
.if n \{\
|
286
|
+
.RS 4
|
287
|
+
.\}
|
288
|
+
.nf
|
289
|
+
git multi for\-each\-ref \-\-sort="\-authordate" \-\-format="%(refname)%09%(authordate:relative)%09%(authorname)" refs/remotes/origin
|
290
|
+
.fi
|
291
|
+
.if n \{\
|
292
|
+
.RE
|
293
|
+
.\}
|
294
|
+
.sp
|
295
|
+
same as above, but columnize the generated output (NOTE: replace \fI^I\fR with CTRL\-V/CTRL\-I in your terminal)
|
296
|
+
.sp
|
297
|
+
.if n \{\
|
298
|
+
.RS 4
|
299
|
+
.\}
|
300
|
+
.nf
|
301
|
+
git multi for\-each\-ref \-\-sort="\-authordate" \-\-format="%(refname)%09%(authordate:relative)%09%(authorname)" refs/remotes/origin | column \-t \-s "^I"
|
302
|
+
.fi
|
303
|
+
.if n \{\
|
304
|
+
.RE
|
305
|
+
.\}
|
306
|
+
.sp
|
307
|
+
same as above, but refresh the list of remote branches first
|
308
|
+
.sp
|
309
|
+
.if n \{\
|
310
|
+
.RS 4
|
311
|
+
.\}
|
312
|
+
.nf
|
313
|
+
git multi fetch \-p ; git multi for\-each\-ref \-\-sort="\-authordate" \-\-format="%(refname)%09%(authordate:relative)%09%(authorname)" refs/remotes/origin
|
314
|
+
.fi
|
315
|
+
.if n \{\
|
316
|
+
.RE
|
317
|
+
.\}
|
318
|
+
.sp
|
319
|
+
find all Rails projects
|
320
|
+
.sp
|
321
|
+
.if n \{\
|
322
|
+
.RS 4
|
323
|
+
.\}
|
324
|
+
.nf
|
325
|
+
git multi \-\-raw \*(Aq[ \-f Gemfile ] && fgrep \-q \-l rails Gemfile && echo uses Rails\*(Aq | cat
|
326
|
+
.fi
|
327
|
+
.if n \{\
|
328
|
+
.RE
|
329
|
+
.\}
|
330
|
+
.sp
|
331
|
+
find all Mongoid dependencies
|
332
|
+
.sp
|
333
|
+
.if n \{\
|
334
|
+
.RS 4
|
335
|
+
.\}
|
336
|
+
.nf
|
337
|
+
git multi \-\-raw \*(Aq[ \-f Gemfile\&.lock ] && egrep \-i "^ mongoid (\&.*)" Gemfile\&.lock\*(Aq | column \-s: \-t
|
338
|
+
.fi
|
339
|
+
.if n \{\
|
340
|
+
.RE
|
341
|
+
.\}
|
342
|
+
.sp
|
343
|
+
find all projects that have been pushed to in the last week
|
344
|
+
.sp
|
345
|
+
.if n \{\
|
346
|
+
.RS 4
|
347
|
+
.\}
|
348
|
+
.nf
|
349
|
+
git multi \-\-find \*(Aq((Time\&.now \- pushed_at) / 60 / 60 / 24) <= 7\*(Aq
|
350
|
+
.fi
|
351
|
+
.if n \{\
|
352
|
+
.RE
|
353
|
+
.\}
|
354
|
+
.sp
|
355
|
+
print out the number of days since the last push to each repository
|
356
|
+
.sp
|
357
|
+
.if n \{\
|
358
|
+
.RS 4
|
359
|
+
.\}
|
360
|
+
.nf
|
361
|
+
git multi \-\-eval \*(Aqputs "%d days" % ((Time\&.now \- pushed_at) / 60 / 60 / 24)\*(Aq
|
362
|
+
.fi
|
363
|
+
.if n \{\
|
364
|
+
.RE
|
365
|
+
.\}
|
366
|
+
.sp
|
367
|
+
find all projects that have seen activity this calendar year
|
368
|
+
.sp
|
369
|
+
.if n \{\
|
370
|
+
.RS 4
|
371
|
+
.\}
|
372
|
+
.nf
|
373
|
+
git multi \-\-find \*(Aqpushed_at >= Date\&.civil(Date\&.today\&.year, 1, 1)\&.to_time\*(Aq
|
374
|
+
.fi
|
375
|
+
.if n \{\
|
376
|
+
.RE
|
377
|
+
.\}
|
378
|
+
.sp
|
379
|
+
print out all webhooks
|
380
|
+
.sp
|
381
|
+
.if n \{\
|
382
|
+
.RS 4
|
383
|
+
.\}
|
384
|
+
.nf
|
385
|
+
git multi \-\-eval \*(Aq(hooks = client\&.hooks(project\&.full_name))\&.any? && begin print project\&.full_name ; print "\et" ; puts hooks\&.map { |hook| ["", hook\&.name, hook\&.config\&.url]\&.join("\et") } ; end\*(Aq
|
386
|
+
.fi
|
387
|
+
.if n \{\
|
388
|
+
.RE
|
389
|
+
.\}
|
390
|
+
.sp
|
391
|
+
print out all deploy keys
|
392
|
+
.sp
|
393
|
+
.if n \{\
|
394
|
+
.RS 4
|
395
|
+
.\}
|
396
|
+
.nf
|
397
|
+
git multi \-\-eval \*(Aq(keys = client\&.list_deploy_keys(project\&.full_name))\&.any? && begin print project\&.full_name ; print "\et" ; puts keys\&.map(&:title)\&.sort\&.join("\et") ; end\*(Aq
|
398
|
+
.fi
|
399
|
+
.if n \{\
|
400
|
+
.RE
|
401
|
+
.\}
|
402
|
+
.sp
|
403
|
+
find all organization repositories that depend on a given org repo, e\&.g\&. \fIbusiness_rules\fR
|
404
|
+
.sp
|
405
|
+
.if n \{\
|
406
|
+
.RS 4
|
407
|
+
.\}
|
408
|
+
.nf
|
409
|
+
git multi \-\-graph | fgrep business_rules
|
410
|
+
.fi
|
411
|
+
.if n \{\
|
412
|
+
.RE
|
413
|
+
.\}
|
414
|
+
.sp
|
415
|
+
generate a dependency graph of all organization repositories using yuml\&.me
|
416
|
+
.sp
|
417
|
+
.if n \{\
|
418
|
+
.RS 4
|
419
|
+
.\}
|
420
|
+
.nf
|
421
|
+
DEPENDENCIES=$( git multi \-\-graph | ruby \-n \-e \*(Aqparent, children = $_\&.split(": ") ; puts children\&.split(" ")\&.map { |child| "[#{parent}]\->[#{child}]" }\*(Aq | tr \*(Aq\en\*(Aq \*(Aq,\*(Aq ) ; open "http://yuml\&.me/diagram/scruffy/class/${DEPENDENCIES}"
|
422
|
+
.fi
|
423
|
+
.if n \{\
|
424
|
+
.RE
|
425
|
+
.\}
|
426
|
+
.sp
|
427
|
+
generate a dependency graph of all organization repositories using Graphviz
|
428
|
+
.sp
|
429
|
+
.if n \{\
|
430
|
+
.RS 4
|
431
|
+
.\}
|
432
|
+
.nf
|
433
|
+
git multi \-\-graph | ruby \-n \-e \*(Aqparent, children = $_\&.split(": ") ; puts children\&.split(" ")\&.map { |child| "\e"#{parent}\e"\->\e"#{child}\e";" }\*(Aq | awk \*(AqBEGIN { print "digraph {\enrankdir=\e"LR\e";\en" } ; { print ; } END { print "}\en" } ; \*(Aq | dot \-Tpng > /tmp/ghor\&.png ; open \-a Preview /tmp/ghor\&.png
|
434
|
+
.fi
|
435
|
+
.if n \{\
|
436
|
+
.RE
|
437
|
+
.\}
|
438
|
+
.SH "QUERY ARGUMENTS"
|
439
|
+
.sp
|
440
|
+
The following is a list of valid arguments for the \fBgit multi \-\-query\fR option:
|
441
|
+
.sp
|
442
|
+
.if n \{\
|
443
|
+
.RS 4
|
444
|
+
.\}
|
445
|
+
.nf
|
446
|
+
archive_url archived assignees_url
|
447
|
+
blobs_url branches_url clone_url
|
448
|
+
collaborators_url comments_url commits_url
|
449
|
+
compare_url contents_url contributors_url
|
450
|
+
created_at default_branch deployments_url
|
451
|
+
description downloads_url events_url
|
452
|
+
fork forks forks_count
|
453
|
+
forks_url full_name git_commits_url
|
454
|
+
git_refs_url git_tags_url git_url
|
455
|
+
has_downloads has_issues has_pages
|
456
|
+
has_projects has_wiki homepage
|
457
|
+
hooks_url html_url id
|
458
|
+
issue_comment_url issue_events_url issues_url
|
459
|
+
keys_url labels_url language
|
460
|
+
languages_url license merges_url
|
461
|
+
milestones_url mirror_url name
|
462
|
+
network_count node_id notifications_url
|
463
|
+
open_issues open_issues_count organization
|
464
|
+
owner permissions private
|
465
|
+
pulls_url pushed_at releases_url
|
466
|
+
size ssh_url stargazers_count
|
467
|
+
stargazers_url statuses_url subscribers_count
|
468
|
+
subscribers_url subscription_url svn_url
|
469
|
+
tags_url teams_url trees_url
|
470
|
+
updated_at url watchers
|
471
|
+
watchers_count
|
472
|
+
.fi
|
473
|
+
.if n \{\
|
474
|
+
.RE
|
475
|
+
.\}
|
476
|
+
.SH "JQ INTEGRATION"
|
477
|
+
.sp
|
478
|
+
\fBjq\fR is like \fBsed\fR for JSON data\&... all of the above query arguments can be used in conjunction with \fBjq\fR to query, filter, map and transform the GitHub repository attributes stored in the local, binary repository cache; here are some examples:
|
479
|
+
.sp
|
480
|
+
.if n \{\
|
481
|
+
.RS 4
|
482
|
+
.\}
|
483
|
+
.nf
|
484
|
+
# print out each repository\*(Aqs name and its description
|
485
|
+
git multi \-\-json | jq \*(Aq\&.[] | \&.name + ": " + \&.description\*(Aq
|
486
|
+
.fi
|
487
|
+
.if n \{\
|
488
|
+
.RE
|
489
|
+
.\}
|
490
|
+
.sp
|
491
|
+
.if n \{\
|
492
|
+
.RS 4
|
493
|
+
.\}
|
494
|
+
.nf
|
495
|
+
# print out the name of all "forked" repositories
|
496
|
+
git multi \-\-json | jq \*(Aq\&.[] | select(\&.fork == true) | \&.full_name\*(Aq
|
497
|
+
.fi
|
498
|
+
.if n \{\
|
499
|
+
.RE
|
500
|
+
.\}
|
501
|
+
.SH "FILES"
|
502
|
+
.PP
|
503
|
+
\fB${HOME}/Workarea\fR
|
504
|
+
.RS 4
|
505
|
+
root directory where repos will been cloned
|
506
|
+
.RE
|
507
|
+
.PP
|
508
|
+
\fB${HOME}/\&.git/multi/repositories\&.byte\fR
|
509
|
+
.RS 4
|
510
|
+
local, binary cache of GitHub repository metadata
|
511
|
+
.RE
|
512
|
+
.SH "REFERENCES"
|
513
|
+
.sp
|
514
|
+
.RS 4
|
515
|
+
.ie n \{\
|
516
|
+
\h'-04'\(bu\h'+03'\c
|
517
|
+
.\}
|
518
|
+
.el \{\
|
519
|
+
.sp -1
|
520
|
+
.IP \(bu 2.3
|
521
|
+
.\}
|
522
|
+
homepage for
|
523
|
+
\fBgit\-multi\fR:
|
524
|
+
\m[blue]\fBhttps://github\&.com/pvdb/git\-multi\fR\m[]
|
525
|
+
.RE
|
526
|
+
.sp
|
527
|
+
.RS 4
|
528
|
+
.ie n \{\
|
529
|
+
\h'-04'\(bu\h'+03'\c
|
530
|
+
.\}
|
531
|
+
.el \{\
|
532
|
+
.sp -1
|
533
|
+
.IP \(bu 2.3
|
534
|
+
.\}
|
535
|
+
the GitHub API:
|
536
|
+
\m[blue]\fBhttps://developer\&.github\&.com/v3/\fR\m[]
|
537
|
+
.RE
|
538
|
+
.sp
|
539
|
+
.RS 4
|
540
|
+
.ie n \{\
|
541
|
+
\h'-04'\(bu\h'+03'\c
|
542
|
+
.\}
|
543
|
+
.el \{\
|
544
|
+
.sp -1
|
545
|
+
.IP \(bu 2.3
|
546
|
+
.\}
|
547
|
+
the
|
548
|
+
\fBjq\fR
|
549
|
+
command\-line utility:
|
550
|
+
\m[blue]\fBhttp://stedolan\&.github\&.io/jq/\fR\m[]
|
551
|
+
.RE
|