FR: Make jj file untrack
work with files that are not ignored
#5225
Labels
enhancement
New feature or request
jj file untrack
work with files that are not ignored
#5225
Is your feature request related to a problem? Please describe.
Currently, if you do
jj file untrack
on a file that is not being ignored, the command is effectively a "no op" since the files are immediately, automatically and silently tracked again. This is extremely surprising and also makes keeping files outside of the repo (but in the working directory) harder than it could be.Describe the solution you'd like
When the using
jj file untrack
on a file is not already gitignored, jujutsu should store the fact that the user explicitly requested to untrack that file, and not track it automatically until the user usedjj file track
to track it again.How to store that information is debatable. I think it should not be added to the "public" .gitignore, to avoid sharing with others the existence of that untracked file. It could perhaps be stored in
.git/info/exclude
(which IMHO would be a much better solution than storing it in the public gitignore). But given that .git does not automatically track any files, maybe it would make more sense to store this info in an "jujutsu specific", local ignore file (e.g..jj/info/exclude
)?Describe alternatives you've considered
I think this behavior should be automatic, but an alternative would be to require the user triggering this behavior by adding a flag to
jj file untrack
(e.g.jj file untrack --save
). I think this might only make sense if jj updated the git exclude file (but not if it created it's one jj specific file to store the list of untracked files). Also, this would still result injj file untrack
(without the flag) having surprising "no op" behavior.Additional context
This is related to #323.
The text was updated successfully, but these errors were encountered: