Skip to content

Commit 27b4c74

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 8f45006 + 2744b1d commit 27b4c74

File tree

106 files changed

+4636
-440
lines changed

Some content is hidden

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

106 files changed

+4636
-440
lines changed

.github/workflows/git-artifacts.yml

Lines changed: 514 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/main.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ jobs:
137137
NO_PERL: 1
138138
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
139139
runs-on: windows-latest
140+
strategy:
141+
matrix:
142+
arch: [x64, arm64]
140143
steps:
141144
- uses: actions/checkout@v2
142145
- uses: git-for-windows/setup-git-for-windows-sdk@v1
@@ -146,26 +149,22 @@ jobs:
146149
repository: 'microsoft/vcpkg'
147150
path: 'compat/vcbuild/vcpkg'
148151
- name: download vcpkg artifacts
149-
shell: powershell
150-
run: |
151-
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
152-
$id = ((Invoke-WebRequest -UseBasicParsing "${urlbase}?definitions=9&statusFilter=completed&resultFilter=succeeded&`$top=1").content | ConvertFrom-JSON).value[0].id
153-
$downloadUrl = ((Invoke-WebRequest -UseBasicParsing "${urlbase}/$id/artifacts").content | ConvertFrom-JSON).value[0].resource.downloadUrl
154-
(New-Object Net.WebClient).DownloadFile($downloadUrl, "compat.zip")
155-
Expand-Archive compat.zip -DestinationPath . -Force
156-
Remove-Item compat.zip
152+
uses: git-for-windows/get-azure-pipelines-artifact@v0
153+
with:
154+
repository: git/git
155+
definitionId: 9
157156
- name: add msbuild to PATH
158157
uses: microsoft/setup-msbuild@v1
159158
- name: copy dlls to root
160159
shell: cmd
161-
run: compat\vcbuild\vcpkg_copy_dlls.bat release
160+
run: compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
162161
- name: generate Visual Studio solution
163162
shell: bash
164163
run: |
165-
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
166-
-DNO_GETTEXT=YesPlease -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
164+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
165+
-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 }}
167166
- name: MSBuild
168-
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
167+
run: msbuild git.sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4 -property:PlatformToolset=v142
169168
- name: bundle artifact tar
170169
shell: bash
171170
env:
@@ -179,7 +178,7 @@ jobs:
179178
- name: upload tracked files and build artifacts
180179
uses: actions/upload-artifact@v2
181180
with:
182-
name: vs-artifacts
181+
name: vs-artifacts-${{ matrix.arch }}
183182
path: artifacts
184183
vs-test:
185184
name: win+VS test
@@ -194,7 +193,7 @@ jobs:
194193
- name: download tracked files and build artifacts
195194
uses: actions/download-artifact@v2
196195
with:
197-
name: vs-artifacts
196+
name: vs-artifacts-x64
198197
path: ${{github.workspace}}
199198
- name: extract tracked files and build artifacts
200199
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ include::config/safe.txt[]
499499

500500
include::config/sendemail.txt[]
501501

502+
include::config/sendpack.txt[]
503+
502504
include::config/sequencer.txt[]
503505

504506
include::config/showbranch.txt[]

Documentation/config/advice.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,7 @@ advice.*::
136136
Advice shown when either linkgit:git-add[1] or linkgit:git-rm[1]
137137
is asked to update index entries outside the current sparse
138138
checkout.
139+
useCoreFSMonitorConfig::
140+
Advice shown if the deprecated 'core.useBuiltinFSMonitor' config
141+
setting is in use.
139142
--

Documentation/config/core.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,14 @@ core.fsyncMethod::
628628
* `writeout-only` issues pagecache writeback requests, but depending on the
629629
filesystem and storage hardware, data added to the repository may not be
630630
durable in the event of a system crash. This is the default mode on macOS.
631+
* `batch` enables a mode that uses writeout-only flushes to stage multiple
632+
updates in the disk writeback cache and then does a single full fsync of
633+
a dummy file to trigger the disk cache flush at the end of the operation.
634+
+
635+
Currently `batch` mode only applies to loose-object files. Other repository
636+
data is made durable as if `fsync` was specified. This mode is expected to
637+
be as safe as `fsync` on macOS for repos stored on HFS+ or APFS filesystems
638+
and on Windows for repos stored on NTFS or ReFS filesystems.
631639

632640
core.fsyncObjectFiles::
633641
This boolean will enable 'fsync()' when writing object files.

Documentation/config/http.txt

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

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

182184
http.schannelUseSSLCAInfo::
183185
As of cURL v7.60.0, the Secure Channel backend can use the
@@ -187,6 +189,11 @@ http.schannelUseSSLCAInfo::
187189
when the `schannel` backend was configured via `http.sslBackend`,
188190
unless `http.schannelUseSSLCAInfo` overrides this behavior.
189191

192+
http.sslAutoClientCert::
193+
As of cURL v7.77.0, the Secure Channel backend won't automatically
194+
send client certificates from the Windows Certificate Store anymore.
195+
To opt in to the old behavior, http.sslAutoClientCert can be set.
196+
190197
http.pinnedpubkey::
191198
Public key of the https service. It may either be the filename of
192199
a PEM or DER encoded public key file or a string starting with

Documentation/config/safe.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ directory was listed in the `safe.directory` list. If `safe.directory=*`
2626
is set in system config and you want to re-enable this protection, then
2727
initialize your list with an empty value before listing the repositories
2828
that you deem safe.
29+
+
30+
Due to the permission model on Windows where ACLs are used instead of
31+
Unix' simpler permission model, it can be a bit tricky to figure out why
32+
a directory is considered unsafe. To help with this, Git will provide
33+
more detailed information when the environment variable
34+
`GIT_TEST_DEBUG_UNSAFE_DIRECTORIES` is set to `true`.

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.

Makefile

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,14 @@ include shared.mak
477477
#
478478
# If your platform supports a built-in fsmonitor backend, set
479479
# FSMONITOR_DAEMON_BACKEND to the "<name>" of the corresponding
480-
# `compat/fsmonitor/fsm-listen-<name>.c` that implements the
481-
# `fsm_listen__*()` routines.
480+
# `compat/fsmonitor/fsm-listen-<name>.c` and
481+
# `compat/fsmonitor/fsm-health-<name>.c` files
482+
# that implement the `fsm_listen__*()` and `fsm_health__*()` routines.
483+
#
484+
# If your platform has OS-specific ways to tell if a repo is incompatible with
485+
# fsmonitor (whether the hook or IPC daemon version), set FSMONITOR_OS_SETTINGS
486+
# to the "<name>" of the corresponding `compat/fsmonitor/fsm-settings-<name>.c`
487+
# that implements the `fsm_os_settings__*()` routines.
482488
#
483489
# Define DEVELOPER to enable more compiler warnings. Compiler version
484490
# and family are auto detected, but could be overridden by defining
@@ -2005,6 +2011,12 @@ endif
20052011
ifdef FSMONITOR_DAEMON_BACKEND
20062012
COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND
20072013
COMPAT_OBJS += compat/fsmonitor/fsm-listen-$(FSMONITOR_DAEMON_BACKEND).o
2014+
COMPAT_OBJS += compat/fsmonitor/fsm-health-$(FSMONITOR_DAEMON_BACKEND).o
2015+
endif
2016+
2017+
ifdef FSMONITOR_OS_SETTINGS
2018+
COMPAT_CFLAGS += -DHAVE_FSMONITOR_OS_SETTINGS
2019+
COMPAT_OBJS += compat/fsmonitor/fsm-settings-$(FSMONITOR_OS_SETTINGS).o
20082020
endif
20092021

20102022
ifeq ($(TCLTK_PATH),)
@@ -2634,6 +2646,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
26342646
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
26352647
endif
26362648

2649+
headless-git.o: compat/win32/headless.c GIT-CFLAGS
2650+
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
2651+
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
2652+
2653+
headless-git$X: headless-git.o git.res GIT-LDFLAGS
2654+
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
2655+
26372656
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
26382657
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
26392658

@@ -2866,6 +2885,9 @@ GIT-BUILD-OPTIONS: FORCE
28662885
ifdef FSMONITOR_DAEMON_BACKEND
28672886
@echo FSMONITOR_DAEMON_BACKEND=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_DAEMON_BACKEND)))'\' >>$@+
28682887
endif
2888+
ifdef FSMONITOR_OS_SETTINGS
2889+
@echo FSMONITOR_OS_SETTINGS=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_OS_SETTINGS)))'\' >>$@+
2890+
endif
28692891
ifdef TEST_OUTPUT_DIRECTORY
28702892
@echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
28712893
endif
@@ -3292,6 +3314,7 @@ cocciclean:
32923314
clean: profile-clean coverage-clean cocciclean
32933315
$(RM) *.res
32943316
$(RM) $(OBJECTS)
3317+
$(RM) headless-git.o
32953318
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
32963319
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
32973320
$(RM) $(TEST_PROGRAMS)
@@ -3321,13 +3344,17 @@ endif
33213344
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
33223345
ifdef MSVC
33233346
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
3347+
$(RM) headless-git.o.pdb
33243348
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
3349+
$(RM) $(patsubst %.exe,%.ilk,$(OTHER_PROGRAMS))
33253350
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
33263351
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
33273352
$(RM) $(patsubst %.exe,%.pdb,$(PROGRAMS))
3353+
$(RM) $(patsubst %.exe,%.ilk,$(PROGRAMS))
33283354
$(RM) $(patsubst %.exe,%.iobj,$(PROGRAMS))
33293355
$(RM) $(patsubst %.exe,%.ipdb,$(PROGRAMS))
33303356
$(RM) $(patsubst %.exe,%.pdb,$(TEST_PROGRAMS))
3357+
$(RM) $(patsubst %.exe,%.ilk,$(TEST_PROGRAMS))
33313358
$(RM) $(patsubst %.exe,%.iobj,$(TEST_PROGRAMS))
33323359
$(RM) $(patsubst %.exe,%.ipdb,$(TEST_PROGRAMS))
33333360
$(RM) compat/vcbuild/MSVC-DEFS-GEN

0 commit comments

Comments
 (0)