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: Stage Changes" command doesn't work during rebase conflict #113302

Closed
csk-ableton opened this issue Dec 22, 2020 · 11 comments · Fixed by #164450
Closed

"Git: Stage Changes" command doesn't work during rebase conflict #113302

csk-ableton opened this issue Dec 22, 2020 · 11 comments · Fixed by #164450
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

@csk-ableton
Copy link
Contributor

  • VSCode Version: 1.53.0-insider
  • OS Version: macOS 10.15.7

Steps to Reproduce:

  1. Use Git's interactive rebase to generate a conflict
  2. Resolve the conflict using vscode and save the file
  3. Execute the "Git: Stage Changes" command

Expected: The changes have been staged
Actual: Nothing happens and I don't get any feedback

There is an additional "Git: Stage All Merge Changes" command that appears during the conflict which stages the file as expected. However it's unclear to me why I can't use the other command to stage a single file already. I would like to put it on a keyboard shortcut but would need multiple shortcuts in case of a conflict. I created a simple task that just calls git add ${file} which gives me the expected behavior as a workaround.

Does this issue occur when all extensions are disabled?: Yes

@subz390
Copy link

subz390 commented Dec 27, 2020

I think I'm getting the same issue on Windows 10

Version: 1.52.1 (user setup)
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:34:46.910Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.17763
git version 2.29.2.windows.3

Reproduce

Using the repository I created for testing;

  1. Checkout development branch
  2. Rebase with main
  3. Resolve conflicts, accept incoming changes
  4. Save conflict file
  5. Stage
  6. Commit - expect VSCode to continue with the commit, instead I get the following error; Code.exe: bad option: --wait

201227-022158 VSCode error box

Video

Here's a video I made reproducing the error

Git log

Here's the log from the moment where it generates the error.

> git rebase --continue
C:\Users\Z390\AppData\Local\Programs\Microsoft VS Code\Code.exe: bad option: --wait
error: There was a problem with the editor 'Code.exe --wait'.
Please supply the message using either -m or -F option.
error: could not commit staged changes.

Check: I disabled/uninstalled all VSCode Git extensions.

@eamodio eamodio added bug Issue identified by VS Code Team member as probable bug git GIT issues labels Jan 5, 2021
@eamodio eamodio added this to the Backlog milestone Jan 5, 2021
@eamodio eamodio added help wanted Issues identified as good community contribution opportunities feature-request Request for new features or functionality and removed feature-request Request for new features or functionality labels Jan 5, 2021
@eamodio
Copy link
Contributor

eamodio commented Jan 5, 2021

@subz390 Your issue is unrelated to this report. And it sounds like you have an issue with the core.editor in your git config. (I used your repo and didn't experience any issue)

@subz390
Copy link

subz390 commented Jan 6, 2021

@eamodio thanks for looking into the issue. I came to the same conclusion as you and so meticulously went through Google for answers, all of which suggested the same thing. When I exhausted all those possible solutions, I searched all the issues in this repo and only found this issue.

So to summarise:

  • core editor is set to core.editor=Code.exe --wait what should it be set to? because this is what it was originally set to and what everyone on Google said it should be set to.
  • I tried setting it with the full path to Code.exe, however Code.exe is in PATH so I've left it like this. Changing it from full path to this made no difference.
  • May I confirm you watched the video I posted all the way through? Why does this only happen with rebasing and not merging? Surely if there was a problem with core.editor merging would also fail?
  • And can you confirm that I'm performing the correct actions in the right order?
  • Finally, as you feel this is a separate issue should I open a new issue or are we good to continue discussing here? Either way I would sincerely like to get to the bottom of this.

@pentatiby
Copy link

I can also reproduce:

  • click a file from "Merge changes" during rebase conflict
  • fix conflicts
  • try to stage it with cmd+shift+p -> "stage changes"
  • does not appear work

This is the output:

git.stage 0
git.getSCMResource.uri file:///Users/<fullPath>
repo root <repoPath>
git.stage.getSCMResource null

Version

Version: 1.52.1
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:30:02.420Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0

@lszomoru lszomoru assigned lszomoru and unassigned eamodio Oct 4, 2021
@Fedcomp
Copy link

Fedcomp commented Jul 7, 2022

I was expecting to try adding my files in rebase the quick way with git stash changes and hit the same issue.
Adding files to git is such basic functionality ...

@lszomoru lszomoru modified the milestones: Backlog, July 2022 Jul 7, 2022
@lszomoru lszomoru modified the milestones: July 2022, August 2022 Jul 25, 2022
@lszomoru lszomoru modified the milestones: August 2022, September 2022 Aug 26, 2022
@lszomoru
Copy link
Member

There have been some improvements in how conflict resolution is being handled while rebasing. These improvements are included in the latest Stable release (1.71.2). I will optimistically close this issue as I would like to ask you to upgrade to the latest Stable release and see if you are still able to reproduce the problem in this issue. Thank you!

@lszomoru
Copy link
Member

There have been some improvements in how conflict resolution is being handled while rebasing. These improvements are included in the latest Stable release (1.71.2).

@roblourens roblourens added the author-verification-requested Issues potentially verifiable by issue author label Sep 29, 2022
@connor4312 connor4312 added the verified Verification succeeded label Sep 30, 2022
@connor4312
Copy link
Member

I believe this issue is still present. I followed subz's helpful steps here #113302 (comment). On stage 5, I attempted to stage changes using /Git: Stage (All )?Changes/ and ran into the same issue the original poster described.

However I did not run into the invalid argument that subz ran into--likely fixed in a separate issue.

@lszomoru
Copy link
Member

The "Git: Stage All Merge Changes" as a community contribution submitted by the community. When it comes to commands that apply for all the resources in a group (ex: "Stage All Changes", "Stage All Merge Changes") it does make sense to have individual ones for each group.

Having said that, it does make sense to me to have one unified command that stages all changes of one resource independent in which group it is. I pushed changes to enable the "Git: Stage Changes" to work with the resources in the merge group as well. You should be able to assign a keybinding to it.

@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Oct 24, 2022
@VSCodeTriageBot
Copy link
Collaborator

This bug has been fixed in the latest release of VS Code Insiders!

@csk-ableton, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version a803dc3 of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@rzhao271 rzhao271 added verified Verification succeeded and removed author-verification-requested Issues potentially verifiable by issue author labels Oct 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2022
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.