tarmstrong/nbdiff

nbdiff crashes on merge conflict

Closed this issue · 4 comments

I get this error when running nbdiff in make-nb-mergecoflicts:
IPython.nbformat.reader.NotJSONError: Notebook does not appear to be JSON: '{\n "metadata": {\n "name": "Burble"\n...

The issue here seems to be that if you run nbdiff instead of nbmerge, it still finds the unmerged file as a diffable file and shows you the change.

Since the current working directory's version of the file looks like:

{
 "metadata": {
  "name": "Burble"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
<<<<<<< HEAD
      "z = {1, 2,

The <<<<<<<<< HEAD business is breaking the JSON parser.

I think nbdiff should ignore these files, because there isn't any meaningful way to get two different notebooks out of a merge conflict.

First shall thou count to three. No more, no less.

Assigning to @BSPlay because he owns the adapter module.

Fixed by #124