From e5ef75bc3647754bde39f0b8c95c1e6b11f7a660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Tejero=20Cantero?= Date: Wed, 28 Oct 2026 07:54:56 +0100 Subject: [PATCH] :bug: Add the safe.directory entry only when missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every run of manage.sh executes git config --global --add safe.directory /home/penpot/penpot and --add appends unconditionally, so N invocations leave N copies of the entry in the developer's global git config: after a few months of daily devenv use, my ~/.config/git/config held 22 duplicates. Ask git first and add the entry only when it is missing, so the devenv behaves exactly as before and the host-side global config stops growing. AI-assisted-by: glm-5.3-flash Signed-off-by: Álvaro Tejero Cantero --- manage.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manage.sh b/manage.sh index f9a5824bfe..58543dd760 100755 --- a/manage.sh +++ b/manage.sh @@ -71,8 +71,10 @@ export CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD); export IMAGEMAGICK_VERSION=7.1.2-32 -# Safe directory to avoid ownership errors with Git -git config --global --add safe.directory /home/penpot/penpot || true +# Safe directory to avoid ownership errors with Git. --add appends on every +# run, so only add it when missing, or ~/.config/git/config grows a +# duplicate line per invocation. +git config --global --get-all safe.directory | grep -qxF '/home/penpot/penpot' || git config --global --add safe.directory /home/penpot/penpot || true # Set default java options export JAVA_OPTS=${JAVA_OPTS:-"-Xmx1000m -Xms50m"};