Skip to content
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

Git integration fails to see merged file as staged if I reject all incoming edits #7989

Closed
sandersaares opened this issue Jun 22, 2016 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@sandersaares
Copy link
Member

VS Code Version 1.2.1
Commit fe7f407
Date 2016-06-14T13:00:22.146Z
Shell 0.37.6
Renderer 49.0.2623.75
Node 5.10.0
Windows 10 Enterprise x64, latest non-Insider
git version 2.9.0.windows.1

Description: during a Git merge process, VSCode can sometimes show no pending changes and refuse to let me commit, while command-line Git believes a merge is in progress and lets me commit. This occurs if the changed file contains no changes (after merge) that came from the commit that I am merging into my local state.

Steps to Reproduce:

  1. Create Git repository (e.g. on GitHub).
  2. Clone to working folder A.
  3. In working folder A, commit a file with some arbitrary text. Commit and sync
  4. Clone to working folder B.
  5. In working folder B, change some part of the file. Commit and sync.
  6. In working folder A, change some part of the file, conflicting with previous. Commit and sync.

This will result in a merge conflict due to the change from working folder B getting pulled.

Resolve the conflict by removing all changes pulled form working folder B - the file should be the same as the committed state that existed in working folder A. Stage the file to mark the file as resolved.

Expected result: file is staged and VSCode lets you commit the merge.

Actual result: file disappears from Git tab and VSCode says cannot commit as there are no pending changes.

git commit from the command line works fine to finish the merge, only VSCode refuses to cooperate here.

@dbaeumer dbaeumer added the git GIT issues label Jun 22, 2016
@joaomoreno
Copy link
Member

This is a bit unfortunate and a not so common real world case. It happens when:

  • There are no changes other than conflicting changes
  • The conflict resolution for all changes is to take A version

The command line git will create an empty commit, since there is nothing to be done on the merge commit. Code will just not let you do a commit since it doesn't support empty commits.

We should maybe make Code aware that a merge is in progress, thus allowing the completion of the merge to follow.

@joaomoreno joaomoreno added this to the Backlog milestone Jun 22, 2016
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Jun 22, 2016
@joaomoreno
Copy link
Member

Related to #6403. Fix could be done regarding both.

@joaomoreno joaomoreno removed their assignment Apr 25, 2017
@joaomoreno joaomoreno added the help wanted Issues identified as good community contribution opportunities label Apr 25, 2017
@yaroslavsadin
Copy link

Any update here?

@quhsi
Copy link

quhsi commented Aug 24, 2020

#88034 is probably a duplicate.

@LitKnd
Copy link

LitKnd commented Nov 4, 2020

I also recently came across this. I think it's not necessarily a rare thing for beginners who are experimenting with a simple repo and simple conflicts. It is very confusing with the way this just disappears in the UI even though the merge isn't complete.

A fix would be very helpful.

@joaomoreno
Copy link
Member

Fixed by adding an action to Create Empty Commit to the notification

@joaomoreno joaomoreno modified the milestones: Backlog, November 2020 Nov 5, 2020
@sbatten sbatten added the verified Verification succeeded label Dec 3, 2020
@sbatten
Copy link
Member

sbatten commented Dec 3, 2020

@joaomoreno this totally works and is clearly a corner case, but its not the most intuitive notification. i wish I could see that I did something with the merge conflicts and create empty commit changes to something like "ignore all incoming merge conflicts". i imagine anything more custom is not trivial so I do not reopen this.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants
@joaomoreno @LitKnd @dbaeumer @yaroslavsadin @sbatten @sandersaares @quhsi and others