Re: Working with zip files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 18 Aug 2016, Jakub Narębski wrote:

On 18 August 2016 at 18:56, David Lang <david@xxxxxxx> wrote:
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.

As I read that section, it only applies to the human readable output of git diff.

And the merge section only talks about the default of using patch vs accepting a specific version in a merge.

It seems to me that what I'm looking for would be something to tell git to use a different command instead of diff/patch internally when creating and using the bundles.

David Lang

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]