Re: Working with zip files

3 messages, 3 authors, 2016-08-17 · open the first message on its own page

Re: Working with zip files

From: Nikolaus Rath <hidden>
Date: 2016-08-16 21:16:08

On Aug 16 2016, David Lang [off-list ref] wrote:
On Tue, 16 Aug 2016, Nikolaus Rath wrote:
quoted
I would like to store Simulink models in a Git
repository. Unfortunately, the file format is binary. But luckily, the
binary format happens to be a zipfile containing nicely formatted XML
files.

Is there a way to teach Git to take advantage of this when storing,
diff-ing and merging these files?
you should be able to use clean/smudge to have git store the files
uncompressed, which will help a lot.
Having looked at that, I'm not sure if this really helps:

As I understand, the smudge command is run on checkout to convert the
blob in the repository to the format that is desired in the working
tree. But this is the opposite of what I need: on checkout, I need to
convert the text data in the repository to a blob in the working tree.

Furthermore, I need to convert multiple text files into one blob, will
smudge/clean seem to do just 1:1 conversions.

Am I missing something? Are there any other options?

Best,
Nikolaus
-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

Re: Working with zip files

From: Jacob Keller <hidden>
Date: 2016-08-17 05:32:18

On Tue, Aug 16, 2016 at 2:14 PM, Nikolaus Rath [off-list ref] wrote:
On Aug 16 2016, David Lang [off-list ref] wrote:
quoted
On Tue, 16 Aug 2016, Nikolaus Rath wrote:
quoted
I would like to store Simulink models in a Git
repository. Unfortunately, the file format is binary. But luckily, the
binary format happens to be a zipfile containing nicely formatted XML
files.

Is there a way to teach Git to take advantage of this when storing,
diff-ing and merging these files?
you should be able to use clean/smudge to have git store the files
uncompressed, which will help a lot.
Having looked at that, I'm not sure if this really helps:

As I understand, the smudge command is run on checkout to convert the
blob in the repository to the format that is desired in the working
tree. But this is the opposite of what I need: on checkout, I need to
convert the text data in the repository to a blob in the working tree.

Furthermore, I need to convert multiple text files into one blob, will
smudge/clean seem to do just 1:1 conversions.

Am I missing something? Are there any other options?
You want to store the contents of the zip file as *one* blob that is
the uncompressed contents of the archive somehow concatenated
together. That should still be a 1:1 relationship.

You won't store one blob per file in the zip.

Thanks,
Jake

Re: Working with zip files

From: David Lang <hidden>
Date: 2016-08-17 09:58:24

On Tue, 16 Aug 2016, Nikolaus Rath wrote:
On Aug 16 2016, David Lang [off-list ref] wrote:
quoted
On Tue, 16 Aug 2016, Nikolaus Rath wrote:
quoted
I would like to store Simulink models in a Git
repository. Unfortunately, the file format is binary. But luckily, the
binary format happens to be a zipfile containing nicely formatted XML
files.

Is there a way to teach Git to take advantage of this when storing,
diff-ing and merging these files?
you should be able to use clean/smudge to have git store the files
uncompressed, which will help a lot.
Having looked at that, I'm not sure if this really helps:

As I understand, the smudge command is run on checkout to convert the
blob in the repository to the format that is desired in the working
tree. But this is the opposite of what I need: on checkout, I need to
convert the text data in the repository to a blob in the working tree.

Furthermore, I need to convert multiple text files into one blob, will
smudge/clean seem to do just 1:1 conversions.

Am I missing something? Are there any other options?
so the smudge command would zip the file and the clean command would unzip the 
file (assuming it's a single file, if the zip is multiple files, you will have 
to add something to combine them)

you want the working tree to have a zip file and the repository to have text.

David Lang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help