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

Re: clean/smudge filters on .zip/.tgz files

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Feb 27, 2013, 06:39 UTC
Message-ID
<512DAA0E.9010401@viscovery.net>
In-Reply-To
<20130226163800.454cd093@bigbox.christie.dr>
Am 2/26/2013 23:38, schrieb Tim Chase:
Show 17 quoted lines
> Various programs that I use ([Open|Libre]Office, Vym, etc) use a
> zipped/.tgz'ed file format, usually containing multiple
> (usually) plain-text files within.
> 
> I'm trying to figure out a way for git to treat these as virtual
> directories for purposes of merging/diffing.  
> 
> Reading up on clean/smudge filters, it looks like they expect one
> file coming in and one file going out, rather than one file
> on one side and a directory-tree of files on the other side.
> 
> I tried creating my own pair of clean/smudge filters that would
> uncompress the files, but there's no good way put multiple files on
> stdout.
> 
> Has anybody else played with such a scheme for uncompressing files as
> they go into git and recompressing them as they come back out?

I attempted to do something like this for OpenDocument files (I didn't get very far) until I discovered that LibreOffice can save "flat open document files". That combined with the option "save files optimized" switched off results in fairly readable XML in a single file that can even be merged under some circumstances.

You would still need a clean filter that normalizes the style numbers, cross reference marks and other stuff that changes each time LibreOffice saves the file.

-- Hannes
Previous: Tim ChaseNext: Michael J Gruber
Message 2 of 3 in “clean/smudge filters on .zip/.tgz files”
  1. Tim ChaseFeb 26, 2013
  2. Johannes SixtFeb 27, 2013
  3. Michael J GruberFeb 27, 2013

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.