# .git/binary

8 messages from 2019-10-25 to 2019-10-25. Participants: без имени, Philip Oakley, Pratyush Yadav.
Thread: https://gitlist.dev/t/52117

## без имени, 2019-10-25 08:53

Subject: .git/binary
Message-ID: <22757761571993594@vla1-d97dbca235a9.qloud-c.yandex.net>
URL: https://gitlist.dev/e/22757761571993594%40vla1-d97dbca235a9.qloud-c.yandex.net

```
Is it possible to add a `.git/binary` configuration file like` .gitignore` to the `git` system with a list of files stored in a single (current) state.

-- 
zvezdochiot


```

## Philip Oakley, 2019-10-25 15:10

Subject: Re: .git/binary
Message-ID: <b9e29a2f-494b-eebc-a3ee-2a2ed4967d7e@iee.email>
URL: https://gitlist.dev/e/b9e29a2f-494b-eebc-a3ee-2a2ed4967d7e%40iee.email
In-Reply-To: <22757761571993594@vla1-d97dbca235a9.qloud-c.yandex.net>

```
Hi zvezdochiot,
On 25/10/2019 09:53, без имени wrote:
> Is it possible to add a `.git/binary` configuration file like` .gitignore` to the `git` system with a list of files stored in a single (current) state.
>
Have you looked at the `git help attributes`?
In particular the example

*.jpg		-text

Where the '-text' says no end of lines for conversion (i.e. binary!)


Or were you thinking of some other meaning for "files stored in a single (current) state"?

-- 
Philip


```

## без имени, 2019-10-25 16:32

Subject: Re: .git/binary
Message-ID: <24796381572021130@iva7-56e9317134d0.qloud-c.yandex.net>
URL: https://gitlist.dev/e/24796381572021130%40iva7-56e9317134d0.qloud-c.yandex.net
In-Reply-To: <b9e29a2f-494b-eebc-a3ee-2a2ed4967d7e@iee.email>

```
> 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).

-- 
Территория без имени


```

## Pratyush Yadav, 2019-10-25 18:05

Subject: Re: .git/binary
Message-ID: <20191025180533.ed6du6weja2wfx6c@yadavpratyush.com>
URL: https://gitlist.dev/e/20191025180533.ed6du6weja2wfx6c%40yadavpratyush.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

```

## без имени, 2019-10-25 18:27

Subject: Re: .git/binary
Message-ID: <26026581572028020@vla4-9d01d86ae0b7.qloud-c.yandex.net>
URL: https://gitlist.dev/e/26026581572028020%40vla4-9d01d86ae0b7.qloud-c.yandex.net
In-Reply-To: <20191025180533.ed6du6weja2wfx6c@yadavpratyush.com>

```
> Something like this might have trouble working with checkouts of past
> commits

This is a conscious step that is taken exactly there and only where there is a need for it. For example, `doc/*.png, doc/*.jpg, doc/*.pdf`.

-- 
zvezdochiot

```

## без имени, 2019-10-25 18:40

Subject: Re: .git/binary
Message-ID: <24145781572028812@sas2-1c82b59a1818.qloud-c.yandex.net>
URL: https://gitlist.dev/e/24145781572028812%40sas2-1c82b59a1818.qloud-c.yandex.net
In-Reply-To: <20191025180533.ed6du6weja2wfx6c@yadavpratyush.com>

```
> 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.

Good. If such a mechanism seems too problematic for you, then suggest another mechanism for resetting the history of a specific file. Alternatives are even more problematic. If the file placed in the list I proposed will go into the git history only as a link without checking and calculating the amounts, then isolating the file included in the history will change all the amounts.

-- 
zvezdochiot


```

## Philip Oakley, 2019-10-25 20:59

Subject: Re: .git/binary
Message-ID: <5f558e34-bdb2-6656-d2ca-42a2d7cb8874@iee.email>
URL: https://gitlist.dev/e/5f558e34-bdb2-6656-d2ca-42a2d7cb8874%40iee.email
In-Reply-To: <24796381572021130@iva7-56e9317134d0.qloud-c.yandex.net>

```
On 25/10/2019 17:32, без имени 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).
>
"completely replace old versions in history" : but why?
- Is it a space (size on disc, or memory) problem/limitation
- A confidentiality problem?
- A 'must use latest procedure' (always checkout latest instructions) 
problem?
- A synchronisation problem (no adequate diff) needing single line of 
development? (there was a discussion at Git Merge in February about this 
for modified Audio-Visual (AV) files in Games development

“Git for games: current problems and solutions” presentation by John
Austin at Git Merge 2019:
   https://www.youtube.com/watch?v=K3zOhU3NdWA&list=PL0lo9MOBetEFqBue4vNcTEnkBjgIQU1Q3&index=8&t=0s

- Something else?


The main advantage of Git is that it distributes control from some central 'manager' to the individual and does that by taking snapshots and exchanging verification stamps, so the idea of deleting history feels somehow 'wrong', hence the need to understand

-- 
Philip


```

## без имени, 2019-10-25 21:33

Subject: Re: .git/binary
Message-ID: <25196441572039199@iva5-58d151f416d2.qloud-c.yandex.net>
URL: https://gitlist.dev/e/25196441572039199%40iva5-58d151f416d2.qloud-c.yandex.net
In-Reply-To: <5f558e34-bdb2-6656-d2ca-42a2d7cb8874@iee.email>

```
> The main advantage of Git is that it distributes control from some central 'manager' to the individual and does that by taking snapshots and exchanging verification stamps, so the idea of deleting history feels somehow 'wrong', hence the need to understand

I perfectly understand that by removing information about the file and its changes from the history, I will “delete” it completely. Git needs changes to work. That means you will need an additional utility file, for example, `.gitshadow`, containing the sum of the files in the list. And this service file will already be reflected in the history. Moreover, it must be to process in a special way.
What is this "all" for?
Too much that is in `git` is completely useless to anyone. This mechanism (if it is implemented) will not be needed by everyone, but those who need it will be very gracious for freeing useless the mountains of  trash.

-- 
zvezdochiot


```
