From patchwork Fri Sep 25 14:28:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 400121580 for ; Fri, 25 Sep 2020 14:28:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A64721741 for ; Fri, 25 Sep 2020 14:28:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TnQzVBaT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728958AbgIYO2n (ORCPT ); Fri, 25 Sep 2020 10:28:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728423AbgIYO2m (ORCPT ); Fri, 25 Sep 2020 10:28:42 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF0EC0613CE for ; Fri, 25 Sep 2020 07:28:42 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id e17so3259929wme.0 for ; Fri, 25 Sep 2020 07:28:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=mRcnH+G1Ka44sLeCNyVBJTX/HZuo1MlBFoUFNXHVNoQ=; b=TnQzVBaTTPO9Qoj0SXak5EmZjiB2UVbCQKO/iyJhiUw2ERwZqn20EuXYGhdO88FcXP 1BGI3+R3bGD/szCufo4BM7L2V8E/b9yLcqByU8Cb1GGTORBYCBahfYNMKJO8I3eNhPxW CU7mPzWsEWxZ7ASVTRJrQG2EIXlv2WW1aX6bZutAXwixr5tizGKXNcLe1SYXxEiqkWUp 9xXWcn0rPVISTx0Dv9RywqY3jhDepQl3nJWpEdIFYMqWFkFvR2hve9j2CgMlX/DnQ6Yu IhZUiDT88PfgkbMLFXQBkUO2cdO/wd42ts1Y8wOBKRjA+0Feh/MH8Hzir6D4PmPPMLzd fV6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=mRcnH+G1Ka44sLeCNyVBJTX/HZuo1MlBFoUFNXHVNoQ=; b=SRadKnM+xeEl2P4vaXPfGKLj9kKa+LnOifYZ/QUkQS/hAQs+e+Ek2cvtVSZpLxDm1c PI6xtS9ABCikEEC/4mjGwMzvT+U7k7s5GG4yuDfMhBWcAK1oFC6OXpj4AdiXnALbXr+Z pn5iAYQLzjZ3ZlOs+t9XXOSc7TT0s94tI/zz98gNxrQxmm4KcBXtk4LpE00vjxtUtO+i mqNXsNAQErq4T+XbrUwV7a16lefb9IsavpvRXHVbDW9y9WbfuNCahpzuV8AZI3tUL8tU pPVLv8342xn5aamo/p5ZZpR7e97+kzkeRJ57Gqowiwjvm8GXh3QFylKsDslbNwNK29P+ zz1A== X-Gm-Message-State: AOAM531aNdCs8KoVW+0giw6KOnh+F7Qi8HR6f6sVOgAbdBUHnXnQnVLf aMZ0ud9GmOHMW3HMT+gs8+JXO/sNOP0= X-Google-Smtp-Source: ABdhPJxQJJRUnLLcMA63QKMSdhqDplzHEa/8WgarSh3sh+fQe1NMzgtNE2Dto65SSBAYGYi9EqKN7w== X-Received: by 2002:a7b:c938:: with SMTP id h24mr3592773wml.142.1601044120877; Fri, 25 Sep 2020 07:28:40 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q12sm3041604wrs.48.2020.09.25.07.28.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:40 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:29 +0000 Subject: [PATCH 01/10] cmake: ignore files generated by CMake as run in Visual Studio MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin As of recent Visual Studio versions, CMake support is built-in: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019 All that needs to be done is to open the worktree as a folder, and Visual Studio will find the `CMakeLists.txt` file and automatically generate the project files. Let's ignore the entirety of those generated files. Helped-by: Đoàn Trần Công Danh Signed-off-by: Johannes Schindelin --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d0f692a355..6521f3cf22 100644 --- a/.gitignore +++ b/.gitignore @@ -241,3 +241,4 @@ Release/ /git.VC.VC.opendb /git.VC.db *.dSYM +/contrib/buildsystems/out From patchwork Fri Sep 25 14:28:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799885 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7749692C for ; Fri, 25 Sep 2020 14:28:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E7EA21741 for ; Fri, 25 Sep 2020 14:28:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bEhD1s8S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728968AbgIYO2o (ORCPT ); Fri, 25 Sep 2020 10:28:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728423AbgIYO2n (ORCPT ); Fri, 25 Sep 2020 10:28:43 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F37C0613CE for ; Fri, 25 Sep 2020 07:28:43 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id q9so3261616wmj.2 for ; Fri, 25 Sep 2020 07:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=xnkt83SLDEtUSWd+hVptfxemrNoGCKpXXnlEscdf5MA=; b=bEhD1s8SBFPY4rdSy6AZxdFlV5+UD5MbY7PMtcAQ0b+42E5euuUdUtGhJ5vdL/1gxz xk9FGhC0NNENZkhCRco4BnjDWiKWpKZXd+2kfKaG79U+xY2epNY2uRutprun3ZunPEoG bCutxHdz7FBb8ZBtNc/zaABt2zZCsvcsQ3JJRaakMJHp260VmNqFeDatVj445GEiCJ1K HP5gM79ze5eMUlVR0vNgGGz5lcmeBE6Rw1dvzDUrI8kdb19A2WZIUOczOEF1zZcGqkcJ 6Vs7ofH/yARUfHoDht50nDQ+tPkqoVkmd6Cl8p8IxOl4JDCG7TkaxyEEXeHM+0MvJzT9 xG2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=xnkt83SLDEtUSWd+hVptfxemrNoGCKpXXnlEscdf5MA=; b=pdJAWKDoM3QpgG9SWdO0f6DZZABj3JrrkQ0gZjOraxJETaZF7InTrAqZHNqRvvy/iA 9Pc9kgDxVH6I5oI1RUqfNCfZHos3AvMICrpKk0lSBPRXnINVuEq61abAPTbc1eBopTZ/ 6QRQseQkFo/D+VCYNCGTHjUtC2ambPABT8R6QNpTSp3LyWGx2ZcWW/ceci4mCX5ATmFB 8M+UtXrDsUK8IOYeAoiWJLVY7a2OcdN5+mkM+272O5hCrygvPS6/IqZGwJmQ9/pHn0m8 O1/8Xtz4pFdfEq3W1gVKhE+USElAIwkLY+I2SP8YtzTG+J2CNluaWeF6bwJywHRv0i9O 69pw== X-Gm-Message-State: AOAM531ve5/YAfKQYx7F4O3nVXhzJWoDNDAeqre6RAAylkv1hfdxgqpj 6gFfnVnBOZ+/EdtkziJQ+OFaE7d2G+s= X-Google-Smtp-Source: ABdhPJxLr1vQ6Hub8ed9/RV9fjnOqyL7ObygcASf3ugANLwLGJo/DkdOvnl26XzfvcrfxSv3LrGDHg== X-Received: by 2002:a7b:c1d9:: with SMTP id a25mr3631128wmj.4.1601044121773; Fri, 25 Sep 2020 07:28:41 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id d13sm3072568wrp.44.2020.09.25.07.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:41 -0700 (PDT) Message-Id: <05b4b69fee2b8c32769dd72dea182cfb72a14876.1601044118.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:30 +0000 Subject: [PATCH 02/10] cmake: do find Git for Windows' shell interpreter Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin By default, Git for Windows does not install its `sh.exe` into the `PATH`. However, our current `CMakeLists.txt` expects to find a shell interpreter in the `PATH`. So let's fall back to looking in the default location where Git for Windows _does_ install a relatively convenient `sh.exe`: `C:\Program Files\Git\bin\sh.exe` Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 5007f173f1..d14fa4f3dc 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -43,8 +43,11 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) find_program(SH_EXE sh) if(NOT SH_EXE) - message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one." - "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/") + set(SH_EXE "C:/Program Files/Git/bin/sh.exe") + if(NOT EXISTS ${SH_EXE}) + message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one." + "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/") + endif() endif() #Create GIT-VERSION-FILE using GIT-VERSION-GEN From patchwork Fri Sep 25 14:28:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799887 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E27BD1580 for ; Fri, 25 Sep 2020 14:28:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C23DD20936 for ; Fri, 25 Sep 2020 14:28:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jpc0p0/P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728975AbgIYO2p (ORCPT ); Fri, 25 Sep 2020 10:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728969AbgIYO2o (ORCPT ); Fri, 25 Sep 2020 10:28:44 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 379F7C0613CE for ; Fri, 25 Sep 2020 07:28:44 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id y15so3538914wmi.0 for ; Fri, 25 Sep 2020 07:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=eZubIZIwUMiFrmcNwqR+VL9ixmOdNHlOZovIEYzMITo=; b=jpc0p0/P4eJd6b7bbI3Uzrekq0K4BfM2RqiUH0JgQJWyyHStzwpuDzt780wYmKGyOH 7Gzgm8JSgSr0j51h0WCXKXHRXtGCXDROwJrcYSiLbjl+NWFeC+xIrkUnEGg11ZnwOdta 6/JJz8+cx2uO34gIifZAvx0sOK0pUk+r6895jgj+S8gXqGd2fC1wBdm4yZh/JTHKTcJg 5YsP6OFVYocIBEE2bnv51f0dOXNL2vm/uhHot39xaFn1WC+XbEsVRkEQXkQKJaw++YBV 1gyuAaZ22ffIysNAX479U7REupXktgQF4uBI13Xiig63iTsV7b5d+rOpZ7FSvuofLOj1 rNlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=eZubIZIwUMiFrmcNwqR+VL9ixmOdNHlOZovIEYzMITo=; b=QCVDs7U3VeQSjjYw5KCOEUH4wskJzJRREKodJMsEC6/mNtCQnUa1puhj25nTAzrS3I HLhvmmUHImQBPTPUkXopy1dG4Z9AawgzSbCQh6uZawmpwAEfNp9keDwOCDZFcuM7bocQ QxkKA7KogkTneqjTLTxaZ79mg+rEbYqf2cNHZt4wCSA6CBNLv3F3PMr9zofuU94AgmC1 KREPU6AWmGdiywnp8TnChnDJsu6g7gl7z1/ERPNbPC2SC4fsXxep6u3C96676/Hwgo6c G/XxiwWs4NYUEY6Pd3Z1XCrd4DXBfjZEERVBGjFtfsLRifa9woaJNhwFBN3qu8alt8CI ENpg== X-Gm-Message-State: AOAM531nLC8dXK8cDbx5T6i6LNhxab4RNsxYNtFp8fdjTFod612TZZbB 8Fi4fQyrJNEseLBoZtqrV6wc6f2WplY= X-Google-Smtp-Source: ABdhPJwlPIyCZ8gxvY9N6djybhOyCqtJgSzEcdOwAk7L33uVDev4bMs5hXbCYNy2XLb/NXZiBn05Ag== X-Received: by 2002:a7b:c453:: with SMTP id l19mr3296154wmi.163.1601044122654; Fri, 25 Sep 2020 07:28:42 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id e7sm571280wrm.6.2020.09.25.07.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:42 -0700 (PDT) Message-Id: <5967822a0c69b9f822d3a4f6412c626c4a43cc35.1601044118.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:31 +0000 Subject: [PATCH 03/10] cmake: ensure that the `vcpkg` packages are found on Windows Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin On Windows, we use the `vcpkg` project to manage the dependencies, via `compat/vcbuild/`. Let's make sure that these dependencies are found by default. This is needed because we are about to recommend loading the Git worktree as a folder into Visual Studio, relying on the automatic CMake support (which would make it relatively cumbersome to adjust the search path used by CMake manually). Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index d14fa4f3dc..16014ac4f7 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -40,6 +40,13 @@ cmake_minimum_required(VERSION 3.14) #set the source directory to root of git set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) +if(WIN32) + set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg") + list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows") + + # In the vcpkg edition, we need this to be able to link to libcurl + set(CURL_NO_CURL_CMAKE ON) +endif() find_program(SH_EXE sh) if(NOT SH_EXE) From patchwork Fri Sep 25 14:28:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79D801580 for ; Fri, 25 Sep 2020 14:28:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 537D9208A9 for ; Fri, 25 Sep 2020 14:28:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M3xJNELJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728984AbgIYO2s (ORCPT ); Fri, 25 Sep 2020 10:28:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728974AbgIYO2p (ORCPT ); Fri, 25 Sep 2020 10:28:45 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1B09C0613CE for ; Fri, 25 Sep 2020 07:28:44 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id e2so3537337wme.1 for ; Fri, 25 Sep 2020 07:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=QPGEktvBa4u524d4A0i6OsR419ivIXg6j+KJkoHFQyE=; b=M3xJNELJBCVHJ/my4Oo87IBBomMXKllMBpN+aDLRvUopdk2bbkBEHQC70Jw0qV8lDP FQAElxwgy6X96WXH9tryE9FI1g0SrFMUq6MNRZXaASO8Q5d89VskiP9qHhnNKgnOecF6 eXz5lrFwne5AM2bGvY8TED4xhUIjT+Vi6RE9OG6WchnvvrnElTdvnd74g9/jZurV54Wf abKeImpfhmLHrQ+r9sBIe57XGlY8LTT0DD/qS9Oubxr7pxYWIFvNevw3JlSjS5USjk5g rEu4jFIFUKnufG7p6t6j8rB1J4/cWYE+tOqML34HQbF87HBCCR8w9LOsQhFw8HJQp4Sn tLJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=QPGEktvBa4u524d4A0i6OsR419ivIXg6j+KJkoHFQyE=; b=KrXrajq4ZdyTBhdoCKsf01p2pXtCgA4KHtdtW6Kjwi3f5GOWcV4KXACopuWQL1Nct7 gNghKgoq2/aoX/HOXtW2yIDEgLlxoUunbMOcs9bbbCFCPF4WYUxUH8pw/KU/WRM60Buh mkcXwB+g0ivNV2ecpaxdnyU1uosVusc5A4d2MX+tFIkvAo8sfN49a8vcMWjsTXQxqwfQ u+1GyeiWZ4fEocF461rpee6ZCyOuLnedL5Ifm8jEB4d8B/+PdbKr8nOcsNOKZq7tJF8n Xl8TqhkNPlAB0rqRerQePR/yowQrrnnTTMda6rVIqmL84DY/eB0SjDmWnCAdiL7JYRXY Hp1Q== X-Gm-Message-State: AOAM531YPZjqvULU5gis/zK8WH7BiPvmWsGh32TB89KvRTNWAPW08Mmj zOBAwW8gnKZ2g93jEwfHChc0RL5gHKc= X-Google-Smtp-Source: ABdhPJyFGL5GOEeQ8qJ5W3t++eOXPWQ22GqaniotGjls9MaDfTtthsmhHialBdHa9RnUgnZqL2uL1w== X-Received: by 2002:a1c:bdd4:: with SMTP id n203mr3419114wmf.119.1601044123473; Fri, 25 Sep 2020 07:28:43 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q20sm3048591wmj.5.2020.09.25.07.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:43 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:32 +0000 Subject: [PATCH 04/10] cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin We are already relying on `vcpkg` to manage our dependencies, including `libiconv`. Let's also use the `msgfmt.exe` from there. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 16014ac4f7..acb197fba5 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -155,7 +155,11 @@ endif() find_program(MSGFMT_EXE msgfmt) if(NOT MSGFMT_EXE) - message(WARNING "Text Translations won't be build") + set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe) + if(NOT EXISTS ${MSGFMT_EXE}) + message(WARNING "Text Translations won't be build") + unset(MSGFMT_EXE) + endif() endif() #Force all visual studio outputs to CMAKE_BINARY_DIR From patchwork Fri Sep 25 14:28:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 307EE16BC for ; Fri, 25 Sep 2020 14:28:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C89520BED for ; Fri, 25 Sep 2020 14:28:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QSSjQSuT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728997AbgIYO2u (ORCPT ); Fri, 25 Sep 2020 10:28:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728969AbgIYO2q (ORCPT ); Fri, 25 Sep 2020 10:28:46 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1CC7C0613D3 for ; Fri, 25 Sep 2020 07:28:45 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id a9so3542016wmm.2 for ; Fri, 25 Sep 2020 07:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=LbzZ7rratphdzpKCzScQ0H87PZ4mOGWV8pJbumS/i3M=; b=QSSjQSuTZdmNQJ3+Ij6Ulwixb5tI0DU2Od5KnB5N0D2B8P9H8UexigLIgmpcpwI5Tm z+kDAvqzPM4CmqveR98lYHlKpsvxooCTQy/bIskPmn1f1WHnrdU39bKpctMAxf4k9ZEL M8oF5snBysUINTg7iR9QxbgF/aNbLPQC2rw9B40PMllDX5frANJvjdqme6tmN/lg0Ynq AX9JhEtNNgjiLyH09Ru2O/Yk2gMpxpvZZFtFiImf834WeV1cdaT9Jib0ZOXZD6Sqbvcs ScWxicZlAYqdur2s1xO3eeuUav5ejGrPyxeOzlxu4BnGdB1vTzxr4K28IvTGKHnBjuT+ PNuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=LbzZ7rratphdzpKCzScQ0H87PZ4mOGWV8pJbumS/i3M=; b=CpCEviScRKLUXerdyKCsbpAbUdqDR8Tl3aK4QEMzkTg0JhefN94eVcn8/O53s8vOmF nLlvNRHa9rehjrvvGf0h4/xiMVZ3Mv/ziXlL/dkFYz9ixDHWYeXgNj5uTKNLalNEgF1f OOx7A9buQ5qxVBHaso1sMsblpYQ5X6F6PAS7Z0F35CHPQUX2Fok9QfmPmMy6gLXmWkv0 wfBj+x/AUmfJRRPbmbtWqaYq+c/aLflDyVbayost4nqLmhkNsRtShG6Xgszb/ktclyDA 39cH09Dh8WLVrwHOqXoYkX+LviDr7fPlpXOIpyE2vTj9ViaZrIXF9cdfUFEkFicK82gZ VVOw== X-Gm-Message-State: AOAM5339V/sm7RzGQcK52tqBmLq8Rnu5Itv3t8fK7fYIEGlER/cN5uLs B62KLxIP3yHPo7rw6gXYU12+qbCMMlE= X-Google-Smtp-Source: ABdhPJyssYx5fqQcoXycyJwYjJd4EctPWa0Nh2y2LkH7wQ7COhDqK69+Jq/jfCqoWp7nymmG2PJgig== X-Received: by 2002:a1c:770c:: with SMTP id t12mr3679754wmi.121.1601044124288; Fri, 25 Sep 2020 07:28:44 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z127sm3222309wmc.2.2020.09.25.07.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:43 -0700 (PDT) Message-Id: <8b3500a07c67d07e0928e8d6638d618ab118e1eb.1601044118.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:33 +0000 Subject: [PATCH 05/10] cmake: quote the path accurately when editing `test-lib.sh` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin By default, the build directory will be called something like `contrib/buildsystems/out/build/x64-Debug (default)` (note the space and the parentheses). We need to make sure that such a path is quoted properly when editing the assignment of the `GIT_BUILD_DIR` variable. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index acb197fba5..e66ae137c2 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -952,7 +952,7 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH}) file(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.cmake "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh GIT_BUILD_DIR_REPL REGEX \"GIT_BUILD_DIR=(.*)\")\n" "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh content NEWLINE_CONSUME)\n" - "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY\\\"/../${BUILD_DIR_RELATIVE}\" content \"\${content}\")\n" + "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY/../${BUILD_DIR_RELATIVE}\\\"\" content \"\${content}\")\n" "file(WRITE ${CMAKE_SOURCE_DIR}/t/test-lib.sh \${content})") #misc copies file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/) From patchwork Fri Sep 25 14:28:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A02D092C for ; Fri, 25 Sep 2020 14:28:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B85320BED for ; Fri, 25 Sep 2020 14:28:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DX1lH25L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728995AbgIYO2t (ORCPT ); Fri, 25 Sep 2020 10:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728976AbgIYO2q (ORCPT ); Fri, 25 Sep 2020 10:28:46 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B01CC0613D4 for ; Fri, 25 Sep 2020 07:28:46 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id e16so3863515wrm.2 for ; Fri, 25 Sep 2020 07:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=bRp5s+30vZ/dwGxaU1pFoSCDKRfHr+eKVN9HMmOsOR8=; b=DX1lH25LZ4AxHdDPXmtSHKOdCVVpv1iRkdh23bmUGDljgSDisBa4e5tiBH3GxRPshS 68Xer4PTeKeGMJW/cCctNb8XVaLV6F3xBTLpBWZn+JFkwsqaeJyGdsN6CjwE8DxneVQQ sxtjRmf2KC32uix8YHWFZOaVgwVlsI1P64AENVVTCjz+XjVcY+YiP5WEnG1ojf+aOtS2 wo9zYi9W+W5vQEaGg7AmEmZIGJucfNsLL36oW2Mnf15USkpJlVuP4VL5FoqixuO6LW8+ 8p6SfXtrWMUTyrzYNtDBvG8jXvO9O03kRbfViDEWPh8uauNkkA/71pJjqUb4dFtzXHgh o/+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=bRp5s+30vZ/dwGxaU1pFoSCDKRfHr+eKVN9HMmOsOR8=; b=pdUH6CVeUg/KYJQKFOa927DoOKznaBBiY7A2IIwROxTKBqi/GmFe5JOK+SO72LY0hb 2R1xI0fQ9AXQoewq+ajl2Fqe1XFvVqmmHyPDnN/7UAB7n6/0DAwHVvtJhQB8mucdEXVu tyU6Xh3+H4M1TOMgDD8jeWP7iyfq+CFaL5EoKUXp8USk1lM+iXyXI94E0GgqLY0v7kqT XbhhBEvMOXF52S4DZzTIH2H2nd9Nek0vxEsXS1TJA7sGloR/+xFsLNYurW7xKoR6MMAa vTHWdchTbptdCAFnPEJ+hGiMLFmJu4que1zSkBCkkr1UuWI0vcUaKEqAWWOTCXLY2P8n vPkA== X-Gm-Message-State: AOAM530d+OtzSznvxa+qvWrW0eb7cuCsUdq22lhIZxFmggVeCgvDDX6o zXwvIrBYtnvkDrgHTx/Rrh3Zn1q8+Fc= X-Google-Smtp-Source: ABdhPJxc9uYZ8rTOf120IveHUeXQUD6dmHmmnVD7GyGfGQ6UZ0BjnSES80KcVS6HevkQTVQYecz+Mw== X-Received: by 2002:a5d:60cc:: with SMTP id x12mr4803686wrt.84.1601044125000; Fri, 25 Sep 2020 07:28:45 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z8sm3032610wrl.11.2020.09.25.07.28.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:44 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:34 +0000 Subject: [PATCH 06/10] cmake (Windows): let the `.dll` files are found when running the tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin Contrary to Unix-ish platforms, the dependencies' shared libraries are not usually found in one central place. In our case, since we use `vcpkg`, they are to be found inside the `compat/vcbuild/vcpkg/` tree. Let's make sure that they are in the search path when running the tests. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index e66ae137c2..5a4e0ccb01 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -942,6 +942,9 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "X='${EXE_EXTENSION}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_GETTEXT='${NO_GETTEXT}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "RUNTIME_PREFIX='${RUNTIME_PREFIX}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PYTHON='${NO_PYTHON}'\n") +if(WIN32) + file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n") +endif() #Make the tests work when building out of the source tree get_filename_component(CACHE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../CMakeCache.txt ABSOLUTE) From patchwork Fri Sep 25 14:28:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1F941580 for ; Fri, 25 Sep 2020 14:28:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 906C520BED for ; Fri, 25 Sep 2020 14:28:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YHkKpUBC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728986AbgIYO2t (ORCPT ); Fri, 25 Sep 2020 10:28:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728977AbgIYO2r (ORCPT ); Fri, 25 Sep 2020 10:28:47 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 644D1C0613D5 for ; Fri, 25 Sep 2020 07:28:47 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id k15so3792137wrn.10 for ; Fri, 25 Sep 2020 07:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=A7/vEiSfbruVzpIjxqhvsJGFYNIJMT4r2lhIkZ+V9Eg=; b=YHkKpUBChgdmOPW7YwfZe9FNQk5awBC+Y2lD/VhfegafYkRx+u4ZlDDnBNDFfocvIR nuJ6kz8qdMW5Wnhcz1E32olVikxfLxYiF8DV7z+Aj2LfudHCwGZtDsdszhbbhi/K5JGX gW+38UmMnE42yNlSvbh22/msaEpkZB64rj5LLNftjX+pGZWj/051loouP08ay1yNXNaZ yVhgHrMVQvBOqz7Oxj+ZSu2AfFRNqeu56YRi4Z14ejovYT/gHf2MYd03of95F6XpE5kL c/TAtI81U67FL8XE8P4wBIKFpw7Ak4JmQRVEydh0VljVdX+xXImXCMLIAsnZt9nEMllu Y47Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=A7/vEiSfbruVzpIjxqhvsJGFYNIJMT4r2lhIkZ+V9Eg=; b=Sh0Ex/bPidkVWshwKZ5pnfspZ2+ZxDSzZC6ZI2BfwJXb1eChBounFU8i61ac3k86Da Lp6Wc8YTg82ZDGMWhUeVf9z/iQKjCkFqKt9n5pZt0+f2LC2YS2Jf33OZs/0NsTaf7HGA QFiXjmu6U0ZWznlJEc20TXkKAHocZ3xENUDTZx8ozDRWPaSlDh2dIKD6h8e3s3We38dc KOs+qSlI3uupNT5DDy1Ikb/JFbQt+KN7msZoBkxkdLTrqVpRhPcL/EMw29dxTEd56Kvw EQcE04ZhzRsV4Cl9blFmvOqzvgilXJo13Yyk7hPpmDv+IKIhLy1rI36BukGWfjt3vdTY zGDQ== X-Gm-Message-State: AOAM533RI9tR+wgzDWlU40tP1DFLkj7AmKDZACjibfFEX4ITfJl63nAs dQo4ziXzyyDWrD8MjBT3kadlYQZ7i9M= X-Google-Smtp-Source: ABdhPJyr5zthRmE9JlPbNHM23QTeI9htGGf1tLpSb1fG+BlRx10LFIxpYmFLf6j9xRZSTJT2CSQXLQ== X-Received: by 2002:a5d:4486:: with SMTP id j6mr4680832wrq.278.1601044125910; Fri, 25 Sep 2020 07:28:45 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u186sm3122898wmu.34.2020.09.25.07.28.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:45 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:35 +0000 Subject: [PATCH 07/10] cmake (Windows): complain when encountering an unknown compiler Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin We have some custom handling regarding the link options, which are specific to each compiler. Therefore: let's not just continue without setting the link options when configuring for a currently unhandled compiler, but error out. Note: for some reason, the `invalidcontinue.obj` trick seems not to work in this developer's hands when building Git in Debug mode: the assertion dialog that is supposed to be suppressed still pops up, complaining about the `entry` variable being uninitialized when it is used in `config.c`'s line 1961. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 5a4e0ccb01..d21849b730 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -620,6 +620,8 @@ if(WIN32) target_link_options(common-main PUBLIC -municode -Wl,-nxcompat -Wl,-dynamicbase -Wl,-entry:wmainCRTStartup -Wl,invalidcontinue.obj) elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") target_link_options(common-main PUBLIC /IGNORE:4217 /IGNORE:4049 /NOLOGO /ENTRY:wmainCRTStartup /SUBSYSTEM:CONSOLE invalidcontinue.obj) + else() + message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}") endif() elseif(UNIX) target_link_libraries(common-main pthread rt) From patchwork Fri Sep 25 14:28:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D979A92C for ; Fri, 25 Sep 2020 14:28:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4C6D20BED for ; Fri, 25 Sep 2020 14:28:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uX2a5A25" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729007AbgIYO2v (ORCPT ); Fri, 25 Sep 2020 10:28:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728978AbgIYO2s (ORCPT ); Fri, 25 Sep 2020 10:28:48 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28780C0613D6 for ; Fri, 25 Sep 2020 07:28:48 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id v12so3524245wmh.3 for ; Fri, 25 Sep 2020 07:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=vyLvrpHfDqe4agokkpcNOrP/sTPDYeWnNvNcWxUJ/E0=; b=uX2a5A25SCKl9op7dH1CYBvaZ3kUDG6U8ZZVTWjRbU3AqJ93daX1XI4mZZoxdE99dW wcROQhMd/kIvTLaQ25WOsV9wLlJmBTbevAyBZX+iCK8Ro69JghNRifkLDkUkGHhy8+JG ec6GB/7Q4cWZ3B0H+5UqH8yh37FchqwBlAn2hov5DskbBFosvdqNeuHbbeti9pM980s/ +AemRKCRqRZmLyQUCDvbYly9IRznScnkl8EFDgZE5rGNozln2KnNk9GcwIubHznImyaE oMu+jmMfrr2/wvpai+p78+Q+wMYlhkUkaWKDm+rasciJRAunzhNRGV39PjtXG82+YTOB vYqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=vyLvrpHfDqe4agokkpcNOrP/sTPDYeWnNvNcWxUJ/E0=; b=UovedRNxDZfx2Xs6l3MQatG4hkaGvuM2gyfOtN5RdSjyUT75XAIl/SrKtJwrxryn8c sykr3g3dT59hZclAvY/5oSOv5JlP8xTMpNQi4FEuXyH6oG6GuR16xgQMETdEvWz3ckJa l1mqgex+khHIP5mhq8GfO6rq03NNM4R+eBYkZv8vvVxcrxgIe6ZNyQZhimvon6eNbUp2 pPZ1I+B9jWh3C3obV/IeOTeBzt0yvMFVnmLxsh2HRHpnc+Gt5QL+1AkplgQ+u9RggHD1 4rmn8zKNYv9AGFOIn+yzj6HPt+xCrcGONsj46cuKkoogUkJwLAszG0j1pCAA2XhgHkBk g+6g== X-Gm-Message-State: AOAM532ceLJ4rFCvtByC6bfZYJ0WizEsYoAkxuEsHcMqBcD4l3G8PejL 03imkt9qOMwiLnA3iddf9r0c26Aronk= X-Google-Smtp-Source: ABdhPJynw6xQua43LOG9WPAr3oZblB00qiC/ZINCjOWWu4F2M3+P3znwOo9v4Hm6J26B/wFvUKJJXA== X-Received: by 2002:a7b:c182:: with SMTP id y2mr3606460wmi.21.1601044126681; Fri, 25 Sep 2020 07:28:46 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t4sm3250163wrr.26.2020.09.25.07.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:46 -0700 (PDT) Message-Id: <3a07bd4916c3949eadaa10fde142fba0acaa974b.1601044118.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:36 +0000 Subject: [PATCH 08/10] cmake (Windows): initialize vcpkg/build dependencies automatically Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin The idea of having CMake support in Git's source tree is to enable contributors on Windows to start contributing with little effort. To that end, we just added some sensible defaults that will let users open the worktree in Visual Studio and start building. This expects the dependencies (such as zlib) to be available already, though. If they are not available, we expect the user to run `compat/vcbuild/vcpkg_install.bat`. Rather than requiring this step to be manual, detect the situation and run it as part of the CMake configuration step. This concludes our journey to make it as effortless as possible to start developing Git in Visual Studio: all the developer needs to do is to clone Git's repository, open the worktree via `File>Open>Folder...` and wait for CMake to finish configuring. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index d21849b730..1eaeb8b8e0 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -42,6 +42,10 @@ cmake_minimum_required(VERSION 3.14) set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) if(WIN32) set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg") + if(NOT EXISTS ${VCPKG_DIR}) + message("Initializinge vcpkg and building the Git's dependencies (this will take a while...)") + execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat) + endif() list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows") # In the vcpkg edition, we need this to be able to link to libcurl From patchwork Fri Sep 25 14:28:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 413BC1580 for ; Fri, 25 Sep 2020 14:28:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1AC5521D42 for ; Fri, 25 Sep 2020 14:28:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GGxAS+kS" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729010AbgIYO2w (ORCPT ); Fri, 25 Sep 2020 10:28:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728977AbgIYO2t (ORCPT ); Fri, 25 Sep 2020 10:28:49 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB1DC0613CE for ; Fri, 25 Sep 2020 07:28:48 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id w2so3260282wmi.1 for ; Fri, 25 Sep 2020 07:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=StAC+JuC7BCx37VzRLDpn7Fy15q3b+oQk3Au3tZXbAE=; b=GGxAS+kSV2ZFgr+zhmlz/15PC06OTg0Hg31nWHZ+el2+Cuae+C1CT9YRyk2xaASUmV 8CBVweP7HY2+IF+MYrlba+1tdnbnG1KZBQkdF5P7c0GBd+hb84v5s8bdEhpC94ao+U1p 8yVeSEf3Df7UlsZClt/JnzleKCoTavchxY9G4/KBQvi8Oh0XIQbp1Vi12dDwKUn3QmUc NhPJORpuJhhBjigs9Buk62lSfy45mmnA3Mio1jxLw0YV8TYO4pkpLVglxMqnORElOOyQ WJVPLLYNYXoNaUWPofXA6DYkUBfRxNDPEPovGgHzGmKmkVepXEfPJuAo9c4BJoGCwpgo t2Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=StAC+JuC7BCx37VzRLDpn7Fy15q3b+oQk3Au3tZXbAE=; b=UVS8CfGx2F291HVQT5+/Sp7Nr9Av53aDwHaAREgKQW5BB0VxCFJvhPo1+BIUMezzm2 qbxtRk+GXpJldZ8LIHyd7drgRUzeATIOwTR37FTie0ZgnIh+p1yR6zjQUX+rhQNcc/UY t2oTDFaly9udVO2Eocuz3T103jncvcx7z+x3VRigjTC4V8HOh/QY5VCO6THwcHWnjoq2 ivyD7qsM75FC64lUFXSQf+LgxjI2w52hQMaqldg6+Nt9DvEN/YvPiDYtmXViOQ06FmoL NevkbAHrlsqu6FUfgOfeH0p0i88tZs4nS1qe3J3OfNTj1Op6ByFOyhc83EIPjfPL+F0f bldA== X-Gm-Message-State: AOAM533oMjy6XLwVIQfVeI2e74RXd88wk2e3I6j/Jp2IFo1Cv4LY8EyW KuQMYaG9QVkijPkVKwDSSkviLxeluKY= X-Google-Smtp-Source: ABdhPJwCJ23v+HA8salCOLD07ca2KZhisUILrXzgkOYM1EwgPhbFpegXdVunUZdfEQRd3jV1rQVdMw== X-Received: by 2002:a1c:63c1:: with SMTP id x184mr3507935wmb.138.1601044127488; Fri, 25 Sep 2020 07:28:47 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l3sm3154502wmh.27.2020.09.25.07.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:47 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:37 +0000 Subject: [PATCH 09/10] cmake (Windows): recommend using Visual Studio's built-in CMake support Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin It is a lot more convenient to use than having to specify the configuration in CMake manually (does not matter whether using the command-line or CMake's GUI). Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 1eaeb8b8e0..442b4e69ad 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -4,7 +4,17 @@ #[[ -Instructions to run CMake: +Instructions how to use this in Visual Studio: + +Open the worktree as a folder. Visual Studio 2019 and later will detect +the CMake configuration automatically and set everything up for you, +ready to build. You can then run the tests in `t/` via a regular Git Bash. + +Note: Visual Studio also has the option of opening the CMake configuration +directly; Using this option, Visual Studio will not find the source code, +though, therefore the `File>Open>Folder...` option is preferred. + +Instructions to run CMake manually: cmake `relative-path-to-CMakeLists.txt` -DCMAKE_BUILD_TYPE=Release Eg. From patchwork Fri Sep 25 14:28:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jean-No=C3=ABl_Avila_via_GitGitGadget?= X-Patchwork-Id: 11799899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D1171580 for ; Fri, 25 Sep 2020 14:28:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3A3A20BED for ; Fri, 25 Sep 2020 14:28:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S7nvTv+T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729017AbgIYO2y (ORCPT ); Fri, 25 Sep 2020 10:28:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728999AbgIYO2u (ORCPT ); Fri, 25 Sep 2020 10:28:50 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA2CDC0613CE for ; Fri, 25 Sep 2020 07:28:49 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id c18so3808039wrm.9 for ; Fri, 25 Sep 2020 07:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=hL9TlMZZosnACEN9wYMLe2vrd/LfeO8AgKrq7EqvNZI=; b=S7nvTv+T346upH+pQc4q1Hp/OF0oJ/O7ULt1y/MvcYeo8admm1YKB29my/shK+y292 UbVf4S5bsxtNI35jVXnCkdBKJ0BeW776Tt2vV1D1rNHtOwFyuPpFK6dgShWduRfCz3Wg DFUxNR0+GwjmIsLQgQ6GvcW3NsUx8gFCNTaKkc5ukjMFJLK/GGLD1e3zIyZhxBUT3Tri v0LY6E6p/zIzxJPCOnfcg7ak7uLKXmpROim8reX6GL/Tz/bJ5j72013nJLLZgsFH1d8V cJCyF7uIjQJt5fAsJDx16/VJkpv/vbidxSzc7VBo2CgFPsTwTHzfa++qnf6MFz5VfaRX fsOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=hL9TlMZZosnACEN9wYMLe2vrd/LfeO8AgKrq7EqvNZI=; b=ff3f7GD6JxeVV53VBsOmLqwNIdvuTUUTTy+GVDVMf2msEUnsCgXnD633+AKK+pWifm JXqMLxx5BfxomwypQguAhtKlCUTa6MIpXf3riBKjL4uy6B9TzYatmhaSqglor+3yuCGx /FC3C32ORnPK46l8DDe2brREfz222a3VB5NLv5dQz2r4lwYlMaD98RUiz+JEonfjPBCx W8MhzthRVjpvuo2mpx5Eo+a1K062YS6FVUtpIsNwuFA1BUGOaRQXXjP5dBvQPP4Mm77J ch/2QMNWZiO0iaeuDQk2W3okXFRuhZbPqwmqY9fxNUQhL3KbIXPhFTdkkZ/dUjI4ktki ul9A== X-Gm-Message-State: AOAM532JC1Obh+rj+LhZFulUHKsSRSuMDRTSE+H8w13qwXx1uYYXLVRP 2m3Z+Oy3OmTxDS5kE4B7HNrAOO+i6ck= X-Google-Smtp-Source: ABdhPJySAUtAPX1lfjiOudXY9DBFZDYWF8bR9fBbptxgt8Hwh/mUdkqTb5o3Jgn8kvmD9RSzc1Hr5Q== X-Received: by 2002:adf:f2d0:: with SMTP id d16mr4644915wrp.332.1601044128189; Fri, 25 Sep 2020 07:28:48 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n4sm2960787wmc.48.2020.09.25.07.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 07:28:47 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Fri, 25 Sep 2020 14:28:38 +0000 Subject: [PATCH 10/10] hashmap_for_each_entry(): work around MSVC's run-time check failure #3 Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin When compiling Git in Visual C, we do not have the luxury of support for `typeof()`, and therefore `OFFSETOF_VAR()` unfortunately has to fall back to pointer arithmetic. When compiling code using the `hashmap_for_each_entry()` macro in Debug mode, this leads to the "run-time check failure #3" because the variable passed as `var` are not initialized, yet we calculate the pointer difference `&(var->member)-var`. This "run-time check failure" causes a scary dialog to pop up. Work around this by initializing the respective variables. Note: according to the C standard, performing pointer arithmetic with `NULL` is not exactly well-defined, but it seems to work here, and it is at least better than performing pointer arithmetic with an uninitialized pointer. Signed-off-by: Johannes Schindelin --- attr.c | 2 +- blame.c | 4 ++-- bloom.c | 2 +- builtin/describe.c | 2 +- builtin/difftool.c | 2 +- builtin/fast-import.c | 2 +- builtin/sparse-checkout.c | 6 +++--- config.c | 2 +- merge-recursive.c | 10 +++++----- name-hash.c | 2 +- revision.c | 4 ++-- submodule-config.c | 2 +- t/helper/test-hashmap.c | 2 +- t/helper/test-lazy-init-name-hash.c | 4 ++-- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/attr.c b/attr.c index a826b2ef1f..b4fde37877 100644 --- a/attr.c +++ b/attr.c @@ -160,7 +160,7 @@ static void all_attrs_init(struct attr_hashmap *map, struct attr_check *check) * field and fill each entry with its corresponding git_attr. */ if (size != check->all_attrs_nr) { - struct attr_hash_entry *e; + struct attr_hash_entry *e = NULL; struct hashmap_iter iter; REALLOC_ARRAY(check->all_attrs, size); diff --git a/blame.c b/blame.c index b475bfa1c0..e9879a772e 100644 --- a/blame.c +++ b/blame.c @@ -450,7 +450,7 @@ static int fingerprint_similarity(struct fingerprint *a, struct fingerprint *b) { int intersection = 0; struct hashmap_iter iter; - const struct fingerprint_entry *entry_a, *entry_b; + const struct fingerprint_entry *entry_a, *entry_b = NULL; hashmap_for_each_entry(&b->map, &iter, entry_b, entry /* member name */) { @@ -469,7 +469,7 @@ static void fingerprint_subtract(struct fingerprint *a, struct fingerprint *b) { struct hashmap_iter iter; struct fingerprint_entry *entry_a; - const struct fingerprint_entry *entry_b; + const struct fingerprint_entry *entry_b = NULL; hashmap_iter_init(&b->map, &iter); diff --git a/bloom.c b/bloom.c index 1a573226e7..ee45e9ccce 100644 --- a/bloom.c +++ b/bloom.c @@ -221,7 +221,7 @@ struct bloom_filter *get_bloom_filter(struct repository *r, if (diffopt.num_changes <= max_changes) { struct hashmap pathmap; - struct pathmap_hash_entry *e; + struct pathmap_hash_entry *e = NULL; struct hashmap_iter iter; hashmap_init(&pathmap, pathmap_cmp, NULL, 0); diff --git a/builtin/describe.c b/builtin/describe.c index 7668591d57..8b281cf426 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -332,7 +332,7 @@ static void describe_commit(struct object_id *oid, struct strbuf *dst) if (!have_util) { struct hashmap_iter iter; struct commit *c; - struct commit_name *n; + struct commit_name *n = NULL; init_commit_names(&commit_names); hashmap_for_each_entry(&names, &iter, n, diff --git a/builtin/difftool.c b/builtin/difftool.c index 7ac432b881..a1527ea01c 100644 --- a/builtin/difftool.c +++ b/builtin/difftool.c @@ -344,7 +344,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix, FILE *fp; struct hashmap working_tree_dups, submodules, symlinks2; struct hashmap_iter iter; - struct pair_entry *entry; + struct pair_entry *entry = NULL; struct index_state wtindex; struct checkout lstate, rstate; int rc, flags = RUN_GIT_CMD, err = 0; diff --git a/builtin/fast-import.c b/builtin/fast-import.c index 1bf50a73dc..72154383c3 100644 --- a/builtin/fast-import.c +++ b/builtin/fast-import.c @@ -498,7 +498,7 @@ static void invalidate_pack_id(unsigned int id) unsigned long lu; struct tag *t; struct hashmap_iter iter; - struct object_entry *e; + struct object_entry *e = NULL; hashmap_for_each_entry(&object_table, &iter, e, ent) { if (e->pack_id == id) diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c index 4003f4d13a..fcd87da036 100644 --- a/builtin/sparse-checkout.c +++ b/builtin/sparse-checkout.c @@ -67,7 +67,7 @@ static int sparse_checkout_list(int argc, const char **argv) if (pl.use_cone_patterns) { int i; - struct pattern_entry *pe; + struct pattern_entry *pe = NULL; struct hashmap_iter iter; struct string_list sl = STRING_LIST_INIT_DUP; @@ -153,7 +153,7 @@ static char *escaped_pattern(char *pattern) static void write_cone_to_file(FILE *fp, struct pattern_list *pl) { int i; - struct pattern_entry *pe; + struct pattern_entry *pe = NULL; struct hashmap_iter iter; struct string_list sl = STRING_LIST_INIT_DUP; struct strbuf parent_pattern = STRBUF_INIT; @@ -465,7 +465,7 @@ static void add_patterns_cone_mode(int argc, const char **argv, struct pattern_list *pl) { struct strbuf buffer = STRBUF_INIT; - struct pattern_entry *pe; + struct pattern_entry *pe = NULL; struct hashmap_iter iter; struct pattern_list existing; char *sparse_filename = get_sparse_checkout_filename(); diff --git a/config.c b/config.c index 2bdff4457b..83c72dd6e6 100644 --- a/config.c +++ b/config.c @@ -1953,7 +1953,7 @@ void git_configset_init(struct config_set *cs) void git_configset_clear(struct config_set *cs) { - struct config_set_element *entry; + struct config_set_element *entry = NULL; struct hashmap_iter iter; if (!cs->hash_initialized) return; diff --git a/merge-recursive.c b/merge-recursive.c index d0214335a7..11ea550b0d 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -2151,8 +2151,8 @@ static void handle_directory_level_conflicts(struct merge_options *opt, struct tree *merge) { struct hashmap_iter iter; - struct dir_rename_entry *head_ent; - struct dir_rename_entry *merge_ent; + struct dir_rename_entry *head_ent = NULL; + struct dir_rename_entry *merge_ent = NULL; struct string_list remove_from_head = STRING_LIST_INIT_NODUP; struct string_list remove_from_merge = STRING_LIST_INIT_NODUP; @@ -2221,7 +2221,7 @@ static struct hashmap *get_directory_renames(struct diff_queue_struct *pairs) { struct hashmap *dir_renames; struct hashmap_iter iter; - struct dir_rename_entry *entry; + struct dir_rename_entry *entry = NULL; int i; /* @@ -2590,7 +2590,7 @@ static struct string_list *get_renames(struct merge_options *opt, int i; struct hashmap collisions; struct hashmap_iter iter; - struct collision_entry *e; + struct collision_entry *e = NULL; struct string_list *renames; compute_collisions(&collisions, dir_renames, pairs); @@ -2862,7 +2862,7 @@ static void initial_cleanup_rename(struct diff_queue_struct *pairs, struct hashmap *dir_renames) { struct hashmap_iter iter; - struct dir_rename_entry *e; + struct dir_rename_entry *e = NULL; hashmap_for_each_entry(dir_renames, &iter, e, ent /* member name */) { diff --git a/name-hash.c b/name-hash.c index fb526a3775..a3f710b2f8 100644 --- a/name-hash.c +++ b/name-hash.c @@ -706,7 +706,7 @@ void adjust_dirname_case(struct index_state *istate, char *name) struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int icase) { - struct cache_entry *ce; + struct cache_entry *ce = NULL; unsigned int hash = memihash(name, namelen); lazy_init_name_hash(istate); diff --git a/revision.c b/revision.c index 067030e64c..232de3f6f5 100644 --- a/revision.c +++ b/revision.c @@ -132,7 +132,7 @@ static void paths_and_oids_init(struct hashmap *map) static void paths_and_oids_clear(struct hashmap *map) { struct hashmap_iter iter; - struct path_and_oids_entry *entry; + struct path_and_oids_entry *entry = NULL; hashmap_for_each_entry(map, &iter, entry, ent /* member name */) { oidset_clear(&entry->trees); @@ -215,7 +215,7 @@ void mark_trees_uninteresting_sparse(struct repository *r, unsigned has_interesting = 0, has_uninteresting = 0; struct hashmap map; struct hashmap_iter map_iter; - struct path_and_oids_entry *entry; + struct path_and_oids_entry *entry = NULL; struct object_id *oid; struct oidset_iter iter; diff --git a/submodule-config.c b/submodule-config.c index c569e22aa3..662b9d9c09 100644 --- a/submodule-config.c +++ b/submodule-config.c @@ -89,7 +89,7 @@ static void free_one_config(struct submodule_entry *entry) static void submodule_cache_clear(struct submodule_cache *cache) { struct hashmap_iter iter; - struct submodule_entry *entry; + struct submodule_entry *entry = NULL; if (!cache->initialized) return; diff --git a/t/helper/test-hashmap.c b/t/helper/test-hashmap.c index f38706216f..2bde90309b 100644 --- a/t/helper/test-hashmap.c +++ b/t/helper/test-hashmap.c @@ -162,7 +162,7 @@ int cmd__hashmap(int argc, const char **argv) while (strbuf_getline(&line, stdin) != EOF) { char *cmd, *p1 = NULL, *p2 = NULL; unsigned int hash = 0; - struct test_entry *entry; + struct test_entry *entry = NULL; /* break line into command and up to two parameters */ cmd = strtok(line.buf, DELIM); diff --git a/t/helper/test-lazy-init-name-hash.c b/t/helper/test-lazy-init-name-hash.c index cd1b4c9736..2cb1fa3d8c 100644 --- a/t/helper/test-lazy-init-name-hash.c +++ b/t/helper/test-lazy-init-name-hash.c @@ -29,8 +29,8 @@ static void dump_run(void) char name[FLEX_ARRAY]; }; - struct dir_entry *dir; - struct cache_entry *ce; + struct dir_entry *dir = NULL; + struct cache_entry *ce = NULL; read_cache(); if (single) {