-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching to a past change where a file has not been ignored adds it to the change. #3204
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When new files are added to a gitignore, these become kind of a boobytrap for editing old changes. As soon as you switch to an old change where the file are not ignored yet, they are added to the change since they are in the working copy. This means that, without actively changing anything, and mostly without feedback, you have added files to the repo which you never wanted to be in there.
This is especially awkward when automating commands over a set of changes (I did that to automate
pre-commit
runs for the branch I am working on).One possible solution to this: When switching between changes, find all files which have been previously
.gitignore
d, and delete them. I realize that this might trash caches for people on a regular basis, but I think this is preferable to accidentally checking in files without noticing.Steps to Reproduce the Problem
c
jj new c
echo "newfile" >> .gitignore
touch newfile
jj edit c
Expected Behavior
newfile
should not be automatically added to the commitActual Behavior
newfile
is added to the commit.Specifications
NixOS 23.11
jj 0.13.0
The text was updated successfully, but these errors were encountered: