PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, March 8, 2022

[FIXED] Can composer display git commits while in stable mode?

 March 08, 2022     composer-php, git-commit, updates, version     No comments   

Issue

When running composer update -v in a project with "minimum-stability": "dev", we can see the latest commits to the package being updated:

composer update -v
...
Extracting archive  - Updating organization/project (v1.0.0 => v1.0.1):  Checking out hash3
    Pulling in changes:
      hash3 - Contributor #1: Improve service
      hash2 - Contributor #2: Improve SQL query
      hash1 - Contributor #3: Hotfix service

This is helpful because it gives us some hints on what code was changed.

However, now that our project is in "minimum-stability": "stable" mode, when running composer update -v, we can no longer see the latest commits to the package being updated:

composer update -v
...
Updates: organization/project:v1.0.2
 - Updating organization/project (v1.0.1 => v1.0.2): Downloading (100%)

No git commits are shown. We have tried using composer update -vv and composer update -vvv to no avail.

Therefore, is it possible to still show git commits when updating a package while in stable mode?


Solution

One possible solution is to delete all installed packages in the /vendor directory, and then re-install them using:

composer install --prefer-source

All of the same packages will be installed along with their respective .git directories.

Then, the next time you run

composer update -v

since the .git directory exists for each package, you will see the latest commits that are pulled in.

However, this solution would not work in a production environment in which deleting files in the /vendor directory, even temporarily, would not be an option.



Answered By - Leo Galleguillos
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing