Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to the 'show' command to show the source repository #11733

Closed
joachim-n opened this issue Nov 28, 2023 · 2 comments · Fixed by #11763
Closed

Add an option to the 'show' command to show the source repository #11733

joachim-n opened this issue Nov 28, 2023 · 2 comments · Fixed by #11763
Labels
Milestone

Comments

@joachim-n
Copy link

When working with a project which has multiple Composer repositories, it would be useful to be able to get an overview of which packages come from where.

AFAICT the show command doesn't have this option. It would be useful to add:

  • an option to show a column with the package repository
  • an option to show only the packages from a particular repository
@joachim-n
Copy link
Author

In the meantime, this gives some idea, though it shows where the code comes from rather than the package repository - e.g. most things on packagist.org have their source on github. But some further judicious filtering could for example show things from a private packagist:

composer show -N | xargs -I % composer show % | ag 'dist |name '

It's very slow though!

@Seldaek
Copy link
Member

Seldaek commented Dec 19, 2023

The problem is once the package is installed we do not really know where it came from. We'd have to resolve this from composer.json, but we cannot give you the info for what is already installed or what is in the lock file.

What I can think of to surface this information is to do it in very verbose (-vv) updates, then you can get the full info by deleting the lock file and doing an update --no-install --dry-run even if you rather not touch disk:

Lock file operations: 0 installs, 2 updates, 0 removals
Updates: composer/ca-bundle:1.4.0, seld/jsonlint:1.10.1
  - Upgrading composer/ca-bundle (1.3.7 => 1.4.0) from composer repo (https://repo.packagist.org)
  - Upgrading seld/jsonlint (1.10.0 => 1.10.1) from composer repo (https://repo.packagist.org)
Installing dependencies from lock file (including require-dev)

See #11763

@Seldaek Seldaek added this to the 2.7 milestone Dec 19, 2023
Seldaek added a commit to Seldaek/composer that referenced this issue Dec 19, 2023
Seldaek added a commit to Seldaek/composer that referenced this issue Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@joachim-n @Seldaek and others