Skip to content

Replace legacy scripts/ with git-repokit-common subtree #24

@djdarcy

Description

@djdarcy

Replace legacy scripts/ with git-repokit-common subtree

Problem

scripts/ contains a divergent, older copy of git hooks and version management that was created before git-repokit-common was extracted as a shared project. The two have drifted:

  • dazzlecmd uses bash update-version.sh; repokit-common uses Python sync-versions.py
  • dazzlecmd hooks have hardcoded src/dazzlecmd/ paths; repokit-common auto-detects package dirs
  • dazzlecmd pre-push uses py_compile glob; repokit-common uses compileall (handles src/ layout)
  • repokit-common has additional tools: gh_issue_full.py, gh_sub_issues.py, search_sesslog.py, safe_move.sh

What needs to happen

  1. Stash or commit all outstanding uncommitted work first -- git subtree add requires a completely clean working tree (including submodules)
  2. Remove existing scripts/ from git
  3. git subtree add --prefix=scripts repokit-common main --squash
  4. Add [tool.repokit-common] config to pyproject.toml:
    [tool.repokit-common]
    version-source = "src/dazzlecmd/_version.py"
    changelog = "CHANGELOG.md"
    repo-url = "https://github.com/DazzleTools/dazzlecmd"
    tag-prefix = "v"
    tag-format = "human"
    private-patterns = ["private/", ".env"]
  5. Run bash scripts/install-hooks.sh to install new hooks
  6. Verify hooks work: commit, push, tag push

Gotcha: clean working tree required

git subtree add refuses to run with ANY dirty files -- even unrelated ones, even submodules with modified content. The wtf submodule's nested tools/core/restarted submodule was dirty, plus untracked directories like projects/dazzletools/private-init/ blocked it. Best to do this when the tree is genuinely clean.

Upstream already prepared

  • repokit-common v0.2.3 (61ebd1e) includes the tag-only push skip from this session
  • Remote repokit-common already added to dazzlecmd: https://github.com/DazzleTools/git-repokit-common.git
  • repokit-common's pre-commit has fallback: tries sync-versions.py first, falls back to update-version.sh

Post-subtree tasks

  • Remove scripts.bak/ if it still exists
  • Update CLAUDE.md version bump checklist (sync-versions.py replaces manual update-version.sh)
  • Consider adding [tool.repokit-common] section to pyproject.toml
  • Future updates: git subtree pull --prefix=scripts repokit-common main --squash

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureStructural and design decisionsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions