Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c91c943
feat(ui): rebuild the interface on iced (work in progress)
MotherSphere Oct 8, 2026
7acc1d8
Merge main into migration/iced-rewrite
MotherSphere Nov 24, 2026
1250767
fix(ui): sign in to GitHub with the device flow in the iced auth panel
MotherSphere Nov 24, 2026
d95bc86
fix(ui): open terminals without putting the repository path in a comm…
MotherSphere Nov 24, 2026
8b45506
fix(ui): show clone progress, report failed clones and copy through iced
MotherSphere Nov 24, 2026
1b88cac
style(ui): format the iced rewrite and fix its clippy warnings
MotherSphere Nov 24, 2026
ac70071
chore(ui): bundle only the font weight the interface uses
MotherSphere Nov 24, 2026
f3cc687
fix(git): pull and push only the checked-out branch
MotherSphere Nov 24, 2026
a619e91
fix(git): detect every SSH URL form and keep the token on HTTPS
MotherSphere Nov 24, 2026
6541864
fix(auth): pick the token validation API by exact host name
MotherSphere Nov 24, 2026
f2de682
fix(auth): save tokens under the host name that lookups use
MotherSphere Nov 24, 2026
090d387
fix(git): keep local edits on checkout and stash apply
MotherSphere Nov 24, 2026
96f95e8
fix(auth): remove signed-out tokens from every store
MotherSphere Nov 24, 2026
6e10cb8
fix(auth): write secret files owner-only and keep a damaged key file
MotherSphere Nov 24, 2026
880a953
fix(git): reload the cached index and simplify the repository cache
MotherSphere Nov 24, 2026
6c34526
fix(auth): read tokens saved with the local key once the keyring unlocks
MotherSphere Nov 24, 2026
9f49ed9
fix(git): drain git's output while waiting for merge and rebase
MotherSphere Nov 24, 2026
b9ca4c5
fix(auth): refresh expired GitLab OAuth tokens
MotherSphere Nov 24, 2026
7c6f9ff
fix(auth): keep waiting for the GitLab callback after a stray request
MotherSphere Nov 24, 2026
6c1d2bc
fix(config): clamp the auto-fetch interval and log retention on read
MotherSphere Nov 24, 2026
c763d35
fix(config): refuse preference imports that hold no preferences
MotherSphere Nov 24, 2026
6ae6757
fix(git): count diff lines, filter the whole log and handle unborn HEAD
MotherSphere Nov 24, 2026
93f07c4
refactor(git): drop no-op code in the git layer
MotherSphere Nov 24, 2026
638e1ce
chore(deps): remove parking_lot
MotherSphere Nov 24, 2026
c47ba2d
Merge branch 'audit-git' into gitspace-audit-fixes
MotherSphere Nov 24, 2026
93cbcf3
refactor: remove unused auth, config and error code
MotherSphere Nov 24, 2026
01cbe29
Merge branch 'audit-auth' into gitspace-audit-fixes
MotherSphere Nov 24, 2026
37f78d6
fix(auth): sign out on machines without a keyring service
MotherSphere Nov 24, 2026
c562080
fix(ui): build the four themes from one constructor
MotherSphere Nov 24, 2026
409752f
fix(ui): drop dead preferences and keep unsaved edits out of the config
MotherSphere Nov 24, 2026
499bd6b
fix(ui): run stage panel git work off the UI thread and add commits
MotherSphere Nov 24, 2026
585ad21
refactor(ui): delete unused animation, perf and dev gallery modules
MotherSphere Nov 24, 2026
e03e4dc
fix(ui): close a toast as soon as its button is clicked
MotherSphere Nov 24, 2026
d10ce0b
perf(ui): compute the Open tab quick-access paths once
MotherSphere Nov 24, 2026
51c4c70
fix(ui): tie repository search results to the request that asked for …
MotherSphere Nov 24, 2026
de8e9ae
fix(ui): read and change saved accounts off the UI thread
MotherSphere Nov 24, 2026
7ce0f76
fix(ui): keep one sidebar entry for the Open tab
MotherSphere Nov 24, 2026
67f4f7e
fix(ui): keep pinned branches when preferences are applied later
MotherSphere Nov 24, 2026
d0d25a8
perf(ui): stop scanning the working tree when a repository opens
MotherSphere Nov 24, 2026
2373d37
fix(ui): run branch operations in the background and confirm destruct…
MotherSphere Nov 24, 2026
a802e16
fix(ui): load repositories and run Repo Overview work in background t…
MotherSphere Nov 24, 2026
5c341ae
fix(ui): load commit history in the background
MotherSphere Nov 24, 2026
5b21010
Merge branch 'audit-ui-panels' into gitspace-audit-fixes
MotherSphere Nov 24, 2026
16ffc80
fix(ui): load every panel when a repository opens and after it changes
MotherSphere Nov 24, 2026
a11cac3
refactor(git): remove git helpers the application never calls
MotherSphere Nov 24, 2026
e59b239
fix(ui): switch tabs with Ctrl+1 to Ctrl+9 again
MotherSphere Nov 24, 2026
a155804
docs: describe the iced interface and the fixed git behaviour
MotherSphere Nov 24, 2026
3b58730
fix(git): push only the checked-out branch and reload the index befor…
MotherSphere Nov 25, 2026
0ee7870
fix(auth): fall back to the saved token and refresh OAuth once at a time
MotherSphere Nov 25, 2026
d227a7d
fix(config): keep every valid value when one value has the wrong type
MotherSphere Nov 25, 2026
afa1c37
fix(ui): refresh the overview after branch changes and keep drafts on…
MotherSphere Nov 25, 2026
ed015de
Merge main after the squash merge of #1
MotherSphere Nov 25, 2026
51b37b0
test(git): compare pulled file contents without line endings
MotherSphere Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 2 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ tracing-appender = "0.2.5"
argon2 = { version = "0.6.0", default-features = false, features = ["alloc"] }
thiserror = "2.0.21"
zeroize = { version = "1.9.2", features = ["derive"] }
parking_lot = "0.13.0"
oauth2 = { version = "5.0.0", default-features = false }
webbrowser = "1.2.7"

Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ panel-based window inspired by GitKraken.
> work out of the box. OAuth sign-in needs the client ID of an OAuth app you register
> yourself, because no build embeds one yet. The git operations are covered by tests on
> local repositories; SSH sign-in, proxies and OAuth are covered by unit tests of their
> logic, not by tests against live servers. The interface has no language setting yet: most
> of it is in English, the Preferences window in French. It is being moved from egui to iced
> and the shared Colony UI kit, which brings English and French locales.
> logic, not by tests against live servers. The interface is built on iced and has no
> language setting yet: most of it is in French, with some labels still in English. It is
> meant to move to the shared Colony UI kit, which brings English and French locales.

## Why GitSpace

Expand All @@ -42,17 +42,19 @@ panel-based window inspired by GitKraken.
- Clone from GitHub, GitLab or any Git URL over HTTPS or SSH, and reopen recent repositories.
- Repository overview with fetch, pull (fast-forward), push, open in the file manager and
open a terminal, plus optional auto-fetch on an interval.
- Stage and unstage files with their diffs, restore a file from another branch, and create,
apply and drop stashes.
- Stage and unstage files with their diffs, commit, restore a file from another branch, and
create, apply and drop stashes.
- History with commit diffs, filtered by branch.
- Branches: create, rename, delete, check out and track, merge or rebase into the current
branch, compare with it, pin favourites, and archive a branch as a tag.
- Branches: create, rename, delete, check out and track, merge a branch into the current one
or rebase the current one onto it, compare with it, pin favourites, and archive a branch as
a tag. Delete, merge and rebase ask for confirmation, and checkout refuses to overwrite
uncommitted changes.
- Sign in to GitHub with a one-time code entered on github.com (OAuth device flow), to
GitLab through OAuth in the browser (PKCE), or to GitHub, GitLab and self-hosted hosts with
a personal access token.
- Network preferences: HTTP and HTTPS proxies, transfer timeout, preferring HTTPS and
allowing SSH.
- Four Catppuccin themes, adjustable control sizes and a reduced-motion setting.
- Four Catppuccin themes.
- Structured logs with daily rotation (`GITSPACE_LOG` sets the filter).

## Installation
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Sorted by who is reading, not by subject.
| | |
|---|---|
| [project/gitkraken-layout.md](project/gitkraken-layout.md) | the window layout, tabs and shortcuts, and what GitKraken has that GitSpace leaves out |
| [project/ui-stack.md](project/ui-stack.md) | why the interface is egui today and why it is moving to iced |
| [project/ui-stack.md](project/ui-stack.md) | why the interface moved from egui to iced, and where it goes next |

Security policy: [../SECURITY.md](../SECURITY.md).
5 changes: 3 additions & 2 deletions docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ GitSpace never saves over a file it could not read:
GitSpace started or `GITSPACE_TOKEN_MASTER_PASSWORD` changed or is no longer set: saving or
removing a token fails with an error and the file is left as it is. Unlock the keyring or set
the same master password, then restart GitSpace. If the key is gone for good, move
`tokens.enc` aside to start over.
`tokens.enc` aside to start over. Tokens saved while the keyring was locked are encrypted
with `token-local-key.bin`; the next start with the keyring unlocked reads them with that
key and saves them again under the keyring key.
- **`token-hosts.json` cannot be read**: the host list is left as it is and the error is
logged.

Expand Down Expand Up @@ -76,5 +78,4 @@ count set in Preferences are deleted at startup. Logs never contain a token.
|---|---|
| `GITSPACE_LOG` | the log filter, in [`tracing` `EnvFilter`](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html) syntax. The default is `gitspace=info,info`; `GITSPACE_LOG=gitspace=debug` shows GitSpace's own debug messages |
| `GITSPACE_TOKEN_MASTER_PASSWORD` | only used when the system keyring is unavailable: a password mixed (Argon2id, salt in `token-salt.bin`) into `token-local-key.bin`, the key that then encrypts `tokens.enc`. In that case it must be set to the same value every time GitSpace starts, or saved tokens cannot be decrypted. It is ignored while the keyring holds the key |
| `GITSPACE_PROFILE_UI` | when set, logs how long each part of the interface takes to draw, for profiling |
| `GITSPACE_GITHUB_CLIENT_ID`, `GITSPACE_GITLAB_CLIENT_ID` | read when GitSpace is **built**, not when it runs: the OAuth client IDs compiled into the binary, used instead of any ID entered in **Configure OAuth Apps** on the Auth tab. Without them, OAuth sign-in needs a client ID entered there: a GitHub OAuth app with "Enable Device Flow" ticked, or a GitLab application with "Confidential" unticked and the redirect URI `http://127.0.0.1:9876/callback` |
66 changes: 38 additions & 28 deletions docs/internals/architecture.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Architecture

GitSpace is one binary crate, `gitspace`, with no workspace and no build script. `src/main.rs`
answers `--version`, starts logging and hands the window to eframe; everything else lives in
answers `--version`, starts logging and hands the window to iced; everything else lives in
five modules.

```
src/
├── main.rs entry point: --version, logging, eframe::run_native
├── ui/ the egui application: shell, tabs, panels, theme, motion
├── main.rs entry point: --version, logging, iced::application
├── ui/ the iced application: shell, tabs, panels, theme
├── git/ repository operations on top of git2, plus the git CLI for three of them
├── auth/ tokens: validation, OAuth, keyring and encrypted-file storage
├── config.rs config.json: preferences, network and logging options, atomic writes
Expand All @@ -21,40 +21,45 @@ token as a plain argument from the UI.

## `ui`: the application

`ui/app.rs` holds `GitSpaceApp`, the `eframe::App`. Each frame it handles keyboard shortcuts,
draws the shell from `ui/layout.rs` (header, left rail, tab strip, see
[gitkraken-layout.md](../project/gitkraken-layout.md)) and the active tab, applies changes the
panels report through `take_*` methods, and runs auto-fetch when it is due.
`ui/app.rs` holds `GitSpaceApp`, the iced application state. Its `update` routes each
message to the panel it belongs to, applies changes the panels report through `take_*`
methods, and reloads the other panels when one of them changes the repository (commit,
checkout, merge, rebase). Its `view` draws the shell from `ui/layout.rs` (header, left rail,
tab strip, see [gitkraken-layout.md](../project/gitkraken-layout.md)) and the active tab. Its
subscriptions are the Ctrl+1 to Ctrl+7 tab shortcuts, the auto-fetch timer and the toast
timer.

One file per tab: `clone.rs` (search and clone), `recent.rs` (the Open tab), `repo_overview.rs`,
`stage.rs`, `history.rs`, `branches.rs`, `auth.rs`, and `preferences.rs` for the full-window
Preferences. `settings.rs` is an older settings panel that the tab strip no longer shows.
Shared pieces: `theme.rs` (the Catppuccin palettes), `animation.rs` (motion tokens and reduced
motion), `menu.rs` (menu items and their hover animation), `fonts.rs` (the bundled JetBrains
Mono Nerd Font), `notifications.rs` (toasts) and `perf.rs` (frame timings, logged when
`GITSPACE_PROFILE_UI` is set). `dev_gallery.rs` is a widget gallery shown in debug builds only.
Preferences. Shared pieces: `theme.rs` (the Catppuccin palettes), `menu.rs` (menu items),
`fonts.rs` (the bundled JetBrains Mono Nerd Font, Regular only), `context.rs` (the open
repository) and `notifications.rs` (toasts).

Network work that can take a while (clone, repository search, token checks, OAuth, auto-fetch)
runs on a thread behind a `poll_promise::Promise` that the frame polls. Fetch, pull and push
from Repo Overview still run on the UI thread.
Every git, keyring and network call runs in an iced `Task`, on tokio's blocking pool, and
returns its result as a message. Results carry the repository path they were computed for,
and a panel drops a result for a repository that is no longer open. `view` functions only
read state.

## `git`: repository operations

Thin functions over [git2](https://docs.rs/git2) (libgit2, vendored OpenSSL), one file per
area: `clone.rs`, `remote.rs` (fetch, pull as fast-forward only, push, prune), `branch.rs`,
`log.rs`, `diff.rs`, `status.rs`, `stash.rs`, `compare.rs` and `discovery.rs` (repository root,
worktrees, submodules).
area: `clone.rs`, `remote.rs` (fetch, pull as a fast-forward of the checked-out branch only,
push of the checked-out branch to its upstream), `branch.rs`, `commit.rs`, `log.rs`,
`diff.rs`, `status.rs`, `stash.rs`, `compare.rs` and `merge.rs`. Checkout, pull and stash
apply use libgit2's safe checkout, which fails instead of overwriting a modified file.

`transport.rs` is shared by every network operation: it checks the URL against the network
preferences (HTTPS preferred, SSH allowed), picks the proxy, applies the idle timeout, and
answers libgit2's credential callback. HTTPS remotes get the saved token, plain HTTP never
does, and SSH tries ssh-agent then the default key files, each method once.
answers libgit2's credential callback. Only `https://` remotes get the saved token. Any URL
with a colon before its first slash (`ssh://`, `git+ssh://`, `host:path`) counts as SSH, which
tries ssh-agent then the default key files, each method once.

Three operations shell out to the `git` command instead of libgit2, which is why `git` must
be on `PATH` at runtime: merge and rebase (`merge.rs`, with a timeout) and restoring a file
from another branch (`branch.rs`).
be on `PATH` at runtime: merge and rebase (`merge.rs`, with a timeout, reading git's output
while it runs) and restoring a file from another branch (`branch.rs`).

`repo_cache.rs` is a cache of open repositories that nothing calls yet.
`repo_cache.rs` keeps a few open `Repository` handles per thread for the read-only
functions; `merge.rs` re-reads the index before it lists conflicts.

## `auth`: tokens

Expand All @@ -64,8 +69,12 @@ it, and `TokenStorage`, which keeps it. Tokens go to the operating system keyrin
With the encrypted fallback on, they are also written to `tokens.enc` (ChaCha20-Poly1305,
fresh nonce per write) under a key that lives in the keyring, or in `token-local-key.bin`
when the keyring is unavailable, optionally mixed with `GITSPACE_TOKEN_MASTER_PASSWORD`
through Argon2id. A file that exists but cannot be decrypted is never overwritten.
Host names are normalised to `https://`; a plain `http://` host is refused before any request.
through Argon2id. If the keyring key cannot decrypt the file, the local key is tried and the
file is written again under the keyring key. A file that exists but cannot be decrypted is
never overwritten, and secret files are created owner-only (0600) on Unix. Tokens are saved
under the lowercase host name without scheme or port, the form lookups use; a plain `http://`
host is refused before any request. Signing out removes the token from the keyring and from
`tokens.enc`.

`auth/oauth.rs` runs the two OAuth sign-ins, both through its own reqwest client with
redirects turned off:
Expand All @@ -79,15 +88,16 @@ redirects turned off:
- **GitLab** uses the authorization code flow with PKCE: `OAuthFlow` opens the browser and
listens for the callback on `127.0.0.1` port 9876, the redirect URI registered with the
GitLab application. If that port is in use, sign-in stops with an error before the browser
opens.
opens. A request without the expected `state` gets a 400 and the listener keeps waiting.
An expired GitLab token is refreshed with its refresh token when it is next needed.

The client IDs come from `GITSPACE_GITHUB_CLIENT_ID` and `GITSPACE_GITLAB_CLIENT_ID` at build
time (`ui/auth.rs`), and otherwise from the IDs entered under Configure OAuth Apps.

## `config`, `logging`, `error`

`config.rs` loads and saves `config.json`. An unknown value falls back to its default
without discarding the rest, an unparseable file is backed up before defaults are used, and
without discarding the rest, out-of-range numbers are clamped when read, an unparseable file is backed up before defaults are used, and
every write goes through `write_atomic` (temporary file, sync, rename). Where the files live
is in [configuration](../guide/configuration.md).

Expand All @@ -114,7 +124,7 @@ Today these only log a warning at startup; nothing else reads them.
## Tests

Unit tests sit next to the code, in a `#[cfg(test)] mod tests` block, or in `git/tests.rs`
and `ui/tests.rs` for the larger suites. The git tests build throwaway repositories with
for the larger git suite. The git tests build throwaway repositories with
`tempfile`. CI runs the built binary with `--version`, as the release smoke test does.

## Release chain
Expand Down
22 changes: 8 additions & 14 deletions docs/project/gitkraken-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ This page describes the shell as it is built today, in `src/ui/layout.rs` and
```

- **Header.** Pinned to the top. Clicking the GitSpace name opens Preferences, which
replaces the whole window until it is closed (General, Appearance, Accessibility and
GitSpace categories).
- **Left rail.** A resizable side panel, 220 px wide by default, in three groups:
- *Workspaces*: Recent, Favorites and Local Repos open the Open tab; Remote Repos opens
Clone.
replaces the whole window until it is closed (General, Appearance and GitSpace
categories).
- **Left rail.** A side panel, 220 px wide, in three groups:
- *Workspaces*: Recent opens the Open tab; Remote Repos opens Clone.
- *Actions*: Clone, Open, New Branch (the Branches tab) and Sync (the Stage tab).
- *Context*: the active repository with its path, and buttons to open it in the file
manager or copy its path. "No repository selected" until one is open.
Expand All @@ -35,24 +34,19 @@ This page describes the shell as it is built today, in `src/ui/layout.rs` and
## Tabs

In their default order: Clone, Open, Repo Overview, Stage, History, Branches and Auth.
Debug builds add a Dev Gallery tab at the end, a gallery of the menus, buttons and inputs
with their animations, for development.

- **Click** a tab to show it. The active tab is underlined in the theme's accent colour.
- **Ctrl+1 to Ctrl+8** (Cmd on macOS) jump to the tab in that position of the current order.
- **Drag** a tab over another to swap them; the dragged tab becomes active. The new order
lasts until GitSpace is closed.
- **Ctrl+1 to Ctrl+7** (Cmd on macOS) jump to the tab in that position.

## What it leaves out

GitKraken has more than this, and so did earlier notes for GitSpace. None of the following
exists, and none of it is planned for the egui shell:
exists, and none of it is planned yet:

- a right-hand context rail;
- context menus on tabs, or tabs that detach into their own window;
- a commit graph with one lane per branch: History draws a single line, with merge commits
marked;
- a commit graph: History is a plain list of commits;
- telemetry of any kind, including on navigation (see [Privacy](../../README.md#privacy)).

The interface is being moved to iced and the shared Colony UI kit (see
The interface runs on iced and is meant to move to the shared Colony UI kit (see
[ui-stack.md](ui-stack.md)); this page changes with that move.
Loading
Loading