Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2026-04

GIT and binary files.

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Marco van de Voort

I want to add a binary (.res for a compiled manifest) to winunits-base, following the pattern of fclel.res in fcl-base as far as fpmake is concerned.

However do I need to do something special while adding/commiting to mark it as a binary file?

I use tortoisegit on a "main" checkout.

Reply by email

Graeme Geldenhuys
to Marco van de Voort

As far as git is concerned, it should auto detect it as a binary.

Binaries might be blocked though via the. gitignore file, in which case you'll have to use the --force argument.

A git config file can also define how file extensions should be treated. I'm not near a computer to see what FPC Source repo has configured.

G.

Marco van de Voort wrote 10 lines
I want to add a binary (.res for a compiled manifest) to winunits-base, following the pattern of fclel.res in fcl-base as far as fpmake is concerned. However do I need to do something special while adding/commiting to mark it as a binary file? I use tortoisegit on a "main" checkout. _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Marco van de Voort
to Graeme Geldenhuys

Op 4-4-2026 om 18:58 schreef Graeme Geldenhuys via fpc-devel:

As far as git is concerned, it should auto detect it as a binary.

Depending on EOL detection it seems. But this is a compield resource file which packs an manifest (XML) in it, so it naturally has EOLs in it, which is why I was careful.

Anyway after adding the explorer properties said something like "saveEOL: false" or something like that. I hope that means it is binary.

Thanks for some keywords to google.

Show quoted text 7 lines
Binaries might be blocked though via the. gitignore file, in which case you'll have to use the --force argument. A git config file can also define how file extensions should be treated. I'm not near a computer to see what FPC Source repo has configured.

In the toplevel .gitattributes (is that valid for the whole repo?), only basic source files seem to have an assigned filetype, rest is auto.

Anyway, it is committed, an unit that has a manifest that sets the default ANSI codepage to UTF8 on "modern" Windows (Win10 1905+ iirc (*)) when used. As a bypass it also enables WinNT LFN. (8192 character filenames), a much older Windows feature.

I've found that these manifests with Lazarus for the last 5 years (that can configure them in the application tab) to be very convenient. Both features are great for small utilities and buildscripts in Pascal.  It was time to have them also for demos and utils etc in the the FPC tree.

Note the heightened Windows requirement only exists if you USES this unit.

(*) IOW all officially installed versions of WIndows, and even older
corporate versions that might use the paid Win10 life extension.

Reply by email

Unknown author
to Marco van de Voort
Marco van de Voort wrote
Depending on EOL detection it seems.

No, not quite. For a start, it totally ignores file extensions - they have no affect on what git does it this regard. It looks for NUL (00) bytes, by scanning the first 8000 bytes. Text files almost never contain a null byte. Binary files, like images, compiled executable, compressed archives etc, frequently contain 00 bytes as part of their data structure. It also does a high-density check for non-printable characters. If git is still not 100% sure, it will default to treating it as a binary, so as to avoid corrupting it during line-ending conversions.

It's a lot more advanced to what what most people think. :-)

Show quoted text 5 lines
> A git config file can also define how file extensions should be > treated. I'm not near a computer to see what FPC Source repo has > configured. > In the toplevel .gitattributes (is that valid for the whole repo?)

Yes.

But sub-directories can override values, if they have their own .gitattributes file. Same behaviour as the .gitignore file.

Regards,
- Graeme -

Reply by email