/composer-lock-diff

See what has changed after a composer update

Primary LanguagePHPMIT LicenseMIT

composer-lock-diff

See what packages have changed after you run composer update by comparing composer.lock to the the git HEAD.

Requires:

  • php >= 5.3

There are no other dependencies.

Install

composer global require davidrjonas/composer-lock-diff:^1.0@dev

Or just copy the 'composer-lock-diff' to /usr/local/bin.

Usage

composer update
# don't commit yet!
composer-lock-diff

Or from vim, to insert the output into the commit message, type :r!composer-lock-diff.

Options

  • --path, -p: Base to with which to prefix paths. Default "./"
  • --from: The file^, git ref, or git ref with filename to compare from (HEAD:composer.lock)
  • --to: The file^, git ref, or git ref with filename to compare to (composer.lock)
  • --md: Markdown table output
  • --json: json output
  • --pretty: pretty output when combined with --json (>=5.4 only)
  • --no-links: Don't include Compare links in plain text or any links in markdown

^ File includes anything available as a protocol stream wrapper such as URLs.

Example Plain Text Table Output

+--------------------+-------+--------+------------------------------------------------------------------+
| Production Changes | From  | To     | Compare                                                          |
+--------------------+-------+--------+------------------------------------------------------------------+
| guzzlehttp/guzzle  | 6.2.0 | 6.3.0  | https://github.com/guzzle/guzzle/compare/6.2.0...6.3.0           |
| hashids/hashids    | 2.0.0 | 2.0.4  | https://github.com/ivanakimov/hashids.php/compare/2.0.0...2.0.4  |
| league/flysystem   | 1.0.0 | 1.0.42 | https://github.com/thephpleague/flysystem/compare/1.0.0...1.0.42 |
| monolog/monolog    | NEW   | 1.21.0 |                                                                  |
+--------------------+-------+--------+------------------------------------------------------------------+

+------------------+--------+---------+---------+
| Dev Changes      | From   | To      | Compare |
+------------------+--------+---------+---------+
| phpspec/php-diff | v1.0.2 | REMOVED |         |
+------------------+--------+---------+---------+

Markdown Table

Raw

| Production Changes | From  | To     | Compare                                                                 |
|--------------------|-------|--------|-------------------------------------------------------------------------|
| guzzlehttp/guzzle  | 6.2.0 | 6.3.0  | [...](https://github.com/guzzle/guzzle/compare/6.2.0...6.3.0)           |
| hashids/hashids    | 2.0.0 | 2.0.4  | [...](https://github.com/ivanakimov/hashids.php/compare/2.0.0...2.0.4)  |
| league/flysystem   | 1.0.0 | 1.0.42 | [...](https://github.com/thephpleague/flysystem/compare/1.0.0...1.0.42) |
| monolog/monolog    | NEW   | 1.21.0 |                                                                         |

| Dev Changes      | From   | To      | Compare |
|------------------|--------|---------|---------|
| phpspec/php-diff | v1.0.2 | REMOVED |         |

Rendered

Production Changes From To Compare
guzzlehttp/guzzle 6.2.0 6.3.0 ...
hashids/hashids 2.0.0 2.0.4 ...
league/flysystem 1.0.0 1.0.42 ...
monolog/monolog NEW 1.21.0
Dev Changes From To Compare
phpspec/php-diff v1.0.2 REMOVED

Contributors

Thanks to everyone who has shared ideas and code! In particular,