git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Working with zip files

From
DLDavid Lang <david@lang.hm>
Date
Aug 19, 2016, 03:00 UTC
Message-ID
<alpine.DEB.2.02.1608181954560.11774@nftneq.ynat.uz>
In-Reply-To
<CANQwDwebocSzwrLRNoZMCkXy0D2HrSrXSyLxV=jNJ4xzCWDhHw@mail.gmail.com>
On Thu, 18 Aug 2016, Jakub Narębski wrote:
Show 29 quoted lines
> On 18 August 2016 at 18:56, David Lang <david@lang.hm> 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
Previous: Jakub NarębskiNext: Nikolaus Rath
Message 11 of 14 in “Working with zip files”
  1. Nikolaus RathAug 16, 2016
  2. David LangAug 16, 2016
  3. Nikolaus RathAug 16, 2016
  4. David LangAug 16, 2016
  5. Junio C HamanoAug 16, 2016
  6. Jakub NarębskiAug 16, 2016
  7. Junio C HamanoAug 16, 2016
  8. Jakub NarębskiAug 18, 2016
  9. David LangAug 18, 2016
  10. Jakub NarębskiAug 18, 2016
  11. David LangAug 19, 2016
  12. Nikolaus RathAug 16, 2016
  13. Jacob KellerAug 17, 2016
  14. David LangAug 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.