Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
335 commits
Select commit Hold shift + click to select a range
362ccba
CMake: default Visual Studio generator has changed
PhilipOakley Jul 1, 2021
18080f7
.gitignore: add Visual Studio CMakeSetting.json file
PhilipOakley Apr 24, 2021
7331098
CMakeLists: add default "x64-windows" arch for Visual Studio
PhilipOakley Apr 22, 2021
7048600
ci: run `contrib/subtree` tests in CI builds
vdye Aug 5, 2021
9ccd499
CMake: show Win32 and Generator_platform build-option values
PhilipOakley May 10, 2021
54ba8da
init: do parse _all_ core.* settings early
dscho Sep 8, 2021
dc8b7e0
hash-object: demonstrate a >4GB/LLP64 problem
PhilipOakley Oct 31, 2021
dd895b7
object-file.c: use size_t for header lengths
PhilipOakley Nov 12, 2021
71c7eba
hash algorithms: use size_t for section lengths
PhilipOakley Nov 12, 2021
c6c20a5
hash-object --stdin: verify that it works with >4GB/LLP64
PhilipOakley Dec 6, 2021
f384eab
hash-object: add another >4GB/LLP64 test case
PhilipOakley Dec 6, 2021
03db3ec
setup: properly use "%(prefix)/" when in WSL
derrickstolee Apr 13, 2022
fb0c951
hash-object: add a >4GB/LLP64 test case using filtered input
PhilipOakley Dec 7, 2021
6c55a5e
compat/mingw.c: do not warn when failing to get owner
derrickstolee Apr 13, 2022
2b9cae2
mingw: $env:TERM="xterm-256color" for newer OSes
rkitover Apr 12, 2022
8bec4e5
winansi: check result and Buffer before using Name
1480c1 May 28, 2022
a92c810
Add config option `windows.appendAtomically`
sunzhuoshi Jan 15, 2022
3b22b60
mingw: change core.fsyncObjectFiles = 1 by default
dscho Sep 4, 2017
0b9a0f4
MinGW: link as terminal server aware
rimrul Jul 10, 2022
e2f7a10
Fix Windows version resources
Mortein Nov 2, 2022
84b80ef
status: fix for old-style submodules with commondir
sceptical-coder Oct 28, 2022
e7e8992
http: optionally load libcurl lazily
dscho May 6, 2023
cb8801f
http: support lazy-loading libcurl also on Windows
dscho May 7, 2023
5c9965e
http: when loading libcurl lazily, allow for multiple SSL backends
dscho May 7, 2023
e7af370
windows: skip linking `git-<command>` for built-ins
dscho Jan 27, 2023
8d177c9
mingw: do load libcurl dynamically by default
dscho May 7, 2023
20a33f6
Add a GitHub workflow to verify that Git/Scalar work in Nano Server
dscho Nov 2, 2022
7bb3751
mingw: suggest `windows.appendAtomically` in more cases
dsl101 Jul 28, 2023
81a2964
win32: use native ANSI sequence processing, if possible
dscho Nov 22, 2023
d9920ea
git.rc: include winuser.h
rimrul Dec 2, 2023
1a2fd28
common-main.c: fflush stdout buffer upon exit
chengzhuo5 Apr 8, 2024
5986729
t5601/t7406(mingw): do run tests with symlink support
dscho Apr 9, 2024
8332d06
win32: ensure that `localtime_r()` is declared even in i686 builds
dscho May 21, 2024
ec071b0
Fallback to AppData if XDG_CONFIG_HOME is unset
ariellourenco Jul 2, 2024
1a38026
run-command: be helpful with Git LFS fails on Windows 7
dscho Jul 4, 2024
e16d02b
ci: work around a problem with HTTP/2 vs libcurl v8.10.0
dscho Sep 24, 2024
95df0f6
survey: stub in new experimental 'git-survey' command
Apr 29, 2024
f81d8b1
survey: add command line opts to select references
Apr 29, 2024
af65786
survey: start pretty printing data in table form
derrickstolee Sep 1, 2024
3c4ed6b
survey: add object count summary
derrickstolee Sep 2, 2024
192e38c
survey: summarize total sizes by object type
derrickstolee Sep 2, 2024
f78e16f
survey: show progress during object walk
derrickstolee Sep 2, 2024
f3f18a2
revision: create mark_trees_uninteresting_dense()
derrickstolee Sep 6, 2024
22fab6f
survey: add ability to track prioritized lists
derrickstolee Sep 2, 2024
a0986d5
mingw: make sure `errno` is set correctly when socket operations fail
dscho Nov 14, 2019
f7c6633
survey: add report of "largest" paths
derrickstolee Sep 2, 2024
b460b4f
compat/mingw: handle WSA errors in strerror
rimrul Dec 22, 2024
acf11e8
survey: add --top=<N> option and config
derrickstolee Sep 23, 2024
27e428f
compat/mingw: drop outdated comment
rimrul Dec 22, 2024
4da203a
survey: clearly note the experimental nature in the output
dscho Jul 1, 2024
ace4563
t0301: actually test credential-cache on Windows
rimrul Dec 29, 2024
84784be
credential-cache: handle ECONNREFUSED gracefully
rimrul Dec 22, 2024
1d52d30
max_tree_depth: lower it for clangarm64 on Windows
dscho Apr 15, 2025
24b3044
reftable: do make sure to use custom allocators
dscho Mar 6, 2025
7cada82
Merge 'remote-hg-prerequisites' into HEAD
dscho Jun 8, 2018
201d5dd
check-whitespace: avoid alerts about upstream commits
dscho Jun 3, 2025
caa7ba0
mingw: avoid the comma operator
dscho Jun 5, 2025
a4d3a73
wincred: Avoid memory corruption
elieux Oct 3, 2025
4a21527
cmake: stop trying to build the reftable and xdiff libraries
dscho Oct 27, 2025
4a6696e
ci(dockerized): do show the result of failing tests again
dscho Nov 3, 2025
2547ade
Merge branch 'drive-prefix'
dscho Jun 8, 2018
ef7e3f3
Merge branch 'dont-clean-junctions'
dscho Jul 30, 2019
097ecf2
Merge branch 'msys2-python'
dscho May 31, 2019
1c199b2
Merge branch 'mimalloc-v2.2.3'
dscho Sep 8, 2022
65f7b1c
Merge pull request #2375 from assarbad/reintroduce-sideband-config
dscho Oct 30, 2019
3fbde77
Merge pull request #2449 from dscho/mingw-getcwd-and-symlinks
dscho Jan 3, 2020
d5e3be9
Merge pull request #2488 from bmueller84/master
dscho Jan 22, 2020
84b76eb
Merge pull request #2501 from jeffhostetler/clink-debug-curl
dscho Jan 30, 2020
b1be2e5
Merge pull request #2504 from dscho/access-repo-via-junction
dscho Feb 1, 2020
0163f52
Merge pull request #2506 from dscho/issue-2283
dscho Feb 11, 2020
297f1e8
Merge pull request #2535 from dscho/schannel-revoke-best-effort
dscho Mar 4, 2020
1f8f9c2
Merge pull request #2618 from dscho/avoid-d/f-conflict-in-vs/master
dscho May 9, 2020
6d75a9a
Merge 'add-p-many-files'
dscho Jun 8, 2018
a48a14f
Merge pull request #2714 from lbonanomi/crlf-scissors
dscho Jul 3, 2020
53c5961
Merge pull request #2655 from jglathe/jg/t0014_trace_extra_info
dscho Oct 9, 2020
42c625e
Merge 'git-gui/js/intent-to-add'
dscho Oct 18, 2020
18cbfc7
Merge pull request #2974 from derrickstolee/maintenance-and-headless
dscho Jan 11, 2021
8722fbf
cmake: install headless-git. (#4338)
dscho Mar 13, 2023
479dadc
Merge pull request #2351 from PhilipOakley/vcpkg-tip
dscho Oct 7, 2019
60d0f3d
Merge pull request #2915 from dennisameling/windows-arm64-support
dscho Dec 9, 2020
ba6d958
Merge pull request #3327 from dennisameling/fix-host-cpu
dscho Jul 19, 2021
057467c
Merge pull request #3165 from dscho/increase-allowed-length-of-interp…
dscho Apr 3, 2021
4e3c484
Merge pull request #3220 from dscho/there-is-no-vs/master-anymore
dscho May 17, 2021
f2af6fa
Merge pull request #3293 from pascalmuller/http-support-automatically…
dscho Jun 24, 2021
e2f94a0
Merge pull request #3349 from vdye/feature/ci-subtree-tests
dscho Aug 10, 2021
3a79d64
Merge pull request #3306 from PhilipOakley/vs-sln
dscho Oct 12, 2021
c210146
Merge pull request #3417 from dscho/initialize-core.symlinks-earlier
dscho Oct 13, 2021
0b537f0
Merge pull request #3533 from PhilipOakley/hashliteral_t
dscho Dec 15, 2021
5a69ac1
Merge pull request #3791: Various fixes around `safe.directory`
derrickstolee Apr 13, 2022
eb5cff4
Merge pull request #3751 from rkitover/native-term
dscho Apr 21, 2022
97c59bd
Merge pull request #3875 from 1480c1/wine/detect_msys_tty
dscho May 30, 2022
af52249
Merge branch 'optionally-dont-append-atomically-on-windows'
dscho Jun 23, 2022
888678e
Merge branch 'fsync-object-files-always'
dscho Oct 11, 2018
c79d740
Merge pull request #3942 from rimrul/mingw-tsaware
dscho Jul 27, 2022
cd4a651
Fix Windows version resources (#4092)
dscho Nov 3, 2022
541d26c
Fix global repository field not being cleared (#4083)
dscho Dec 20, 2022
42acad4
Skip linking the "dashed" `git-<command>`s for built-ins (#4252)
dscho Jan 31, 2023
0435626
Lazy load libcurl, allowing for an SSL/TLS backend-specific libcurl (…
dscho May 15, 2023
22be9ae
Merge branch 'nano-server'
dscho Aug 7, 2023
642fa2c
Additional error checks for issuing the windows.appendAtomically warn…
dscho Aug 7, 2023
05231cd
win32: use native ANSI sequence processing, if possible (#4700)
dscho Dec 2, 2023
17f4427
ARM64: Embed manifest properly (#4718)
dscho Dec 7, 2023
14c90f8
common-main.c: fflush stdout buffer when exit (#4901)
dscho Apr 12, 2024
10b3fdb
Merge branch 'run-t5601-and-t7406-with-symlinks-on-windows-10'
dscho Jul 12, 2024
14be81f
Merge branch 'Fix-i686-build-with-GCC-v14'
dscho Jul 12, 2024
d52dd6f
Merge branch 'Fallback-to-AppData-if-XDG-CONFIG-HOME-is-unset'
dscho Jul 12, 2024
dde91c7
Merge branch 'run-command-be-helpful-when-Git-LFS-fails-on-Windows-7'
dscho Jul 12, 2024
0b5403e
pack-objects: create new name-hash algorithm (#5157)
dscho Sep 24, 2024
514dc7b
Add path walk API and its use in 'git pack-objects' (#5171)
derrickstolee Sep 25, 2024
e04bd60
Add experimental 'git survey' builtin (#5174)
dscho Sep 26, 2024
034d310
credential-cache: handle ECONNREFUSED gracefully (#5329)
dscho Jan 1, 2025
d4c56bd
clangarm64: let the tests pass! (#5586)
dscho Apr 21, 2025
76aae33
Merge branch 'reftable-vs-custom-allocators'
dscho Jun 2, 2025
57c1f48
Merge branch 'check-whitespace-only-downstream'
dscho Jun 3, 2025
2465359
mingw: avoid the comma operator (#5660)
dscho Jun 5, 2025
91be192
wincred: Avoid memory corruption (#5856)
dscho Oct 6, 2025
9c753dd
Merge branch 'adjust-cmake-to-xdiff-and-reftable-merge-into-libgit'
dscho Nov 4, 2025
da376bd
Merge branch 'fix-failure-reporting-in-dockerized-ci'
dscho Nov 4, 2025
cf68e0c
Merge branch 'ready-for-upstream'
dscho Oct 11, 2018
5d9dc33
git-svn: mark it as unsupported by the Git for Windows project
dscho Nov 3, 2025
f1870bb
ci(macos): skip the `git p4` tests
dscho Nov 13, 2025
af77e0d
git-svn: mark it as unsupported by the Git for Windows project (#5923)
dscho Nov 4, 2025
c4b8b2f
ci(macos): skip the `git p4` tests (#5954)
dscho Nov 14, 2025
318047a
Win32: make FILETIME conversion functions public
kblees Jul 6, 2013
325e614
Win32: dirent.c: Move opendir down
kblees Sep 8, 2013
df5e38f
mingw: make the dirent implementation pluggable
kblees Sep 8, 2013
14143dd
git-gui--askyesno: fix funny text wrapping
dscho Sep 20, 2017
c9e86db
Win32: make the lstat implementation pluggable
kblees Sep 8, 2013
f8b490a
git-gui--askyesno (mingw): use Git for Windows' icon, if available
dscho Sep 20, 2017
731539c
mingw: add infrastructure for read-only file system level caches
kblees Sep 8, 2013
c0b5b47
Merge branch 'git-gui-askyesno'
dscho Jun 8, 2018
7c1db29
mingw: add a cache below mingw's lstat and dirent implementations
kblees Oct 1, 2013
40938ff
fscache: load directories only once
kblees Jun 24, 2014
6d8ff51
fscache: add key for GIT_TRACE_FSCACHE
jeffhostetler Jan 24, 2017
8a50efe
fscache: remember not-found directories
jeffhostetler Dec 13, 2016
accdcbd
fscache: add a test for the dir-not-found optimization
dscho Jan 25, 2017
b18f0e5
add: use preload-index and fscache for performance
jeffhostetler Nov 22, 2016
1fe74fa
dir.c: make add_excludes aware of fscache during status
jeffhostetler Nov 1, 2017
4c6b720
fscache: make fscache_enabled() public
jeffhostetler Dec 20, 2017
452e4bd
dir.c: regression fix for add_excludes with fscache
jeffhostetler Dec 20, 2017
e1d9f08
fetch-pack.c: enable fscache for stats under .git/objects
Nov 22, 2017
66a160a
checkout.c: enable fscache for checkout again
Jan 30, 2018
c4b82d9
Enable the filesystem cache (fscache) in refresh_index().
benpeart Sep 7, 2018
d24c19f
fscache: use FindFirstFileExW to avoid retrieving the short name
benpeart Oct 23, 2018
9ac9e20
fscache: add GIT_TEST_FSCACHE support
benpeart Oct 4, 2018
eefbd68
mem_pool: add GIT_TRACE_MEMPOOL support
benpeart Oct 4, 2018
56acd73
fscache: add fscache hit statistics
benpeart Sep 25, 2018
d3cf820
fscache: fscache takes an initial size
benpeart Nov 2, 2018
a7f97ae
unpack-trees: enable fscache for sparse-checkout
derrickstolee Jun 12, 2019
c789ac1
status: disable and free fscache at the end of the status command
benpeart Nov 1, 2018
4e43298
fscache: update fscache to be thread specific instead of global
benpeart Oct 4, 2018
4c5b1e3
fscache: teach fscache to use mempool
benpeart Nov 2, 2018
c045384
fscache: remember the reparse tag for each entry
dscho Dec 11, 2018
6afb01b
fscache: make fscache_enable() thread safe
benpeart Nov 16, 2018
55caebc
fscache: implement an FSCache-aware is_mount_point()
dscho Dec 11, 2018
a47d909
fscache: teach fscache to use NtQueryDirectoryFile
benpeart Nov 15, 2018
19b677a
Merge branch 'fscache'
dscho Nov 15, 2018
9202571
Merge pull request #1909 from benpeart/free-fscache-after-status-gfw
dscho Nov 5, 2018
7fcb2b7
clean: make use of FSCache
dscho Dec 11, 2018
07d70b3
Merge remote-tracking branch 'benpeart/fscache-per-thread-gfw'
dscho Nov 16, 2018
49f00ba
Merge branch 'dont-clean-junctions-fscache'
dscho Jul 23, 2019
496ea4b
pack-objects (mingw): demonstrate a segmentation fault with large deltas
vangdfang Jan 9, 2014
8093ade
mingw: support long paths
kblees Jul 28, 2015
0c8f71e
Win32: fix 'lstat("dir/")' with long paths
kblees Jul 4, 2014
f39a12a
win32(long path support): leave drive-less absolute paths intact
dscho Sep 6, 2023
e8ec49f
mingw: Support `git_terminal_prompt` with more terminals
kblees Mar 19, 2015
7a9af39
compat/fsmonitor/fsm-*-win32: support long paths
jeffhostetler Mar 25, 2022
ad23120
compat/terminal.c: only use the Windows console if bash 'read -r' fails
kblees May 9, 2015
7f78f8c
clean: suggest using `core.longPaths` if paths are too long to remove
mathstuf Apr 22, 2022
c6161dd
mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
dscho Feb 23, 2018
0d976f7
strbuf_readlink: don't call readlink twice if hint is the exact link …
kblees May 11, 2015
bc92f58
strbuf_readlink: support link targets that exceed PATH_MAX
kblees May 11, 2015
e3f79df
lockfile.c: use is_dir_sep() instead of hardcoded '/' checks
kblees May 11, 2015
8de7a37
Win32: don't call GetFileAttributes twice in mingw_lstat()
kblees May 12, 2015
1a21b37
Win32: implement stat() with symlink support
kblees May 15, 2015
f61d707
Win32: remove separate do_lstat() function
kblees May 11, 2015
1af64be
Win32: let mingw_lstat() error early upon problems with reparse points
kblees May 23, 2015
418d5ff
mingw: teach fscache and dirent about symlinks
kblees Jan 10, 2017
b07d268
Win32: lstat(): return adequate stat.st_size for symlinks
kblees May 15, 2015
cc0eb8e
Win32: factor out retry logic
kblees May 19, 2015
5cd3507
Win32: change default of 'core.symlinks' to false
kblees May 23, 2015
4de05f0
Win32: add symlink-specific error codes
kblees May 15, 2015
a74d76c
Win32: mingw_unlink: support symlinks to directories
kblees May 23, 2015
20109e2
Win32: mingw_rename: support renaming symlinks
kblees May 19, 2015
fcaeac9
Win32: mingw_chdir: change to symlink-resolved directory
kblees May 23, 2015
7ef5a5e
Win32: implement readlink()
kblees May 23, 2015
4631988
mingw: lstat: compute correct size for symlinks
billziss-gh May 28, 2020
53891f4
Win32: implement basic symlink() functionality (file symlinks only)
kblees May 23, 2015
914b5a8
Win32: symlink: add support for symlinks to directories
kblees May 23, 2015
e0f2297
mingw: try to create symlinks without elevated permissions
dscho May 30, 2017
96f34f8
mingw: emulate stat() a little more faithfully
dscho Mar 2, 2020
3404c03
mingw: introduce code to detect whether we're inside a Windows container
zcube Apr 23, 2018
ae2f825
mingw: when running in a Windows container, try to rename() harder
zcube Apr 23, 2018
d90febd
mingw: move the file_attr_to_st_mode() function definition
zcube Apr 23, 2018
dcec765
mingw: special-case index entries for symlinks with buggy size
dscho Jun 4, 2020
25cea2a
mingw: Windows Docker volumes are *not* symbolic links
dscho Apr 23, 2018
9e2baae
mingw: work around rename() failing on a read-only file
dsl101 Jul 28, 2023
f8464ec
Win32: symlink: move phantom symlink creation to a separate function
piscisaureus Oct 26, 2018
74b0e01
Introduce helper to create symlinks that knows about index_state
dscho Feb 11, 2019
1f5deb0
mingw: explicitly specify with which cmd to prefix the cmdline
dscho Jul 20, 2017
bd18984
mingw: allow to specify the symlink type in .gitattributes
piscisaureus Oct 26, 2018
a36ee0d
mingw: when path_lookup() failed, try BusyBox
dscho Jul 20, 2017
6c651e6
Win32: symlink: add test for `symlink` attribute
piscisaureus Oct 26, 2018
ad99b08
test-tool: learn to act as a drop-in replacement for `iconv`
dscho Jul 20, 2017
b2ca295
tests(mingw): if `iconv` is unavailable, use `test-helper --iconv`
dscho Jul 20, 2017
99f4a2d
gitattributes: mark .png files as binary
dscho Oct 11, 2018
aca812d
tests: move test PNGs into t/lib-diff/
dscho Aug 5, 2017
1f8c540
tests: only override sort & find if there are usable ones in /usr/bin/
dscho Jul 17, 2017
1c392f5
tests: use the correct path separator with BusyBox
dscho Nov 19, 2018
f2638ab
mingw: only use Bash-ism `builtin pwd -W` when available
dscho Jun 29, 2017
74b42e2
tests (mingw): remove Bash-specific pwd option
dscho Jun 30, 2017
78084cd
test-lib: add BUSYBOX prerequisite
dscho Jul 19, 2017
194fa5b
t5003: use binary file from t/lib-diff/
dscho Aug 5, 2017
5f77614
t5532: workaround for BusyBox on Windows
dscho Jul 21, 2017
2ecb94f
t5605: special-case hardlink test for BusyBox-w32
dscho Jul 21, 2017
4be9142
t5813: allow for $PWD to be a Windows path
dscho Jul 5, 2017
7602832
t9200: skip tests when $PWD contains a colon
dscho Jul 7, 2017
367c0ca
mingw: add a Makefile target to copy test artifacts
dscho Jul 19, 2017
0a0232d
mingw: kill child processes in a gentler way
dscho May 17, 2017
75248bf
mingw: optionally enable wsl compability file mode bits
swigger Jun 7, 2023
40965ca
mingw: really handle SIGINT
dscho Apr 22, 2018
11ed93d
mingw: do not call xutftowcs_path in mingw_mktemp
neerajsi-msft Oct 27, 2021
6f8bdde
Partially un-revert "editor: save and reset terminal after calling ED…
dscho Nov 25, 2021
4e79029
reset: reinstate support for the deprecated --stdin option
dscho Dec 10, 2019
0e6a045
fsmonitor: reintroduce core.useBuiltinFSMonitor
vdye Apr 4, 2022
5fc4037
Describe Git for Windows' architecture [no ci]
dscho Feb 13, 2023
1b45425
Modify the Code of Conduct for Git for Windows
dscho Oct 11, 2019
5e5b765
CONTRIBUTING.md: add guide for first-time contributors
derrickstolee Mar 1, 2018
7dd942a
README.md: Add a Windows-specific preamble
dscho Jan 10, 2014
03c83c5
Add an issue template
shiftkey Feb 18, 2016
4739f76
Add a GitHub workflow to monitor component updates
dscho Sep 29, 2020
51b26a1
Modify the GitHub Pull Request template (to reflect Git for Windows)
Dec 22, 2017
ad9803b
dependabot: help keeping GitHub Actions versions up to date
dscho Feb 6, 2024
508a595
Merge branch 'gitk-and-git-gui-patches'
dscho Oct 11, 2018
30dfc9d
Merge branch 'long-paths'
dscho Nov 15, 2018
2b06ab0
SECURITY.md: document Git for Windows' policies
dscho Aug 23, 2019
ccb9b47
Merge branch 'msys2'
dscho Nov 15, 2018
528332d
Merge branch 'kblees/kb/symlinks'
dscho Nov 15, 2018
395d3c4
Merge 'docker-volumes-are-no-symlinks'
dscho Oct 12, 2018
0cc377d
mingw: try resetting the read-only bit if rename fails (#4527)
dscho Aug 7, 2023
92b1d95
Merge pull request #1897 from piscisaureus/symlink-attr
dscho Oct 31, 2018
7730b8f
Merge branch 'busybox-w32'
dscho Feb 7, 2019
a4944b2
Merge branch 'wsl-file-mode-bits'
dscho Aug 7, 2023
f34df8b
Merge pull request #1170 from dscho/mingw-kill-process
dscho Oct 11, 2018
c92a7ce
Merge pull request #3492 from dscho/ns/batched-fsync
vdye Oct 28, 2021
b68b041
Merge branch 'un-revert-editor-save-and-reset'
dscho Jan 15, 2022
48e659d
Merge branch 'phase-out-reset-stdin'
dscho Jun 8, 2018
b4697e6
Merge branch 'deprecate-core.useBuiltinFSMonitor'
dscho Jan 24, 2023
bd1f83a
Merge pull request #2837 from dscho/monitor-component-updates
dscho Oct 7, 2020
2912d8e
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
11 changes: 7 additions & 4 deletions Documentation/RelNotes/2.52.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ UI, Workflows & Features
* A new command "git last-modified" has been added to show the closest
ancestor commit that touched each path.

* "git refs exists" that works like "git show-ref --exists" has been
added.
* The "git refs exists" command that works like "git show-ref --exists"
has been added.

* "repo info" learns a short-hand option "-z" that is the same as
* "git repo info" learns the short-hand option "-z" that is the same as
"--format=nul", and learns to report the objects format used in the
repository.

Expand Down Expand Up @@ -53,7 +53,7 @@ UI, Workflows & Features

* Configuration variables that take a pathname as a value
(e.g. blame.ignorerevsfile) can be marked as optional by prefixing
":(optoinal)" before its value.
":(optional)" before its value.

* Show 'P'ipe command in "git add -p".

Expand Down Expand Up @@ -433,7 +433,10 @@ including security updates, are included in this release.

* The version of macos image used in GitHub CI has been updated to
macos-14, as the macos-13 that we have been using got deprecated.
Perforce binary used there has been changed to arm64 version to
match.
(merge 73b9cdb7c4 jc/ci-use-macos-14 later to maint).
(merge ffff0bb0da jc/ci-use-arm64-p4-on-macos later to maint).

* Other code cleanup, docfix, build fix, etc.
(merge 529a60a885 ua/t1517-short-help-tests later to maint).
Expand Down
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

DEF_VER=v2.52.0-rc2
DEF_VER=v2.52.0

LF='
'
Expand Down
250 changes: 235 additions & 15 deletions builtin/last-modified.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@
#include "bloom.h"
#include "builtin.h"
#include "commit-graph.h"
#include "commit-slab.h"
#include "commit.h"
#include "config.h"
#include "environment.h"
#include "diff.h"
#include "diffcore.h"
#include "environment.h"
#include "ewah/ewok.h"
#include "hashmap.h"
#include "hex.h"
#include "log-tree.h"
#include "object-name.h"
#include "object.h"
#include "parse-options.h"
#include "prio-queue.h"
#include "quote.h"
#include "repository.h"
#include "revision.h"

/* Remember to update object flag allocation in object.h */
#define PARENT1 (1u<<16) /* used instead of SEEN */
#define PARENT2 (1u<<17) /* used instead of BOTTOM, BOUNDARY */

struct last_modified_entry {
struct hashmap_entry hashent;
struct object_id oid;
struct bloom_key key;
size_t diff_idx;
const char path[FLEX_ARRAY];
};

Expand All @@ -37,13 +43,45 @@ static int last_modified_entry_hashcmp(const void *unused UNUSED,
return strcmp(ent1->path, path ? path : ent2->path);
}

/*
* Hold a bitmap for each commit we're working with. In the bitmap, each bit
* represents a path in `lm->all_paths`. An active bit indicates the path still
* needs to be associated to a commit.
*/
define_commit_slab(active_paths_for_commit, struct bitmap *);

struct last_modified {
struct hashmap paths;
struct rev_info rev;
bool recursive;
bool show_trees;

const char **all_paths;
size_t all_paths_nr;
struct active_paths_for_commit active_paths;

/* 'scratch' to avoid allocating a bitmap every process_parent() */
struct bitmap *scratch;
};

static struct bitmap *active_paths_for(struct last_modified *lm, struct commit *c)
{
struct bitmap **bitmap = active_paths_for_commit_at(&lm->active_paths, c);
if (!*bitmap)
*bitmap = bitmap_word_alloc(lm->all_paths_nr / BITS_IN_EWORD + 1);

return *bitmap;
}

static void active_paths_free(struct last_modified *lm, struct commit *c)
{
struct bitmap **bitmap = active_paths_for_commit_at(&lm->active_paths, c);
if (*bitmap) {
bitmap_free(*bitmap);
*bitmap = NULL;
}
}

static void last_modified_release(struct last_modified *lm)
{
struct hashmap_iter iter;
Expand All @@ -54,6 +92,8 @@ static void last_modified_release(struct last_modified *lm)

hashmap_clear_and_free(&lm->paths, struct last_modified_entry, hashent);
release_revisions(&lm->rev);

free(lm->all_paths);
}

struct last_modified_callback_data {
Expand Down Expand Up @@ -146,7 +186,7 @@ static void mark_path(const char *path, const struct object_id *oid,
* Is it arriving at a version of interest, or is it from a side branch
* which did not contribute to the final state?
*/
if (!oideq(oid, &ent->oid))
if (oid && !oideq(oid, &ent->oid))
return;

last_modified_emit(data->lm, path, data->commit);
Expand Down Expand Up @@ -196,7 +236,17 @@ static void last_modified_diff(struct diff_queue_struct *q,
}
}

static bool maybe_changed_path(struct last_modified *lm, struct commit *origin)
static void pass_to_parent(struct bitmap *c,
struct bitmap *p,
size_t pos)
{
bitmap_unset(c, pos);
bitmap_set(p, pos);
}

static bool maybe_changed_path(struct last_modified *lm,
struct commit *origin,
struct bitmap *active)
{
struct bloom_filter *filter;
struct last_modified_entry *ent;
Expand All @@ -213,49 +263,212 @@ static bool maybe_changed_path(struct last_modified *lm, struct commit *origin)
return true;

hashmap_for_each_entry(&lm->paths, &iter, ent, hashent) {
if (active && !bitmap_get(active, ent->diff_idx))
continue;

if (bloom_filter_contains(filter, &ent->key,
lm->rev.bloom_filter_settings))
return true;
}
return false;
}

static void process_parent(struct last_modified *lm,
struct prio_queue *queue,
struct commit *c, struct bitmap *active_c,
struct commit *parent, int parent_i)
{
struct bitmap *active_p;

repo_parse_commit(lm->rev.repo, parent);
active_p = active_paths_for(lm, parent);

/*
* The first time entering this function for this commit (i.e. first parent)
* see if Bloom filters will tell us it's worth to do the diff.
*/
if (parent_i || maybe_changed_path(lm, c, active_c)) {
diff_tree_oid(&parent->object.oid,
&c->object.oid, "", &lm->rev.diffopt);
diffcore_std(&lm->rev.diffopt);
}

/*
* Test each path for TREESAME-ness against the parent. If a path is
* TREESAME, pass it on to this parent.
*
* First, collect all paths that are *not* TREESAME in 'scratch'.
* Then, pass paths that *are* TREESAME and active to the parent.
*/
for (int i = 0; i < diff_queued_diff.nr; i++) {
struct diff_filepair *fp = diff_queued_diff.queue[i];
const char *path = fp->two->path;
struct last_modified_entry *ent =
hashmap_get_entry_from_hash(&lm->paths, strhash(path), path,
struct last_modified_entry, hashent);
if (ent) {
size_t k = ent->diff_idx;
if (bitmap_get(active_c, k))
bitmap_set(lm->scratch, k);
}
}
for (size_t i = 0; i < lm->all_paths_nr; i++) {
if (bitmap_get(active_c, i) && !bitmap_get(lm->scratch, i))
pass_to_parent(active_c, active_p, i);
}

/*
* If parent has any active paths, put it on the queue (if not already).
*/
if (!bitmap_is_empty(active_p) && !(parent->object.flags & PARENT1)) {
parent->object.flags |= PARENT1;
prio_queue_put(queue, parent);
}
if (!(parent->object.flags & PARENT1))
active_paths_free(lm, parent);

memset(lm->scratch->words, 0x0, lm->scratch->word_alloc);
diff_queue_clear(&diff_queued_diff);
}

static int last_modified_run(struct last_modified *lm)
{
int max_count, queue_popped = 0;
struct prio_queue queue = { compare_commits_by_gen_then_commit_date };
struct prio_queue not_queue = { compare_commits_by_gen_then_commit_date };
struct commit_list *list;
struct last_modified_callback_data data = { .lm = lm };

lm->rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
lm->rev.diffopt.format_callback = last_modified_diff;
lm->rev.diffopt.format_callback_data = &data;
lm->rev.no_walk = 1;

prepare_revision_walk(&lm->rev);

while (hashmap_get_size(&lm->paths)) {
data.commit = get_revision(&lm->rev);
if (!data.commit)
BUG("paths remaining beyond boundary in last-modified");
max_count = lm->rev.max_count;

init_active_paths_for_commit(&lm->active_paths);
lm->scratch = bitmap_word_alloc(lm->all_paths_nr);

/*
* lm->rev.commits holds the set of boundary commits for our walk.
*
* Loop through each such commit, and place it in the appropriate queue.
*/
for (list = lm->rev.commits; list; list = list->next) {
struct commit *c = list->item;

if (c->object.flags & BOTTOM) {
prio_queue_put(&not_queue, c);
c->object.flags |= PARENT2;
} else if (!(c->object.flags & PARENT1)) {
/*
* If the commit is a starting point (and hasn't been
* seen yet), then initialize the set of interesting
* paths, too.
*/
struct bitmap *active;

prio_queue_put(&queue, c);
c->object.flags |= PARENT1;

active = active_paths_for(lm, c);
for (size_t i = 0; i < lm->all_paths_nr; i++)
bitmap_set(active, i);
}
}

if (data.commit->object.flags & BOUNDARY) {
while (queue.nr) {
int parent_i;
struct commit_list *p;
struct commit *c = prio_queue_get(&queue);
struct bitmap *active_c = active_paths_for(lm, c);

if ((0 <= max_count && max_count < ++queue_popped) ||
(c->object.flags & PARENT2)) {
/*
* Either a boundary commit, or we have already seen too
* many others. Either way, stop here.
*/
c->object.flags |= PARENT2 | BOUNDARY;
data.commit = c;
diff_tree_oid(lm->rev.repo->hash_algo->empty_tree,
&data.commit->object.oid, "",
&lm->rev.diffopt);
&c->object.oid,
"", &lm->rev.diffopt);
diff_flush(&lm->rev.diffopt);
goto cleanup;
}

break;
/*
* Otherwise, make sure that 'c' isn't reachable from anything
* in the '--not' queue.
*/
repo_parse_commit(lm->rev.repo, c);

while (not_queue.nr) {
struct commit_list *np;
struct commit *n = prio_queue_get(&not_queue);

repo_parse_commit(lm->rev.repo, n);

for (np = n->parents; np; np = np->next) {
if (!(np->item->object.flags & PARENT2)) {
prio_queue_put(&not_queue, np->item);
np->item->object.flags |= PARENT2;
}
}

if (commit_graph_generation(n) < commit_graph_generation(c))
break;
}

if (!maybe_changed_path(lm, data.commit))
continue;
/*
* Look at each parent and pass on each path that's TREESAME
* with that parent. Stop early when no active paths remain.
*/
for (p = c->parents, parent_i = 0; p; p = p->next, parent_i++) {
process_parent(lm, &queue,
c, active_c,
p->item, parent_i);

if (bitmap_is_empty(active_c))
break;
}

/*
* Paths that remain active, or not TREESAME with any parent,
* were changed by 'c'.
*/
if (!bitmap_is_empty(active_c)) {
data.commit = c;
for (size_t i = 0; i < lm->all_paths_nr; i++) {
if (bitmap_get(active_c, i))
mark_path(lm->all_paths[i], NULL, &data);
}
}

log_tree_commit(&lm->rev, data.commit);
cleanup:
active_paths_free(lm, c);
}

if (hashmap_get_size(&lm->paths))
BUG("paths remaining beyond boundary in last-modified");

clear_prio_queue(&not_queue);
clear_prio_queue(&queue);
clear_active_paths_for_commit(&lm->active_paths);
bitmap_free(lm->scratch);

return 0;
}

static int last_modified_init(struct last_modified *lm, struct repository *r,
const char *prefix, int argc, const char **argv)
{
struct hashmap_iter iter;
struct last_modified_entry *ent;

hashmap_init(&lm->paths, last_modified_entry_hashcmp, NULL, 0);

repo_init_revisions(r, &lm->rev, prefix);
Expand All @@ -280,6 +493,13 @@ static int last_modified_init(struct last_modified *lm, struct repository *r,
if (populate_paths_from_revs(lm) < 0)
return error(_("unable to setup last-modified"));

CALLOC_ARRAY(lm->all_paths, hashmap_get_size(&lm->paths));
lm->all_paths_nr = 0;
hashmap_for_each_entry(&lm->paths, &iter, ent, hashent) {
ent->diff_idx = lm->all_paths_nr++;
lm->all_paths[ent->diff_idx] = ent->path;
}

return 0;
}

Expand Down
Loading
Loading