Skip to content

Commit 187d406

Browse files
authored
Merge pull request #102 from objectstack-ai/copilot/configure-pnpm-merge-driver
2 parents 23f03f9 + 29f65cb commit 187d406

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# pnpm-lock.yaml merge driver
2+
# This custom merge driver automatically resolves conflicts in pnpm-lock.yaml
3+
# by regenerating the lock file using 'pnpm install'
4+
pnpm-lock.yaml merge=pnpm-merge

docs/guide/ide-setup.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,32 @@ Essential for editing `*.object.yml` files. It provides syntax highlighting and
1515
**2. JSON (Official)**
1616
For editing configuration files.
1717

18+
## Git Configuration
19+
20+
### PNPM Lock File Merge Driver
21+
22+
To avoid manual merge conflicts in `pnpm-lock.yaml`, run the setup script after cloning the repository:
23+
24+
```bash
25+
bash scripts/setup-merge-driver.sh
26+
```
27+
28+
This configures Git to automatically regenerate the lock file when conflicts occur by running `pnpm install`.
29+
30+
**What it does:**
31+
- Configures a custom merge driver named "pnpm-merge"
32+
- When `pnpm-lock.yaml` has merge conflicts, Git will automatically run `pnpm install` to regenerate it
33+
- This eliminates the need to manually resolve lock file conflicts
34+
35+
**Manual Configuration:**
36+
37+
If you prefer to configure manually, run:
38+
39+
```bash
40+
git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver"
41+
git config merge.pnpm-merge.driver "pnpm install"
42+
```
43+
1844
## AI Assistant Configuration
1945

2046
ObjectQL is designed to be "AI-Native". The most efficient way to write schema and hooks is by pairing with an LLM.

scripts/setup-merge-driver.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Setup script for configuring the pnpm-lock.yaml merge driver
4+
# This script configures Git to automatically resolve conflicts in pnpm-lock.yaml
5+
# by regenerating the lock file using 'pnpm install'
6+
7+
echo "Configuring pnpm-lock.yaml merge driver..."
8+
9+
# Configure the merge driver
10+
git config merge.pnpm-merge.name "pnpm-lock.yaml merge driver"
11+
git config merge.pnpm-merge.driver "pnpm install"
12+
13+
if [ $? -eq 0 ]; then
14+
echo "✓ pnpm-lock.yaml merge driver configured successfully"
15+
echo ""
16+
echo "The merge driver will automatically regenerate pnpm-lock.yaml when conflicts occur."
17+
echo "You can verify the configuration with: git config --get merge.pnpm-merge.driver"
18+
else
19+
echo "✗ Failed to configure merge driver"
20+
exit 1
21+
fi

0 commit comments

Comments
 (0)