Skip to content

feat: honor GIT_SIDE_BASE_PATH as the default storage location - #3

Open
Qu4tro wants to merge 1 commit into
Solexma:mainfrom
Qu4tro:feat/base-path-env
Open

feat: honor GIT_SIDE_BASE_PATH as the default storage location#3
Qu4tro wants to merge 1 commit into
Solexma:mainfrom
Qu4tro:feat/base-path-env

Conversation

@Qu4tro

@Qu4tro Qu4tro commented Jul 30, 2026

Copy link
Copy Markdown

Motivation

git side init --path relocates storage one project at a time, with the
mapping recorded per root SHA. There is currently no way to say "store every
side repo under this base path" — which is the natural setup when the storage
should live on a durable mount (dev containers, network volumes) and projects
come and go. In a disposable container home, any project that never got its
init --path silently falls back to the platform data dir and its side
history dies with the container; today the workaround is symlinking
~/.local/share/git-side onto the mount.

Change

default_base_path() honors a GIT_SIDE_BASE_PATH environment variable:

  1. per-project path from git side init --path (unchanged, still wins)
  2. GIT_SIDE_BASE_PATH, if set and non-empty
  3. platform data dir (unchanged)

Existing setups see no behavior change unless they export the variable. An
empty value is treated as unset. Documented in the README next to the
per-project mechanism.

Testing

  • cargo clippy --all-targets clean (pedantic + nursery), release build ok.
  • Manual run against a scratch repo with isolated HOME/XDG dirs verified
    all three resolution steps plus the empty-value case.

Setting the environment variable relocates the default base path for
every project at once, e.g. onto a durable mount in a container. A
per-project path registered with 'git side init --path' still takes
precedence, and an empty value is treated as unset.
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