git-pincer 0.1.3 → 0.1.4

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/README.md CHANGED
@@ -22,7 +22,7 @@ The name comes from Rust's mascot — the crab. A Git conflict is like two branc
22
22
  - **Three-pane merge UI** — local | result | remote, with chunk bands colored by change type using IDEA semantics: blue = modified, green = added, gray = deleted, red = conflict. Bands fade as chunks get resolved.
23
23
  - **Precise diff rendering** — delta-style word-level emphasis inside changed chunks, plus syntax highlighting (Maple theme via syntect, selected by file extension, gracefully disabled for huge files).
24
24
  - **Full flow takeover** — after all files are resolved it runs `git add` and the matching `--continue`, re-probes, and loops until the repository is clean. Multi-commit cherry-picks and multi-round rebases just work.
25
- - **RPG-style action menu** — running bare `git-pincer` in a clean repository opens a pixel-art menu with a status window that maps your repository to character vitals (Lv. = commit count, HP = uncommitted changes, MP = stashes, EXP = commits ahead). Pick an action, then a branch (merge / rebase) or a commit (cherry-pick / revert); success and failure both pop an in-TUI dialog and return to the menu — no flicker, no exit.
25
+ - **RPG-style action menu** — running bare `git-pincer` in a clean repository opens a pixel-art menu with a status window that maps your repository to character vitals (Lv. = commit count, HP = uncommitted changes, MP = stashes, EXP = commits ahead). Pick an action, then a branch (merge / rebase / switch) or a commit (cherry-pick / revert); success and failure both pop an in-TUI dialog and return to the menu — no flicker, no exit.
26
26
  - **Broad conflict-source support** — merge, rebase, pull, cherry-pick, revert, `git am`, and even flows without a `--continue` such as `stash pop`, `checkout -m` or `apply --3way`.
27
27
  - **Native git, zero magic** — everything shells out to your git binary (the same route lazygit and IDEA take), so credentials, hooks, merge strategies and rerere all follow your existing configuration. Arguments are passed as arrays (no shell, no injection), and host `GIT_DIR`-style variables are scrubbed so nested invocations from hooks cannot hijack the wrong repository.
28
28
  - **Terminal-aware theming** — dark (Tokyo Night) and light (Maple Light) themes via `--theme <auto|dark|light>`, `COLORFGBG` auto-detection, and automatic xterm-256 quantization on terminals without truecolor support.
@@ -37,6 +37,12 @@ Requires `git` on your `PATH`.
37
37
  cargo install git-pincer
38
38
  ```
39
39
 
40
+ Or via npm (prebuilt binary, no Rust toolchain needed):
41
+
42
+ ```bash
43
+ npm install -g git-pincer
44
+ ```
45
+
40
46
  Prebuilt binaries for major platforms are also attached to [GitHub Releases](https://github.com/zlx2019/git-pincer/releases). To build from source (Rust 1.96+):
41
47
 
42
48
  ```bash
@@ -53,6 +59,7 @@ git-pincer rebase <branch> # run git rebase, looping through every conflict
53
59
  git-pincer pull origin main # arguments are passed straight to git pull
54
60
  git-pincer cherry-pick <commit> # multiple commits / options are passed through
55
61
  git-pincer revert <commit> # run git revert and take over the conflicts
62
+ git-pincer switch [branch] # switch branches; remote ones get a local tracking branch (no arg opens a picker)
56
63
  git-pincer file conflict.txt # git-free: parse a conflict-marked file, write it back
57
64
  git-pincer abort # abort the operation in progress (with confirmation)
58
65
  git-pincer completions zsh # shell completion script (bash/zsh/fish/powershell/elvish)
@@ -98,7 +105,7 @@ rpg_accent = "#ff7a2f"
98
105
  band_conflict = ["#3a1e22", "#5e2d35"] # band_* / emph_* colors take a [normal, selected] pair
99
106
  ```
100
107
 
101
- Rebindable actions: `take-local`, `take-remote`, `ignore`, `undo`, `undo-file`, `edit`, `apply-all`, `next-change`, `prev-change`, `next-conflict`, `prev-conflict`, `copy-chunk`, `copy-file`, `copy-local`, `copy-remote`, `write`, `next-file`, `fold`, `quit`, `help`. Overridden keys show up in the hint bar and help overlay automatically. Unknown action names, key conflicts and invalid colors are rejected at startup with the full list of valid values.
108
+ Rebindable actions: `take-local`, `take-remote`, `ignore`, `undo`, `undo-file`, `edit`, `apply-all`, `next-change`, `prev-change`, `next-conflict`, `prev-conflict`, `scroll-down`, `scroll-up`, `scroll-left`, `scroll-right`, `copy-chunk`, `copy-file`, `copy-local`, `copy-remote`, `write`, `next-file`, `fold`, `quit`, `help`. Overridden keys show up in the hint bar and help overlay automatically. Unknown action names, key conflicts and invalid colors are rejected at startup with the full list of valid values.
102
109
 
103
110
  Try the TUI without a git repository:
104
111
 
@@ -120,6 +127,7 @@ cp fixtures/conflict.txt /tmp/ && git-pincer file /tmp/conflict.txt
120
127
  | `j` / `k` | Move to the next / previous change chunk |
121
128
  | `n` / `p` | Jump to the next / previous unresolved conflict |
122
129
  | `Ctrl+d` / `Ctrl+u` | Scroll the viewport half a page down / up (navigation keys re-attach it to the cursor) |
130
+ | `<` / `>` (or `Shift+←` / `Shift+→`) | Pan all three panes left / right on long lines (`…` marks clipped content) |
123
131
  | `y` / `Y` | Copy the current chunk result / the whole file result |
124
132
  | `H` / `L` | Copy the local / remote side of the current chunk |
125
133
  | `w` | Write the file (auto-applies remaining non-conflict changes, then `git add`) |
package/bin/git-pincer.js CHANGED
@@ -1,13 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
 
4
- // git-pincer 的 npm 启动垫片:
5
- // 按当前平台定位 optionalDependencies 里对应的二进制子包, 并把参数原样转发给它。
6
-
7
4
  const { spawnSync } = require("node:child_process");
8
5
  const path = require("node:path");
9
6
 
10
- // 判断 Linux 是否为 musl 环境(运行时报告中没有 glibc 版本信息即视为 musl)
11
7
  function isMusl() {
12
8
  try {
13
9
  return !process.report.getReport().header.glibcVersionRuntime;
@@ -16,7 +12,6 @@ function isMusl() {
16
12
  }
17
13
  }
18
14
 
19
- // 根据平台与架构推导对应的二进制子包名, 不支持的平台返回 null
20
15
  function platformPackage() {
21
16
  const { platform, arch } = process;
22
17
  if (platform === "darwin" && arch === "arm64") return "@zero9501/git-pincer-darwin-arm64";
@@ -29,7 +24,6 @@ function platformPackage() {
29
24
  return null;
30
25
  }
31
26
 
32
- // 定位子包内的可执行文件绝对路径, 失败时输出指引并退出
33
27
  function binaryPath() {
34
28
  const pkg = platformPackage();
35
29
  if (!pkg) {
@@ -52,7 +46,6 @@ if (result.error) {
52
46
  process.exit(1);
53
47
  }
54
48
  if (result.signal) {
55
- // 被信号终止时对自身重放同一信号, 让退出码符合 shell 约定(128+N)
56
49
  process.kill(process.pid, result.signal);
57
50
  }
58
51
  process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-pincer",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A simple and efficient terminal Git conflict resolution CLI tool.",
5
5
  "keywords": [
6
6
  "git",
@@ -27,11 +27,11 @@
27
27
  "node": ">=16"
28
28
  },
29
29
  "optionalDependencies": {
30
- "@zero9501/git-pincer-darwin-arm64": "0.1.3",
31
- "@zero9501/git-pincer-darwin-x64": "0.1.3",
32
- "@zero9501/git-pincer-linux-arm64-gnu": "0.1.3",
33
- "@zero9501/git-pincer-linux-x64-gnu": "0.1.3",
34
- "@zero9501/git-pincer-linux-x64-musl": "0.1.3",
35
- "@zero9501/git-pincer-win32-x64": "0.1.3"
30
+ "@zero9501/git-pincer-darwin-arm64": "0.1.4",
31
+ "@zero9501/git-pincer-darwin-x64": "0.1.4",
32
+ "@zero9501/git-pincer-linux-arm64-gnu": "0.1.4",
33
+ "@zero9501/git-pincer-linux-x64-gnu": "0.1.4",
34
+ "@zero9501/git-pincer-linux-x64-musl": "0.1.4",
35
+ "@zero9501/git-pincer-win32-x64": "0.1.4"
36
36
  }
37
37
  }