{"thread":{"id":"58230","subject":"[PATCH] cmake: support local installations of git","startedAt":"2022-07-27T09:06:11Z","lastAt":"2022-07-27T09:06:11Z","messageCount":1,"participants":["Johannes Schindelin via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"460011","messageId":"pull.1304.git.1658912756815.gitgitgadget@gmail.com","threadId":"58230","inReplyTo":null,"subject":"[PATCH] cmake: support local installations of git","fromName":"Johannes Schindelin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-07-27T09:05:56Z","receivedAt":"2022-07-27T09:06:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>\n\nAt least in systems where the user is local and not an administrator\ngit will install in a subdirectory of %APPDATALOCAL%, so it makes\nsense to also look there for the shell needed by the cmake integration\nwith Visual Studio.\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n    cmake(windows): fall back to user-wide Git if there is no system Git\n    \n    On Windows, software is typically either installed into C:\\Program\n    Files, where all users can use it, or into a location inside the user's\n    home directory, where only that particular user can use the software.\n    \n    Git for Windows strongly encourages system-wide installations, but does\n    not prevent user-wide installations.\n    \n    When building Git via CMake, this matters because we rely on Git for\n    Windows to provide the POSIX shell that is needed to run Git's generator\n    scripts such as generate-cmdlist.sh. So far, we only found Git for\n    Windows if it was installed system-wide, but with this here patch, we\n    also find any user-wide installation.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1304%2Fdscho%2Fcmake-and-user-wide-g4w-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1304/dscho/cmake-and-user-wide-g4w-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1304\n\n contrib/buildsystems/CMakeLists.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\nindex 1b23f2440d8..2237109b57f 100644\n--- a/contrib/buildsystems/CMakeLists.txt\n+++ b/contrib/buildsystems/CMakeLists.txt\n@@ -77,7 +77,7 @@ if(USE_VCPKG)\n \tset(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING \"Vcpkg toolchain file\")\n endif()\n \n-find_program(SH_EXE sh PATHS \"C:/Program Files/Git/bin\")\n+find_program(SH_EXE sh PATHS \"C:/Program Files/Git/bin\" \"$ENV{LOCALAPPDATA}/Programs/Git/bin\")\n if(NOT SH_EXE)\n \tmessage(FATAL_ERROR \"sh: shell interpreter was not found in your path, please install one.\"\n \t\t\t\"On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/\")\n\nbase-commit: 6a475b71f8c4ce708d69fdc9317aefbde3769e25\n-- \ngitgitgadget\n"}]}