Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Source checks
on: [push, pull_request]
concurrency:
group: source-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
Expand All @@ -19,8 +22,21 @@ jobs:
node-version: 24.19.0
cache: pnpm
- uses: dtolnay/rust-toolchain@1.99.0
- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/desktop/src-tauri
cache-on-failure: true
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- name: Prepare Windows native write bridge
if: runner.os == 'Windows'
shell: pwsh
run: |
pnpm build
node scripts/build-desktop.mjs --prepare-only
cargo build --locked --manifest-path apps/desktop/src-tauri/Cargo.toml
if ($LASTEXITCODE -ne 0) { throw 'Native write bridge build failed' }
"GIT_VIEW_NATIVE_HELPER=$env:GITHUB_WORKSPACE\apps\desktop\src-tauri\target\debug\git-view-desktop.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: macOS full tests including HTTP transport
if: runner.os == 'macOS'
run: pnpm test
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ jobs:
cache-on-failure: true
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- name: Prepare Windows native write bridge
if: runner.os == 'Windows'
shell: pwsh
run: |
pnpm build
node scripts/build-desktop.mjs --prepare-only
cargo build --locked --manifest-path apps/desktop/src-tauri/Cargo.toml
if ($LASTEXITCODE -ne 0) { throw 'Native write bridge build failed' }
"GIT_VIEW_NATIVE_HELPER=$env:GITHUB_WORKSPACE\apps\desktop\src-tauri\target\debug\git-view-desktop.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: macOS full tests including HTTP transport
if: runner.os == 'macOS'
run: pnpm test
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Git View 是一个本地 Git 图形工具,用于查看文件差异、浏览提交历史,以及比较分支和提交。支持整文件暂存、提交和本地分支操作,写入前需要预览确认。

支持中文和英文界面,通过本机 Git 读取仓库,无需连接远程服务。目前为桌面预览版,提供 macOS Apple silicon 和 Windows x64 安装包;Windows 暂时只开放查看。
支持中文和英文界面,通过本机 Git 读取仓库,无需连接远程服务。目前为桌面预览版,提供 macOS Apple silicon 和 Windows x64 安装包。

![提交历史与文件差异,浏览器中的演示仓库](docs/verification/screenshots/history-simplification-browser.png)

Expand All @@ -25,7 +25,7 @@ Git View 是一个本地 Git 图形工具,用于查看文件差异、浏览提
在 [GitHub Releases](https://github.com/XSY-28/git-view/releases/latest) 下载当前版本的安装包和 `.sha256` 校验文件,无需登录 GitHub。两种包都自带 Node 运行时,使用时只需系统 Git,无需另装 Node、pnpm 或 Rust。

- **macOS Apple silicon**:下载 `macos-arm64.dmg`,打开后先退出 Git View,再双击 **Install Git View.command**。安装位置固定为 `~/Applications/Git View.app`,旧版本保留为 ZIP;完成后弹出磁盘映像。不要再复制一份到 `/Applications`。
- **Windows x64**:下载 `windows-x64-setup.exe`,运行安装向导,再从开始菜单打开。需要 Git for Windows 与 WebView2;缺少 WebView2 时安装程序会下载运行时。Windows 仅支持查看,不开放暂存、提交和分支写入。
- **Windows x64**:下载 `windows-x64-setup.exe`,运行安装向导,再从开始菜单打开。需要 Git for Windows 与 WebView2;缺少 WebView2 时安装程序会下载运行时。Windows 桌面应用支持暂存、取消暂存、提交、创建和切换分支。

当前包尚未代码签名或 Apple 公证,系统可能提示无法验证发布者。确认下载来源后,使用系统提供的“仍要运行”或“隐私与安全性 → 仍要打开”入口,不要关闭系统安全机制。完整步骤与校验、卸载说明见[安装包说明](docs/INSTALL.md)。

Expand Down Expand Up @@ -86,7 +86,7 @@ open "$HOME/Applications/Git View.app"

## 支持范围

macOS Apple silicon 已有桌面实机验证。Windows 暂时仅开放查看,已通过 Windows CI 中的实际安装、原生窗口差异与历史走查、正常退出和卸载验证;Windows 10/11 实体电脑尚未复测。详见[安装包验收记录](docs/verification/2026-10-07-desktop-installers.md)。
macOS Apple silicon 已有桌面实机验证。Windows 通过 CI 验证实际安装、原生窗口及仓库操作;Windows 10/11 实体电脑尚未复测。详见[安装包验收记录](docs/verification/2026-10-07-windows-operations.md)。

- 暂不提供 push、merge、rebase 或历史重写。远程跟踪引用来自本地仓库,不会自动获取远端更新。
- 暂存按整个文件操作,不支持选择差异行或片段。写入限常规仓库和 index;冲突、进行中的 Git 操作、submodule、特殊 index 或外部内容过滤器会被拒绝。暂不支持 `text`、`eol`、`ident`、`working-tree-encoding` 和 autocrlf 转换。
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/Cargo.lock

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

4 changes: 2 additions & 2 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "git-view-desktop"
version = "0.2.0"
version = "0.3.0"
edition = "2021"
description = "Desktop host for local Git viewing and previewed operations"
license = "MIT"
Expand All @@ -20,7 +20,7 @@ uuid = { version = "1", features = ["v4"] }
libc = "0.2"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_JobObjects", "Win32_System_Threading", "Win32_Security"] }
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_JobObjects", "Win32_System_Threading", "Win32_Security", "Win32_Security_Authorization", "Win32_Storage_FileSystem", "Win32_System_Diagnostics_ToolHelp"] }

[profile.release]
strip = true
Expand Down
7 changes: 7 additions & 0 deletions apps/desktop/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
)]
mod config;
mod sidecar;
#[cfg(windows)]
mod windows_platform;

use serde_json::{json, Value};
use std::{
Expand Down Expand Up @@ -129,6 +131,11 @@ fn main() {
libc::umask(0o077);
}
let args: Vec<String> = std::env::args().skip(1).collect();
#[cfg(windows)]
if args.as_slice() == ["--windows-platform"] {
windows_platform::main();
return;
}
if args.first().map(String::as_str) == Some("inspect") {
// This branch exits before any Tauri builder, webview or dialog is created.
let status = config::cli_resources().and_then(|resources| {
Expand Down
8 changes: 6 additions & 2 deletions apps/desktop/src-tauri/src/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ impl Sidecar {
}
#[cfg(windows)]
{
command.env(
"GIT_VIEW_NATIVE_HELPER",
std::env::current_exe().map_err(|_| "Cannot locate native helper")?,
);
use std::os::windows::process::CommandExt;
// The GUI host has no console; keep its piped background runtime quiet.
command.creation_flags(windows_sys::Win32::System::Threading::CREATE_NO_WINDOW);
Expand Down Expand Up @@ -266,12 +270,12 @@ fn reap(running: Running) {
}

#[cfg(windows)]
struct WindowsJob(windows_sys::Win32::Foundation::HANDLE);
pub(crate) struct WindowsJob(windows_sys::Win32::Foundation::HANDLE);
#[cfg(windows)]
unsafe impl Send for WindowsJob {}
#[cfg(windows)]
impl WindowsJob {
fn assign(child: &Child) -> Result<Self, String> {
pub(crate) fn assign(child: &Child) -> Result<Self, String> {
use std::os::windows::io::AsRawHandle;
use windows_sys::Win32::{Foundation::CloseHandle, System::JobObjects::*};
unsafe {
Expand Down
Loading
Loading