From a767474773e038ce7c1929e56e8ed89e9e6ed6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Tejero-Cantero?= <807608+alvorithm@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:33:53 +0100 Subject: [PATCH] :bug: Add the safe.directory entry only when missing (#12667) 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 2696b9eefe..6af7aec517 100755 --- a/manage.sh +++ b/manage.sh @@ -82,8 +82,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"};