[IPython-dev] Flatten notebooks for git diff

Fernando Perez fperez.net at gmail.com
Mon Sep 8 17:33:13 EDT 2014


On Sat, Sep 6, 2014 at 2:57 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> 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.
>

I just wanted to say this is *great*. It's an excellent, practical solution
that will cover a ton of everyday cases.

One thought: perhaps also enabiling it as a standalone `git nbdiff`
command, that can take extra switches for metadata and other things... So
it would do the bare-bones thing when called by git itself during a diff of
an entire repo, but could be used in a more targeted and feature-rich
manner manually...

In any case, thanks!

f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140908/b476835e/attachment.html>


More information about the IPython-dev mailing list