Re: Working with zip files
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Aug 18, 2016, 17:45 UTC
- Message-ID
- <CANQwDwebocSzwrLRNoZMCkXy0D2HrSrXSyLxV=jNJ4xzCWDhHw@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.2.02.1608180954400.11774@nftneq.ynat.uz>
On 18 August 2016 at 18:56, David Lang <david@lang.hm> wrote:
Show 18 quoted lines
> On Thu, 18 Aug 2016, Jakub Narębski wrote: > >> JN>> You can find rezip clean/smudge filter (originally intended for >> JN>> OpenDocument Format (ODF), that is OpenOffice.org etc.) that stores >> JN>> zip or zip-archive (like ODT, jar, etc.) uncompressed. I think >> JN>> you can find it on GitWiki, but I might be mistaken. >> >> Using 'unzip -c' as separate / additional `textconv` filter for diff >> generation allows to separate the problem of deltifiable storage format >> from textual representation for diff-ing. >> >> Though best results could be had with `diff` and `merge` drivers... > > > can you point at an example of how to do this? when I went looking about a > year ago to deal with single-line json data I wasn't able to find anything > good. I ended up using clean/smudge to pretty-print the json so it was > easier to handle.
Pro Git has a chapter "Customizing Git - Git Attributes" about gitattributes https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
The section "Diffing Binary Files" has two examples: docx2txt (with wrapper) for DOCX (MS Word) files, and exiftool for images. For JSON you could use some prettyprinter / formatter like pp-json.
"Performing text diffs of binary files" section of gitattributes(1) manpage covers 'textconv' vs 'diff', and uses 'exif' tool as textconv example.
HTH
-- Jakub Narębski -- Jakub Narebski