[IPython-dev] Flatten notebooks for git diff

Thomas Kluyver takowl at gmail.com
Mon Sep 8 18:17:46 EDT 2014


>From what I can see, Mercurial requires you to specify a diff program. This
is particularly convenient with git, because it allows you to specify a
filter to process a single file, and then diffs the results for you. Of
course, it would be easy to wrap this up together with diff.

Thomas

On 8 September 2014 14:43, Nathan Goldbaum <nathan12343 at gmail.com> wrote:

>
>
> On Mon, Sep 8, 2014 at 2:33 PM, Fernando Perez <fperez.net at gmail.com>
> wrote:
>
>> 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...
>>
>
> Or even a standalone shell script - this will make it easier to use with
> the mercurial extdiff extension.
>
>
>>
>> In any case, thanks!
>>
>> f
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140908/ab2a2d95/attachment.html>


More information about the IPython-dev mailing list