{"thread":{"id":"33026","subject":"clean/smudge filters on .zip/.tgz files","startedAt":"2013-02-26T22:38:00Z","lastAt":"2013-02-27T15:18:17Z","messageCount":3,"participants":["Tim Chase","Johannes Sixt","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"210376","messageId":"20130226163800.454cd093@bigbox.christie.dr","threadId":"33026","inReplyTo":null,"subject":"clean/smudge filters on .zip/.tgz files","fromName":"Tim Chase","fromEmail":"git@tim.thechases.com","sentAt":"2013-02-26T22:38:00Z","receivedAt":"2013-02-26T22:38:00Z","isPatch":false,"sender":{"key":"git@tim.thechases.com","avatar":null},"body":"Various programs that I use ([Open|Libre]Office, Vym, etc) use a\nzipped/.tgz'ed file format, usually containing multiple\n(usually) plain-text files within.\n\nI'm trying to figure out a way for git to treat these as virtual\ndirectories for purposes of merging/diffing.  \n\nReading up on clean/smudge filters, it looks like they expect one\nfile coming in and one file going out, rather than one file\non one side and a directory-tree of files on the other side.\n\nI tried creating my own pair of clean/smudge filters that would\nuncompress the files, but there's no good way put multiple files on\nstdout.\n\nHas anybody else played with such a scheme for uncompressing files as\nthey go into git and recompressing them as they come back out?\n\n-tkc\n"},{"id":"210383","messageId":"512DAA0E.9010401@viscovery.net","threadId":"33026","inReplyTo":"20130226163800.454cd093@bigbox.christie.dr","subject":"Re: clean/smudge filters on .zip/.tgz files","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2013-02-27T06:39:10Z","receivedAt":"2013-02-27T06:39:10Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 2/26/2013 23:38, schrieb Tim Chase:\n> Various programs that I use ([Open|Libre]Office, Vym, etc) use a\n> zipped/.tgz'ed file format, usually containing multiple\n> (usually) plain-text files within.\n> \n> I'm trying to figure out a way for git to treat these as virtual\n> directories for purposes of merging/diffing.  \n> \n> Reading up on clean/smudge filters, it looks like they expect one\n> file coming in and one file going out, rather than one file\n> on one side and a directory-tree of files on the other side.\n> \n> I tried creating my own pair of clean/smudge filters that would\n> uncompress the files, but there's no good way put multiple files on\n> stdout.\n> \n> Has anybody else played with such a scheme for uncompressing files as\n> they go into git and recompressing them as they come back out?\n\nI attempted to do something like this for OpenDocument files (I didn't get\nvery far) until I discovered that LibreOffice can save \"flat open document\nfiles\". That combined with the option \"save files optimized\" switched off\nresults in fairly readable XML in a single file that can even be merged\nunder some circumstances.\n\nYou would still need a clean filter that normalizes the style numbers,\ncross reference marks and other stuff that changes each time LibreOffice\nsaves the file.\n\n-- Hannes\n"},{"id":"210396","messageId":"512E23B9.4070000@drmicha.warpmail.net","threadId":"33026","inReplyTo":"512DAA0E.9010401@viscovery.net","subject":"Re: clean/smudge filters on .zip/.tgz files","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2013-02-27T15:18:17Z","receivedAt":"2013-02-27T15:18:17Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Johannes Sixt venit, vidit, dixit 27.02.2013 07:39:\n> Am 2/26/2013 23:38, schrieb Tim Chase:\n>> Various programs that I use ([Open|Libre]Office, Vym, etc) use a\n>> zipped/.tgz'ed file format, usually containing multiple\n>> (usually) plain-text files within.\n>>\n>> I'm trying to figure out a way for git to treat these as virtual\n>> directories for purposes of merging/diffing.  \n>>\n>> Reading up on clean/smudge filters, it looks like they expect one\n>> file coming in and one file going out, rather than one file\n>> on one side and a directory-tree of files on the other side.\n>>\n>> I tried creating my own pair of clean/smudge filters that would\n>> uncompress the files, but there's no good way put multiple files on\n>> stdout.\n>>\n>> Has anybody else played with such a scheme for uncompressing files as\n>> they go into git and recompressing them as they come back out?\n> \n> I attempted to do something like this for OpenDocument files (I didn't get\n> very far) until I discovered that LibreOffice can save \"flat open document\n> files\". That combined with the option \"save files optimized\" switched off\n> results in fairly readable XML in a single file that can even be merged\n> under some circumstances.\n> \n> You would still need a clean filter that normalizes the style numbers,\n> cross reference marks and other stuff that changes each time LibreOffice\n> saves the file.\n> \n> -- Hannes\n> \n\nIn general, using \"zip -0\" is a good way of getting something that\ndelta-compresses well and that can give a meaningful diff (and has no\ninformation loss).\n\nThe (my) problem is that recompressing a zip archive (i.e. multi-file)\nis a pita, you can't just use a pipe \"unzip | zip -0\". You'd have to do\nthat in a temp dir.\n\nMichael\n"}]}