You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 .gitignored, 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
Find a change where a specific file does not exist, let's call it c
jj new c
echo "newfile" >> .gitignore
touch newfile
jj edit c
Expected Behavior
newfile should not be automatically added to the commit
Actual Behavior
newfile is added to the commit.
Specifications
Platform: NixOS 23.11
Version: jj 0.13.0
The text was updated successfully, but these errors were encountered:
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: