Skip to content

Commit b5fb053

Browse files
author
Evert
committed
Enable automatic submodule switching
1 parent 7d2704d commit b5fb053

File tree

4 files changed

+29
-36
lines changed

4 files changed

+29
-36
lines changed

.githooks/post-checkout

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
if [ "$3" = "1" ]; then
3+
echo "Updating submodules..."
4+
git submodule update --init --recursive
5+
fi
6+

.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
path = external/duckdb
33
url = https://github.com/duckdb/duckdb.git
44
branch = main
5+
[submodule]
6+
recurse = true

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,27 @@ pip install 'duckdb[all]'
4444

4545
## Development
4646

47+
### Cloning
48+
49+
When you clone the repo or your fork, make sure you initialize the duckdb submodule:
50+
```shell
51+
git clone --recurse-submodules <repo>
52+
```
53+
54+
... or, if you already have the repo locally:
55+
```shell
56+
git clone <your-repo>
57+
cd <your-repo>
58+
git submodule update --init --recursive
59+
```
60+
61+
If you'll be switching between branches that are have the submodule set to different refs, then make your life
62+
easier and add the git hooks in the .githooks directory to your local config:
63+
```shell
64+
git config --local core.hooksPath .githooks/
65+
```
66+
67+
4768
### Building wheels and sdists
4869

4970
To build a wheel and sdist for your system and the default Python version:

external/README_GIT_SUBMODULE.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)