惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Vercel News
Vercel News
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
量子位
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)

Lobsters

Lunacy | Red Vice CIFSwitch: a non-universal Linux local root vulnerability RIPE NCC session fixation: poaching logins with an Atlas probe GNOME 2.20 but its Web Components Agentic Search for Context Engineering – Leonie Monigatti Garnix is shutting down [not OC] Concerning Emacs (and Jazz) Nitpicking the shell history scene in ‘Tron: Legacy’ What's cooking on SourceHut? Q2 2026 The tenth OpenPGP email summit Package managers that package package managers Clojure on Fennel part three: parsing WordPress at 23 Finding Miscompiles for Fun, Not Profit GitHub - creusot-rs/creusot: Creusot helps you prove your Rust code is correct. Announcing Rust 1.96.0 | Rust Blog A Love Letter to Neovim sqlite AGENTS.md Am I a Bad Friend? CSS vs. JavaScript • Josh W. Comeau Erlang Ecosystem Foundation - Supporting the BEAM community A brief note about slot access cost in Common Lisp Keyboard latency probe Rethinking the GNOME clipboard issues Back to the Building Blocks’ Building Blocks Tech Notes: Theseus: translating win32 to wasm Fast is better than slow Content-addressed Rust builds (or, what kache actually caches) Intent to Prototype: Embedding API Canada’s Bill C-22 and the security cost of collecting more data
akashina.tngl.sh/jjc
Tangled · 2026-05-28 · via Lobsters

Non-interactive hunk-level operations for Jujutsu. Scriptable alternative to jj split's interactive mode.

Requires jj v0.41.0.

Install#

cargo install --git https://tangled.sh/akashina.tngl.sh/jjc  # or from local checkout:
cargo install --path .

Commands#

jjc hunks — list hunks#

jjc hunks                    # list all hunks in @
jjc hunks --from main        # list hunks in a specific revision
jjc hunks -r @-              # shorthand for --from
jjc hunks abc123             # inspect a single hunk (by ID or prefix)
jjc hunks --full             # include numbered diff lines
jjc hunks --blame            # annotate each line with originating commit

--from accepts any revset that resolves to one revision. Hunks are listed for that revision's diff against its parent, so jjc hunks --from @- shows the parent commit's own hunks rather than the working copy's hunks.

Default output shows a changed-lines preview (up to 4 lines):

a1b[2c3d4e5f6] src/main.rs (+3 -1)
  +    println!("new line");
  -    old_call();

f09[8a7b6c5d4e] src/lib.rs (+1 -0)
  +use std::io;

--full adds context lines with line numbers, and lists change atoms when a hunk has more than one:

a1b[2c3d4e5f6] src/main.rs (+3 -1)
  1: fn main() {
  2:+    println!("new line");
  3:-    old_call();
  4: }
  a1b[2c3d4e5f6]#1 @2 a1b[2c3d4e5f6]#2 @3

Hunk IDs use bracket-style prefix highlighting (same as jj log): a1b[2c3d4e5f6] means a1b is the shortest unique prefix.

jjc pick — split hunks into a new commit#

jjc pick a1b -m "extract logging"        # pick entire hunk
jjc pick a1b#2 -m "fix off-by-one"       # pick a single change atom
jjc pick a1b@15-20 -m "refactor"         # pick by target line range
jjc pick a1b c3d -r foo -m "partial"     # pick multiple hunks from revision foo

Creates a new commit with the selected hunks, then rewrites the source revision on top of it (like jj split but non-interactive).

jjc drop — revert hunks to parent content#

jjc drop a1b           # drop a hunk from @
jjc drop a1b c3d       # drop multiple hunks

Rewrites the revision in place with selected hunks reverted. Like "Revert Hunk" in a diff editor.

jjc fold — squash hunks into another revision#

jjc fold a1b --into main              # fold hunk from @ into main
jjc fold a1b -r feat --into main      # fold from a specific source
jjc fold --select feat:a1b,c3d        # multi-source with explicit assignment

Hunk selectors#

All write commands (pick, drop, fold) accept hunk selectors:

Form Meaning
a1b Entire hunk matching ID prefix a1b
a1b#2 Change atom #2 within the hunk
a1b@15 Lines covering target line 15
a1b@10-20 Lines covering target range 10-20

Use jjc hunks to discover IDs and atom indices.

How it works#

jjc reads the jj repository directly via jj-lib. It loads your jj config (user, repo, workspace layers), snapshots the working copy, and commits transactions with proper descendant rebasing and working copy updates. No jj commands are shelled out or proxied.

Limitations#

  • Only text file hunks are supported. Binary files, renames, copies, additions, and deletions are listed as unsupported.
  • Immutable commit checking is minimal (root commit only). Use jj log to verify before rewriting shared history.