mirror of
https://github.com/Dasemu/Grove.git
synced 2026-11-26 07:16:11 +00:00
chore: bootstrap Claude setup
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2068890cca
commit
5b3737ad3b
8 files changed
+127
No files matched your search
@@ -0,0 +1 @@
|
||||
2
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Edit|Write",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "f=$(jq -r '.tool_input.file_path // empty'); case \"$f\" in *.sh) bash -n \"$f\" || exit 2;; *.rs) rustfmt --edition 2021 \"$f\" >/dev/null 2>&1 || true;; esac"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "cd \"$CLAUDE_PROJECT_DIR\" && for f in spikes/*.sh; do [ -e \"$f\" ] && { bash -n \"$f\" || { echo \"syntax error in $f\" >&2; exit 2; }; }; done; if [ -f Cargo.toml ]; then cargo fmt --check && cargo clippy -- -D warnings && cargo test || exit 2; fi"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
# No environment variables are read yet. Add names only (never values) as they appear.
|
||||
@@ -0,0 +1,19 @@
|
||||
name: ci
|
||||
on:
|
||||
pull_request:
|
||||
branches: [development]
|
||||
push:
|
||||
branches: [development, main]
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Shell syntax
|
||||
run: for f in spikes/*.sh; do bash -n "$f"; done
|
||||
- name: Rust (once a Cargo workspace exists)
|
||||
if: hashFiles('Cargo.toml') != ''
|
||||
run: |
|
||||
cargo fmt --check
|
||||
cargo clippy -- -D warnings
|
||||
cargo test
|
||||
@@ -0,0 +1,41 @@
|
||||
name: version
|
||||
on:
|
||||
push:
|
||||
branches: [development, main]
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
bump:
|
||||
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && github.actor != 'github-actions[bot]' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Bump version
|
||||
id: bump
|
||||
run: |
|
||||
set -euo pipefail
|
||||
IFS=. read -r MA MI PA < VERSION
|
||||
branch="${GITHUB_REF_NAME}"
|
||||
if [ "$branch" = main ] && [ "$(git rev-list --parents -n1 HEAD | wc -w)" = 3 ] \
|
||||
&& git merge-base --is-ancestor HEAD^2 origin/development; then
|
||||
MI=$((MI+1)); PA=0
|
||||
else
|
||||
PA=$((PA+1))
|
||||
fi
|
||||
echo "$MA.$MI.$PA" > VERSION
|
||||
echo "v=$MA.$MI.$PA" >> "$GITHUB_OUTPUT"
|
||||
- name: Commit and push
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add VERSION
|
||||
git commit -m "chore(release): v${{ steps.bump.outputs.v }} [skip ci]"
|
||||
git push origin "HEAD:${GITHUB_REF_NAME}"
|
||||
if [ "${GITHUB_REF_NAME}" = main ]; then
|
||||
git fetch origin development
|
||||
git checkout -B development origin/development
|
||||
git merge --no-edit origin/main
|
||||
git push origin development
|
||||
fi
|
||||
@@ -0,0 +1,35 @@
|
||||
# Grove (working name: gitsync)
|
||||
|
||||
## Overview
|
||||
Linux tool that keeps chosen git repos continuously in sync across machines, including
|
||||
uncommitted work, via snapshot refs (`refs/sync/<machine>/<branch>`) on a primary remote.
|
||||
Planned as a Rust workspace (core, providers, daemon, CLI, Tauri GUI). Currently in
|
||||
**Phase 0 done / Phase 1 not started**: only spike scripts and docs exist. Do not start a
|
||||
new phase before its predecessor's results are written to `docs/`.
|
||||
|
||||
## Commands
|
||||
- Check shell scripts: `for f in spikes/*.sh; do bash -n "$f"; done`
|
||||
- Throwaway Forgejo (dev only, Podman): `spikes/forgejo-up.sh`, then `spikes/phase0.sh`
|
||||
- Once the Rust workspace exists: `cargo fmt --check`, `cargo clippy -- -D warnings`, `cargo test`
|
||||
|
||||
## Architecture
|
||||
See `docs/` (`phase0-spike.md`, `DECISIONS.md`). Git is the storage layer; shell out to
|
||||
system `git`; snapshots use a temp `GIT_INDEX_FILE` + `commit-tree`, never touching the
|
||||
user's branch or index.
|
||||
|
||||
## Conventions
|
||||
- Everything in the repo is English. Open questions go to `docs/DECISIONS.md`.
|
||||
- Never destroy local work; divergence is surfaced, never auto-merged.
|
||||
|
||||
## Workflow quirks
|
||||
- Remote: Gitea `git.zenvairo.es`, owner `dasemu` (section `Darío`), CLI `tea`. SSH (port 22)
|
||||
is unreachable from the dev machine; use HTTPS with `git -c credential.helper='!tea login helper'`.
|
||||
- In zsh, aliases like `g`/`gg` shadow shell functions; use unusual function names in scripts.
|
||||
- Throwaway repos created on the real Gitea for tests must be deleted afterwards.
|
||||
|
||||
## Deployment
|
||||
Native Linux app (systemd user service). Never Docker for deployment.
|
||||
|
||||
## Gotchas
|
||||
- Forgejo push mirrors to localhost need `migrations.ALLOW_LOCALNETWORKS` (test instances only).
|
||||
- Push-mirror exclusion of `refs/sync/*` is verified on Forgejo 11 only, not yet on the real Gitea.
|
||||
@@ -0,0 +1,4 @@
|
||||
# Grove
|
||||
|
||||
Keeps your git repos in sync across machines without manual commit/push/pull, including
|
||||
work in progress. Early stage (spikes only). See `docs/` for details.
|
||||
Reference in new issue
Block a user