Skip to content

Single branch project starting#14674

Merged
Caleb-T-Owens merged 1 commit into
masterfrom
caleb/single-branch-project-starting
Jul 13, 2026
Merged

Single branch project starting#14674
Caleb-T-Owens merged 1 commit into
masterfrom
caleb/single-branch-project-starting

Conversation

@Caleb-T-Owens

@Caleb-T-Owens Caleb-T-Owens commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 8, 2026 12:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a metadata-only “set target ref” initialization path to support single-branch mode: projects can be initialized (target ref + related metadata) without switching the user onto gitbutler/workspace, and the UI messaging/flows are updated accordingly.

Changes:

  • Introduces set_target_ref_and_init_project in but-workspace and exposes it through but-api (server/Tauri/SDK) for setting target metadata without changing the checked-out branch.
  • Updates Desktop + Lite clients to call the new command when singleBranch is enabled, including UI copy/loading states that no longer imply a branch switch.
  • Adds Rust tests + Playwright coverage for the single-branch onboarding path and supporting e2e git assertions.

Reviewed changes

Copilot reviewed 22 out of 26 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/but-sdk/src/generated/linear/index.js Re-exports the new native binding entrypoint in the Linear build.
packages/but-sdk/src/generated/linear/index.d.ts Adds TS declaration/docs for setTargetRefAndInitProject.
packages/but-sdk/src/generated/graph/index.js Re-exports the new native binding entrypoint in the Graph build.
packages/but-sdk/src/generated/graph/index.d.ts Adds TS declaration/docs for setTargetRefAndInitProject.
e2e/playwright/tests/singleBranch/addingAProject.spec.ts New Playwright test asserting onboarding sets target metadata without switching to workspace.
e2e/playwright/src/branch.ts Adds helper assertions for “ref does not exist” and “git config key equals value”.
crates/gitbutler-tauri/src/main.rs Registers the new Tauri command handler.
crates/gitbutler-operating-modes/src/lib.rs Makes outside-workspace metadata resilient to conflict computation failures (warn + empty conflicts).
crates/but-workspace/tests/workspace/main.rs Wires new init test module into the workspace test suite.
crates/but-workspace/tests/workspace/init.rs Adds thorough unit tests for metadata-only initialization behavior and error cases.
crates/but-workspace/tests/fixtures/scenario/init-project-with-origin.sh New fixture scenario used by init tests (origin + fork remotes).
crates/but-workspace/src/lib.rs Exposes new init module from but-workspace.
crates/but-workspace/src/init.rs Implements set_target_ref_and_init_project (validate target, compute/repair metadata, persist config).
crates/but-server/src/lib.rs Exposes the new endpoint route on the HTTP server.
crates/but-ctx/src/lib.rs Refactors set_project_meta to use new ProjectMeta::persist helper and invalidate cache.
crates/but-core/src/ref_metadata.rs Adds ProjectMeta::persist helper (persist local config + backfill legacy workspace metadata).
crates/but-api/src/workspace.rs Adds NAPI/Tauri-exposed API wrapper for set_target_ref_and_init_project plus tests.
crates/but-api/src/branch.rs Removes the older set_default_target implementation/tests in favor of the workspace API.
apps/lite/electron/src/preload.cts Adds Lite Electron preload API method to invoke new IPC command.
apps/lite/electron/src/main.ts Registers IPC handler calling SDK setTargetRefAndInitProject.
apps/lite/electron/src/ipc.ts Adds IPC channel + params typing + API surface for the new action.
apps/desktop/src/lib/branches/branchEndpoints.ts Adds a new backend mutation setTargetRef mapped to set_target_ref_and_init_project.
apps/desktop/src/lib/baseBranch/baseBranchService.svelte.ts Exposes setTargetRef mutation via the base-branch service.
apps/desktop/src/components/onboarding/ProjectSetupTarget.svelte Hides “GitButler switches your active branch…” messaging when singleBranch is enabled.
apps/desktop/src/components/onboarding/ProjectSetup.svelte Onboarding uses metadata-only target set when singleBranch is enabled.
apps/desktop/src/components/forge/BaseBranchSwitch.svelte Uses metadata-only target updates under singleBranch and adjusts loading label/state accordingly.

@Caleb-T-Owens Caleb-T-Owens changed the base branch from master to caleb/fix-remote-only-segments-in-workspace July 8, 2026 12:39
@Caleb-T-Owens Caleb-T-Owens force-pushed the caleb/single-branch-project-starting branch from 87fb4f7 to 14fd5d3 Compare July 9, 2026 11:45
Copilot AI review requested due to automatic review settings July 9, 2026 11:45
@github-actions github-actions Bot added rust Pull requests that update Rust code @gitbutler/desktop @gitbutler/ui CLI The command-line program `but` labels Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings July 12, 2026 14:11
@Caleb-T-Owens Caleb-T-Owens force-pushed the caleb/single-branch-project-starting branch from 14fd5d3 to 7a89c61 Compare July 12, 2026 14:11
@Caleb-T-Owens Caleb-T-Owens changed the base branch from caleb/fix-remote-only-segments-in-workspace to master July 12, 2026 14:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 26 changed files in this pull request and generated no new comments.

@Caleb-T-Owens Caleb-T-Owens force-pushed the caleb/single-branch-project-starting branch from 7a89c61 to 08b3df8 Compare July 12, 2026 14:41
@Caleb-T-Owens Caleb-T-Owens merged commit e921801 into master Jul 13, 2026
46 of 71 checks passed
@Caleb-T-Owens Caleb-T-Owens deleted the caleb/single-branch-project-starting branch July 13, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` @gitbutler/desktop @gitbutler/ui rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants