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

Re: .git/binary

From
Pratyush Yadav <me@yadavpratyush.com>
Date
Oct 25, 2019, 18:05 UTC
Message-ID
<20191025180533.ed6du6weja2wfx6c@yadavpratyush.com>
In-Reply-To
<24796381572021130@iva7-56e9317134d0.qloud-c.yandex.net>
On 25/10/19 07:32PM, без имени wrote:
> > Or were you thinking of some other meaning for "files stored in a single (current) state"?
> 
> It means that new versions of files located in `.git / binary` will completely replace old versions in history, and therefore will be in a single (current) state in history. What used to be another version of this file should be ignored (very useful for PNG, JPEG, PDF).
 
Something like this might have trouble working with checkouts of past 
commits, which is a major reason (at least for me) for using a version 
control system.

Say you have two files marked as "binary" A.png and B.png at commit X. Some part of your code references those files. Now let's say you make a new commit Y where you remove A.png. You also remove all references to A.png in your code since you don't need it anymore. In your suggested system, we drop A.png.

Now if you checkout the commit X, A.png does not exist. This means your code won't compile or work properly, defeating the purpose of version control.

You can argue that "how about we keep deleted files in history, but for the files that are modified, we don't keep their history, just the latest version?".

For that argument, consider the following: say you have a commit X which has A.png. A.png has the dimensions 200x200. You make a new commit Y where you make A.png larger, say 400x400.

Now if you checkout X, A.png is still 400x400 since we didn't track its history. And so, the behaviour of your software at that point might also change, defeating the purpose of version control.

So instead, I'd point you to git-lfs [0]. I haven't personally used the tool ever, but it _might_ help in your use case.

[0] https://git-lfs.github.com/
-- 
Regards,
Pratyush Yadav
Previous: без имениNext: без имени
Message 4 of 8 in “.git/binary”
  1. без имениOct 25, 2019
  2. Philip OakleyOct 25, 2019
  3. без имениOct 25, 2019
  4. Pratyush YadavOct 25, 2019
  5. без имениOct 25, 2019
  6. без имениOct 25, 2019
  7. Philip OakleyOct 25, 2019
  8. без имениOct 25, 2019

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.