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

`jjc hunks` re-tracks globally gitignored files #1

Closed akashina.tngl.sh
Closed opened by akashina.tngl.sh

Update: After filing this, I noticed this issue is already listed as a "limitation" in the README. I hope it can be fixed, in any case it might make sense to have a thread about it here.


I ran jjc hunks in a repo, and it resulted in a symlink called _ilyagrignore and a file called .workmux.yaml becoming tracked. This is likely because it is in the global gitignore (~/.config/git/ignore), not in the repo gitignore. In other words, my ~/.config/git/ignore contains:

_ilyagrignore/*
# Can also be a symlink
_ilyagrignore

.workmux.yaml

jj and git both correctly treat these files as ignored. For example,

$  git check-ignore _ilyagrignore --verbose
/Users/ilyagr/.config/git/ignore:11:_ilyagrignore	_ilyagrignore

Demo of the bug:

$ jj status
The working copy has no changes.
Working copy  (@) : zkmkpm a2ad381 (empty) (no description set)
Parent commit (@-): qkolry 7bf1daa (empty) (no description set)
$ jjc -V
jjc 0.1.0
$ jjc hunks
add _ilyagrignore (file-level change; hunk selection not supported yet)
$ jj status
Working copy changes:
A _ilyagrignore
Working copy  (@) : zkmkpm 3df9338 (no description set)
Parent commit (@-): qkolry 7bf1daa (empty) (no description set)

Workaround: I end up needing to run $ jj file untrack _ilyagrignore after any jjc commands.

And BTW, if it would help to move some jj functions to jj-lib for a cleaner solution, that is absolutely something to try (I haven't checked whether there's a PR already). It might be a bit slower than just fixing it in jjc for now, maybe with a TODO comment.

I really never thought it would attract 14 stars and I have not yet got used to checking tangled.org every day so, thanks for all people that see these words.

First off, I'm slightly flattered that contributor #4 to gh:jj-vcs/jj might have discovered this project via the timeline on tangled.org. This project came about because I once got so absorbed in working on a large patch that I forgot to run jj new, and then tried to offload the jj split grunt work to a coding agent—paying a hefty price for it (...). I did notice that jjk tackled this by introducing a fake editor written in Zig and passing it to jj split... but honestly, that's all beside the point. Anyway, thank you so much for actually dedicating your time to this project.

I have pushed a workaround, now considering throw a PR to jj-vcs/jj all 😃

(but designing a extensible one...? jjc might shouldn't mirror so many things from jj)

jjc do need a WorkspaceSession alike thing. the prev attempt that directly interact with jj-cli was failed, this cli just mirror all actions from jj-cli's clap and can do nothing from these pub(crate) or priv.

Sign up or Sign in to add to the discussion.