Skip to content

Uninstall is asymmetric with init: advice.addEmbeddedRepo=false is never restored (no deinit) #42

Description

@Shinrai

Problem

init does two things (per its own description — "run install-hooks, then silence the 'embedded git repository' advice"):

  1. installs the per-repo hooks, and
  2. sets git config advice.addEmbeddedRepo false (src/api/cli/init.mjs:18).

But removal only undoes the first. uninstall-hooks removes the hook scripts and nothing else, and there is no deinit command. So after uninstalling, advice.addEmbeddedRepo=false is left behind in the repo's local config — which means git's "adding embedded git repository" warning stays permanently silenced even though git-embedded is gone.

That warning is precisely the safety net you want back once the tool is removed: it's what catches an accidental git add of a nested checkout as a stray gitlink. Leaving it off is the worst-direction failure — silent.

Reproduce

git-embedded init          # installs hooks + sets advice.addEmbeddedRepo=false
git-embedded uninstall-hooks
git config --local --get advice.addEmbeddedRepo   # → false  (still set; should be gone)

Confirmation

  • init.mjs:18 sets advice.addEmbeddedRepo false.
  • No source path unsets/restores it (grep for unset / addEmbeddedRepo across src/ finds only the setter and unrelated registry getters).
  • Command surface is doctor / export / init / install-hooks / install-template / link / print-hook-script / record / restore / sync / uninstall-hooks / version / help — no deinit / full uninstall.

Suggested fix

Make removal symmetric with init. Preferably add a deinit command (the mirror of init) that:

  1. runs uninstall-hooks, and
  2. restores the advice — git config --local --unset advice.addEmbeddedRepo (guard: only unset when the local value is false, i.e. what init would have set, so a user's deliberate setting isn't clobbered).

Alternatively (or additionally), have uninstall-hooks unset the advice config too, or at minimum print a warning that it left advice.addEmbeddedRepo=false behind and how to restore it.

Workaround (what removal currently requires by hand)

git-embedded uninstall-hooks
git config --local --unset advice.addEmbeddedRepo

Encountered while removing git-embedded from a parent workspace repo: uninstall-hooks cleared the hooks but left the advice silenced, so the embedded-repo warning had to be restored manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions