Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ jobs:
NO_PERL: 1
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
runs-on: windows-latest
strategy:
matrix:
arch: [x64, arm64]
concurrency:
group: vs-build-${{ github.ref }}
group: vs-build-${{ github.ref }}-${{ matrix.arch }}
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
steps:
- uses: actions/checkout@v6
Expand All @@ -189,14 +192,16 @@ jobs:
uses: microsoft/setup-msbuild@v3
- name: copy dlls to root
shell: cmd
run: compat\vcbuild\vcpkg_copy_dlls.bat release
run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
- name: generate Visual Studio solution
shell: bash
run: |
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows
- name: MSBuild
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
run: |
$sln = if (Test-Path git.slnx) { 'git.slnx' } else { 'git.sln' }
msbuild $sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4
- name: bundle artifact tar
shell: bash
env:
Expand All @@ -210,7 +215,7 @@ jobs:
- name: upload tracked files and build artifacts
uses: actions/upload-artifact@v7
with:
name: vs-artifacts
name: vs-artifacts-${{ matrix.arch }}
path: artifacts
vs-test:
name: win+VS test
Expand All @@ -228,7 +233,7 @@ jobs:
- name: download tracked files and build artifacts
uses: actions/download-artifact@v8
with:
name: vs-artifacts
name: vs-artifacts-x64
path: ${{github.workspace}}
- name: extract tracked files and build artifacts
shell: bash
Expand Down
23 changes: 23 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,29 @@ process_phantom_symlink(const wchar_t *wtarget, const wchar_t *wlink)
wchar_t relative[MAX_PATH];
const wchar_t *rel;

/*
* Do not follow symlinks to network shares, to avoid NTLM credential
* leak from crafted repositories (e.g. \\attacker-server\share).
* Since paths come in all kind of enterprising shapes and forms (in
* addition to the canonical `\\host\share` form, there's also
* `\??\UNC\host\share`, `\GLOBAL??\UNC\host\share` and also
* `\Device\Mup\host\share`, just to name a few), we simply avoid
* following every symlink target that starts with a slash.
*
* This also catches drive-less absolute paths, of course. These are
* uncommon in practice (and also fragile because they are relative to
* the current working directory's drive). The only "harm" this does
* is that it now requires users to specify via the Git attributes if
* they have such an uncommon symbolic link and need it to be a
* directory type link.
*/
if (is_wdir_sep(wtarget[0])) {
warning("created file symlink '%ls' pointing to '%ls';\n"
"set the `symlink` gitattribute to `dir` if a "
"directory symlink is required", wlink, wtarget);
return PHANTOM_SYMLINK_DONE;
}

/* check that wlink is still a file symlink */
if ((GetFileAttributesW(wlink)
& (FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_DIRECTORY))
Expand Down
6 changes: 5 additions & 1 deletion compat/vcbuild/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ The Steps to Build Git with VS2015 or VS2017 from the command line.
Prompt or from an SDK bash window:

$ cd <repo_root>
$ ./compat/vcbuild/vcpkg_install.bat
$ ./compat/vcbuild/vcpkg_install.bat x64-windows

or

$ ./compat/vcbuild/vcpkg_install.bat arm64-windows

The vcpkg tools and all of the third-party sources will be installed
in this folder:
Expand Down
7 changes: 6 additions & 1 deletion compat/vcbuild/vcpkg_copy_dlls.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ REM ================================================================
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
cd %cwd%

SET arch=x64-windows
SET arch=%2
IF NOT DEFINED arch (
echo defaulting to 'x64-windows`. Invoke %0 with 'x86-windows', 'x64-windows', or 'arm64-windows'
set arch=x64-windows
)

SET inst=%cwd%vcpkg\installed\%arch%

IF [%1]==[release] (
Expand Down
57 changes: 54 additions & 3 deletions compat/vcbuild/vcpkg_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,24 @@ REM ================================================================

SETLOCAL EnableDelayedExpansion

SET arch=%1
IF NOT DEFINED arch (
echo defaulting to 'x64-windows`. Invoke %0 with 'x86-windows', 'x64-windows', or 'arm64-windows'
set arch=x64-windows
)

@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
cd %cwd%

dir vcpkg\vcpkg.exe >nul 2>nul && GOTO :install_libraries

git.exe version 2>nul
IF ERRORLEVEL 1 (
echo "***"
echo "Git not found. Please adjust your CMD path or Git install option."
echo "***"
EXIT /B 1 )

echo Fetching vcpkg in %cwd%vcpkg
git.exe clone https://github.com/Microsoft/vcpkg vcpkg
IF ERRORLEVEL 1 ( EXIT /B 1 )
Expand All @@ -48,9 +61,8 @@ REM ================================================================
echo Successfully installed %cwd%vcpkg\vcpkg.exe

:install_libraries
SET arch=x64-windows

echo Installing third-party libraries...
echo Installing third-party libraries(%arch%)...
FOR %%i IN (zlib expat libiconv openssl libssh2 curl) DO (
cd %cwd%vcpkg
IF NOT EXIST "packages\%%i_%arch%" CALL :sub__install_one %%i
Expand All @@ -73,8 +85,47 @@ REM ================================================================
:sub__install_one
echo Installing package %1...

.\vcpkg.exe install %1:%arch%
call :%1_features

REM vcpkg may not be reliable on slow, intermittent or proxy
REM connections, see e.g.
REM https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4a8f7be5-5e15-4213-a7bb-ddf424a954e6/winhttpsendrequest-ends-with-12002-errorhttptimeout-after-21-seconds-no-matter-what-timeout?forum=windowssdk
REM which explains the hidden 21 second timeout
REM (last post by Dave : Microsoft - Windows Networking team)

.\vcpkg.exe install %1%features%:%arch%
IF ERRORLEVEL 1 ( EXIT /B 1 )

echo Finished %1
goto :EOF

::
:: features for each vcpkg to install
:: there should be an entry here for each package to install
:: 'set features=' means use the default otherwise
:: 'set features=[comma-delimited-feature-set]' is the syntax
::

:zlib_features
set features=
goto :EOF

:expat_features
set features=
goto :EOF

:libiconv_features
set features=
goto :EOF

:openssl_features
set features=
goto :EOF

:libssh2_features
set features=
goto :EOF

:curl_features
set features=[core,openssl]
goto :EOF
179 changes: 179 additions & 0 deletions conflict-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
## Rebase Summary: seen

**From**: [05faa940c3](https://github.com/git-for-windows/git/commit/05faa940c3c8aa9187fdbe00181254b2efcd15a2) (Merge tag 'v2.55.0.windows.3', 2026-07-16) ([35f921a6c9..05faa940c3](https://github.com/git-for-windows/git/compare/35f921a6c99d147f2571de3a9a7f7775a9043146...05faa940c3c8aa9187fdbe00181254b2efcd15a2))

#### Resolved: a551cb2753 (vcbuild: install ARM64 dependencies when building ARM64 binaries, 2020-01-31)

adapted ARM64 vcpkg_install.bat examples to use current compat/vcbuild/ path instead of lib/compat/vcbuild/

<details>
<summary>Range-diff</summary>

* 1: a551cb2753 ! 1: 50f49bc45a vcbuild: install ARM64 dependencies when building ARM64 binaries

``````diff
@@ Commit message
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

- ## lib/compat/vcbuild/README ##
-@@ lib/compat/vcbuild/README: The Steps to Build Git with VS2015 or VS2017 from the command line.
+ ## compat/vcbuild/README ##
+@@ compat/vcbuild/README: The Steps to Build Git with VS2015 or VS2017 from the command line.
Prompt or from an SDK bash window:

$ cd <repo_root>
-- $ ./lib/compat/vcbuild/vcpkg_install.bat
-+ $ ./lib/compat/vcbuild/vcpkg_install.bat x64-windows
+- $ ./compat/vcbuild/vcpkg_install.bat
++ $ ./compat/vcbuild/vcpkg_install.bat x64-windows
+
+ or
+
-+ $ ./lib/compat/vcbuild/vcpkg_install.bat arm64-windows
++ $ ./compat/vcbuild/vcpkg_install.bat arm64-windows

The vcpkg tools and all of the third-party sources will be installed
in this folder:

- ## lib/compat/vcbuild/vcpkg_copy_dlls.bat ##
-@@ lib/compat/vcbuild/vcpkg_copy_dlls.bat: REM ================================================================
+ ## compat/vcbuild/vcpkg_copy_dlls.bat ##
+@@ compat/vcbuild/vcpkg_copy_dlls.bat: REM ================================================================
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
cd %cwd%

@@ lib/compat/vcbuild/vcpkg_copy_dlls.bat: REM ====================================

IF [%1]==[release] (

- ## lib/compat/vcbuild/vcpkg_install.bat ##
-@@ lib/compat/vcbuild/vcpkg_install.bat: REM ================================================================
+ ## compat/vcbuild/vcpkg_install.bat ##
+@@ compat/vcbuild/vcpkg_install.bat: REM ================================================================

SETLOCAL EnableDelayedExpansion

@@ lib/compat/vcbuild/vcpkg_install.bat: REM ======================================
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
cd %cwd%

-@@ lib/compat/vcbuild/vcpkg_install.bat: REM ================================================================
+@@ compat/vcbuild/vcpkg_install.bat: REM ================================================================
echo Successfully installed %cwd%vcpkg\vcpkg.exe

:install_libraries
``````

</details>


#### Resolved: 9bc9746d42 (cmake: allow building for Windows/ARM64, 2020-12-04)

adapted patch to use upstream's `compat/vcbuild/` path (without `lib/` prefix) while preserving the patch's `${VCPKG_ARCH}` additions

<details>
<summary>Range-diff</summary>

* 1: 9bc9746d42 ! 1: 7253c8035c cmake: allow building for Windows/ARM64

``````diff
@@ Commit message

## contrib/buildsystems/CMakeLists.txt ##
@@ contrib/buildsystems/CMakeLists.txt: if(USE_VCPKG)
- set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg")
+ set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
if(NOT EXISTS ${VCPKG_DIR})
message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
-- execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat)
-+ execute_process(COMMAND ${CMAKE_SOURCE_DIR}/lib/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
+- execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)
++ execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
endif()
- list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows")
+ list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/${VCPKG_ARCH}")
@@ contrib/buildsystems/CMakeLists.txt: string(REPLACE "@USE_LIBPCRE2@" "" git_buil
string(REPLACE "@WITH_BREAKING_CHANGES@" "" git_build_options "${git_build_options}")
string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
if(USE_VCPKG)
-- string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../lib/compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
-+ string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../lib/compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
+- string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
++ string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
endif()
file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS ${git_build_options})

``````

</details>


#### FAILED: 2873943bc0 (ci(vs-build) also build Windows/ARM64 artifacts, 2020-11-29)

Unexpected AI decision: ''. Full output:

```
● Check REBASE_HEAD commit (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && git show --stat REBASE_HEAD && echo "---SUBJECT---" && git log -1 --format=%s
│ REBASE_HEAD
└ 17 lines…

● Check if upstreamed (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && git range-diff REBASE_HEAD^! REBASE_HEAD.. 2>&1 | head -20
└ 21 lines…

No upstream correspondence found. Let me try with higher creation factor and examine the conflict.

● Find conflict markers (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && grep -n '<<<<<<<\|=======\|>>>>>>>' .github/workflows/main.yml
└ 4 lines…

● See the patch (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && git show REBASE_HEAD -- .github/workflows/main.yml
└ 69 lines…

● Try higher creation factor (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && git range-diff --creation-factor=200 REBASE_HEAD^! REBASE_HEAD.. 2>&1 | head -5
└ 6 lines…

● Read main.yml
│ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-seen/.github/wo
│ rkflows/main.yml
└ L185:220 (36 lines read)

I see the conflict. Upstream moved paths from `lib\compat\vcbuild\` to `compat\vcbuild\` while the patch added `${{ matrix.arch }}` parameterization. I need to combine both: use upstream's paths (`compat\vcbuild\`) with the patch's arch parameterization.

● Edit main.yml +2 -11
└ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-seen/.github/wo
rkflows/main.yml

● Verify no remaining conflict markers (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && grep -n '<<<<<<<\|=======\|>>>>>>>' .github/workflows/main.yml; echo "exit: $?"
└ 2 lines…

No remaining conflict markers. Let me stage the file.

● Stage resolved file (shell)
│ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/git/rebase-worktree-
│ seen" && git add .github/workflows/main.yml
└ 1 line…

Resolved the conflict by combining upstream's path change (`compat\vcbuild\` instead of `lib\compat\vcbuild\`) with the patch's ARM64 arch parameterization (`${{ matrix.arch }}-windows`).

continue -- used upstream's compat\vcbuild\ paths with the patch's matrix.arch parameterization for ARM64 support



Changes +2 -11
AI Credits 25 (42s)
Tokens ↑ 194.1k (175.5k cached, 17.4k written) • ↓ 1.9k (88 reasoning)
Resume copilot --resume=9b864ed3-18fc-4139-98d5-28687872f198
```

6 changes: 3 additions & 3 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ if(USE_VCPKG)
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
if(NOT EXISTS ${VCPKG_DIR})
message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
endif()
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows")
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/${VCPKG_ARCH}")

# In the vcpkg edition, we need this to be able to link to libcurl
set(CURL_NO_CURL_CMAKE ON)
Expand Down Expand Up @@ -1205,7 +1205,7 @@ string(REPLACE "@USE_LIBPCRE2@" "" git_build_options "${git_build_options}")
string(REPLACE "@WITH_BREAKING_CHANGES@" "" git_build_options "${git_build_options}")
string(REPLACE "@X@" "${EXE_EXTENSION}" git_build_options "${git_build_options}")
if(USE_VCPKG)
string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
string(APPEND git_build_options "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
endif()
file(WRITE ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS ${git_build_options})

Expand Down
1 change: 1 addition & 0 deletions copilot.exitcode
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Loading