From bbde4778d0bc9c1177c17e8da2137bcde6537d5e Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Fri, 7 Jun 2024 00:35:18 +0200 Subject: [PATCH 1/4] Fix user path reg query potentially getting truncated The reg query command used returns a multi-line output that contains the path variable's content in its third line: Path REG_EXPAND_SZ [actual path variable] The previous code just returned the last column of that line using awk, which fails to account for spaces in the path, in which case only the part after the last space was printed. Now cut is used to skip the first 12 spaces and print every after it, which returns the entire path variable's content unmodified. Signed-off-by: Moritz Bender <35152647+Morilli@users.noreply.github.com> --- git-extra/getgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-extra/getgit b/git-extra/getgit index 3d19009a00..d49b0feb66 100755 --- a/git-extra/getgit +++ b/git-extra/getgit @@ -248,7 +248,7 @@ echo "be removed from the context menu is available as $rm_ctxmenu " echo "" # Setting ENV echo -n "Setting env ..." -userpath=$(reg query "HKEY_CURRENT_USER\Environment" //v Path 2>/dev/null | awk 'NR==3 {print $NF}') +userpath=$(reg query "HKEY_CURRENT_USER\Environment" //v Path 2>/dev/null | awk 'NR==3 {print}' | cut -d ' ' -f 13-) if [[ "$userpath" == "" ]]; then setx PATH "$(cygpath -m /cmd)" > /dev/null 2>&1 elif [[ "$userpath" != *"$(cygpath -m /cmd)"* ]]; then From 3f4a1a678d4825f12f6449df14a58a41f910fa3e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 10 Jun 2024 17:08:02 +0000 Subject: [PATCH 2/4] git-extra: update checksums Signed-off-by: Johannes Schindelin --- git-extra/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-extra/PKGBUILD b/git-extra/PKGBUILD index 140964b9fd..ad1f326ac7 100644 --- a/git-extra/PKGBUILD +++ b/git-extra/PKGBUILD @@ -5,7 +5,7 @@ pkgbase="mingw-w64-${_realname}" pkgname=($_realname "${MINGW_PACKAGE_PREFIX}-${_realname}") _ver_base=1.1 -pkgver=1.1.636.2db97b993 +pkgver=1.1.639.bbde4778d pkgrel=1 pkgdesc="Git for Windows extra files" arch=('any') From 031e03baf26d4267a71fae0ce93103cd04c02cda Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:40:52 +0200 Subject: [PATCH 3/4] Use powershell to query registry instead of reg command The powershell command returns the queried value directly with no additional parsing required. Signed-off-by: Moritz Bender <35152647+Morilli@users.noreply.github.com> --- git-extra/getgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-extra/getgit b/git-extra/getgit index d49b0feb66..55e4d58e95 100755 --- a/git-extra/getgit +++ b/git-extra/getgit @@ -248,7 +248,7 @@ echo "be removed from the context menu is available as $rm_ctxmenu " echo "" # Setting ENV echo -n "Setting env ..." -userpath=$(reg query "HKEY_CURRENT_USER\Environment" //v Path 2>/dev/null | awk 'NR==3 {print}' | cut -d ' ' -f 13-) +userpath="$(powershell -command '(Get-ItemProperty -Path 'HKCU:\Environment' -Name Path).Path')" if [[ "$userpath" == "" ]]; then setx PATH "$(cygpath -m /cmd)" > /dev/null 2>&1 elif [[ "$userpath" != *"$(cygpath -m /cmd)"* ]]; then From dba6db7e1299327291f54dbb22235e7b1c88ae4a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 12 Jun 2024 14:49:57 +0000 Subject: [PATCH 4/4] git-extra: update checksums Signed-off-by: Johannes Schindelin --- git-extra/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-extra/PKGBUILD b/git-extra/PKGBUILD index ad1f326ac7..d45fddb666 100644 --- a/git-extra/PKGBUILD +++ b/git-extra/PKGBUILD @@ -5,7 +5,7 @@ pkgbase="mingw-w64-${_realname}" pkgname=($_realname "${MINGW_PACKAGE_PREFIX}-${_realname}") _ver_base=1.1 -pkgver=1.1.639.bbde4778d +pkgver=1.1.641.031e03baf pkgrel=1 pkgdesc="Git for Windows extra files" arch=('any')