Created
August 10, 2015 08:44
-
-
Save Mikulas/4a96845716361cea5eaa to your computer and use it in GitHub Desktop.
git composer.lock differ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/composer.lock -merge diff=composer.lock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[diff "composer.lock"] | |
textconv = bin/scripts/git-diff-composer.php | |
cachetextconv = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
# Usage: add following line to .gitattributes | |
# /composer.lock -merge diff=composer.lock | |
# and register this diff engine in your git config | |
# (I suggest setting this per project at .git/config) | |
# [diff "composer.lock"] | |
# textconv = bin/scripts/git-diff-composer.php | |
# cachetextconv = TRUE | |
$lock = json_decode(file_get_contents($argv[1])); | |
$packages = []; | |
foreach ($lock->packages as $package) { | |
$version = str_pad($package->version, 10, ' '); | |
$ref = $package->source->reference; | |
$packages[$package->name] = "$version $ref"; | |
} | |
ksort($packages); | |
foreach ($packages as $name => $version) { | |
echo "$name\n $version\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Po:

#### Před: