Skip to content

Commit 70072c1

Browse files
committed
Updated README.md with examples for the Compare and the Suggest commands.
1 parent 871fc33 commit 70072c1

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,22 @@ See the example section for examples of how to use the tool.
3030

3131
## Example
3232

33+
### Compare two commits (without semantic versioning)
34+
35+
```bash
36+
# arguments are: before-commit/branch/tag after-commit/branch/tag before-source after-source
37+
php bin/php-semver-checker-git compare v1.6.4 v2.0.0 src src
38+
```
39+
40+
### Compare HEAD against your latest semantic version tag
41+
3342
```bash
34-
# arguments are: repository-directory before-commit/branch/tag after-commit/branch/tag before-source after-source
35-
php bin/php-semver-checker-git compare factory-muffin v1.6.4 v2.0.0 factory-muffin/src factory-muffin/src
36-
37-
Suggested semantic versioning change: MAJOR
38-
39-
CLASS
40-
LEVEL LOCATION REASON
41-
MAJOR src/Zizaco/FactoryMuff/Facade/FactoryMuff.php#8 Zizaco\FactoryMuff\Facade\FactoryMuff Class was removed.
42-
MAJOR src/Zizaco/FactoryMuff/FactoryMuff.php#13 Zizaco\FactoryMuff\FactoryMuff Class was removed.
43-
MAJOR src/Zizaco/FactoryMuff/Kind.php#7 Zizaco\FactoryMuff\Kind Class was removed.
44-
[...]
45-
MINOR src/Exceptions/DeleteFailedException.php#17 League\FactoryMuffin\Exceptions\DeleteFailedException Class was added.
46-
MINOR src/Exceptions/DeleteMethodNotFoundException.php#17 League\FactoryMuffin\Exceptions\DeleteMethodNotFoundException Class was added.
47-
MINOR src/Exceptions/DeletingFailedException.php#21 League\FactoryMuffin\Exceptions\DeletingFailedException Class was added.
48-
[... cut for brievity ...]
49-
50-
FUNCTION
51-
LEVEL LOCATION REASON
43+
# arguments are: before-source after-source
44+
php bin/php-semver-checker-git suggest src src --allow-detached
5245
```
5346

47+
Note: `--allow-detached` is very useful when you are running this command on [`travis-ci`](https://travis-ci.org) or any other continuous integration provider. It is necessary when a checkout is done on a particular commit, which makes `HEAD` become `detached`. If this option is not passed to the command, it will abort. This is done because it is impossible to revert the original `detached` branch when the `suggest` command completes.
48+
5449
## License
5550

56-
The code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). See LICENSE.
51+
The code is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). See LICENSE.

0 commit comments

Comments
 (0)