Skip to content

Commit 1e3feec

Browse files
committed
improved bump-sqlite.sh
1 parent a4bcddf commit 1e3feec

3 files changed

Lines changed: 43 additions & 12 deletions

File tree

memory-bank/custom-instructions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
- Do not prefix commands with `cd /home/gms/gms/projects/hot/node-sqlite3 &&` when the command should run in the current workspace directory
88
- Use `yarn test`, `yarn lint` instead of npm run scripts (e.g., avoid `npm run test`, use `yarn test` instead)
99

10+
## Plans
11+
12+
- Never refer to a plan (files in `plans/`) from any memory bank file except `activeContext.md`
13+
- Plans are temporary: once implemented, they are moved from active context to `progress.md`, and the plan file may be deleted
14+
- References to plans in `progress.md`, `decisionLog.md`, `development.md`, or `project-overview.md` would become stale/broken
15+
1016
## Notes
1117

1218
These instructions apply to all future sessions working in this project.

memory-bank/development.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,20 @@ Uses ESLint with configuration in `.eslintrc.js`.
205205
The `tools/bin/bump-sqlite.sh` script automates upgrading the bundled SQLite version:
206206

207207
```bash
208-
# Auto-detect latest version
209-
tools/bin/bump-sqlite.sh --usage
208+
# Show usage
209+
tools/bin/bump-sqlite.sh --help
210210

211+
# Preview without making changes
212+
tools/bin/bump-sqlite.sh --dry-run
213+
214+
# Commit but don't push
215+
tools/bin/bump-sqlite.sh --no-push
216+
217+
# Specify version explicitly
218+
tools/bin/bump-sqlite.sh 3510400
219+
220+
# Skip cooldown period check
221+
tools/bin/bump-sqlite.sh --force 3510400
211222
```
212223

213224
## Benchmarks

tools/bin/bump-sqlite.sh

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,11 @@ step2_check_clean_tree() {
231231

232232
if ! git diff --quiet HEAD 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then
233233
echo "ERROR: Source tree has uncommitted changes. Please commit or stash first." >&2
234-
exit "$EXIT_DIRTY_TREE"
234+
if [[ "$DRY_RUN" == true ]]; then
235+
log_dry "Would exit with ${EXIT_DIRTY_TREE}"
236+
else
237+
exit "$EXIT_DIRTY_TREE"
238+
fi
235239
fi
236240

237241
local untracked
@@ -590,31 +594,41 @@ step11_update_readme() {
590594
step12_check_other_changes() {
591595
log_step "12" "Check for other required changes"
592596

597+
local from_human
598+
from_human="$(numeric_to_human "$FROM_VERSION")"
593599
local to_human
594600
to_human="$(numeric_to_human "$NEW_VERSION")"
595601

596-
log "Fetching SQLite changelog for ${to_human}..."
602+
log "Fetching SQLite changelog from ${from_human} to ${to_human}..."
597603

598604
local changes_html
599605
changes_html="$(curl -sL "$SQLITE_CHANGES_URL" 2>/dev/null || true)"
600606

601607
if [[ -n "$changes_html" ]]; then
602-
# Extract changelog entries for the target version
603-
# SQLite changes.html has sections per version
608+
# Extract changelog entries for ALL versions between from and to.
609+
# SQLite changes.html lists versions in reverse chronological order
610+
# (newest first), with each version section starting at an <h3> heading
611+
# like: <h3>2025-04-15 (3.51.4)</h3>
612+
# We capture from the to_human heading down to (but not including)
613+
# the from_human heading, which gives us all intermediate versions.
604614
local changelog_section
605615
changelog_section="$(echo "$changes_html" | \
606-
sed -n "/<h[23]>/,/<h[23]>/p" | \
607-
sed -n "/${to_human}/,/<h[23]>/p" | \
608-
head -50 || true)"
616+
awk -v from="$from_human" -v to="$to_human" '
617+
/<h[23]>/ {
618+
if (index($0, from) > 0 && index($0, to) == 0) { capturing = 0; next }
619+
if (index($0, to) > 0) { capturing = 1 }
620+
}
621+
capturing { print }
622+
' | head -100 || true)"
609623

610624
if [[ -n "$changelog_section" ]]; then
611625
echo ""
612-
echo "=== SQLite Changelog for ${to_human} ==="
626+
echo "=== SQLite Changelog: ${from_human} ${to_human} ==="
613627
# Strip HTML tags for display
614-
echo "$changelog_section" | sed 's/<[^>]*>//g' | sed '/^$/d' | head -30
628+
echo "$changelog_section" | sed 's/<[^>]*>//g' | sed '/^$/d' | head -50
615629
echo "=== End of changelog excerpt ==="
616630
else
617-
log "Could not extract changelog for ${to_human}"
631+
log "Could not extract changelog for ${from_human}${to_human}"
618632
fi
619633
else
620634
log "WARNING: Could not fetch SQLite changelog"

0 commit comments

Comments
 (0)