Description
Describe the bug
I mainly work in VSCode, so it often occurs that open merge conflicts during rebase/merge. When I then open lazygit which (configured to use external diff tool called "difftastic"), suddenly files I had been merging in VScode get overwritten and they both disappear from merge conflicts from vscode and lazygit. I don't know yet whose fault it is more - lazygit's or VSCodes.
To Reproduce
Steps to reproduce the behavior:
- Enter a codebase and try to merge/rebase with merge conflicts
- Open VSCode merge view (advanced algorithm) in one window
- Open lazygit in another window
- After a second or two, files from merge conflict seem to disappear in lazygit, the vscode window (after focusing) refreshes and merge conflicts (at least some) are missing, overwritten with the version (probably) from the current branch
Expected behavior
Two programs should just show diff errors, lazygit shouldn't write to file unless explicit user action was taken.
Version info:
commit=1b571f9e6b0a9a0040654aaf99333509a74613fc, build date=2025-03-01T02:30:10Z, build source=binaryRelease, version=0.48.0, os=linux, arch=amd64, git version=2.43.0
git version 2.43.0
Additional context
What I think is happening under the hood is either:
- vscode erases merge markers and keeps internal state based on the file and index state
- lazygit may be detecting "no semantic change" using external difftool (difftastic in this case) and adding the "unchanged" file to the index on it's own
And indeed, the conflict markers seem to be erased from the file when VScode is mid-merge, but that doesn't mean lazygit should be adding those files on it's own, if this is what happens (imo).
Note: please try updating to the latest version or manually building the latest master
to see if the issue still occurs.