Expand description
Config-driven clone with explicit flag placement, built-in stateless steps, and pre/post-clone hooks.
Per repo, in order: global pre-clone → repo pre-clone → git <PRE> clone <POST> <url> <dir> → built-ins (git identity + submodule branch-switch +
direnv allow) → global post-clone → repo post-clone.
Git identity (user.name/user.email) is per-invocation, not in the conf
(the conf is shared across a team): it comes from Opts (the clone
--user-name/--user-email flags, or an interactive prompt), and is stamped
git config on each cloned repo right after clone so post-clone hooks see it.
The git clone and built-ins are captured (clean status; an .envrc that
runs glow … can’t distort output — direnv allow only records trust). User
hooks run via sh -c with their output inherited (explicit commands, shown
live) and $GKIT_REPO/GKIT_DIR/GKIT_URL/GKIT_HOST/GKIT_NAMESPACE set
(plus GKIT_USER_NAME/GKIT_USER_EMAIL, empty when no identity was given).
Structs§
Enums§
Functions§
- clone_
all - Clone every repo in
conf, printing each step in order. Returns a report per repo (for the aggregate exit code). - distinct_
namespaces - Distinct namespaces across a conf’s repos (each repo’s effective namespace), in
conf order, deduplicated — one
insteadOfrule is written per distinct namespace. - insteadof_
pair - The git-config
(key, value)for the namespace-scopedinsteadOfrewrite that lets a canonical submodule URL route through the alias’s key: key =url.<alias>:<ns>/.insteadOfvalue =git@<hostname>:<ns>/so git rewritesgit@<hostname>:<ns>/repo.git→<alias>:<ns>/repo.git→id_<alias>. The trailing/on both sides scopes the rule to the namespace (so multiple aliases on the same host — different clients — each keep their own key).