dcs-sirgit 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +141 -2
- package/bin/sirgit +0 -0
- package/package.json +28 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DreamCreatures
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# sirgit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**A fast, visual git client — built as a thank-you to [ungit](https://github.com/FredrikNoren/ungit).**
|
|
4
|
+
|
|
5
|
+
## Why sirgit exists
|
|
6
|
+
|
|
7
|
+
I've used ungit nearly every working day for more than ten years. It's where I learned that version control could be visual, immediate, and humane — and its core idea, *the commit graph as the primary surface you think on*, has stayed with me longer than any tool since. But ungit's development has quietly wound down to automated dependency bumps, and the parts I loved began to strain on today's larger repositories.
|
|
8
|
+
|
|
9
|
+
So rather than watch the idea age, I rebuilt it. Every line of sirgit is written fresh, but nearly every design decision traces back to a decade of living in ungit — this project stands on its shoulders.
|
|
10
|
+
|
|
11
|
+
And I'll be candid about how a one-person rewrite became practical in days instead of years: sirgit was designed and built pair-programming with AI — **openclaw + ZCode + z.ai**. The taste came from ten years of using the original; the leverage came from the machines.
|
|
12
|
+
|
|
13
|
+
If you've loved ungit, sirgit is for you.
|
|
14
|
+
|
|
15
|
+
## What it is
|
|
16
|
+
|
|
17
|
+
A fast, lightweight local git graph UI — ungit's proven concepts on a modern stack, designed to stay smooth on repositories with 100k+ commits.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
┌──────────────────────────────────────────────────────────┐
|
|
21
|
+
│ ungit ▸ ~/Projects/ungit [master ↑2 ↓1] Fetch Pull … │
|
|
22
|
+
├────────────┬─────────────────────────────────────────────┤
|
|
23
|
+
│ branches │ ●──●──● main (HEAD) │
|
|
24
|
+
│ remotes │ ● feature/big ← virtualized │
|
|
25
|
+
│ tags │ ●──●──●──● (only visible rows in DOM) │
|
|
26
|
+
│ │ ── staging ────────────────────────── │
|
|
27
|
+
│ [+ branch] │ ✓ src/api.ts +12 −3 │
|
|
28
|
+
│ [+ tag] │ [ commit message… ] │
|
|
29
|
+
└────────────┴─────────────────────────────────────────────┘
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
One Rust binary, distributed through npm so `pnpm install -g` works (macOS arm64 today; the package refuses politely elsewhere):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm install -g dcs-sirgit # from npm
|
|
38
|
+
pnpm install -g . # or from a checkout — builds the release binary and links it
|
|
39
|
+
|
|
40
|
+
sirgit # inside a project: opens that repo
|
|
41
|
+
sirgit ~/Projects/ungit # or point anywhere
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
No node shim, no runtime dependencies — the npm package *is* the binary. Already running? A second `sirgit` just focuses the existing instance instead of erroring (port from `~/.sirgitrc.json`, default 8449).
|
|
45
|
+
|
|
46
|
+
## Why a rewrite
|
|
47
|
+
|
|
48
|
+
To be clear up front: none of this is a knock on ungit — it predates virtualized rendering, modern bundlers, and today's repository sizes, and it served a decade of my daily use without complaint. But its development has wound down to automated dependency bumps, and its 2013-era architecture (every loaded commit in the DOM, cumulative refetching on scroll) strains on large repos. The full reverse-engineering analysis lives in [`docs/recon.md`](docs/recon.md); the headline fixes:
|
|
49
|
+
|
|
50
|
+
| ungit | sirgit |
|
|
51
|
+
|---|---|
|
|
52
|
+
| "Load more" **cumulatively re-fetches** the entire history window on every scroll | Disjoint windowed pages, merged client-side by sha — nothing is re-fetched |
|
|
53
|
+
| Every loaded commit lives in the DOM forever | Virtualized: ~20–30 rows in the DOM regardless of history size (verified: 50k commits, flat DOM) |
|
|
54
|
+
| `git log --numstat --show-signature` per page (GPG + per-commit diffs) | Lightweight topology pages; numstat/diffs fetched lazily per visible commit |
|
|
55
|
+
| Every watcher event fetches **all remotes** → `index.lock` races patched over with retries | Fetch only on open/button/pull; per-repo single-writer operation queue makes races impossible |
|
|
56
|
+
| Live updates = full re-fetch + full re-render | WebSocket events → **O(delta) graph sync** (`/api/log/delta` returns only new/removed commits) |
|
|
57
|
+
| chokidar walks the entire worktree | `.git`-focused watcher + coalesced debounced events |
|
|
58
|
+
|
|
59
|
+
## Architecture
|
|
60
|
+
|
|
61
|
+
Monorepo:
|
|
62
|
+
|
|
63
|
+
- **`server/`** — Rust (axum + tokio). Serves the REST API, WebSocket events, and the built frontend **embedded in a single binary**. Git is invoked as the CLI (porcelain v2 / NUL-separated machine formats — no free-text parsing), with read results cached per repo revision and all mutations serialized through a per-repo write queue.
|
|
64
|
+
- **`web/`** — React 19 + TypeScript + Vite + Tailwind CSS 4 + TanStack Query + Zustand. Lane assignment and date-order topological sorting run client-side (pure, unit-tested, O(N log N)); rendering is fully virtualized.
|
|
65
|
+
|
|
66
|
+
### Run it
|
|
67
|
+
|
|
68
|
+
Prereqs: Rust ≥ 1.85, Node ≥ 20 + pnpm (frontend build), git ≥ 2.34.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# build the frontend once (the server embeds web/dist)
|
|
72
|
+
pnpm --dir web install
|
|
73
|
+
pnpm --dir web build
|
|
74
|
+
|
|
75
|
+
# run the server (debug build)
|
|
76
|
+
cargo run --manifest-path server/Cargo.toml # opens a browser on :8449
|
|
77
|
+
|
|
78
|
+
# or the release binary
|
|
79
|
+
cargo build --release --manifest-path server/Cargo.toml
|
|
80
|
+
./server/target/release/sirgit # single binary, ~3.5MB
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Then open a repository from the home screen, or pass it directly:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
sirgit --no-open /path/to/repo # http://localhost:8449/#/repository?path=...
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Options: `--port N`, `--no-open`. Config lives in `~/.sirgitrc.json` (`port`, `autoFetchOnOpen`, `pageSize`, `theme`).
|
|
90
|
+
|
|
91
|
+
### Develop
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
cargo run --manifest-path server/Cargo.toml -- --no-open # terminal 1
|
|
95
|
+
pnpm --dir web dev # terminal 2 → :5173 (proxies API/WS to :8449)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Test
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cargo test --manifest-path server/Cargo.toml # parsers, b64, delta, fixture repos (12 tests)
|
|
102
|
+
pnpm --dir web test # graph ordering + lane algorithms (8 tests, incl. 100k-commit scale)
|
|
103
|
+
pnpm --dir web exec playwright test # Playwright smoke: open → graph → stage → commit (2 tests)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
E2E starts its own server on :8549 automatically (`reuseExistingServer` honored; set `SIRGIT_URL` to target a running one).
|
|
107
|
+
|
|
108
|
+
### Release
|
|
109
|
+
|
|
110
|
+
Bump `version` in **both** `server/Cargo.toml` and `package.json` (prepare-bin warns on mismatch), commit, then:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git tag v0.2.0 && git push origin v0.2.0
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The `release` workflow builds the release binary (web/dist embedded), runs the full suite, publishes to npm, and attaches the binary + tarball to a GitHub Release. One-time setup: add the `NPM_TOKEN` repo secret (an npm *Automation* token, which skips 2FA in CI).
|
|
117
|
+
|
|
118
|
+
### Performance numbers (M1 acceptance)
|
|
119
|
+
|
|
120
|
+
Benchmarked head-to-head against ungit on **ungit's own repository** — see **[`docs/performance.md`](docs/performance.md)**: 10× faster first paint, ~420× less data transferred to scroll the same history, constant 25-row DOM, 0 long tasks. Also measured on the 50k-commit fixture (`node scripts/make-big-repo.mjs /tmp/sirgit-big 50000`):
|
|
121
|
+
|
|
122
|
+
- First topology build (entire 50k history, one `git log` pass): **~320ms**, then cached
|
|
123
|
+
- Any page, any offset (warm): **~9ms**, 42KB per 200 commits
|
|
124
|
+
- DOM while scrolling 1,200+ commits deep: **~24–34 rows / ~1,630 nodes**, flat
|
|
125
|
+
- Graph sync on a new commit: **O(delta)** — a single small JSON diff over the WS
|
|
126
|
+
|
|
127
|
+
On the real ungit repo (4,079 commits, 152 tags, 16 remote branches): 22 DOM rows on load, deep-scroll stays flat, live UI commit round-trips through staging → graph in <300ms.
|
|
128
|
+
|
|
129
|
+
### Credentials
|
|
130
|
+
|
|
131
|
+
Network operations route git's credential prompts through the UI: an inline shell credential-helper GETs `/api/credentials`, the server pushes a request over the WebSocket, and the credentials modal responds. Requires `curl` on PATH (present on macOS/Linux by default). Public repos and ssh-agent keys need nothing.
|
|
132
|
+
|
|
133
|
+
## Status / roadmap
|
|
134
|
+
|
|
135
|
+
**M1 (this repo, working):** virtualized graph + lanes, live delta sync, staging/commit (incl. amend), conflict banner + continue/abort, branch/tag CRUD + checkout (remote→local), fetch/pull/push with progress, clone/init, commit detail with per-file diffs, credentials modal, single-binary packaging, `.sirgitrc.json`.
|
|
136
|
+
|
|
137
|
+
**M2 (next):** drag-and-drop graph operations (rebase/merge/squash/reset/revert/cherry-pick/move/push), stash panel, submodules, patch-mode line staging, remote management UI.
|
|
138
|
+
**M3:** image diffs, GPG signing UI, auth, plugin story, Tauri desktop packaging.
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
MIT
|
package/bin/sirgit
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcs-sirgit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A fast, visual git client — built as a thank-you to ungit. One Rust binary, zero runtime dependencies.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"git",
|
|
7
|
+
"gui",
|
|
8
|
+
"ungit",
|
|
9
|
+
"graph",
|
|
10
|
+
"client"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/DreamCreatures/sirgit.git"
|
|
16
|
+
},
|
|
17
|
+
"bin": {
|
|
18
|
+
"sirgit": "bin/sirgit"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"bin/sirgit",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"os": [
|
|
25
|
+
"darwin"
|
|
26
|
+
],
|
|
27
|
+
"cpu": [
|
|
28
|
+
"arm64"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {}
|
|
6
31
|
}
|