question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Merge editor: restore original contents if aborting and allow to undo

See original GitHub issue

This issue is 2 issues but closely related: how to get back to the workspace file contents after closing the merge editor without having resolved the conflict. The setup is:

  • have the conflicting workspace file opened as a text editor
  • then open the merge editor for it

I think this setup will be common because users would most likely first see the workspace file in a text editor with the git merge markers before deciding to use the merge editor.

Auto Save: ON In this case the user should not see a dialog asking to revert the changes back but I think as we had discussed allowing to run the Undo command in the text editor would be nice to get the model at the contents how they were.

Auto Save: OFF Assuming the user has not saved the merge editor yet (i.e. the dirty indicator shows), closing the merge editor and picking “Do not save” should ideally restore the workspace file text editor as it was:

  • if the editor was dirty, restore the buffer and show the editor dirty [1]
  • if the editor was saved, restore the contents from disk

Does that make sense? I wonder how weird [1] would be given that after clicking “Do not save” the workspace file would show as dirty again, but I think it makes sense to restore it how it was.

//cc @isidorn @daviddossett

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
hedietcommented, Sep 27, 2022

if the editor was dirty, restore the buffer and show the editor dirty [1]

At the moment, the merge editor saves the content of result before it opens. (same as F5 saves the current file)

I’ll move this issue to October, as it seems to be under discussion. Please create seperate issues for concrete actionables if you want to have them addressed this milestone.

1reaction
bpaserocommented, Sep 23, 2022

I like your idea of saving before opening the merge editor, I think that is solving the corner case quite well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dealing With Merge Conflicts | Learn Version Control with Git
The first thing that you should keep in mind is that you can always undo a merge and go back to the state...
Read more >
Undo a Git merge that hasn't been pushed yet - Stack Overflow
After a failed merge, when there is no MERGE_HEAD , the failed merge can be undone with git reset --merge , but not...
Read more >
How do you undo a Git merge? | Solutions to Git Problems
If you want to undo a merge in Git, the process will depend on whether you've pushed the merge commit to your remote....
Read more >
Undo possibilities in Git - GitLab Documentation
Undo staged local changes · To unstage the file but keep your changes: git restore --staged <file> · To unstage everything but keep...
Read more >
How to Abort Git Merge Conflicts - YouTube
Got a merge conflict you need to abort ? Too early to do a git merge undo, but too late to not trigger...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found