Skip to content

Commit dd8d2d8

Browse files
author
Fred Condo
committed
Convert script to a composer module
1 parent 88e065b commit dd8d2d8

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,32 +51,30 @@ i.e. you can install the driver globally but only activate it on certain project
5151

5252
### 1. Download the merge driver.
5353

54-
Download the `merge.php` file from this repo. For example, to download to your home directory:
54+
Use composer to install the driver into your repo or globally.
5555

5656
```sh
57-
$ curl -Lo ~/composer-git-merge-driver.php https://raw.githubusercontent.com/balbuf/composer-git-merge-driver/master/merge.php
57+
$ composer require --dev balbuf/composer-git-merge-driver
5858
```
5959

60-
Make the file executable:
60+
or
6161

6262
```sh
63-
$ chmod +x ~/composer-git-merge-driver.php
64-
```
65-
66-
Optionally, you can move the file somewhere in your `$PATH`, e.g.:
67-
68-
```sh
69-
$ mv ~/composer-git-merge-driver.php /usr/local/bin/composer-git-merge-driver
63+
$ composer global require balbuf/composer-git-merge-driver
7064
```
7165

7266
### 2. Install the merge driver.
7367

74-
The driver is installed by informing git of its existence via a [git config][git config] file:
68+
The driver is installed by informing git of its existence via a [git config][git config]
69+
file. This example assumes that your path includes
70+
`~/.composer/vendor/bin` (for global installation) or `./vendor/bin`
71+
(for repo installation.) If that is not so, update the path to the
72+
driver on the `driver` line.
7573

7674
```
7775
[merge "composer_json"]
7876
name = composer JSON file merge driver
79-
driver = ~/composer-git-merge-driver.php %O %A %B %L %P
77+
driver = composer-git-merge-driver %O %A %B %L %P
8078
recursive = binary
8179
```
8280

File renamed without changes.

composer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "balbuf/composer-git-merge-driver",
3+
"description": "Merge composer.* files with conflicts.",
4+
"keywords": ["composer", "composer.lock", "composer.json", "git", "merge", "conflict"],
5+
"type": "library",
6+
"bin": ["bin/composer-git-merge-driver"],
7+
"authors": [{
8+
"name": "Stephen Beemsterboer",
9+
"homepage": "https://github.com/balbuf"
10+
}],
11+
"require": {
12+
"php": ">=5.4"
13+
}
14+
}

0 commit comments

Comments
 (0)