Skip to content

Opening lazygit while VSCode merge is in progress causes some files to be overwritten #4599

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

Open
T3sT3ro opened this issue May 27, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@T3sT3ro
Copy link

T3sT3ro commented May 27, 2025

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:

  1. Enter a codebase and try to merge/rebase with merge conflicts
  2. Open VSCode merge view (advanced algorithm) in one window
  3. Open lazygit in another window
  4. 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.

@T3sT3ro T3sT3ro added the bug Something isn't working label May 27, 2025
@T3sT3ro
Copy link
Author

T3sT3ro commented May 27, 2025

I have asked copilot on the codebase and it found for me the config option Git.AutoStageResolvedConflicts which I now disabled. I also found #3111. In that case this is not a bug anymore, or rather a feature request to enable it by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant