Skip to content

simple merge conflicts in notebooks require manually editing the ipynb json #160941

Closed

Description

@amunger

Locally I have an empty cell at the bottom of my notebook because I executed the last cell
When I try to merge in a change that has new cells, I get a merge conflict that requires I open the ipynb in a text editor to resolve.

image

Activity

  1. rebornix commented on Oct 21, 2022

    @rebornix
    Contributor

    We can explore how to handle this gracefully in the serializer.

  2. DonJayamanne commented on May 9, 2023

    @DonJayamanne
    Contributor

    Peng Lyu (@rebornix) not sure what needs to be done in the serializer here. can you provide more information, i would have thought this was purely an issue with merge conflicts.

  3. yohfdo commented on Nov 16, 2023

    @yohfdo

    Can this please be solved? It's hard to work collaboratively within a team using Jupyter notebooks and VS Code if we can't sort out merge conflicts.

  4. ttimasdf commented on Feb 22, 2024

    @ttimasdf

    I suggest there be an option to disable the notebook renderer temporarily in all editors. git operates at the text level and when merge conflict happens, it will likely produce a malformed JSON file.

    We now have an error message to notify users to fallback to text editor, but "resolve in merge editor" button still don't work.

    image

  5. added and removed
    unreleasedPatch has not yet been released in VS Code Insiders
    on May 28, 2024
  6. DonJayamanne commented on May 28, 2024

    @DonJayamanne
    Contributor

    Note:

    • When there are merge conflicts, one will always have to open a plain text (json) editor to resolve the merge confligs
    • I.e. its not possible to use Notebook UI to resolve merge conflicts (at least not yet)

    Steps to test

    • Ensure you have merge conflicts in a Notebook document
    • Open the SCM view, and click on the IPYNB file, and verify you can see the merge conflicts in plain text editor view
    • Click on the Resolve in Merge Editor button and verify you get the merge editor (again plain text), see here simple merge conflicts in notebooks require manually editing the ipynb json #160941 (comment)
    • When you have merge conflicts, try opening the ipynb file from the explorer view, if this fails verify you are displayed with an error message with the option to open the file in plain text view
  7. locked and limited conversation to collaborators on Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions