[IPython-dev] Flatten notebooks for git diff

Thomas Kluyver takowl at gmail.com
Sat Sep 6 17:57:47 EDT 2014


The notebook document format makes diffing and merging in version control
awkward. http://nbdiff.org/ is one attempt to address this by doing rich
diffs in the web browser.

I've made a simpler approach to diffing only - an nbflatten tool that can
be integrated with git diff to display a simplified version of the diff. It
discards some information, like metadata and rich output, but the flattened
diffs are easier to read for simple changes. The script, and installation
instructions, are in a gist:

https://gist.github.com/takluyver/bc8f3275c7d34abb68bf

This is a very quick hack. Feel free to improve it or work it into bigger
things.

Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140906/9d4bcd56/attachment.html>


More information about the IPython-dev mailing list