From 7534ab5f416ac8bb5eb9a1ab45c8fc06c7d6d0c7 Mon Sep 17 00:00:00 2001 From: Christoph Thiede Date: Wed, 10 Jan 2024 18:33:41 +0100 Subject: [PATCH] git: truncate existing oversized GitStore logs --- .../monticello.meta/postscript.st | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/FileSystem-Git.package/monticello.meta/postscript.st b/src/FileSystem-Git.package/monticello.meta/postscript.st index 672e617b3..5612c6545 100644 --- a/src/FileSystem-Git.package/monticello.meta/postscript.st +++ b/src/FileSystem-Git.package/monticello.meta/postscript.st @@ -32,4 +32,12 @@ FileSystemGitCompatibility hadInadequateFromUnixTimeImplementation ifFalse: changeRecord ifNotNil: [[changeRecord fileIn] ensure: [Smalltalk globals removeKey: #TEMP_Squot_ShadowedChangeRecord255]]]. -FileSystemGitCompatibility ensureValidFromUnixTimeImplementation.'! +FileSystemGitCompatibility ensureValidFromUnixTimeImplementation. + +"2024-01-10: fix git log rotation and truncate older logs, see https://github.com/hpi-swa/Squot/pull/410" +(GitStore classPool at: #LogMessages) ifNotNil: [:logMessages | + | count | + count := logMessages size. + GitStore classPool + at: #LogMessages put: ((logMessages asArray last: (count := 5000 clampHigh: count)) as: LinkedList) "forth and back conversion to avoid inefficient LinkedList(...)>>#last: (quadratic in older versions of Squeak)"; + at: #LogMessageCount put: count].'!