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

fix(scm): add onDidChangeCommitTemplate event #9792

Merged

Conversation

zWingz
Copy link
Contributor

@zWingz zWingz commented Jul 28, 2021

Signed-off-by: zwingz [email protected]

What it does

add onDidChangeCommitTemplate event to SCM extensions, close #9778

In vscode-git, when our repo has some change, It will get the inputTemplate and set it to SCM input (updateModalState)
and it will call getInputTemplate and getMergeMessage

The SCM will call updateSourceControl and fire onDidChangeCommitTemplateEmitter

But Theia does not provide a onDidChangeCommitTemplate listeners

image

So the vscode-git cann't update the SCM-input
Vscode References

How to test

  • remove example/browser dependencies @theia/git
  • add [email protected] to theiaPlugins
  • start example browser
  • merge two conflicting branches
mkdir test-merge-conflict
cd test-merge-conflict
echo 'master' > a.txt
git add . && git commit -m 'from master'
git checkout -b conflict-1
echo 'conflict-1' > a.txt
git add . && git commit -m 'from conflict-1'
git checkout master
echo 'master modified` > a.txt
git add . && git commit -m 'from master 2`
git merge conflit

Note the SCM input, should be with value Merge branch 'conflict'
image

@vince-fugnitto vince-fugnitto added git issues related to git scm issues related to the source control manager labels Jul 28, 2021
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that the issue exists on master and is addressed nicely by this change. Very clean solution 👍

State after trying to merge on master:
2021-07-28 15_50_33-Window
State after trying to merge with the PR:
2021-07-28 15_48_14-Window

@paul-marechal paul-marechal merged commit 6618964 into eclipse-theia:master Aug 26, 2021
@paul-marechal paul-marechal added this to the 1.17.0 milestone Aug 26, 2021
@zWingz zWingz deleted the bugfix/scm-add-missing-event branch August 27, 2021 01:21
RomanNikitenko pushed a commit that referenced this pull request Sep 16, 2021
RomanNikitenko pushed a commit that referenced this pull request Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git issues related to git scm issues related to the source control manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode-git extension can't put MERGE_MSG to SCMInput
4 participants