Skip to content

fix(doctor): hint how to finish a hopspace move Windows refuses - #151

Merged
jadb merged 3 commits into
mainfrom
fix/hooks-lock-prune-docs
Sep 26, 2026
Merged

jadb merged 3 commits into
mainfrom
fix/hooks-lock-prune-docs

Conversation

@jadb

@jadb jadb commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

docs: prune drops records only; never stops or removes containers

  • advanced usage "Orphaned Resources": prune claimed to clean up orphaned
    containers and volumes; it drops state, hop.json, ports and volumes
    records only, never runs Docker, never deletes volume directories
  • real cleanup paths: git hop env stop before removal, docker compose -p
    down (compose ls --all once the entry is gone), remove
    --delete-volumes for hub volume data
  • prune reference: containers never went through env gc
  • workflows, FAQ: "prune orphaned hopspaces" -> records; stop the
    environment before remove in the end-to-end example

fix(hooks): mirror committed hooks under the hopspace's hop.json lock

  • hopspace hooks dir written under its hopspace's hop.json.lock, the lock
    doctor --fix moves hooks dirs and hopspaces under: a move waits for the
    hooks being written and carries them; a mirror waits for a move
  • decide first, write after: every hook decided (prompts included) and
    hooks dir resolved (git config) before the lock; lock held only around
    mkdir + writes; nothing under it runs git, a hook or git-hop
  • dir moved away while waiting (hooks dir gone, or hopspace emptied):
    nothing written at the old path; dir resolved again, bounded retries,
    then warning + re-mirror hint
  • destination re-checked under the lock: identical -> already-present;
    different -> kept with warning unless --hooks-overwrite or a prompt
    answered for an existing hook
  • prompt EOF / read error: hooks answered before it still mirrored
  • docs: hooks mirroring lock, doctor legacy hooks move waits for a mirror

fix(doctor): hint how to finish a hopspace move Windows refuses

  • known limitation, documented: hopspace layout move renames the dir while
    holding its lock files open inside it; Windows refuses the rename ->
    failed repair, nothing moved or lost; untested there
  • on Windows the failed repair adds a hint: close other git-hop processes,
    move to by hand
  • no hint for the move's own refusals (destination taken, source gone) or
    on other systems
  • GOOS injectable for tests
  • docs: doctor section, configuration locks

Test plan

  • tests added per commit (unit and/or testscript); each fix mutation-tested: defect re-introduced, new tests red, fix restored, green
  • go test ./..., go vet, gofmt, staticcheck green locally before rebase onto current main

- advanced usage "Orphaned Resources": prune claimed to clean up orphaned
  containers and volumes; it drops state, hop.json, ports and volumes
  records only, never runs Docker, never deletes volume directories
- real cleanup paths: git hop env stop before removal, docker compose -p
  <project> down (compose ls --all once the entry is gone), remove
  --delete-volumes for hub volume data
- prune reference: containers never went through env gc
- workflows, FAQ: "prune orphaned hopspaces" -> records; stop the
  environment before remove in the end-to-end example
- hopspace hooks dir written under its hopspace's hop.json.lock, the lock
  doctor --fix moves hooks dirs and hopspaces under: a move waits for the
  hooks being written and carries them; a mirror waits for a move
- decide first, write after: every hook decided (prompts included) and
  hooks dir resolved (git config) before the lock; lock held only around
  mkdir + writes; nothing under it runs git, a hook or git-hop
- dir moved away while waiting (hooks dir gone, or hopspace emptied):
  nothing written at the old path; dir resolved again, bounded retries,
  then warning + re-mirror hint
- destination re-checked under the lock: identical -> already-present;
  different -> kept with warning unless --hooks-overwrite or a prompt
  answered for an existing hook
- prompt EOF / read error: hooks answered before it still mirrored
- docs: hooks mirroring lock, doctor legacy hooks move waits for a mirror
- known limitation, documented: hopspace layout move renames the dir while
  holding its lock files open inside it; Windows refuses the rename ->
  failed repair, nothing moved or lost; untested there
- on Windows the failed repair adds a hint: close other git-hop processes,
  move <from> to <to> by hand
- no hint for the move's own refusals (destination taken, source gone) or
  on other systems
- GOOS injectable for tests
- docs: doctor section, configuration locks
@jadb
jadb merged commit ac66632 into main Sep 26, 2026
5 checks passed
@jadb
jadb deleted the fix/hooks-lock-prune-docs branch September 26, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant