Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

add name-rev trying to retrieve a nice version #255

Merged
merged 1 commit into from over 2 years ago

2 participants

Toni Uebernickel Fabien Potencier
Toni Uebernickel

This will render tag names rather than commit hashes in deps.lock file, where possible.

An example deps.lock generated:

symfony v2.0.9
twig v1.5.1
monolog 1.0.2
doctrine-common 2.1.4
swiftmailer v4.1.5
assetic v1.0.2
twig-extensions a05ab5ed18a51ae45f3dcc2d0c4ec9b3a6386987
metadata 1.0.0
SensioFrameworkExtraBundle 1c7e92f466d11f83130b0c1271f44d067a2c3b31
SensioDistributionBundle 20b66a408084ad8752f98e50f10533f5245310bf
SensioGeneratorBundle dd37fc4487bc09ac01bdcf89e0ff4ee4484b7fab
AsseticBundle v1.0.1
phing 1fd92c78f14a02b3e1cd9c59c7a08b4cab532d33
propel 77a7262d5234fb05ca71922d70bb7476ec0d3a9b
PropelBundle 654ba24db2413fc19cc0f99b8eb0d695705368b8
FOSUserBundle 7688e1edb2ec645b0ca3c060df1cb2073bf1c9cc
gherkin v1.1.4
behat v2.2.5
BehatBundle 4062918f3db5641ea70cd5bd4d78be4646b2b7b1
mink v1.3.2
MinkBundle 788e4a170ab037bf810a26d2b25bfdb7b496df66
Geocoder b1b33e8ec2459c24a31a05e79a0e5833aa27ac8c
GeocodableBehavior efc5426c6fe2eb9dda22e8f43e51261752d6f8ba
Gaufrette ed24a3cd6a322019f0bef6d79873686ba96b8278
Toni Uebernickel add name-rev trying to retrieve a nice version
This will render tag names rather than commit hashes in deps.lock file, where possible.
dc62f29
Fabien Potencier fabpot referenced this pull request from a commit January 10, 2012
Fabien Potencier merged branch havvg/depslock-nice-version (PR #255)
Commits
-------

dc62f29 add name-rev trying to retrieve a nice version

Discussion
----------

add name-rev trying to retrieve a nice version

This will render tag names rather than commit hashes in `deps.lock` file, where possible.

An example `deps.lock` generated:

```plain
symfony v2.0.9
twig v1.5.1
monolog 1.0.2
doctrine-common 2.1.4
swiftmailer v4.1.5
assetic v1.0.2
twig-extensions a05ab5e
metadata 1.0.0
SensioFrameworkExtraBundle 1c7e92f
SensioDistributionBundle 20b66a4
SensioGeneratorBundle dd37fc4
AsseticBundle v1.0.1
phing 1fd92c7
propel 77a7262
PropelBundle 654ba24
FOSUserBundle 7688e1e
gherkin v1.1.4
behat v2.2.5
BehatBundle 4062918
mink v1.3.2
MinkBundle 788e4a170ab037bf810a26d2b25bfdb7b496df66
Geocoder b1b33e8ec2459c24a31a05e79a0e5833aa27ac8c
GeocodableBehavior efc5426c6fe2eb9dda22e8f43e51261752d6f8ba
Gaufrette ed24a3cd6a322019f0bef6d79873686ba96b8278
```
a213b8f
Fabien Potencier fabpot merged commit dc62f29 into from January 09, 2012
Fabien Potencier fabpot closed this January 09, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 09, 2012
Toni Uebernickel add name-rev trying to retrieve a nice version
This will render tag names rather than commit hashes in deps.lock file, where possible.
dc62f29
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 13 additions and 1 deletion. Show diff stats Hide diff stats

  1. 14  bin/vendors
14  bin/vendors
@@ -118,7 +118,19 @@ foreach ($deps as $name => $dep) {
118 118
     if ('update' === $command || 'lock' === $command) {
119 119
         ob_start();
120 120
         system(sprintf('cd %s && git log -n 1 --format=%%H', escapeshellarg($installDir)));
121  
-        $newversions[] = trim($name.' '.ob_get_clean());
  121
+        $newversion = trim(ob_get_clean());
  122
+
  123
+        ob_start();
  124
+        system(sprintf('cd %s && git name-rev --tags --name-only %s', escapeshellarg($installDir), $newversion));
  125
+        // remove trailing ^0 from tags, those are the tags themselves
  126
+        $niceversion = preg_replace('/\^0$/', '', trim(ob_get_clean()));
  127
+
  128
+        // undefined is returned in case no name-rev could be found
  129
+        if ('undefined' !== $niceversion) {
  130
+            $newversions[] = $name.' '.$niceversion;
  131
+        } else {
  132
+            $newversions[] = $name.' '.$newversion;
  133
+        }
122 134
     }
123 135
 }
124 136
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.