configurable gitbutler storage path via Git config#12646
Draft
Byron wants to merge 1 commit intogitbutlerapp:masterfrom
Draft
configurable gitbutler storage path via Git config#12646Byron wants to merge 1 commit intogitbutlerapp:masterfrom
Byron wants to merge 1 commit intogitbutlerapp:masterfrom
Conversation
|
@Byron is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
Resolve GitButler project storage from Git config and make non-release defaults channel-specific (.git/gitbutler.<channel>) so app channels do not interfere with incompatible database versions. Non-stable builds read gitbutler.<channel>.storagePath (for example gitbutler.nightly.storagePath), while release builds read gitbutler.storagePath. Relative paths are resolved against the repository git dir. This also allows moving project storage off unsuitable repository drives (e.g. NFS/network mounts), addressing SQLite lock/rename failures reported in gitbutlerapp#11157. Behavior notes: no automatic migration/fallback from legacy .git/gitbutler, defaults are computed in-memory (not auto-persisted to Git config), and path resolution now logs the effective storage path plus the config key to override it. Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
2 tasks
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.
Fixes #11157 and resolves the issue of Nightly builds putting the database into the future, making it unreadable with the stable build.
As this new default for
.git/gitbutleris configurable, the user can force both build types toTasks
Codex Plan
Commit-Ready Plan: Configurable GitButler Storage Path with Channel Isolation
Summary
Change GitButler project storage to be resolved from Git config (
gitbutler.storagePath) and default non-stable builds to channel-specific storage paths (.git/gitbutler.<channel>).This addresses two motivations:
Scope and behavior
gitbutler.storagePath.gitbutler.storagePathis absolute: use it directly.gitbutler.storagePathis relative: resolve againstrepo.git_dir().<git_dir>/gitbutler.<git_dir>/gitbutler.<channel>.devand use<git_dir>/gitbutler.dev..git/gitbutler..git/config.Required implementation changes
but-core(RepositoryExt) so all callers use one implementation.but-ctx::Contextto store the resolved project-data directory eagerly at creation time.Contextconstructors create/open a real repository before finalizing context so full Git config is available.Contextthrough the resolved project-data directory, not a hardcodedgitdir.join("gitbutler").gitbutler-projectadd/get/delete storage dir operations) to use the same resolver logic..git/gitbutler.Public API / interface changes
gitbutler.storagePath.RepositoryExtmethod for resolved storage path.Context::project_data_dir()becomes config-aware instead of hardcoded.Contextand thread-safe context equivalents carry the resolved project-data directory as state.Testing and acceptance criteria
<git_dir>/gitbutler.<git_dir>/gitbutler.nightly.<git_dir>/gitbutler.<channel>.git_dir.project_data_dir..git/gitbutler.Rollout and compatibility notes
.git/gitbutlerdata will start isolated storage by default.gitbutler.storagePathto a local filesystem path suitable for SQLite.Proposed commit message
Subject
ctx/project: make storage path git-configurable and channel-isolatedBody
Resolve GitButler project storage from gitbutler.storagePath and make non-release defaults channel-specific (.git/gitbutler.<channel>) to prevent channel interference from incompatible DB versions.This also enables moving project storage off unsuitable repository drives (e.g. NFS/network mounts), addressing SQLite lock/rename failures reported in #11157.Behavior notes: no automatic migration/fallback from legacy .git/gitbutler, and defaults are computed in-memory (not auto-persisted to git config).Assumptions locked
gitbutler.storagePath.git_dir-relative.gitbutler-projectstorage directory operations are included in this same change.