<div dir="ltr"><div dir="ltr">On Sat, Mar 4, 2023 at 10:49 AM Ben Cooksley <<a href="mailto:bcooksley@kde.org">bcooksley@kde.org</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>Over the past few months Sysadmin has periodically received reports of our Git hooks failing when processing commits in certain circumstances. </div><div><br></div><div>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.</div><div><br></div><div>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).</div><div><br></div><div>In all cases i'm aware of, the files have been in either SVG, JSON or XML in format.</div><div><br></div><div>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:</div><div><br></div><div><code><span id="m_7584782217254443177gmail-LC1" lang="plaintext">*.svg binary</span></code><br></div><div><br></div><div>Amending as needed to cover other files that also contain content that has a meaningless diff.</div><div><br></div><div>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.</div></div></blockquote><div><br></div><div>Necro posting to my own thread here...</div><div><br></div><div>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.</div><div>This affects all repositories as they have logic to cleanup any previously propagated files.</div><div><br></div><div>I have just made a change to the hooks that should hopefully help alleviate part of the issue.</div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks,</div><div>Ben</div></div></blockquote><div><br></div><div>Thanks,</div><div>Ben </div></div></div>