git-multi 6.0.0 → 7.0.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: f9c0aa5b5dc19107281de9fe6c8dae2d956f77954b7f645f70102d2d693a69bd
4
- data.tar.gz: b5033965b46ce4c2d4a7d781d3e1efa55a6b3f87f63563fde4e913461bcac1f1
3
+ metadata.gz: 0124014ecd67cbda989511455a0a46878a40365660a613337c87b35813a48af8
4
+ data.tar.gz: 46971c1b9b60f26a13eb67453d5ab0f9e88bbcf795ed6709b26b6511d8c341c4
5
5
  SHA512:
6
- metadata.gz: f76f76d736d13581e3a280118a4ec112cfeb8239a0ebb91d708ad22704b384d5ee0b85e1cd231af76e536ce0903953eaafc7d04e45073606d32b0f3d2ac6dd3a
7
- data.tar.gz: 8b1fb3fe50001711983dbc9e998af763a6d5c8c57cdea814bb7bc2d5e7a1828e5291d0f0630f3cd69b30140334091fd318708fe2099bb50639f32d79c2303bbd
6
+ metadata.gz: f9061a4c54c89b1eb6ad29949e0c72c6d4d2aadce7e37e498cfc5b2ecd8cbd769685e81d9f188b9d12aea30079d7fbb71944de86a6910a66f2734a074a807eea
7
+ data.tar.gz: 58c513e28b65dcd040b8ac1bf29c62c7130dcf848f0f106db2052ff7578381260b30c4f182c30ba61b4f819cb0a55fd72c9c8773a8a5d08dd3d48b5b93e65f2f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-multi (6.0.0)
4
+ git-multi (7.0.0)
5
5
  faraday (~> 1)
6
6
  octokit (~> 4)
7
7
 
@@ -7,8 +7,8 @@ module Git
7
7
  value.empty? && default ? default : value
8
8
  end
9
9
 
10
- def full_names_for(superproject)
11
- list = `git config --get-all superproject.#{superproject}.repo`
10
+ def global_options(name)
11
+ list = `git config --global --get-all #{name}`
12
12
  list.split($RS).map(&:strip).map(&:freeze)
13
13
  end
14
14
 
@@ -22,8 +22,7 @@ module Git
22
22
  end
23
23
 
24
24
  def env_var(name, default = nil)
25
- value = ENV[name]
26
- (value.nil? || value.empty?) && default ? default : value
25
+ ENV.fetch(name, default)
27
26
  end
28
27
  end
29
28
  end
@@ -16,6 +16,13 @@ module Git
16
16
 
17
17
  \tgit config --global --add \033[1mgit.multi.workarea\033[0m <your_root_workarea>
18
18
 
19
+ You can specify a list of user or organization repositories to ignore:
20
+
21
+ \tgit config --global --add \033[1mgit.multi.exclude\033[0m <org_name>/<repo_name>
22
+ \tgit config --global --add \033[1mgit.multi.exclude\033[0m <user_name>/<repo_name>
23
+
24
+ (can be used multiple times to exclude multiple user or organization repositories)
25
+
19
26
  Thanks for using \033[1mgit multi\033[0m ... the ultimate multi-repo utility for git!
20
27
 
21
28
  PIM
@@ -35,6 +35,9 @@ module Git
35
35
  Git::Multi.missing_repositories_for(owner).each do |missing|
36
36
  setting_status(["\tmissing", missing.full_name], valid: false, optional: false)
37
37
  end
38
+ Git::Multi.excluded_repositories_for(owner).each do |excluded|
39
+ setting_status(["\texcluded", excluded.full_name], valid: false, optional: false)
40
+ end
38
41
  setting_status(["\tsubdirs", subdir_count, "(#{surplus_count} surplus)"])
39
42
  end
40
43
 
@@ -44,7 +47,7 @@ module Git
44
47
  if github_count.zero?
45
48
  setting_status([message, 'listed but not configured'], valid: false, optional: false)
46
49
  else
47
- setting_status([message], true)
50
+ setting_status([message], valid: true)
48
51
  Git::Multi.repositories_for(superproject).each do |repo|
49
52
  if File.directory? repo.local_path
50
53
  setting_status(["\tcloned ", repo.full_name], valid: true)
@@ -1,7 +1,7 @@
1
1
  module Git
2
2
  module Multi
3
3
  NAME = 'git-multi'.freeze
4
- VERSION = '6.0.0'.freeze
4
+ VERSION = '7.0.0'.freeze
5
5
 
6
6
  def self.version
7
7
  "#{NAME} v#{VERSION}"
data/lib/git/multi.rb CHANGED
@@ -36,9 +36,6 @@ module Git
36
36
  TOKEN = global_option('github.token', DEFAULT_TOKEN)
37
37
 
38
38
  GIT_MULTI_DIR = File.join(HOME, '.git', 'multi')
39
-
40
- FileUtils.mkdir_p(GIT_MULTI_DIR) # ensure `~/.git/multi` directory exists
41
-
42
39
  GITHUB_CACHE = File.join(GIT_MULTI_DIR, 'repositories.byte')
43
40
 
44
41
  USERS = global_list('git.multi.users')
@@ -46,6 +43,7 @@ module Git
46
43
  SUPERPROJECTS = global_list('git.multi.superprojects')
47
44
 
48
45
  MULTI_REPOS = (USERS + ORGANIZATIONS + SUPERPROJECTS)
46
+ EXCLUDED_REPOS = global_options('git.multi.exclude')
49
47
 
50
48
  MAN_PAGE = File.expand_path('../../man/git-multi.1', __dir__)
51
49
  HTML_PAGE = File.expand_path('../../man/git-multi.html', __dir__)
@@ -129,6 +127,9 @@ module Git
129
127
  #
130
128
 
131
129
  def refresh_repositories
130
+ # ensure `~/.git/multi` directory exists
131
+ FileUtils.mkdir_p(GIT_MULTI_DIR)
132
+
132
133
  File.open(GITHUB_CACHE, 'wb') do |file|
133
134
  Marshal.dump(github_repositories, file)
134
135
  end
@@ -194,6 +195,8 @@ module Git
194
195
  repo.parent_dir = Pathname.new(File.join(WORKAREA, repo.owner.login))
195
196
  repo.local_path = Pathname.new(File.join(WORKAREA, repo.full_name))
196
197
  repo.fractional_index = "#{index + 1}/#{repos.count}"
198
+ # git multi will "hard ignore" all excluded repos
199
+ repo.excluded = EXCLUDED_REPOS.include?(repo.full_name)
197
200
  # fix 'repo' => https://github.com/octokit/octokit.rb/issues/727
198
201
  repo.compliant_ssh_url = "ssh://#{repo.ssh_url.split(':', 2).join('/')}"
199
202
  # remove optional '.git' suffix from 'git@github.com:pvdb/git-multi.git'
@@ -213,7 +216,11 @@ module Git
213
216
  # lists of repos for a given multi-repo
214
217
  #
215
218
 
216
- def repositories_for(multi_repo = nil)
219
+ def full_names_for(superproject)
220
+ global_options("superproject.#{superproject}.repo")
221
+ end
222
+
223
+ def all_repositories_for(multi_repo = nil)
217
224
  case (owner = superproject = full_names = multi_repo)
218
225
  when nil
219
226
  repositories # all of them
@@ -226,26 +233,34 @@ module Git
226
233
  repository.owner.login == owner
227
234
  }
228
235
  when *SUPERPROJECTS
229
- repositories_for(full_names_for(superproject))
236
+ all_repositories_for(full_names_for(superproject))
230
237
  else
231
238
  raise ArgumentError, multi_repo
232
239
  end
233
240
  end
234
241
 
242
+ def repositories_for(multi_repo = nil)
243
+ all_repositories_for(multi_repo).delete_if(&:excluded)
244
+ end
245
+
235
246
  #
236
247
  # lists of repositories with a given state
237
248
  #
238
249
 
239
250
  def archived_repositories_for(multi_repo = nil)
240
- repositories_for(multi_repo).find_all(&:archived)
251
+ all_repositories_for(multi_repo).find_all(&:archived)
241
252
  end
242
253
 
243
254
  def forked_repositories_for(multi_repo = nil)
244
- repositories_for(multi_repo).find_all(&:fork)
255
+ all_repositories_for(multi_repo).find_all(&:fork)
245
256
  end
246
257
 
247
258
  def private_repositories_for(multi_repo = nil)
248
- repositories_for(multi_repo).find_all(&:private)
259
+ all_repositories_for(multi_repo).find_all(&:private)
260
+ end
261
+
262
+ def excluded_repositories_for(multi_repo = nil)
263
+ all_repositories_for(multi_repo).find_all(&:excluded)
249
264
  end
250
265
 
251
266
  #
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 \fBv6\&.0\&.0\fR of \fIgit multi\fR \&... hooray!
34
+ This is \fBv7\&.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:
@@ -585,11 +585,6 @@ root directory where repos will been cloned
585
585
  .RS 4
586
586
  local, binary cache of GitHub repository metadata
587
587
  .RE
588
- .PP
589
- \fB${HOME}/\&.git/multi/superprojects\&.config\fR
590
- .RS 4
591
- definitions for so\-called "superproject" multi\-repos
592
- .RE
593
588
  .SH "REFERENCES"
594
589
  .sp
595
590
  .RS 4
data/man/git-multi.erb CHANGED
@@ -268,9 +268,6 @@ FILES
268
268
  `${HOME}/.git/multi/repositories.byte`::
269
269
  local, binary cache of GitHub repository metadata
270
270
 
271
- `${HOME}/.git/multi/superprojects.config`::
272
- definitions for so-called "superproject" multi-repos
273
-
274
271
  REFERENCES
275
272
  ----------
276
273
 
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>v6.0.0</code> of <em>git multi</em> &#8230; hooray!</p></div>
751
+ <div class="paragraph"><p>This is <code>v7.0.0</code> of <em>git multi</em> &#8230; hooray!</p></div>
752
752
  </div>
753
753
  </div>
754
754
  <div class="sect1">
@@ -1200,14 +1200,6 @@ git multi ++&lt;multi_repo&gt; --find 'language == "Ruby"' | git multi --raw 'ca
1200
1200
  local, binary cache of GitHub repository metadata
1201
1201
  </p>
1202
1202
  </dd>
1203
- <dt class="hdlist1">
1204
- <code>${HOME}/.git/multi/superprojects.config</code>
1205
- </dt>
1206
- <dd>
1207
- <p>
1208
- definitions for so-called "superproject" multi-repos
1209
- </p>
1210
- </dd>
1211
1203
  </dl></div>
1212
1204
  </div>
1213
1205
  </div>
@@ -1241,7 +1233,7 @@ the <code>jq</code> command-line utility:
1241
1233
  <div id="footer">
1242
1234
  <div id="footer-text">
1243
1235
  Last updated
1244
- 2022-02-02 12:24:05 GMT
1236
+ 2022-02-02 17:29:17 GMT
1245
1237
  </div>
1246
1238
  </div>
1247
1239
  </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: 6.0.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
@@ -204,7 +204,11 @@ post_install_message: "\nThe only required setting for \e[1mgit multi\e[0m is:\n
204
204
  config --global --add \e[1mgit.multi.users\e[0m <list_of_github_users>\n\tgit config
205
205
  --global --add \e[1mgit.multi.organizations\e[0m <list_of_github_orgs>\n\nUnless
206
206
  your top-level workarea is `${HOME}/Workarea` you should also set:\n\n\tgit config
207
- --global --add \e[1mgit.multi.workarea\e[0m <your_root_workarea>\n\nThanks for using
207
+ --global --add \e[1mgit.multi.workarea\e[0m <your_root_workarea>\n\nYou can specify
208
+ a list of user or organization repositories to ignore:\n\n\tgit config --global
209
+ --add \e[1mgit.multi.exclude\e[0m <org_name>/<repo_name>\n\tgit config --global
210
+ --add \e[1mgit.multi.exclude\e[0m <user_name>/<repo_name>\n\n(can be used multiple
211
+ times to exclude multiple user or organization repositories)\n\nThanks for using
208
212
  \e[1mgit multi\e[0m ... the ultimate multi-repo utility for git!\n\n"
209
213
  rdoc_options: []
210
214
  require_paths: