From d0cfe35265310c4013d15fe71c8fe8366e2b221a Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 27 Mar 2012 22:49:35 +0200 Subject: [PATCH 1/2] [docs] clarify lock file insignificance for libs, closes #504 --- doc/01-basic-usage.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/01-basic-usage.md b/doc/01-basic-usage.md index 161cd6499..3ba3e5158 100644 --- a/doc/01-basic-usage.md +++ b/doc/01-basic-usage.md @@ -98,7 +98,7 @@ After installing the dependencies, Composer writes the list of the exact versions it installed into a `composer.lock` file. This locks the project to those specific versions. -**Commit your project's `composer.lock` (along with `composer.json`) into version control.** +**Commit your application's `composer.lock` (along with `composer.json`) into version control.** This is important because the `install` command checks if a lock file is present, and if it is, it downloads the versions specified there (regardless of what `composer.json` @@ -115,6 +115,10 @@ the lock file with the new version. $ php composer.phar update +> **Note:** For your library you may commit the `composer.lock` file too, but it +> will not have any effect on other projects that depend on it. See also +> [Libraries - Lock file](02-libraries.md#lock-file). + ## Packagist [Packagist](http://packagist.org/) is the main Composer repository. A Composer From ea19aba18cd407928f47ab5dba2bee416a807d13 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 27 Mar 2012 23:18:34 +0200 Subject: [PATCH 2/2] [docs] move lib lockfile notes into lib chapter --- doc/01-basic-usage.md | 5 ++--- doc/02-libraries.md | 14 ++++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/doc/01-basic-usage.md b/doc/01-basic-usage.md index 3ba3e5158..42c543a6f 100644 --- a/doc/01-basic-usage.md +++ b/doc/01-basic-usage.md @@ -115,9 +115,8 @@ the lock file with the new version. $ php composer.phar update -> **Note:** For your library you may commit the `composer.lock` file too, but it -> will not have any effect on other projects that depend on it. See also -> [Libraries - Lock file](02-libraries.md#lock-file). +> **Note:** For libraries it is not necessarily recommended to commit the lock file, +> see also: [Libraries - Lock file](02-libraries.md#lock-file). ## Packagist diff --git a/doc/02-libraries.md b/doc/02-libraries.md index da540e9a9..a6adab3a0 100644 --- a/doc/02-libraries.md +++ b/doc/02-libraries.md @@ -78,15 +78,13 @@ See [Repositories](05-repositories.md) for more information. ## Lock file -For projects it is recommended to commit the `composer.lock` file into version -control. For libraries this is not the case. You do not want your library to -be tied to exact versions of the dependencies. It should work with any -compatible version, so make sure you specify your version constraints so that -they include all compatible versions. +For your library you may commit the `composer.lock` file if you want to. This +can help your team to always test against the same dependency versions. +However, this lock file will not have any effect on other projects that depend +on it. It only has an effect on the main project. -**Do not commit your library's `composer.lock` into version control.** - -If you are using git, add it to the `.gitignore`. +If you do not want to commit the lock file and you are using git, add it to +the `.gitignore`. ## Publishing to a VCS