Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .beads/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ backup/
# Tracker data (lives in the Dolt remote named by sync.remote, never in git)
issues.jsonl
interactions.jsonl
events.jsonl

# Legacy files (from pre-Dolt versions)
*.db
Expand Down
38 changes: 32 additions & 6 deletions .beads/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
#!/bin/sh
# Strip Co-Authored-By lines from commit messages
sed -i.bak '/Co-Authored-By/Id' "$1"
# Remove trailing blank lines left behind
sed -i.bak -e :a -e '/^\n*$/{$d;N;ba' -e '}' "$1"
rm -f "$1.bak"
#!/usr/bin/env sh
# Every commit in this repository has one author. Clones that point
# core.hooksPath at .beads/hooks skip the machine-wide git hooks, so this
# hook does the one job those had here: it removes Co-Authored-By trailer
# lines from the commit message. A mention inside a sentence is kept.
#
# A message without such a line is never touched. Otherwise the cleaned
# text goes to a fresh file from mktemp, is compared with a second run,
# and is renamed over the message only when every step worked; on any
# failure the message stays as it was and the commit stops.
msg="$1"
[ -f "$msg" ] || exit 0
case $msg in -*) msg="./$msg" ;; esac
found=0
LC_ALL=C grep -q -i '^[[:space:]]*co-authored-by:' "$msg" || found=$?
case $found in
0) ;;
1) exit 0 ;;
*) echo "commit-msg: cannot read $msg" >&2; exit 1 ;;
esac
clean() {
LC_ALL=C awk 'tolower($0) !~ /^[ \t\r\f\v]*co-authored-by:/ { line[++n] = $0 }
END { while (n > 0 && line[n] ~ /^[ \t\r\f\v]*$/) n--
for (i = 1; i <= n; i++) print line[i] }' < "$msg"
}
tmp=$(mktemp "$msg.XXXXXX") || { echo "commit-msg: cannot create a temporary file beside $msg" >&2; exit 1; }
trap 'rm -f "$tmp"' EXIT
trap 'exit 1' HUP INT TERM
clean > "$tmp" && clean | cmp -s - "$tmp" || { echo "commit-msg: cannot rewrite $msg" >&2; exit 1; }
trap '' HUP INT TERM
mv -f "$tmp" "$msg" || { echo "commit-msg: cannot replace $msg" >&2; exit 1; }
exit 0
Comment thread
GeiserX marked this conversation as resolved.
10 changes: 3 additions & 7 deletions .beads/hooks/post-checkout
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/sh
case ":$PATH:" in *":/opt/homebrew/bin:"*) ;; *) PATH="/opt/homebrew/bin:$PATH"; export PATH ;; esac
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs post-checkout "$@"

# --- BEGIN BEADS INTEGRATION v1.0.5 ---
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.1.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
Expand Down Expand Up @@ -34,4 +30,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.0.5 ---
# --- END BEADS INTEGRATION v1.1.2 ---
4 changes: 0 additions & 4 deletions .beads/hooks/post-commit

This file was deleted.

10 changes: 3 additions & 7 deletions .beads/hooks/post-merge
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/sh
case ":$PATH:" in *":/opt/homebrew/bin:"*) ;; *) PATH="/opt/homebrew/bin:$PATH"; export PATH ;; esac
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs post-merge "$@"

# --- BEGIN BEADS INTEGRATION v1.0.5 ---
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.1.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
Expand Down Expand Up @@ -34,4 +30,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.0.5 ---
# --- END BEADS INTEGRATION v1.1.2 ---
66 changes: 3 additions & 63 deletions .beads/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,65 +1,5 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "pre-commit" "$@"

# --- BEGIN BEADS INTEGRATION v1.0.5 ---
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.1.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
Expand Down Expand Up @@ -90,4 +30,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.0.5 ---
# --- END BEADS INTEGRATION v1.1.2 ---
10 changes: 3 additions & 7 deletions .beads/hooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/sh
case ":$PATH:" in *":/opt/homebrew/bin:"*) ;; *) PATH="/opt/homebrew/bin:$PATH"; export PATH ;; esac
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs pre-push "$@"

# --- BEGIN BEADS INTEGRATION v1.0.5 ---
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.1.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
Expand Down Expand Up @@ -34,4 +30,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.0.5 ---
# --- END BEADS INTEGRATION v1.1.2 ---
74 changes: 3 additions & 71 deletions .beads/hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,73 +1,5 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"
elif go tool lefthook -h >/dev/null 2>&1
then
go tool lefthook "$@"
elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package lefthook >/dev/null 2>&1
then
swift package --build-path .build/lefthook --disable-sandbox lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif uv run lefthook -h >/dev/null 2>&1
then
uv run lefthook "$@"
elif mise exec -- lefthook -h >/dev/null 2>&1
then
mise exec -- lefthook "$@"
elif devbox run lefthook -h >/dev/null 2>&1
then
devbox run lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "prepare-commit-msg" "$@"

# --- BEGIN BEADS INTEGRATION v1.0.5 ---
#!/usr/bin/env sh
# --- BEGIN BEADS INTEGRATION v1.1.2 ---
# This section is managed by beads. Do not remove these markers.
if command -v bd >/dev/null 2>&1; then
export BD_GIT_HOOK=1
Expand Down Expand Up @@ -98,4 +30,4 @@ if command -v bd >/dev/null 2>&1; then
fi
if [ $_bd_exit -ne 0 ]; then exit $_bd_exit; fi
fi
# --- END BEADS INTEGRATION v1.0.5 ---
# --- END BEADS INTEGRATION v1.1.2 ---
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ bun.lockb
# remote (see .beads/config.yaml sync.remote); only the scaffolding under .beads/ is committed.
.beads/issues.jsonl
.beads/interactions.jsonl
.beads/events.jsonl
.beads/dolt/
.beads/embeddeddolt/
.beads/backup/
Expand Down
4 changes: 4 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ This protocol applies when ending a Beads implementation workflow. It is subordi
- Do not commit or push without clear authority from the active profile or the current user request.
- If a required sync or push is blocked, stop and report the exact command and error.
<!-- END BEADS INTEGRATION -->

## Where the tracker syncs

This repo is public, so its tracker syncs only to the private Dolt remote named by `sync.remote` in `.beads/config.yaml` (`giteaer/Pumperly-beads` on Gitea). The block above says sync uses "your git remote". Here that never means this GitHub repo. Don't add it as a Dolt remote and don't push `refs/dolt/*` to it.
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,3 +525,7 @@ This protocol applies when ending a Beads implementation workflow. It is subordi
- Do not commit or push without clear authority from the active profile or the current user request.
- If a required sync or push is blocked, stop and report the exact command and error.
<!-- END BEADS INTEGRATION -->

## Where the tracker syncs

This repo is public, so its tracker syncs only to the private Dolt remote named by `sync.remote` in `.beads/config.yaml` (`giteaer/Pumperly-beads` on Gitea). The block above says sync uses "your git remote". Here that never means this GitHub repo. Don't add it as a Dolt remote and don't push `refs/dolt/*` to it.
Comment thread
GeiserX marked this conversation as resolved.
Loading