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

Install/archive: improve error message if commit was deleted #10484

Closed
glaubinix opened this issue Jan 26, 2022 · 0 comments
Closed

Install/archive: improve error message if commit was deleted #10484

glaubinix opened this issue Jan 26, 2022 · 0 comments
Labels
Milestone

Comments

@glaubinix
Copy link
Contributor

It happens that commits get removed from VCS repositories, e.g. force push, maintainers delete and recreate tags, resulting in the error output below

composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 1 install, 0 updates, 0 removals
  - Downloading psr/log (3.0.0)
    Failed to download psr/log from dist: The "https://codeload.github.com/php-fig/log/legacy.zip/fe5ea303b0887d5caefd3d431c3e61ad47037002" file could not be downloaded (HTTP/2 404 )
    Now trying to download from source
  - Syncing psr/log (3.0.0) into cache
  - Installing psr/log (3.0.0): Cloning fe5ea303b0
    fe5ea303b0887d5caefd3d431c3e61ad47037002 is gone (history was rewritten?)
    Install of psr/log failed


  [RuntimeException]
  Failed to execute git checkout 'fe5ea303b0887d5caefd3d431c3e61ad47037002' -- && git reset --hard 'fe5ea303b0887d5caefd3d431c3e61ad
  47037002' --

  fatal: reference is not a tree: fe5ea303b0887d5caefd3d431c3e61ad47037002

This already says that the issue might be that the history was rewritten and the commit was not found in the repository. For users, it could be helpful to have a hint at how they can resolve the issue in their project. Maybe something like below?

Looks like the commit hash is not available in the repository, maybe (the tag got recreated|the comit was removed from the branch)? Run composer update package/name to resolve this```
@Seldaek Seldaek added this to the 2.2 milestone Feb 2, 2022
@Seldaek Seldaek added the Bug label Feb 3, 2022
@Seldaek Seldaek closed this as completed in e7c04e3 Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants