l
dsh-easy-git
Manifest validGit panel for the DeepSeek Harness sidebar: commit history, per-file diffs, .patch export, fast-forward pull, branch switching.
UI (client)hasBundlePatch
dsh-easy-git
A Git panel for the DeepSeek Harness sidebar: browse commits, read diffs file by file, export a .patch, pull the current branch, and switch branches — without leaving the GUI.
中文:DSH 侧栏里的 Git 面板,不用离开界面就能看提交、逐文件看 diff、导出 patch、拉取和切分支。
Features
- Commit history — paged log, search by subject/author/hash, relative times.
- Per-file diff — click a file to see its patch; two-column line numbers, hunk headers, add/remove counts, merge commits diffed against their first parent.
- Fullscreen diff — expand the diff to the whole panel (Esc to exit); the left rail lists the commit's files so you can switch files without leaving fullscreen.
- Export
.patch— pick a folder (native dialog) and get agit format-patchfile named<short-hash>-<subject>.patch; the panel shows the full path and copies it in one click. - Pull —
fetch+merge --ff-onlyfor the current branch. A diverged branch or a conflicting working tree is reported instead of being merged or reset. - Branches — local/remote list, current branch marked, switch local branch or check out a remote branch.
- AI helpers — explain a commit in three paragraphs, review uncommitted changes, turn the branch into a PR description, or find a commit from a sentence; all use the model selected in Harness and run only when you click.
- Commit from the panel — stage or unstage a file, stage everything, write a message, and commit;
⌘↵commits, and one button asks the configured model for a message (falls back to a message built from the file list when no model is available). - Discard one file — with a confirmation, and the current content is copied to a temp backup first.
- Right-click menus — on a commit: copy the full hash, copy the message, open it in the browser; on a file: view its history, copy its path, copy that file's diff, reveal it in Finder.
- File history —
git log --followfor one path, with a filter chip to jump back to the whole log. - Auto paging — scrolling the commit list loads the next page without a click.
- Copy repo URL — normalizes
git@/ssh://remotes to a web URL and copies it, with a short "copied" toast. - Follows the open workspace — when you open another workspace, the panel locates the repository containing it.
Install
From npm (once published):
dsh plugin --profile desktop add dsh-easy-git
From this repository:
dsh plugin --profile desktop add github:luyanghtml/dsh-easy-git
Then open Plugins, enable dsh-easy-git, and refresh the page. The panel appears as a Git icon in the sidebar.
Permissions and behavior
The plugin runs local git commands through the Harness host — it never talks to a Git host API and never asks for credentials.
- Read-only:
status,log,show,diff,branches,remotes. - Writes, only after you click:
checkout(branch switch),fetch,pull(merge --ff-only), and writing the exported.patchfile into a folder you choose. - The browser side calls the host through
/api/dsh-git, which requires the same-origin check plus anx-dsh-git: 1header, so a random page cannot drive it.
Development
- Host half:
index.js(route +git_panelagent tool),git.js(pure git operations). - Client half:
client.js, plain JavaScript with the React instance from the Harness module table; no build step. - Tests:
npm test(git layer, host route, client render).
Two Harness details worth knowing when hacking on it:
- The client bundle is served from a snapshot taken at plugin activation with an immutable cache header, so a client change needs the plugin disabled and enabled again — a page refresh alone shows the old code.
- Host changes need a Harness restart.
License
MIT
Comments
Loading…