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 AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ updates (`update.sh`), post-install test suite (`test.sh`), and CI matrix coveri

| File | Role |
|------|------|
| `get.sh` | curl-pipe bootstrap; auto-stashes local modifications on existing clones before pulling |
| `install.sh` | Entry point — profile selection, module orchestration |
| `update.sh` | Tool updates with `--check` mode and PATH shadow detection |
| `test.sh` | Post-install validation (run after every install and update) |
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.5.2] - 2026-05-06

### Fixed
- `get.sh`: on existing installs with local modifications, the installer now
automatically stashes changes, pulls the latest, and restores the stash instead
of aborting with a manual-steps error. Only aborts if the stash pop itself has
merge conflicts (content disagreement requiring human judgment). Resolves #25.

## [1.5.1] - 2026-05-06

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ install.sh entry point — profile selection, module orchestration
update.sh managed tool updates with --check mode + PATH shadow check
test.sh post-install validation suite (profile-aware)
ci-local.sh local Docker matrix runner — mirrors GitHub CI matrix
get.sh curl-pipe bootstrap (clones repo → runs install.sh)
get.sh curl-pipe bootstrap (clones repo → runs install.sh);
on existing clones auto-stashes local modifications, pulls,
then restores the stash — only aborts on stash-pop conflicts
Dockerfile bakes docker profile into an image at build time
Dockerfile.nosudo parameterized no-sudo test image (two variants: forced/auto)
lib/utils.sh shared logging, sudo detection, GitHub helpers, binary utils
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.1
1.5.2
36 changes: 24 additions & 12 deletions get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,32 @@ if [ -d "$DEST/.git" ]; then
_die "Repo at $DEST is in an unfinished merge/rebase state.\n Resolve it first: git -C '$DEST' status\n Then: bash '$DEST/install.sh' ${PROFILE:-workstation}"
fi

# Local modifications would be overwritten by pull
# Local modifications would be overwritten by pull — auto-stash, pull, restore
if ! git -C "$DEST" diff --quiet HEAD 2>/dev/null; then
_warn "Local modifications detected — cannot pull cleanly:"
_warn "Local modifications detected — auto-stashing before pull:"
git -C "$DEST" diff --name-only HEAD 2>/dev/null | while IFS= read -r f; do _warn " $f"; done
_warn "Resolve manually, then run install.sh directly (get.sh is gone after curl-pipe):"
_warn " git -C '$DEST' stash"
_warn " git -C '$DEST' pull"
_warn " git -C '$DEST' stash pop"
_warn " # WARNING: if stash pop has conflicts, ~/.zshrc may break."
_warn " # If that happens: exec bash (use bash until resolved)"
_warn " # Accept upstream: git -C '$DEST' checkout -- <file>"
_warn " # Then: git -C '$DEST' stash drop"
_warn " bash '$DEST/install.sh' ${PROFILE:-workstation}"
_die "Aborting — resolve local changes first."

if ! git -C "$DEST" stash 2>&1; then
_die "git stash failed — resolve manually, then:\n bash '$DEST/install.sh' ${PROFILE:-workstation}"
fi
_ok "Local changes stashed"

if ! git -C "$DEST" pull --ff-only 2>&1; then
git -C "$DEST" stash pop 2>/dev/null || true
_die "Pull failed (stash restored) — resolve manually:\n git -C '$DEST' pull\n bash '$DEST/install.sh' ${PROFILE:-workstation}"
fi
_ok "Pulled latest"

if ! git -C "$DEST" stash pop 2>&1; then
_warn "Stash pop has conflicts — your local changes conflict with what was pulled."
_warn " See conflicts: git -C '$DEST' status"
_warn " Accept upstream: git -C '$DEST' checkout -- <file>"
_warn " Drop the stash: git -C '$DEST' stash drop"
_warn " Then install: bash '$DEST/install.sh' ${PROFILE:-workstation}"
_warn " If shell is broken: exec bash"
_die "Resolve stash pop conflicts manually."
fi
_ok "Local changes restored after pull"
fi

# Local commits ahead of upstream (clean tree but diverged)
Expand Down
Loading