jj icon indicating copy to clipboard operation
jj copied to clipboard

FR: `jj untrack --local`, `jj untrack --ignore`

Open lf- opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I want to be able to easily untrack a file and have it stick without having to manually edit a gitignore/.git/info/exclude file. This could be achieved by automatically editing the relevant gitignore file (probably the nearest one to the file for --ignore?) to add the file, and for --local, .git/info/exclude.

Describe the solution you'd like jj untrack could be taught how to make untracking sticky, and print a warning if the file will get immediately tracked again suggesting the command that sticks the untracking.

Describe alternatives you've considered

Status quo: have to open an editor/type another command to do the untracking operation. Reduce the necessity for untracking things (see #323).

Additional context Add any other context or screenshots about the feature request here.

lf- avatar Apr 12 '24 02:04 lf-

This could be achieved by automatically editing the relevant gitignore file (probably the nearest one to the file for --ignore?) to add the file, and for --local, .git/info/exclude.

Just a comment: this could be done a lot more easily if we had some kind of .jj-ignore file supporting jj's fileset syntax. In that case, jj untrack $FILESET is trivial (it just writes $FILESET to the .jj-ignore).

I think this approach of combining the concepts of file tracking and ignoring plays very nicely jj's philosophy of eliminating unnecessary complexity and statefulness from git (like the staging area).

ParadaCarleton avatar Oct 21 '25 17:10 ParadaCarleton

Just a comment: this could be done a lot more easily if we had some kind of .jj-ignore file supporting jj's fileset syntax. In that case, jj untrack $FILESET is trivial (it just writes $FILESET to the .jj-ignore).

See #3525 for that specific issue.

PhilipMetzger avatar Oct 21 '25 17:10 PhilipMetzger