When I switch to different branch (abc) that doesn't even have phapi dir, I end up with an untracked phapi dir (I think). When I try to switch back to xyz I get this:
The file '.../phapi/erl_crash.dump' is too large to be snapshotted: it is 2.8MiB; the maximum size allowed is ~1.0MiB.
Hint: This is to prevent large files from being added on accident. You can fix this error by:
Adding the file to .gitignore
Run jj config set --repo snapshot.max-new-file-size 2977833
This will increase the maximum file size allowed for new files, in this repository only.
Run jj --config-toml 'snapshot.max-new-file-size=2977833' st
This will increase the maximum file size allowed for new files, for this command only
This breaks my flow entirely. In case I decide to handle this issue by blowing away the dir, those files are gone.
Describe the solution you'd like
I don't want untracked files from xyz to show up when I move to another dir. These files are orphans. The new branch may or may not care about these files. If it does care about these files (.env file for example) and it needs to use it somehow, it should have it in .gitignore, if it doesn't then it doesn't care about that file.
Haven't thought much about this but perhaps this could be the algo:
when switching from revision a to b,
if there are files that are untracked in a (in .gitignore) but not in b, create an "untracked file stash only on local" and associate those files with a and delete the files from disk when moving to b
when you move back to a restore "untracked file stash"
when switching from a to b rev, if b has untracked files in .gitignore also, keep files on disk
Describe alternatives you've considered
There's an option to update .gitignore automatically but that doesn't feel right.
Additional context
I'm not sure about the mechanics of how I did it, but I've lost .env files before switching from one rev to another and it's quite annoying.
Not being able to switch from one branch to another really quick is very un-jj.
Is your feature request related to a problem? Please describe.
I'm on revision
xyz
which has has dir:phapi/.gitignore
haserl_crash.dump
When I switch to different branch (
abc
) that doesn't even havephapi
dir, I end up with an untrackedphapi
dir (I think). When I try to switch back toxyz
I get this:This breaks my flow entirely. In case I decide to handle this issue by blowing away the dir, those files are gone.
Describe the solution you'd like
I don't want untracked files from
xyz
to show up when I move to another dir. These files are orphans. The new branch may or may not care about these files. If it does care about these files (.env
file for example) and it needs to use it somehow, it should have it in .gitignore, if it doesn't then it doesn't care about that file.Haven't thought much about this but perhaps this could be the algo:
a
tob
,a
(in .gitignore) but not inb
, create an "untracked file stash only on local" and associate those files witha
and delete the files from disk when moving tob
a
restore "untracked file stash"a
tob
rev, ifb
has untracked files in.gitignore
also, keep files on diskDescribe alternatives you've considered
There's an option to update
.gitignore
automatically but that doesn't feel right.Additional context
I'm not sure about the mechanics of how I did it, but I've lost
.env
files before switching from one rev to another and it's quite annoying.Not being able to switch from one branch to another really quick is very un-jj.