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

Re: Interaction between clean/smudge and git status

From
SCSergio Callegari <scallegari@arces.unibo.it>
Date
Apr 14, 2008, 07:38 UTC
Message-ID
<loom.20080414T072615-85@post.gmane.org>
In-Reply-To
<7vej98apdo.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster <at> pobox.com> writes:
Show 5 quoted lines
> 
> What is to "re-zip"?  You have a .zip file that contains a single file in
> your work tree, and the index and the tree objects record that single file
> deflated?  When you "check out" from the index, you run smudge to create a
> new .zip file with that single file?

I have a zip file that contains a collection of files (or I have an openoffice file that is just the same). The program that creates the zip file uses default compression. In this way, things managed by git result in objects that cannot be deltified one against the other very well by git repack.

my re-zip script takes a zip file on stdin, unpacks everything in a temporary directory, then recreates the archive with a different compression level and puts it out on stdout. When the compression is 0, things are merely put in the archive. In this way the files managed git result in objects that do deltify well one against the other and in much smaller packs.

> Are you recreating the .zip file in the filter in such a way that a file
> with the same contents results in byte-to-byte identical .zip file?
> Otherwise as far as git is concerned you have changed the file in the work
> tree.

And here you are right!!! I thought that re-zip script was repeatable in behaviour, but it is not (probably because things like file dates change when files are unpacked in the temporary dir and dates get stored).

I absolutely overlooked that.

Then to do what I want to do, I need to work at a lower level, I cannot just unzip and zip again.

Thanks
Previous: Johannes SixtNext: Sergio Callegari
Message 5 of 6 in “Interaction between clean/smudge and git status”
  1. Sergio CallegariApr 13, 2008
  2. Johannes SixtApr 14, 2008
  3. Junio C HamanoApr 14, 2008
  4. Johannes SixtApr 14, 2008
  5. Sergio CallegariApr 14, 2008
  6. Sergio CallegariApr 14, 2008

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.