Skip to content

Commit f6c0ece

Browse files
committed
dx: improve dev workflow
1 parent 48bf22e commit f6c0ece

File tree

4 files changed

+44
-6
lines changed

4 files changed

+44
-6
lines changed

.githooks/post-checkout

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
# Git post-checkout hook - updates submodules after checkout
3+
#
4+
# This hook runs after:
5+
# - git checkout
6+
# - git switch
7+
# - git clone (with checkout)
8+
#
9+
# Arguments:
10+
# $1 - ref of previous HEAD
11+
# $2 - ref of new HEAD
12+
# $3 - flag (1 = branch checkout, 0 = file checkout)
13+
14+
# Only run on branch checkouts, not file checkouts
15+
if [ "$3" = "0" ]; then
16+
exit 0
17+
fi
18+
19+
echo "Updating submodules..."
20+
git submodule update --init --recursive --remote
21+
22+
exit 0

.githooks/post-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
# Git post-commit hook - updates submodules after each commit
3+
#
4+
# This hook runs after every local commit, ensuring submodules
5+
# stay up to date with their tracked branches.
6+
7+
echo "Updating submodules..."
8+
git submodule update --init --recursive --remote
9+
10+
exit 0

.mise.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# Mise configuration for InferaDB
1+
# Mise configuration for InferaDB Rust SDK
22
# https://mise.jdx.dev/
33
#
44
# Mise is used for:
5-
# - Tool installation (Rust, cargo extensions, protobuf)
5+
# - Tool installation (Rust, cargo extensions)
66
# - Environment variable configuration
77
# - One-time development setup
88
#
99
# For daily development, use standard cargo commands.
10-
# See Makefile for convenient shortcuts.
10+
# See README.md for common development workflows.
1111

1212
[tools]
1313
rust = "stable"
@@ -25,8 +25,10 @@ CARGO_BUILD_JOBS = "{{ num_cpus() }}"
2525
[tasks.setup]
2626
description = "One-time development environment setup"
2727
run = [
28+
"git config core.hooksPath .githooks",
29+
"git submodule update --init --recursive",
2830
"rustup component add rustfmt clippy rust-src rust-analyzer",
31+
"rustup toolchain install nightly --component rustfmt",
2932
"cargo fetch",
3033
"echo '\n✅ Setup complete! Use standard cargo commands for development.'",
31-
"echo 'Run \"make help\" to see available shortcuts.\n'",
3234
]

.serena/memories/suggested_commands.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414

1515
```bash
1616
mise trust && mise install
17-
rustup component add rustfmt clippy
18-
rustup toolchain install nightly --component rustfmt
17+
mise run setup # Configures git hooks and initializes proto submodule
1918
```
2019

20+
The setup task runs:
21+
- `git config core.hooksPath .githooks` - Use version-controlled hooks
22+
- `git submodule update --init --recursive` - Initialize proto submodule
23+
- Installs rustfmt, clippy, and nightly toolchain
24+
2125
## Build Commands
2226

2327
```bash

0 commit comments

Comments
 (0)