Open
Description
Description
When switching branches - jupyterlab git should close all open files that are not present in the other branch.
Reproduce
- Create branch A
- Commit a notebook to it (N1) and leave that notebook open in lab
- Create a new branch from A, called B (which now has N1) and switch to B
- Create a second notebook (N2) commit that and leave it open in lab (here you are in B with N1/N2 committed and opened in Lab)
- Switch to A (either via CLI or UI).
- If autosave enabled, wait for it to be autosaved (you can also just save it)
- Try to switch to branch B again
This creates an issue because:
- Switching branches fails because my untracked file would be overwritten with itself
- It makes it easier to get confused
Expected behavior
Any committed file should be closed when switching branches if it is not in the new branch (i. e. if git removes when switching). Ideally this is true both for the CLI and the UI, but I think it's ok to only fix the UI if the CLI variant is too hard/out of scope.
Maybe this is a jupyterlab request, as it could also be thought of as any file removed from disk should close in lab (possible with a warning).
Context
Lab 2.3.0a1
Jupyterlab-Git: 0.23.1