Skip to content

Commit 3e79471

Browse files
committed
Merge branch 'ready-for-upstream'
This is the branch thicket of patches in Git for Windows that are considered ready for upstream. To keep them in a ready-to-submit shape, they are kept as close to the beginning of the branch thicket as possible.
2 parents f647f57 + eab10d3 commit 3e79471

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+15478
-213
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CLANG build ARM64
2+
3+
on:
4+
workflow_dispatch:
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
jobs:
11+
clang-build:
12+
runs-on: [Windows, ARM64]
13+
env:
14+
NO_PERL: 1
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: git-for-windows/setup-git-for-windows-sdk@v1
18+
with:
19+
flavor: makepkg-git
20+
architecture: aarch64
21+
# This assumes that the job is running on a self-hosted runner,
22+
# in which case we need to cleanup SDK files.
23+
cleanup: true
24+
- name: Build Git CLANGARM64
25+
run: make -j`nproc`

.github/workflows/main.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ jobs:
152152
NO_PERL: 1
153153
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
154154
runs-on: windows-latest
155+
strategy:
156+
matrix:
157+
arch: [x64, arm64]
155158
concurrency:
156-
group: vs-build-${{ github.ref }}
159+
group: vs-build-${{ github.ref }}-${{ matrix.arch }}
157160
cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }}
158161
steps:
159162
- uses: actions/checkout@v3
@@ -164,26 +167,22 @@ jobs:
164167
repository: 'microsoft/vcpkg'
165168
path: 'compat/vcbuild/vcpkg'
166169
- name: download vcpkg artifacts
167-
shell: powershell
168-
run: |
169-
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
170-
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
171-
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
172-
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
173-
Expand-Archive compat.zip -DestinationPath . -Force
174-
Remove-Item compat.zip
170+
uses: git-for-windows/get-azure-pipelines-artifact@v0
171+
with:
172+
repository: git/git
173+
definitionId: 9
175174
- name: add msbuild to PATH
176175
uses: microsoft/setup-msbuild@v1
177176
- name: copy dlls to root
178177
shell: cmd
179-
run: compat\vcbuild\vcpkg_copy_dlls.bat release
178+
run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
180179
- name: generate Visual Studio solution
181180
shell: bash
182181
run: |
183-
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
184-
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
182+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
183+
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows -DHOST_CPU=${{ matrix.arch }}
185184
- name: MSBuild
186-
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
185+
run: msbuild git.sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4 -property:PlatformToolset=v142
187186
- name: bundle artifact tar
188187
shell: bash
189188
env:
@@ -197,7 +196,7 @@ jobs:
197196
- name: upload tracked files and build artifacts
198197
uses: actions/upload-artifact@v3
199198
with:
200-
name: vs-artifacts
199+
name: vs-artifacts-${{ matrix.arch }}
201200
path: artifacts
202201
vs-test:
203202
name: win+VS test
@@ -215,7 +214,7 @@ jobs:
215214
- name: download tracked files and build artifacts
216215
uses: actions/download-artifact@v3
217216
with:
218-
name: vs-artifacts
217+
name: vs-artifacts-x64
219218
path: ${{github.workspace}}
220219
- name: extract tracked files and build artifacts
221220
shell: bash

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,4 @@ Release/
245245
/git.VC.db
246246
*.dSYM
247247
/contrib/buildsystems/out
248+
CMakeSettings.json

Documentation/config.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ include::config/safe.txt[]
507507

508508
include::config/sendemail.txt[]
509509

510+
include::config/sendpack.txt[]
511+
510512
include::config/sequencer.txt[]
511513

512514
include::config/showbranch.txt[]
@@ -543,4 +545,6 @@ include::config/versionsort.txt[]
543545

544546
include::config/web.txt[]
545547

548+
include::config/windows.txt[]
549+
546550
include::config/worktree.txt[]

Documentation/config/http.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ http.sslBackend::
189189

190190
http.schannelCheckRevoke::
191191
Used to enforce or disable certificate revocation checks in cURL
192-
when http.sslBackend is set to "schannel". Defaults to `true` if
193-
unset. Only necessary to disable this if Git consistently errors
194-
and the message is about checking the revocation status of a
195-
certificate. This option is ignored if cURL lacks support for
196-
setting the relevant SSL option at runtime.
192+
when http.sslBackend is set to "schannel" via "true" and "false",
193+
respectively. Another accepted value is "best-effort" (the default)
194+
in which case revocation checks are performed, but errors due to
195+
revocation list distribution points that are offline are silently
196+
ignored, as well as errors due to certificates missing revocation
197+
list distribution points. This option is ignored if cURL lacks
198+
support for setting the relevant SSL option at runtime.
197199

198200
http.schannelUseSSLCAInfo::
199201
As of cURL v7.60.0, the Secure Channel backend can use the
@@ -203,6 +205,11 @@ http.schannelUseSSLCAInfo::
203205
when the `schannel` backend was configured via `http.sslBackend`,
204206
unless `http.schannelUseSSLCAInfo` overrides this behavior.
205207

208+
http.sslAutoClientCert::
209+
As of cURL v7.77.0, the Secure Channel backend won't automatically
210+
send client certificates from the Windows Certificate Store anymore.
211+
To opt in to the old behavior, http.sslAutoClientCert can be set.
212+
206213
http.pinnedPubkey::
207214
Public key of the https service. It may either be the filename of
208215
a PEM or DER encoded public key file or a string starting with

Documentation/config/sendpack.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sendpack.sideband::
2+
Allows to disable the side-band-64k capability for send-pack even
3+
when it is advertised by the server. Makes it possible to work
4+
around a limitation in the git for windows implementation together
5+
with the dump git protocol. Defaults to true.

Documentation/config/windows.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
windows.appendAtomically::
2+
By default, append atomic API is used on windows. But it works only with
3+
local disk files, if you're working on a network file system, you should
4+
set it false to turn it off.

Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,7 @@ BUILTIN_OBJS += builtin/write-tree.o
13281328
# upstream unnecessarily (making merging in future changes easier).
13291329
THIRD_PARTY_SOURCES += compat/inet_ntop.c
13301330
THIRD_PARTY_SOURCES += compat/inet_pton.c
1331+
THIRD_PARTY_SOURCES += compat/mimalloc/%
13311332
THIRD_PARTY_SOURCES += compat/nedmalloc/%
13321333
THIRD_PARTY_SOURCES += compat/obstack.%
13331334
THIRD_PARTY_SOURCES += compat/poll/%
@@ -2056,6 +2057,41 @@ ifdef USE_NED_ALLOCATOR
20562057
OVERRIDE_STRDUP = YesPlease
20572058
endif
20582059

2060+
ifdef USE_MIMALLOC
2061+
MIMALLOC_OBJS = \
2062+
compat/mimalloc/alloc-aligned.o \
2063+
compat/mimalloc/alloc.o \
2064+
compat/mimalloc/arena.o \
2065+
compat/mimalloc/bitmap.o \
2066+
compat/mimalloc/heap.o \
2067+
compat/mimalloc/init.o \
2068+
compat/mimalloc/options.o \
2069+
compat/mimalloc/os.o \
2070+
compat/mimalloc/page.o \
2071+
compat/mimalloc/random.o \
2072+
compat/mimalloc/segment.o \
2073+
compat/mimalloc/segment-cache.o \
2074+
compat/mimalloc/stats.o
2075+
2076+
COMPAT_CFLAGS += -Icompat/mimalloc -DMI_DEBUG=0 -DUSE_MIMALLOC --std=gnu11
2077+
COMPAT_OBJS += $(MIMALLOC_OBJS)
2078+
2079+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += -DBANNED_H
2080+
2081+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
2082+
-Wno-attributes \
2083+
-Wno-unknown-pragmas \
2084+
-Wno-array-bounds
2085+
2086+
ifdef DEVELOPER
2087+
$(MIMALLOC_OBJS): COMPAT_CFLAGS += \
2088+
-Wno-pedantic \
2089+
-Wno-declaration-after-statement \
2090+
-Wno-old-style-definition \
2091+
-Wno-missing-prototypes
2092+
endif
2093+
endif
2094+
20592095
ifdef OVERRIDE_STRDUP
20602096
COMPAT_CFLAGS += -DOVERRIDE_STRDUP
20612097
COMPAT_OBJS += compat/strdup.o
@@ -2782,6 +2818,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
27822818
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
27832819
endif
27842820

2821+
headless-git.o: compat/win32/headless.c GIT-CFLAGS
2822+
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
2823+
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
2824+
2825+
headless-git$X: headless-git.o git.res GIT-LDFLAGS
2826+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
2827+
27852828
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
27862829
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
27872830

@@ -3655,6 +3698,7 @@ clean: profile-clean coverage-clean cocciclean
36553698
$(RM) po/git.pot po/git-core.pot
36563699
$(RM) git.res
36573700
$(RM) $(OBJECTS)
3701+
$(RM) headless-git.o
36583702
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
36593703
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
36603704
$(RM) $(TEST_PROGRAMS)
@@ -3683,13 +3727,17 @@ endif
36833727
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
36843728
ifdef MSVC
36853729
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3730+
$(RM) headless-git.o.pdb
36863731
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
3732+
$(RM) $(patsubst %.exe,%.ilk,$(OTHER_PROGRAMS))
36873733
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
36883734
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
36893735
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
3736+
$(RM) $(patsubst %.exe,%.ilk,$(PROGRAMS))
36903737
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
36913738
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
36923739
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
3740+
$(RM) $(patsubst %.exe,%.ilk,$(TEST_PROGRAMS))
36933741
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
36943742
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
36953743
$(RM) compat/vcbuild/MSVC-DEFS-GEN

abspath.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ static char *strbuf_realpath_1(struct strbuf *resolved, const char *path,
9191
goto error_out;
9292
}
9393

94+
if (platform_strbuf_realpath(resolved, path))
95+
return resolved->buf;
96+
9497
strbuf_addstr(&remaining, path);
9598
get_root_part(resolved, &remaining);
9699

0 commit comments

Comments
 (0)