Introduction¶
The core design philosophy of DeepSeek Harness (DSH) is “everything is a plugin.” During agent development and debugging, common tasks include frequently checking the Git commit history, locating specific changes, and safely switching branches. The dsh-git-chain plugin is designed to address these needs. It presents repository history as an SVG swimlane diagram and provides the ability to inspect details, review diffs, and perform protected branch switching directly within the sidebar workflow.
Plugin Positioning¶
dsh-git-chain is a DSH client plugin maintained by ShinonomeAya. It does not operate directly on low-level Git internals. Instead, it acts as a bridge between the DSH Web GUI and the DSH Host: the frontend handles SVG visualization and interaction, while the backend invokes the Git CLI through ctx.subprocess to perform specific graph generation, diffing, and branch operations.
Core Features¶
History View and Filtering¶
The plugin provides an SVG swimlane topology diagram showing commit nodes, merge inflow lines, and branch outflow lines.
- First-parent mainline view: Focuses on the first-parent chain of the current HEAD while preserving merge metadata.
- Range filtering: Supports viewing all refs, the current branch, or a specified local branch.
- Instant filtering: Within the loaded history window, entries can be filtered by subject, author, ref, or commit OID.
- Layout strategy: Uses a minimal lane strategy, with fixed row height and virtual scrolling, suitable for long commit lists.
Commit Details and Diffs¶
- Clicking a commit node displays the author, committer, timestamp, parent commits, and changed files.
- Provides file status badges and added/deleted line counts.
- Unified diffs are lazy-loaded, with a single output limit of 1 MB to prevent large changes from filling the interface.
Branch Switching and Protection¶
- Protected switching: Before switching branches, the system automatically checks for conflicts, ongoing Git operations, other worktrees, and files that may be overwritten.
- Safety mechanisms: Uses
git switch --no-guessto avoid implicit creation or guessing of remote branches; branch names and commit OIDs are validated against a whitelist before command execution, using argv rather than concatenated shell strings. - Fallback mechanism: The preferred host is
dsh-better-sidebar; if that base is unavailable, it falls back to input-bar chips and a floating panel.
Installation and Enablement¶
Before installation, ensure the environment meets the following requirements:
- DSH version >= 0.1.1-rc.1
- Node.js version >= 22.19.0
- Git is available in the system PATH
- Clone the repository:
git clone https://github.com/ShinonomeAya/dsh-git-chain.git
cd dsh-git-chain
- Install dependencies and build:
pnpm install
pnpm run build
- Add the plugin to the DSH Desktop profile:
dsh plugin --profile desktop add link:/absolute/path/to/dsh-git-chain
- Restart DSH and find the Git Chain Diagram tab in the sidebar.
To uninstall it:
dsh plugin --profile desktop remove dsh-git-chain
Typical Usage¶
- View commit details: Click a commit node; the sidebar expands to show author information, parent commit history, and the list of changed files.
- Browse the mainline: Enable first-parent in the view selector to focus on the mainline history of the current branch, making it easier to trace the logical flow.
- Safe switching: Click a branch name in the branch list; the system performs safety checks (such as uncommitted changes or conflicts) and switches after confirming there are no issues.
- Filter history: Within the loaded history window, enter a keyword to quickly filter commits by a specific author or subject.
Applicable Scenarios and Cautions¶
This plugin is suitable for developers who need to perform frequent code review, history retrospection, or branch management in DSH.
Be aware of the following known limitations:
- Filter scope: Text filtering currently only applies to the loaded window; repository-wide subject, author, or file-level server-side search is still on the roadmap.
- Layout limitation: The diagram layout uses a minimal lane strategy; some complex diamond merge nodes may slightly overlap.
- Visual truncation: The virtual scroll window truncates lanes at the top and bottom edges, but overscan reduces visual jumps.
- Diff size: A single complete diff output is limited to 1 MB.
Additionally, the plugin runs under DSH process privileges. The Git route only accepts registered workspaces and, by default, only accepts loopback requests. Security is controlled at the Host layer.
Conclusion¶
dsh-git-chain refactors the experience of viewing Git history through visualization and incorporates branch switching safety checks into the workflow. For users who use DSH for agent development or code management, it is a tool that can directly improve debugging efficiency.