Skip to content

Git - Source Control tab and Merge conflict detection #125413

Closed
@nosjojo

Description

My project's auto-generated code uses this structure for comment blocks (I think Labview/CVI generates it):

/*============================================================
Comment string
============================================================*/

This comment block is detected as a merge conflict flag by the Source Control tab - but the actual merge conflict resolution tool doesn't see it as a conflict.

Actual recreation of the issue just seems to require a file with that comment block be involved in a merge conflict. It looks like this on my end:

  1. Call git merge, get a merge conflict on the file. File is now shown in the "Merge Conflicts" group of Source Control.
  2. Open file, which now contains the merge conflict ======= tags for the break in individual merge conflicts.
  3. Resolve the conflicts. Editor window no longer shows any active merge conflicts.
  4. Select the "Add" button in Source Control to move the file to the "Staged Changes" group.

When the "Add" button is pressed, instead of the file being detected as resolved, the file is considered to still be under conflict resolution, and a popup is triggered asking "Are you sure you want to stage [filename] with merge conflicts?"

I was hoping this was getting fixed with the update included in #116027 but appears to have gone live in 1.56.2 and this issue is still present.

I'm not super familiar with the language and codebase used in VSCode, but I'm guessing the issue stems from this line:

const promises = possibleUnresolved.map(s => grep(s.resourceUri.fsPath, /^<{7}|^={7}|^>{7}/));

Which uses the regex pattern /^<{7}|^={7}|^>{7}/ to scan for unresolved conflicts. This likely needs to be /^<{7}|^={7}$|^>{7}/ or some other variation that locks the regex match to exactly 7 with no additional characters allowed.

Version: 1.56.2 (user setup)
Commit: 054a929
Date: 2021-05-12T17:13:13.157Z (3 wks ago)
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.18363

Running the following extensions:
ms-vscode.cpptools
eamodio.gitlens
ms-vscode.hexeditor
ms-toolsai.jupyter
shd101wyy.markdown-preview-enhanced
ms-python.vscode-pylance
ms-python.python

All extensions are up-to-date as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issuesinsiders-releasedPatch has been released in VS Code Insiders

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions