PSA: Mark SVG as binary

Ben Cooksley bcooksley at kde.org
Mon Apr 21 19:38:18 BST 2025


On Sat, Mar 4, 2023 at 10:49 AM Ben Cooksley <bcooksley at kde.org> wrote:

> Hi all,
>
> Over the past few months Sysadmin has periodically received reports of our
> Git hooks failing when processing commits in certain circumstances.
>
> Looking at all of these instances a clear trend has emerged, with files
> that have lines in them that are extremely and excessively long being the
> culprit of this issue. In all instances, the files in question have been
> generated by software and not been written by humans.
>
> While it is not entirely clear why this issue has suddenly appeared (as
> the code within the Git hooks causing the failure has been in production
> for 10+ years) I am suspecting a change in behaviour in either Git or
> Python to be the cause of this (with Git being most likely).
>
> In all cases i'm aware of, the files have been in either SVG, JSON or XML
> in format.
>
> To fix this, and allow changes to be merged please add a ".gitattributes"
> file at the top level of the Git repository you are seeing this behaviour
> in on the master branch with the following contents:
>
> *.svg binary
>
> Amending as needed to cover other files that also contain content that has
> a meaningless diff.
>
> Note that the file *must* be placed at the root of the repository and on
> the master branch, otherwise it will not be propagated by GitLab to our
> hooks.
>

Necro posting to my own thread here...

Late in 2024 there was a change to how GitLab operates which means it no
longer propagates .gitattributes files from the default branch (or in fact
any branch at all) to the Git repository on disk.
This affects all repositories as they have logic to cleanup any previously
propagated files.

I have just made a change to the hooks that should hopefully help alleviate
part of the issue.

In my local testing the eternal loop in the relevant section of the hooks
was not reproducible (even with a SVG altering commit that has previously
triggered the issue) however that doesn't necessarily mean the problem is
fully fixed.


>
> Thanks,
> Ben
>

Thanks,
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-devel/attachments/20250422/0f07f9fa/attachment.htm>


More information about the kde-devel mailing list