feat: honor GIT_SIDE_BASE_PATH as the default storage location - #3
Open
Qu4tro wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
git side init --pathrelocates storage one project at a time, with themapping 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 --pathsilently falls back to the platform data dir and its sidehistory dies with the container; today the workaround is symlinking
~/.local/share/git-sideonto the mount.Change
default_base_path()honors aGIT_SIDE_BASE_PATHenvironment variable:git side init --path(unchanged, still wins)GIT_SIDE_BASE_PATH, if set and non-emptyExisting 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-targetsclean (pedantic + nursery), release build ok.HOME/XDG dirs verifiedall three resolution steps plus the empty-value case.