Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase to v2.46.1 #5151

Merged
merged 435 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
435 commits
Select commit Hold shift + click to select a range
38a219e
vcxproj: allow building with `NO_PERL` again
dscho Mar 29, 2022
0cd5262
vcxproj: require C11
dscho Jun 28, 2022
1d0780b
vcxproj: ignore the `-pedantic` option
dscho Jun 28, 2022
4c51d47
vcxproj: include reftable when committing `.vcxproj` files
dscho Jun 28, 2022
ba05b17
vcxproj: handle libreftable_test, too
dscho Jun 28, 2022
85874a1
vcxproj: avoid escaping double quotes in the defines
dscho Jun 28, 2022
65c7df4
ci: adjust Azure Pipeline for `runs_on_pool`
dscho Jul 9, 2022
60e1dc4
ci: stop linking the `prove` cache
dscho Jul 9, 2022
d33fb7d
ci: reinstate Azure Pipelines support
dscho Feb 11, 2021
074f591
azure-pipeline: drop the `GETTEXT_POISON` job
dscho Mar 29, 2022
06e2381
azure-pipeline: stop hard-coding `apt-get` calls
dscho Mar 29, 2022
fae12b0
Add config option `windows.appendAtomically`
sunzhuoshi Jan 15, 2022
30899bf
mingw: change core.fsyncObjectFiles = 1 by default
dscho Sep 4, 2017
dd78210
azure-pipeline: drop the code to write to/read from a file share
dscho Jul 9, 2022
ae18a1c
azure-pipeline: use partial clone/parallel checkout to initialize min…
dscho Jul 9, 2022
57cbc42
azure-pipeline: downcase the job name of the `Linux32` job
dscho Jul 9, 2022
9c686c9
config.mak.uname: add support for clangarm64
dennisameling Oct 4, 2022
a4f6141
azure-pipeline: run static-analysis on jammy
ttaylorr Feb 8, 2021
be6056f
MinGW: link as terminal server aware
rimrul Jul 10, 2022
40fe633
Fix Windows version resources
Mortein Nov 2, 2022
3c8827b
bswap.h: add support for built-in bswap functions
dennisameling Oct 4, 2022
f3d1c55
ci: create clangarm64-build.yml
dennisameling Oct 4, 2022
7eeb802
http: optionally load libcurl lazily
dscho May 6, 2023
00f1088
http: support lazy-loading libcurl also on Windows
dscho May 7, 2023
6d8e07c
http: when loading libcurl lazily, allow for multiple SSL backends
dscho May 7, 2023
1aa651e
status: fix for old-style submodules with commondir
sceptical-coder Oct 28, 2022
f5fc17d
windows: skip linking `git-<command>` for built-ins
dscho Jan 27, 2023
d656540
windows: fix Repository>Explore Working Copy
dscho Mar 21, 2023
9780d3a
mingw: do load libcurl dynamically by default
dscho May 7, 2023
4325885
Add a GitHub workflow to verify that Git/Scalar work in Nano Server
dscho Nov 2, 2022
6f70ef4
mingw: suggest `windows.appendAtomically` in more cases
dsl101 Jul 28, 2023
f1898a0
win32: use native ANSI sequence processing, if possible
dscho Nov 22, 2023
9b44ed4
git.rc: include winuser.h
rimrul Dec 2, 2023
afecd4a
common-main.c: fflush stdout buffer upon exit
chengzhuo5 Apr 8, 2024
377cb33
t5601/t7406(mingw): do run tests with symlink support
dscho Apr 9, 2024
36daaa9
Merge 'remote-hg-prerequisites' into HEAD
dscho Jun 8, 2018
5042e2d
win32: ensure that `localtime_r()` is declared even in i686 builds
dscho May 21, 2024
a56147b
Fallback to AppData if XDG_CONFIG_HOME is unset
ariellourenco Jul 2, 2024
112efba
run-command: be helpful with Git LFS fails on Windows 7
dscho Jul 4, 2024
1a9bffc
Merge branch 'drive-prefix'
dscho Jun 8, 2018
2c65ce6
Merge branch 'dont-clean-junctions'
dscho Jul 30, 2019
4f2c840
Merge branch 'msys2-python'
dscho May 31, 2019
511f485
Merge branch 'mimalloc-v2.0.9'
dscho Sep 8, 2022
d09a6c7
Merge pull request #2375 from assarbad/reintroduce-sideband-config
dscho Oct 30, 2019
4695049
Merge pull request #2405 from dscho/mingw-setsockopt
dscho Nov 25, 2019
3e429b9
Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
dscho Jan 3, 2020
a90073e
Merge pull request #2488 from bmueller84/master
dscho Jan 22, 2020
50fbe4f
Merge pull request #2501 from jeffhostetler/clink-debug-curl
dscho Jan 30, 2020
cb98281
Merge pull request #2504 from dscho/access-repo-via-junction
dscho Feb 1, 2020
02c226d
Merge pull request #2506 from dscho/issue-2283
dscho Feb 11, 2020
9e4a8d7
Merge pull request #2535 from dscho/schannel-revoke-best-effort
dscho Mar 4, 2020
bc741f4
Merge pull request #2618 from dscho/avoid-d/f-conflict-in-vs/master
dscho May 9, 2020
57b8ffd
Merge 'add-p-many-files'
dscho Jun 8, 2018
8103526
Merge pull request #2730 from dscho/crlf-aware-git-add-i
dscho Jul 2, 2020
d62e2b6
Merge pull request #2714 from lbonanomi/crlf-scissors
dscho Jul 3, 2020
9fad570
Merge pull request #2655 from jglathe/jg/t0014_trace_extra_info
dscho Oct 9, 2020
e8bcd2a
Merge 'git-gui/js/intent-to-add'
dscho Oct 18, 2020
382c5bc
Merge pull request #2974 from derrickstolee/maintenance-and-headless
dscho Jan 11, 2021
30ee49f
cmake: install headless-git. (#4338)
dscho Mar 13, 2023
22a8284
Merge pull request #2351 from PhilipOakley/vcpkg-tip
dscho Oct 7, 2019
c3d02c8
Merge pull request #2915 from dennisameling/windows-arm64-support
dscho Dec 9, 2020
c63fe74
Merge pull request #3327 from dennisameling/fix-host-cpu
dscho Jul 19, 2021
83252d6
Merge pull request #3165 from dscho/increase-allowed-length-of-interp…
dscho Apr 3, 2021
f1668ab
Merge pull request #3220 from dscho/there-is-no-vs/master-anymore
dscho May 17, 2021
3d6b1e6
Merge pull request #3293 from pascalmuller/http-support-automatically…
dscho Jun 24, 2021
da7148e
Merge pull request #3349 from vdye/feature/ci-subtree-tests
dscho Aug 10, 2021
3eaccfc
Merge pull request #3306 from PhilipOakley/vs-sln
dscho Oct 12, 2021
1a1dc0d
Merge pull request #3417 from dscho/initialize-core.symlinks-earlier
dscho Oct 13, 2021
6be65f3
Merge branch 'mark-v4-fsmonitor-experimental' into try-v4-fsmonitor
jeffhostetler Sep 29, 2021
f5d7d76
Merge pull request #3533 from PhilipOakley/hashliteral_t
dscho Dec 15, 2021
7a4dc73
Merge pull request #3791: Various fixes around `safe.directory`
derrickstolee Apr 13, 2022
d8e5e19
Merge pull request #3751 from rkitover/native-term
dscho Apr 21, 2022
b098796
Merge pull request #3875 from 1480c1/wine/detect_msys_tty
dscho May 30, 2022
ceb622e
Merge branch 'optionally-dont-append-atomically-on-windows'
dscho Jun 23, 2022
bca98ed
Merge branch 'fsync-object-files-always'
dscho Oct 11, 2018
dfd3f21
Merge branch 'ci-fixes'
dscho Feb 11, 2021
639055a
Merge pull request #3942 from rimrul/mingw-tsaware
dscho Jul 27, 2022
592e34a
Fix Windows version resources (#4092)
dscho Nov 3, 2022
687b409
Merge branch 'builtin-swap-functions'
dscho Nov 23, 2022
0852ec5
Add support for CLANGARM64 target (#3916)
dscho Oct 28, 2022
cc7144f
Fix global repository field not being cleared (#4083)
dscho Dec 20, 2022
7bab634
Skip linking the "dashed" `git-<command>`s for built-ins (#4252)
dscho Jan 31, 2023
776137b
Git GUI: fix Repository>Explore Working Copy (#4357)
dscho Mar 21, 2023
8d72181
Lazy load libcurl, allowing for an SSL/TLS backend-specific libcurl (…
dscho May 15, 2023
1b91356
Merge branch 'nano-server'
dscho Aug 7, 2023
cd2384a
Additional error checks for issuing the windows.appendAtomically warn…
dscho Aug 7, 2023
b68077c
win32: use native ANSI sequence processing, if possible (#4700)
dscho Dec 2, 2023
d19d46a
ARM64: Embed manifest properly (#4718)
dscho Dec 7, 2023
cd08df4
common-main.c: fflush stdout buffer when exit (#4901)
dscho Apr 12, 2024
3a74a4c
Merge branch 'run-t5601-and-t7406-with-symlinks-on-windows-10'
dscho Jul 12, 2024
c9db30a
Merge branch 'Fix-i686-build-with-GCC-v14'
dscho Jul 12, 2024
fb20d53
Merge branch 'Fallback-to-AppData-if-XDG-CONFIG-HOME-is-unset'
dscho Jul 12, 2024
4900cf0
Merge branch 'run-command-be-helpful-when-Git-LFS-fails-on-Windows-7'
dscho Jul 12, 2024
a7dcca5
ci: remove 'Upload failed tests' directories' step from linux32 jobs
gitster Sep 9, 2024
7ca6405
Backport `linux32` CI fix from upstream Git (#5145)
dscho Sep 16, 2024
ea9d3da
Merge branch 'ready-for-upstream'
dscho Oct 11, 2018
cec19bb
Win32: make FILETIME conversion functions public
kblees Jul 6, 2013
237f9dd
Win32: dirent.c: Move opendir down
kblees Sep 8, 2013
dc626be
mingw: make the dirent implementation pluggable
kblees Sep 8, 2013
cc74000
Win32: make the lstat implementation pluggable
kblees Sep 8, 2013
711da7f
mingw: add infrastructure for read-only file system level caches
kblees Sep 8, 2013
3fb0e0b
fscache: add key for GIT_TRACE_FSCACHE
jeffhostetler Jan 24, 2017
6cc1649
dir.c: make add_excludes aware of fscache during status
jeffhostetler Nov 1, 2017
91d2040
mingw: add a cache below mingw's lstat and dirent implementations
kblees Oct 1, 2013
db1763d
fscache: remember not-found directories
jeffhostetler Dec 13, 2016
5a2c256
fscache: make fscache_enabled() public
jeffhostetler Dec 20, 2017
da8579d
fscache: load directories only once
kblees Jun 24, 2014
3d53293
fscache: add a test for the dir-not-found optimization
dscho Jan 25, 2017
a598846
add: use preload-index and fscache for performance
jeffhostetler Nov 22, 2016
07cec99
dir.c: regression fix for add_excludes with fscache
jeffhostetler Dec 20, 2017
2b1802f
mem_pool: add GIT_TRACE_MEMPOOL support
benpeart Oct 4, 2018
5505563
fscache: fscache takes an initial size
benpeart Nov 2, 2018
3972d4c
fscache: update fscache to be thread specific instead of global
benpeart Oct 4, 2018
f16ef35
fetch-pack.c: enable fscache for stats under .git/objects
Nov 22, 2017
0b3cb86
checkout.c: enable fscache for checkout again
Jan 30, 2018
56cf170
Enable the filesystem cache (fscache) in refresh_index().
benpeart Sep 7, 2018
747bfe0
fscache: use FindFirstFileExW to avoid retrieving the short name
benpeart Oct 23, 2018
d45c22b
status: disable and free fscache at the end of the status command
benpeart Nov 1, 2018
fc7b9bf
fscache: add GIT_TEST_FSCACHE support
benpeart Oct 4, 2018
284eb3e
fscache: add fscache hit statistics
benpeart Sep 25, 2018
dd188fa
fscache: remember the reparse tag for each entry
dscho Dec 11, 2018
949503d
git-gui: provide question helper for retry fallback on Windows
hvoigt Feb 21, 2010
87a73ce
fscache: implement an FSCache-aware is_mount_point()
dscho Dec 11, 2018
d74467f
git-gui--askyesno: fix funny text wrapping
dscho Sep 20, 2017
26cb463
git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
dscho Jul 23, 2010
a6a4906
fscache: teach fscache to use mempool
benpeart Nov 2, 2018
29054d2
fscache: make fscache_enable() thread safe
benpeart Nov 16, 2018
8be5c62
fscache: teach fscache to use NtQueryDirectoryFile
benpeart Nov 15, 2018
8b5b156
unpack-trees: enable fscache for sparse-checkout
derrickstolee Jun 12, 2019
7d7c8d2
clean: make use of FSCache
dscho Dec 11, 2018
193fea2
gitk: Unicode file name support
kblees Feb 4, 2012
edebad2
gitk: Use an external icon file on Windows
sschuberth Jul 22, 2012
0792487
git-gui--askyesno: allow overriding the window title
dscho Sep 20, 2017
5040e8b
gitk: fix arrow keys in input fields with Tcl/Tk >= 8.6
dscho Feb 16, 2016
f57f1f1
git-gui--askyesno (mingw): use Git for Windows' icon, if available
dscho Sep 20, 2017
a14b15e
Merge 'git-gui' into HEAD
dscho Jun 7, 2018
2dfff15
gitk: make the "list references" default window width wider
sidecut Jan 21, 2016
8c00c8b
Merge branch 'git-gui-askyesno'
dscho Jun 8, 2018
19081ef
Merge 'gitk' into HEAD
dscho Jun 7, 2018
4aaf317
Merge branch 'fscache'
dscho Nov 15, 2018
3566c8e
Merge pull request #994 from jeffhostetler/jeffhostetler/fscache_nfd
dscho Jun 8, 2018
c70161a
Merge pull request #971 from jeffhostetler/jeffhostetler/add_preload_…
dscho Jun 8, 2018
6c967ab
Merge pull request #1344 from jeffhostetler/perf_add_excludes_with_fs…
dscho Jun 8, 2018
5f58b1b
Merge pull request #1426 from atetubou/fetch_pack
dscho Jun 8, 2018
ef9ec88
Merge pull request #1468 from atetubou/fscache_checkout_flush
dscho Oct 12, 2018
2beebf9
Merge pull request #1827 from benpeart/fscache_refresh_index
dscho Sep 27, 2018
5ed6db3
Merge pull request #1908 from benpeart/FindFirstFileEx-gfw
dscho Nov 5, 2018
7aa8049
Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
dscho Nov 5, 2018
50cab11
Merge pull request #1911 from benpeart/git_test_fscache-gfw
dscho Nov 5, 2018
009a746
Merge pull request #1910 from benpeart/fscache_statistics-gfw
dscho Nov 16, 2018
046969a
Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'
dscho Nov 16, 2018
9cf3d51
Merge pull request #1934 from benpeart/fscache-thread-safe-enable-gfw
dscho Nov 26, 2018
d021adf
Merge pull request #1937 from benpeart/fscache-NtQueryDirectoryFile-gfw
dscho Nov 27, 2018
1d4e21b
Merge branch 'fscache-and-sparse-checkout'
derrickstolee Jun 18, 2019
ed4cdb7
pack-objects (mingw): demonstrate a segmentation fault with large deltas
vangdfang Jan 9, 2014
b1eb679
mingw: Support `git_terminal_prompt` with more terminals
kblees Mar 19, 2015
90a0bd5
mingw: support long paths
kblees Jul 28, 2015
6e351ec
compat/terminal.c: only use the Windows console if bash 'read -r' fails
kblees May 9, 2015
f0c7c00
Win32: fix 'lstat("dir/")' with long paths
kblees Jul 4, 2014
3dab29b
mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
dscho Feb 23, 2018
0352225
Merge branch 'dont-clean-junctions-fscache'
dscho Jul 23, 2019
2a1b191
win32(long path support): leave drive-less absolute paths intact
dscho Sep 6, 2023
12a0a6f
compat/fsmonitor/fsm-*-win32: support long paths
jeffhostetler Mar 25, 2022
caae38a
clean: suggest using `core.longPaths` if paths are too long to remove
mathstuf Apr 22, 2022
08d520d
Unbreak interactive GPG prompt upon signing
dscho Sep 6, 2016
a1f7c57
strbuf_readlink: don't call readlink twice if hint is the exact link …
kblees May 11, 2015
5bcdd25
strbuf_readlink: support link targets that exceed PATH_MAX
kblees May 11, 2015
0ccd0dd
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
kblees May 11, 2015
a1ba0b3
Win32: don't call GetFileAttributes twice in mingw_lstat()
kblees May 12, 2015
6cc554f
Win32: implement stat() with symlink support
kblees May 15, 2015
bfb6c70
Win32: remove separate do_lstat() function
kblees May 11, 2015
f027e0c
Win32: let mingw_lstat() error early upon problems with reparse points
kblees May 23, 2015
793e318
mingw: teach fscache and dirent about symlinks
kblees Jan 10, 2017
ba6cfb4
Win32: lstat(): return adequate stat.st_size for symlinks
kblees May 15, 2015
4cac428
Win32: factor out retry logic
kblees May 19, 2015
a2d3f15
Win32: change default of 'core.symlinks' to false
kblees May 23, 2015
9bc14e2
Win32: add symlink-specific error codes
kblees May 15, 2015
d34eeb7
Win32: mingw_unlink: support symlinks to directories
kblees May 23, 2015
ab63096
Win32: mingw_rename: support renaming symlinks
kblees May 19, 2015
d40f2b0
Win32: mingw_chdir: change to symlink-resolved directory
kblees May 23, 2015
fd2b6ed
Win32: implement readlink()
kblees May 23, 2015
c75bdec
mingw: lstat: compute correct size for symlinks
billziss-gh May 28, 2020
5e2eb17
Win32: implement basic symlink() functionality (file symlinks only)
kblees May 23, 2015
102cf11
Win32: symlink: add support for symlinks to directories
kblees May 23, 2015
f763ec7
mingw: introduce code to detect whether we're inside a Windows container
ZCube Apr 23, 2018
c96e816
mingw: try to create symlinks without elevated permissions
dscho May 30, 2017
b1a2f3c
mingw: when running in a Windows container, try to rename() harder
ZCube Apr 23, 2018
c582bd8
mingw: emulate stat() a little more faithfully
dscho Mar 2, 2020
38d49a6
mingw: move the file_attr_to_st_mode() function definition
ZCube Apr 23, 2018
97d618e
mingw: special-case index entries for symlinks with buggy size
dscho Jun 4, 2020
6b1d24d
mingw: explicitly specify with which cmd to prefix the cmdline
dscho Jul 20, 2017
a850248
mingw: when path_lookup() failed, try BusyBox
dscho Jul 20, 2017
41f035f
Win32: symlink: move phantom symlink creation to a separate function
piscisaureus Oct 26, 2018
78a45cd
test-lib: avoid unnecessary Perl invocation
dscho Aug 5, 2017
ceee7f1
Introduce helper to create symlinks that knows about index_state
dscho Feb 11, 2019
4bcaf18
test-tool: learn to act as a drop-in replacement for `iconv`
dscho Jul 20, 2017
9f76016
mingw: allow to specify the symlink type in .gitattributes
piscisaureus Oct 26, 2018
b72eed6
tests(mingw): if `iconv` is unavailable, use `test-helper --iconv`
dscho Jul 20, 2017
e86fe24
mingw: Windows Docker volumes are *not* symbolic links
dscho Apr 23, 2018
0becea9
mingw: work around rename() failing on a read-only file
dsl101 Jul 28, 2023
1cf49e5
Win32: symlink: add test for `symlink` attribute
piscisaureus Oct 26, 2018
f6a5a9a
gitattributes: mark .png files as binary
dscho Oct 11, 2018
ab6ffcf
tests: move test PNGs into t/lib-diff/
dscho Aug 5, 2017
a07c026
tests: only override sort & find if there are usable ones in /usr/bin/
dscho Jul 17, 2017
b4cfcbc
tests: use the correct path separator with BusyBox
dscho Nov 19, 2018
68ff010
mingw: only use Bash-ism `builtin pwd -W` when available
dscho Jun 29, 2017
cfa1803
tests (mingw): remove Bash-specific pwd option
dscho Jun 30, 2017
d48d5f2
test-lib: add BUSYBOX prerequisite
dscho Jul 19, 2017
da65a4f
t5003: use binary file from t/lib-diff/
dscho Aug 5, 2017
b67f7f0
t5532: workaround for BusyBox on Windows
dscho Jul 21, 2017
103d7b3
t5605: special-case hardlink test for BusyBox-w32
dscho Jul 21, 2017
14c9d27
t5813: allow for $PWD to be a Windows path
dscho Jul 5, 2017
3c78f25
t9200: skip tests when $PWD contains a colon
dscho Jul 7, 2017
66f7a2d
mingw: add a Makefile target to copy test artifacts
dscho Jul 19, 2017
19430b7
mingw: kill child processes in a gentler way
dscho May 17, 2017
e315485
mingw: optionally enable wsl compability file mode bits
swigger Jun 7, 2023
034eb03
mingw: really handle SIGINT
dscho Apr 22, 2018
cfce051
mingw: do not call xutftowcs_path in mingw_mktemp
neerajsi-msft Oct 27, 2021
d9da48c
Partially un-revert "editor: save and reset terminal after calling ED…
dscho Nov 25, 2021
69a6f8e
reset: reinstate support for the deprecated --stdin option
dscho Dec 10, 2019
2d20861
Describe Git for Windows' architecture [no ci]
dscho Feb 13, 2023
79d8838
Modify the Code of Conduct for Git for Windows
dscho Oct 11, 2019
56ce15a
CONTRIBUTING.md: add guide for first-time contributors
derrickstolee Mar 1, 2018
46a6c34
README.md: Add a Windows-specific preamble
dscho Jan 10, 2014
34bbb92
Add an issue template
shiftkey Feb 18, 2016
b0d782a
Modify the GitHub Pull Request template (to reflect Git for Windows)
Dec 22, 2017
79df07f
.github: Add configuration for the Sentiment Bot
dscho Feb 20, 2018
4b11981
Add a GitHub workflow to monitor component updates
dscho Sep 29, 2020
15f95ac
Document how $HOME is set on Windows
alejandro5042 Mar 9, 2018
7337fe1
fsmonitor: reintroduce core.useBuiltinFSMonitor
vdye Apr 4, 2022
b347f2c
dependabot: help keeping GitHub Actions versions up to date
dscho Feb 6, 2024
95bf514
SECURITY.md: document Git for Windows' policies
dscho Aug 23, 2019
26632c9
Merge branch 'gitk-and-git-gui-patches'
dscho Oct 11, 2018
eaa7c46
Merge branch 'long-paths'
dscho Nov 15, 2018
fa75cb1
Merge branch 'fix-v4-fsmonitor-long-paths' into try-v4-fsmonitor
jeffhostetler Sep 29, 2021
24f3237
Merge pull request #3817 from mathstuf/name-too-long-advice
dscho Apr 22, 2022
6acf27e
Merge branch 'msys2'
dscho Nov 15, 2018
33a1faf
Merge branch 'kblees/kb/symlinks'
dscho Nov 15, 2018
1f39a0c
Merge 'docker-volumes-are-no-symlinks'
dscho Oct 12, 2018
8dfed81
mingw: try resetting the read-only bit if rename fails (#4527)
dscho Aug 7, 2023
9d3bc8d
Merge pull request #1897 from piscisaureus/symlink-attr
dscho Oct 31, 2018
73c17f8
Merge branch 'busybox-w32'
dscho Feb 7, 2019
ac26c86
Merge branch 'wsl-file-mode-bits'
dscho Aug 7, 2023
edf529e
Merge pull request #1170 from dscho/mingw-kill-process
dscho Oct 11, 2018
b9f7b1e
Merge pull request #3492 from dscho/ns/batched-fsync
vdye Oct 28, 2021
d1d3c0f
Merge branch 'un-revert-editor-save-and-reset'
dscho Jan 15, 2022
353c2fc
Merge branch 'phase-out-reset-stdin'
dscho Jun 8, 2018
9160ec5
Merge branch 'deprecate-core.useBuiltinFSMonitor'
dscho Jan 24, 2023
a0842d8
Merge pull request #2837 from dscho/monitor-component-updates
dscho Oct 7, 2020
6cd9c83
Merge 'readme' into HEAD
dscho Jun 7, 2018
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
Prev Previous commit
Next Next commit
dir.c: make add_excludes aware of fscache during status
Teach read_directory_recursive() and add_excludes() to
be aware of optional fscache and avoid trying to open()
and fstat() non-existant ".gitignore" files in every
directory in the worktree.

The current code in add_excludes() calls open() and then
fstat() for a ".gitignore" file in each directory present
in the worktree.  Change that when fscache is enabled to
call lstat() first and if present, call open().

This seems backwards because both lstat needs to do more
work than fstat.  But when fscache is enabled, fscache will
already know if the .gitignore file exists and can completely
avoid the IO calls.  This works because of the lstat diversion
to mingw_lstat when fscache is enabled.

This reduced status times on a 350K file enlistment of the
Windows repo on a NVMe SSD by 0.25 seconds.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
  • Loading branch information
jeffhostetler authored and dscho committed Sep 18, 2024
commit 6cc16496a7eeeca844213e41b522910419a9ad88
5 changes: 5 additions & 0 deletions compat/win32/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ static struct hashmap map;
static CRITICAL_SECTION mutex;
static struct trace_key trace_fscache = TRACE_KEY_INIT(FSCACHE);

int fscache_is_enabled(void)
{
return enabled;
}

/*
* An entry in the file system cache. Used for both entire directory listings
* and file entries.
Expand Down
3 changes: 3 additions & 0 deletions compat/win32/fscache.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
int fscache_enable(int enable);
#define enable_fscache(x) fscache_enable(x)

int fscache_is_enabled(void);
#define is_fscache_enabled() (fscache_is_enabled())

DIR *fscache_opendir(const char *dir);
int fscache_lstat(const char *file_name, struct stat *buf);

Expand Down
33 changes: 24 additions & 9 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,16 +1113,31 @@ static int add_patterns(const char *fname, const char *base, int baselen,
size_t size = 0;
char *buf;

if (flags & PATTERN_NOFOLLOW)
fd = open_nofollow(fname, O_RDONLY);
else
fd = open(fname, O_RDONLY);

if (fd < 0 || fstat(fd, &st) < 0) {
if (fd < 0)
warn_on_fopen_errors(fname);
if (is_fscache_enabled()) {
if (lstat(fname, &st) < 0) {
fd = -1;
} else {
fd = open(fname, O_RDONLY);
if (fd < 0)
warn_on_fopen_errors(fname);
}
} else {
if (flags & PATTERN_NOFOLLOW)
fd = open_nofollow(fname, O_RDONLY);
else
close(fd);
fd = open(fname, O_RDONLY);

if (fd < 0 || fstat(fd, &st) < 0) {
if (fd < 0)
warn_on_fopen_errors(fname);
else {
close(fd);
fd = -1;
}
}
}

if (fd < 0) {
if (!istate)
return -1;
r = read_skip_worktree_file_from_index(istate, fname,
Expand Down
4 changes: 4 additions & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,10 @@ static inline int is_missing_file_error(int errno_)
#define enable_fscache(x) /* noop */
#endif

#ifndef is_fscache_enabled
#define is_fscache_enabled() (0)
#endif

int cmd_main(int, const char **);

/*
Expand Down