Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 114accc

Browse files
committed
Remove remote ecosystem logic
1 parent d2d5e87 commit 114accc

File tree

4 files changed

+7
-60
lines changed

4 files changed

+7
-60
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,7 @@ Optimizations:
429429

430430
git-pkgs uses [ecosystems-bibliothecary](https://github.com/ecosyste-ms/bibliothecary) for parsing, supporting:
431431

432-
Actions, BentoML, Bower, Cargo, CocoaPods, Cog, Conda, CPAN, CRAN, Docker, Dub, DVC, Elm, Go, Haxelib, Homebrew, Julia, Maven, Meteor, MLflow, npm, NuGet, Ollama, Packagist, Pub, PyPI, RubyGems, Shards, Vcpkg
433-
434-
Some ecosystems require remote parsing services and are disabled by default: Carthage, Clojars, Hackage, Hex, SwiftPM. Enable with `git config --add pkgs.ecosystems <name>`.
432+
Actions, BentoML, Bower, Cargo, Carthage, Clojars, CocoaPods, Cog, Conda, CPAN, CRAN, Docker, Dub, DVC, Elm, Go, Hackage, Haxelib, Hex, Homebrew, Julia, Maven, Meteor, MLflow, npm, NuGet, Ollama, Packagist, Pub, PyPI, RubyGems, Shards, SwiftPM, Vcpkg
435433

436434
SBOM formats (CycloneDX, SPDX) are not supported as they duplicate information from the actual lockfiles.
437435

lib/git/pkgs/commands/info.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ def output_ecosystems
102102

103103
all_ecosystems.each do |eco|
104104
if Config.filter_ecosystem?(eco)
105-
remote = Config.remote_ecosystem?(eco)
106-
disabled_ecos << { name: eco, remote: remote }
105+
disabled_ecos << eco
107106
else
108107
enabled_ecos << eco
109108
end
@@ -119,10 +118,7 @@ def output_ecosystems
119118
puts
120119
puts "Disabled:"
121120
if disabled_ecos.any?
122-
disabled_ecos.each do |eco|
123-
suffix = eco[:remote] ? " (remote)" : ""
124-
puts " #{eco[:name]}#{suffix}"
125-
end
121+
disabled_ecos.each { |eco| puts " #{eco}" }
126122
else
127123
puts " (none)"
128124
end
@@ -131,9 +127,8 @@ def output_ecosystems
131127
if filtering
132128
puts "Filtering: only #{configured.join(', ')}"
133129
else
134-
puts "All local ecosystems enabled"
130+
puts "All ecosystems enabled"
135131
end
136-
puts "Remote ecosystems require explicit opt-in"
137132
puts "Configure with: git config --add pkgs.ecosystems <name>"
138133
end
139134

lib/git/pkgs/config.rb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
module Git
66
module Pkgs
77
module Config
8-
# Ecosystems that require remote parsing services - disabled by default
9-
REMOTE_ECOSYSTEMS = %w[carthage clojars hackage hex swiftpm].freeze
10-
118
# File patterns ignored by default (SBOM formats not supported)
129
DEFAULT_IGNORED_FILES = %w[
1310
cyclonedx.xml
@@ -41,24 +38,12 @@ def self.configure_bibliothecary
4138
end
4239

4340
def self.filter_ecosystem?(platform)
44-
platform_lower = platform.to_s.downcase
45-
46-
# Remote ecosystems are disabled unless explicitly enabled
47-
if REMOTE_ECOSYSTEMS.include?(platform_lower)
48-
return !ecosystems.map(&:downcase).include?(platform_lower)
49-
end
50-
51-
# If no filter configured, allow all non-remote ecosystems
5241
return false if ecosystems.empty?
5342

54-
# Otherwise, only allow explicitly listed ecosystems
43+
platform_lower = platform.to_s.downcase
5544
!ecosystems.map(&:downcase).include?(platform_lower)
5645
end
5746

58-
def self.remote_ecosystem?(platform)
59-
REMOTE_ECOSYSTEMS.include?(platform.to_s.downcase)
60-
end
61-
6247
def self.reset!
6348
@ignored_dirs = nil
6449
@ignored_files = nil

test/git/pkgs/test_config.rb

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,12 @@ def test_ecosystems_returns_configured_values
6262
end
6363
end
6464

65-
def test_filter_ecosystem_returns_false_for_local_when_no_ecosystems_configured
65+
def test_filter_ecosystem_returns_false_when_no_ecosystems_configured
6666
Dir.chdir(@test_dir) do
6767
refute Git::Pkgs::Config.filter_ecosystem?("rubygems")
6868
refute Git::Pkgs::Config.filter_ecosystem?("npm")
69-
end
70-
end
71-
72-
def test_filter_ecosystem_returns_true_for_remote_when_no_ecosystems_configured
73-
Dir.chdir(@test_dir) do
74-
assert Git::Pkgs::Config.filter_ecosystem?("carthage")
75-
assert Git::Pkgs::Config.filter_ecosystem?("clojars")
76-
assert Git::Pkgs::Config.filter_ecosystem?("hackage")
77-
assert Git::Pkgs::Config.filter_ecosystem?("hex")
78-
assert Git::Pkgs::Config.filter_ecosystem?("swiftpm")
79-
end
80-
end
81-
82-
def test_filter_ecosystem_allows_remote_when_explicitly_enabled
83-
Dir.chdir(@test_dir) do
84-
system("git config --add pkgs.ecosystems carthage", out: File::NULL)
85-
Git::Pkgs::Config.reset!
86-
8769
refute Git::Pkgs::Config.filter_ecosystem?("carthage")
70+
refute Git::Pkgs::Config.filter_ecosystem?("hex")
8871
end
8972
end
9073

@@ -119,20 +102,6 @@ def test_filter_ecosystem_is_case_insensitive
119102
end
120103
end
121104

122-
def test_remote_ecosystem_returns_true_for_remote_ecosystems
123-
assert Git::Pkgs::Config.remote_ecosystem?("carthage")
124-
assert Git::Pkgs::Config.remote_ecosystem?("clojars")
125-
assert Git::Pkgs::Config.remote_ecosystem?("hackage")
126-
assert Git::Pkgs::Config.remote_ecosystem?("hex")
127-
assert Git::Pkgs::Config.remote_ecosystem?("swiftpm")
128-
end
129-
130-
def test_remote_ecosystem_returns_false_for_local_ecosystems
131-
refute Git::Pkgs::Config.remote_ecosystem?("rubygems")
132-
refute Git::Pkgs::Config.remote_ecosystem?("npm")
133-
refute Git::Pkgs::Config.remote_ecosystem?("pypi")
134-
end
135-
136105
def test_configure_bibliothecary_adds_ignored_dirs
137106
Dir.chdir(@test_dir) do
138107
system("git config --add pkgs.ignoredDirs my_vendor", out: File::NULL)

0 commit comments

Comments
 (0)