Repository navigation
Conversation
Prep for the upcoming read_blob_data_from_index() widening, whose callers in convert.c feed the size they receive straight into these two helpers. Both are file-static, so the change is contained. Also fixes a small pre-existing narrowing on the get_wt_convert_stats_ascii() path, where strbuf.len (size_t) was passed to a unsigned long parameter. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Continue the size_t evacuation. read_blob_data_from_index() reads the blob through the size_t odb_read_object() API but writes the size back through an unsigned long out-parameter, silently truncating anything past 4 GiB on Windows. Widen the out-parameter, drop the cast_size_t_to_ulong() shim, and move the matching locals in the two convert.c callers and the one in attr.c. Their downstream consumers (gather_convert_stats() widened in the prior commit and read_attr_from_buf() already size_t) take the new type directly. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Prep for the widenings of its callers, where size-receiving locals will become size_t (combine-diff's result_size in the immediately following commit, struct diff_filespec.size in a later topic). Body caps the parameter at 8000 anyway, so the type change is mechanical. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This will come in handy in the next commit. Signed-off-by: JiSeop Moon <zcube@zcube.kr> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Bert Belder <bertbelder@gmail.com>
Continue the size_t evacuation. With buffer_is_binary() widened in the prior commit, every consumer that the size flows into in combine-diff.c is size_t-ready, so widen grab_blob()'s out-param outright and move the matching locals at its three call sites together. grab_blob()'s body collapses to a direct odb_read_object(&size) since the bridge variable is no longer needed. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `git_terminal_prompt()` function expects the terminal window to be attached to a Win32 Console. However, this is not the case with terminal windows other than `cmd.exe`'s, e.g. with MSys2's own `mintty`. Non-cmd terminals such as `mintty` still have to have a Win32 Console to be proper console programs, but have to hide the Win32 Console to be able to provide more flexibility (such as being resizeable not only vertically but also horizontally). By writing to that Win32 Console, `git_terminal_prompt()` manages only to send the prompt to nowhere and to wait for input from a Console to which the user has no access. This commit introduces a function specifically to support `mintty` -- or other terminals that are compatible with MSys2's `/dev/tty` emulation. We use the `TERM` environment variable as an indicator for that: if the value starts with "xterm" (such as `mintty`'s "xterm_256color"), we prefer to let `xterm_prompt()` handle the user interaction. The most prominent user of `git_terminal_prompt()` is certainly `git-remote-https.exe`. It is an interesting use case because both `stdin` and `stdout` are redirected when Git calls said executable, yet it still wants to access the terminal. When running inside a `mintty`, the terminal is not accessible to the `git-remote-https.exe` program, though, because it is a MinGW program and the `mintty` terminal is not backed by a Win32 console. To solve that problem, we simply call out to the shell -- which is an *MSys2* program and can therefore access `/dev/tty`. Helped-by: nalla <nalla@hamal.uberspace.de> Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is a known issue that a rename() can fail with an "Access denied" error at times, when copying followed by deleting the original file works. Let's just fall back to that behavior. Signed-off-by: JiSeop Moon <zcube@zcube.kr> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, symbolic links actually have a type depending on the target: it can be a file or a directory. In certain circumstances, this poses problems, e.g. when a symbolic link is supposed to point into a submodule that is not checked out, so there is no way for Git to auto-detect the type. To help with that, we will add support over the course of the next commits to specify that symlink type via the Git attributes. This requires an index_state, though, something that Git for Windows' `symlink()` replacement cannot know about because the function signature is defined by the POSIX standard and not ours to change. So let's introduce a helper function to create symbolic links that *does* know about the index_state. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Continue the size_t evacuation. textconv_object() fills its out-parameter from fill_textconv()'s size_t return through an unsigned long*; widen the API to match, then take advantage of the new shape where callers can. cat-file's 'c' and batch-mode 'c' branches lose their size_ul bridge variables (one site becomes a direct call, the other collapses an if/else into a single negated condition that reads as "try textconv, fall back to a raw read"). blame.c likewise drops the file_size_st bridge in fill_origin_blob() and hoists final_buf_size_st to bracket both branches in setup_scoreboard(). The latter keeps a cast_size_t_to_ulong() shim because struct blame_scoreboard.final_buf_size is still unsigned long; that field is its own topic. log.c just widens its local from unsigned long to size_t. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Accessing the Windows console through the special CONIN$ / CONOUT$ devices doesn't work properly for non-ASCII usernames an passwords. It also doesn't work for terminal emulators that hide the native console window (such as mintty), and 'TERM=xterm*' is not necessarily a reliable indicator for such terminals. The new shell_prompt() function, on the other hand, works fine for both MSys1 and MSys2, in native console windows as well as mintty, and properly supports Unicode. It just needs bash on the path (for 'read -s', which is bash-specific). On Windows, try to use the shell to read from the terminal. If that fails with ENOENT (i.e. bash was not found), use CONIN/OUT as fallback. Note: To test this, create a UTF-8 credential file with non-ASCII chars, e.g. in git-bash: 'echo url=http://täst.com > cred.txt'. Then in git-cmd, 'git credential fill <cred.txt' works (shell version), while calling git without the git-wrapper (i.e. 'mingw64\bin\git credential fill <cred.txt') mangles non-ASCII chars in both console output and input. Signed-off-by: Karsten Blees <blees@dcon.de>
In preparation for making this function a bit more complicated (to allow for special-casing the `ContainerMappedDirectories` in Windows containers, which look like a symbolic link, but are not), let's move it out of the header. Signed-off-by: JiSeop Moon <zcube@zcube.kr> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, symbolic links have a type: a "file symlink" must point at a file, and a "directory symlink" must point at a directory. If the type of symlink does not match its target, it doesn't work. Git does not record the type of symlink in the index or in a tree. On checkout it'll guess the type, which only works if the target exists at the time the symlink is created. This may often not be the case, for example when the link points at a directory inside a submodule. By specifying `symlink=file` or `symlink=dir` the user can specify what type of symlink Git should create, so Git doesn't have to rely on unreliable heuristics. Signed-off-by: Bert Belder <bertbelder@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It seems to be not exactly rare on Windows to install NTFS junction points (the equivalent of "bind mounts" on Linux/Unix) in worktrees, e.g. to map some development tools into a subdirectory. In such a scenario, it is pretty horrible if `git clean -dfx` traverses into the mapped directory and starts to "clean up". Let's just not do that. Let's make sure before we traverse into a directory that it is not a mount point (or junction). This addresses git-for-windows#607 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Smallest piece of the tree topic. link_len is only used as strbuf_splice()'s size_t length and as an array index; widening it outright removes the cast_size_t_to_ulong() shim and the bridge local that fed it. odb_read_object() now writes straight into link_len. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Same theme as the preceding pack-objects series: get_size_by_pos() returns an unsigned long but reads its size out of packed_object_info() / odb_read_object_info_extended() via a size_t out-parameter, so on Windows it would silently truncate the very sizes filter_bitmap_blob_limit() then compares against the --filter=blob:limit threshold to decide which blobs to elide from the bitmap-backed traversal. Drop the cast_size_t_to_ulong() and return size_t directly. The two callers' limit comparison promotes to size_t cleanly. limit itself stays unsigned long; it is part of a filter API ripple of its own. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Continue the size_t evacuation. The struct field already receives its writes from a size_t-shaped source (xsize_t(st.st_size), strbuf.len, fill_textconv()'s return, odb_read_object_info_extended() via oi.sizep), so on Windows it was already truncating anything past 4 GiB silently on the strbuf and textconv paths and loudly through cast_size_t_to_ulong() on the odb path. Switch the field to size_t. In diff_populate_filespec(), point oi.sizep at the field directly and drop both cast_size_t_to_ulong() shims and the size_st bridge they fed. Downstream consumers that still read .size into unsigned long locals will now silently narrow on Windows where the field exceeds 4 GiB. Each of those is its own follow-up; the writer side is the prerequisite for ever putting a >4 GiB value in the field in the first place. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
To support Git Bash running in a MinTTY, we use a dirty trick to access the MSYS2 pseudo terminal: we execute a Bash snippet that accesses /dev/tty. The idea was to fall back to writing to/reading from CONOUT$/CONIN$ if that Bash call failed because Bash was not found. However, we should fall back even in other error conditions, because we have not successfully read the user input. Let's make it so. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
... even if they may look like them. As looking up the target of the "symbolic link" (just to see whether it starts with `/ContainerMappedDirectories/`) is pretty expensive, we do it when we can be *really* sure that there is a possibility that this might be the case. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: JiSeop Moon <zcube@zcube.kr>
At least on _some_ APFS network shares, Git fails to rename the object files because they are marked as read-only, because that has the effect of setting the uchg flag on APFS, which then means the file can't be renamed or deleted. To work around that, when a rename failed, and the read-only flag is set, try to turn it off and on again. This fixes git-for-windows#4482 Signed-off-by: David Lomas <dl3@pale-eds.co.uk> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To verify that the symlink is resolved correctly, we use the fact that `git.exe` is a native Win32 program, and that `git.exe config -f <path>` therefore uses the native symlink resolution. Signed-off-by: Bert Belder <bertbelder@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Windows' equivalent to "bind mounts", NTFS junction points, can be unlinked without affecting the mount target. This is clearly what users expect to happen when they call `git clean -dfx` in a worktree that contains NTFS junction points: the junction should be removed, and the target directory of said junction should be left alone (unless it is inside the worktree). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The Windows Subsystem for Linux (WSL) version 2 allows to use `chmod` on NTFS volumes provided that they are mounted with metadata enabled (see https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/ for details), for example: $ chmod 0755 /mnt/d/test/a.sh In order to facilitate better collaboration between the Windows version of Git and the WSL version of Git, we can make the Windows version of Git also support reading and writing NTFS file modes in a manner compatible with WSL. Since this slightly slows down operations where lots of files are created (such as an initial checkout), this feature is only enabled when `core.WSLCompat` is set to true. Note that you also have to set `core.fileMode=true` in repositories that have been initialized without enabling WSL compatibility. There are several ways to enable metadata loading for NTFS volumes in WSL, one of which is to modify `/etc/wsl.conf` by adding: ``` [automount] enabled = true options = "metadata,umask=027,fmask=117" ``` And reboot WSL. It can also be enabled temporarily by this incantation: $ sudo umount /mnt/c && sudo mount -t drvfs C: /mnt/c -o metadata,uid=1000,gid=1000,umask=22,fmask=111 It's important to note that this modification is compatible with, but does not depend on WSL. The helper functions in this commit can operate independently and functions normally on devices where WSL is not installed or properly configured. Signed-off-by: xungeng li <xungeng@gmail.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This corresponds to the fixes in TortoiseGit v2.19 that were announced in https://groups.google.com/g/tortoisegit-announce/c/31zdmOBi4vY. The threat surface in Git for Windows is a lot smaller than in TortoiseGit because Git is not integrated directly into the Windows Explorer and hence does not run automatically on any extracted archive. A Git user would have to run Git operations on an extracted archive of dubious origin, which is never a good idea. In all other circumstances, the `.git` files Git would see would always be written by Git for Windows itself, which will never write `.git` files containing invalid paths (or paths pointing to other servers). For this reason, it was deemed okay to integrate this change as a regular patch. Signed-off-by: Sven Strickroth <email@cs-ware.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
With init_tree_desc() widened in the prior commit, the size_t-returning odb_read_object_peeled() call in add_preferred_base() and odb_read_object() call in pbase_tree_get() can both flow straight through to init_tree_desc() and into the pbase_tree_cache. Widen pbase_tree_cache.tree_size and the two local size variables to size_t, drop the size_st bridges, and drop the two cast_size_t_to_ulong() shims. This was the last pair of cast_size_t_to_ulong() call sites in builtin/pack-objects.c, completing the >4 GiB-objects work in that file that this branch and its predecessors have been pursuing. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Continue the migration from `unsigned long` to `size_t`. The `size` attribute of `struct commit_buffer` is fed either from `odb_read_object()`'s return value (`size_t`, handled with `cast_size_t_to_ulong()`) or from `strbuf.len` in `fake_working_tree_commit()` (silently narrowed today). Widen the field and a couple of function signatures together, drop the shim in `repo_get_commit_buffer()`, and move the matching `unsigned long` locals at the in-tree callers in commit.c (three sites), builtin/replace.c, and builtin/stash.c (two sites). The remaining callers pass NULL or already pass a size_t-compatible variable. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Prep for the upcoming blame_scoreboard.final_buf_size widening: prepare_lines() will pass a size_t through to find_line_starts(), and the other caller (fill_origin_blob() via o->file.size) already goes through long->size_t promotion. The function is file-static and only uses len as a loop bound. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit continue the migration from `unsigned long` to `size_t`, converting `grep_buffer()` and helpers. The callers are already prepared for this change. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Mirror of the preceding fast-import sweep. anonymize_blob() writes strbuf.len (size_t) into its out-parameter, and export_blob()'s non-anonymize branch reads odb_read_object()'s size_t out-parameter through a size_st + cast_size_t_to_ulong() bridge into an unsigned long local; both have been silent on Windows past 4 GiB. Widen the helper signature and the local, and drop the bridge. check_object_signature() and parse_object_buffer() still take unsigned long, so the silent narrowing on Windows just moves from the local assignment to those call sites; both are separate topics. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Continue the size_t evacuation. count_objects() feeds the inflated size from odb_read_object_info_extended()'s size_t out-parameter into struct object_values (size_t) and check_largest() (size_t) through an unsigned long bridge with a cast_size_t_to_ulong() shim. The bridge was the only narrow link in the chain. Widen the local, point oi.sizep at it directly, and drop the cast. parse_object_buffer() still takes unsigned long, so a Windows narrowing remains at that one call; that is its own follow-up topic. Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Process-tree cleanup can kill an older, unrelated orphan when Windows assigns the cleanup target a PID formerly held by the orphan's parent. Matching a parent PID alone does not prove ancestry; see git-for-windows#6435. Use `NtQuerySystemInformation` with `SystemProcessInformation` to obtain creation times alongside PID and parent PID without opening processes during discovery. Reject candidates that predate their claimed parents. Record a UTC `FILETIME` with `GetSystemTimeAsFileTime()` immediately before each query attempt and use the successful attempt's cutoff. Reject entries whose recorded creation time is at or after that cutoff. Windows records the `KeQuerySystemTime()` value at process creation and leaves it unchanged when system time is adjusted, as documented here: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-psgetprocesscreatetimequadpart `GetSystemTimePreciseAsFileTime()` adds elapsed time since the last tick. A process born after the sample within that tick can therefore appear older than the cutoff. Use the same tick-based clock as process creation; Microsoft documents the distinction here: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-kequerysystemtimeprecise Rejecting equality also excludes genuine children created in the capture-start tick. This conservative choice needs no waits or extra handles during cleanup. Only terminate a descendant if `GetProcessTimes()` on its termination handle reports the exact creation time captured for that PID. This rejects replacements from PID reuse after capture. The root's held handle pins its PID. Assisted-by: GPT-6.1 Sol Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, `poll()` in `compat/poll/poll.c` waits with `MsgWaitForMultipleObjects()` and pumps window messages with `PeekMessage()`, `TranslateMessage()` and `DispatchMessage()`. These are the only functions `git.exe` imports from user32.dll, so every Git process loads user32, and with it gdi32, gdi32full, win32u and imm32, even though most commands never call `poll()`. This loads the four functions with the existing `lazyload.h` helpers the first time `poll()` runs. If user32 cannot be loaded, the process cannot have a message queue to pump, so it waits with `WaitForMultipleObjects()`. `git.exe` then maps 17 images for `git --version` instead of 23. On a Windows 11 desktop, built from v2.55.0.windows.5 with and without the change, 100 interleaved runs each: | | before | after | saved | |---|---:|---:|---:| | `git --version` | 15.5 ms | 13.2 ms | 2.2 ms [2.0, 2.4] | | `git rev-parse --git-dir` | 17.5 ms | 15.2 ms | 2.3 ms [2.0, 2.4] | | `git status --short` | 48.5 ms | 46.2 ms | 2.0 ms [1.7, 2.2] | | `git log -1 --oneline` | 20.4 ms | 18.0 ms | 2.3 ms [2.0, 2.5] | `t0061-run-command`, `t5400-send-pack` and `t5601-clone` pass with the change, on the release and on main. The same code is in upstream Git, so I can send it to the mailing list too if you prefer it to go upstream first. I used GitHub Copilot to help investigate and prepare this change. I have reviewed and tested it.
This bumps `actions/setup-python from version 6 to 7. The main change is that this is now an ECMAScript Module, which bumps the minimum requirements for GitHub Enterprise Server setups enough to warrant a full major version bump. Release notes: https://github.com/actions/setup-python/releases Commits: actions/setup-python@v6...v7 Originally-authored-by: dependabot[bot] <support@github.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Git for Windows should retain its existing collision detector while making accelerated C and Rust selectable at runtime. Keep original C as the default, including in Rust-enabled builds, and retain accelerated C when Rust is disabled. Rust SHA1DC needs Rust 1.87, while Git's other Rust components support Rust 1.49. Preserve the separate DC_SHA1_RS opt-in rather than raising the compiler requirement for all Rust-enabled builds. Backend selection must be thread-safe and must not cache incomplete repository configuration. Trace2 hashes the hostname before command-line and repository setup, so that startup hash must not freeze the choice. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…windows#6493) Windows can reuse the PID of an orphan's dead parent for a process Git is cleaning up. Our process-tree traversal currently matches only the parent PID, so it can mistake that unrelated orphan and its descendants for processes Git should terminate. Let's exclude reused PIDs by ensuring that the process creation time matches the one obtained together with the PID when the process tree was enumerated, by switching to `NtQuerySystemInformation()` to obtain creation times alongside parent PIDs. Candidates must not predate their claimed parents, and their recorded creation times must precede the snapshot-start cutoff. When opening a descendant for termination, its creation time must match the captured value, so a reused PID does not select a different process. This should also fix a frequent flake in VFS for Git's Functional Tests. This supersedes the process-tree cleanup proposal in the following PR: git-for-windows#6474. That approach opens candidates during discovery and retains a handle for every accepted descendant. Here, discovery opens no process handles, and each descendant is opened only once, at termination. Handle usage stays bounded by the root plus one temporary handle rather than growing with the tree. The independent growable-storage change is a separate commit. This fixes git-for-windows#6435.
Exercise the optional Rust SHA1DC backend in the existing Make-based Windows artifact tests when Rust 1.87.0 or newer is available. Otherwise, those tests do not exercise the Rust backend at runtime. The C backend remains the runtime default, and the standalone Rust 1.49 minimum-version job is unaffected. Assisted-by: GPT-6.2 Sol Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
…r-windows#6358) ## Summary As reported in git-for-windows#6475, on native Windows, `git_shell_path()` assumes that `locate_in_PATH("sh")` always succeeds and passes its result directly to `convert_slashes()`. If `sh` is absent from `PATH`, the lookup returns `NULL` and Git terminates with an access violation. Check the lookup result and report a fatal error instead: ``` fatal: cannot find 'sh' in PATH ``` This prevents the NULL dereference. It does not add a shell fallback, so commands requiring a shell still fail when no shell is available. ## Crash analysis The failure was reproduced in `git-remote-https.exe` from Git for Windows 2.55.0.windows.3. ProcDump captured the unhandled exception: ```text Process: git-remote-https.exe (97196) Process image: C:\Program Files\Git\mingw64\libexec\git-core\git-remote-https.exe Exception monitor: Unhandled [21:32:43]Exception: C0000005.ACCESS_VIOLATION [21:32:43]Unhandled: C0000005.ACCESS_VIOLATION [21:32:43]Dump 1 initiated: D:\Libraries\Downloads\git-remote-https-crash.dmp [21:32:44]Dump 1 writing: Estimated dump file size is 47 MB. [21:32:44]Dump 1 complete: 47 MB written in 0.6 seconds ``` The dump confirms that the faulting instruction attempted to read through `RAX` while `RAX` was zero: ```text C0000005.ACCESS_VIOLATION RAX=0000000000000000 movzx edx, byte ptr [rax] ``` Correlation of the surrounding disassembly with the source shows it loading `"sh"`, performing the PATH lookup, and then entering the slash conversion. This matches the native Windows implementation: ```c char *p = locate_in_PATH("sh"); convert_slashes(p); ``` The reproduced missing-`sh` condition therefore leaves `p` as `NULL`, which is dereferenced by `convert_slashes()`. ## Regression test Add a MINGW-only regression test that clears `PATH` inside `test-tool run-command`, calls `git_shell_path()`, and verifies that Git reports the controlled fatal diagnostic instead of crashing. The helper clears `PATH` after process startup, making the missing-shell condition deterministic without depending on Windows startup PATH reconstruction. ## Testing Passed: - `git diff --check` - Shell syntax check for `t/t0061-run-command.sh` - Added-line formatting and commit-message checks The native Windows test suite was not run locally because a Git for Windows SDK/compiler was unavailable in the test environment. Windows CI is expected to build the change and run `t0061-run-command.sh`. <img width="500" height="230" alt="codex-clipboard-d4f6fbaa-5f73-4e36-8923-acc0596047db" src="https://github.com/user-attachments/assets/ffe18c92-32c0-4dd7-96fc-d7bc59d2a3b4" />
mingw_utime() clears FILE_ATTRIBUTE_READONLY before opening the file, and restores it afterwards. That was needed when the file was opened O_RDWR (852f098, 2010), but since 090a308 (2022) it is opened with only FILE_WRITE_ATTRIBUTES, which Windows grants on read-only files. Loose objects are read-only and are freshened with utime() whenever Git is about to write an object it already has, so each of those calls pays for two SetFileAttributesW() calls, i.e. two extra opens through the file system filter stack (antivirus in particular). Open the file first, and clear the attribute and retry only if the open fails with ERROR_ACCESS_DENIED. Signed-off-by: Alexandre Zollinger Chohfi <alzollin@microsoft.com>
The SHA-1 instructions and SIMD features provided by many x86_64 and aarch64 CPUs can make collision-detecting SHA-1 hashing much faster. In git-for-windows#6438, I proposed optionally using the Rust [`sha1dc`](https://crates.io/crates/sha1dc) crate to take advantage of this. Git for Windows v2.56 is still built without Rust, though, so that change alone cannot currently improve the binaries we ship. Scott Chacon's [accelerated C series][c] offers that acceleration without requiring Rust. Let's integrate the accelerated C implementation alongside the optional Rust support, superseding git-for-windows#6438. Keep the original C implementation as the default for now, with `core.sha1dcBackend` selecting `c`, `accel`, or `rust`. The Rust backend still requires the explicit `DC_SHA1_RS=1` build option and Rust 1.87 or newer. The C implementation includes the mirrored SHA-NI schedule improvement. The Rust hasher uses the existing context storage instead of a boxed allocation, with a runtime size/alignment check. The branch is based on `v2.56.1.windows.1` for reuse in Microsoft Git. [c]: https://lore.kernel.org/git/20260929112544.86511-1-scott@gitbutler.net/ <!-- Thanks for taking the time to contribute to Git! Those seeking to contribute to the Git for Windows fork should see http://gitforwindows.org/#contribute on how to contribute Windows specific enhancements. If your contribution is for the core Git functions and documentation please be aware that the Git community does not use the github.com issues or pull request mechanism for their contributions. Instead, we use the Git mailing list (git@vger.kernel.org) for code and documentation submissions, code reviews, and bug reports. The mailing list is plain text only (anything with HTML is sent directly to the spam folder). Nevertheless, you can use GitGitGadget (https://gitgitgadget.github.io/) to conveniently send your Pull Requests commits to our mailing list. For a single-commit pull request, please *leave the pull request description empty*: your commit message itself should describe your changes. Please read the "guidelines for contributing" linked above! -->
…ws#6505) When Git is about to write an object that it already has, it freshens the existing file with `utime()` instead. On Windows that happens a lot: `git add` of content that was added before, `git stash`, rebases that recreate blobs, and so on. Loose objects are read-only, and `mingw_utime()` clears `FILE_ATTRIBUTE_READONLY` before every call and restores it afterwards. Each freshen therefore opens the object file three times instead of once. The toggle comes from 852f098 (Windows: fix utime() for read-only files, 2010), when `utime()` opened the file `O_RDWR`. Since 090a308 (2022) it opens the file with `CreateFileW()` and only `FILE_WRITE_ATTRIBUTES` access, which Windows grants on read-only files. This PR tries the open first. It clears the attribute only if the open is refused with `ERROR_ACCESS_DENIED`, so a file system that enforces it keeps working as before. **Effect.** Measured with `git add -A` after rewriting 200 tracked files whose new content was already in the object store (a 40,000-file repository, Git for Windows v2.55.0.windows.5 with and without this patch, same toolchain). 20 interleaved runs, median, paired 95% CI: | | before | after | saved | |---|---:|---:|---:| | ReFS Dev Drive | 103.5 ms | 97.4 ms | 6.6 ms [3.9, 7.9] | | NTFS with real-time antivirus | 349.0 ms | 316.1 ms | 31.6 ms [24.4, 35.1] | Per freshened object, measured with the same Win32 calls outside Git, the cost drops from 159 µs to 63 µs on the Dev Drive and from 460 µs to 206 µs on NTFS. Each freshen now makes one `NtCreateFile`, and the two `NtOpenFile` / `NtSetInformationFile` pairs are gone. **Tests.** `t6501-freshen-objects`, `t5304-prune`, `t3700-add` and `t7063-status-untracked-cache` pass. The freshened objects keep `FILE_ATTRIBUTE_READONLY`, and their mtime is updated. The same code is in upstream `compat/mingw.c` (without long-path support). I can send it to the mailing list too if you prefer it to go upstream first.
|
Things look good to me, @dscho, except I'm not sure what this is about?... @@ builtin/add.c: int cmd_add(int argc,
## builtin/checkout.c ##
@@ builtin/checkout.c: static int checkout_worktree(const struct checkout_opts *opts,
- if (pc_workers > 1)
- init_parallel_checkout();
+ checkout_merged_data.conflict_style = opts->conflict_style;
+ }
- enable_fscache(1);
+ enable_fscache(the_repository->index->cache_nr);
+
for (pos = 0; pos < the_repository->index->cache_nr; pos++) {
struct cache_entry *ce = the_repository->index->cache[pos];
- if (ce->ce_flags & CE_MATCHED) {
@@ builtin/checkout.c: static int checkout_worktree(const struct checkout_opts *opts,
errs |= run_parallel_checkout(&state, pc_workers, pc_threshold,
NULL, NULL); |
@mjcheetham That's a bit of a tricky thing to read. It basically says that the context before and after the change have changed. I did add an empty line after that As to the pre-context: The original pre-context is still there, but an extra block has been introduced in the meantime which looks as if the pre-context changed completely, but it did not. |
Oops, an extra `-` slipped in here... Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
Whoops: 84db80d is needed to fix a mistake I made resolving that |
Since e928a32 (object-file: create ODB transaction temporary directory eagerly), every ODB transaction in the "files" backend immediately creates `<objects>/tmp_objdir-transaction-XXXXXX/pack`, see git@e928a32 cache_tree_update() begins such a transaction whenever none is in flight, even with WRITE_TREE_REPAIR. A repair never writes objects, though: it only hashes tree buffers and checks whether those objects already exist. Because unpack_trees() and `git checkout` both request repair-only updates, a checkout can now create and then remove a temporary object directory for nothing. On Windows without core.longPaths, that is not just wasteful. Git's mkdir() refuses paths of 248 characters or more. Git for Windows' t7429-submodule-long-path.sh started failing when Git for Windows was rebased onto v2.98.0-rc0: git-for-windows#6581 The object directory of the nested submodule is 214 characters long. Appending "/tmp_objdir-transaction-XXXXXX/pack" goes over the limit, and the checkout aborted: error: unable to create temporary object directory in .../objects: Filename too long fatal: failed to start object transaction That checkout did not need any new objects. So skip the transaction when repairing, and keep it unchanged for updates that write trees. Code paths that do write objects still need room for the longer temporary directory path. This change only removes that requirement for read-only repairs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
I will want to wait for |
I've updated the ticket with an analysis. No urgency there, but I still want to wait for it, just in case ;-) I also want to see whether git-for-windows/msys2-runtime#148 can be merged and deployed later today, still. It would be the best opportunity to get testers for -rc0 if we could ship it with "experimental support for running in MXC (AI sandboxes)". |
This comment was marked as outdated.
This comment was marked as outdated.
|
/git-artifacts The The |
Validate the installer manuallyThe installer was built successfully; |
|
/release The |
|
@dscho, please Share on Bluesky and send the announcement email. |
Range-diff relative to main
1: 3c3ce82 = 1: e8be35f unix-socket: avoid leak when initialization fails
149: 0fbd58c = 2: 55cc299 difftool: do not crash on a path rejected by verify_path()
2: dff9ccc = 3: d0e3dc3 grep: prevent
^$false match at end of file151: 2a4d52f = 4: 91744f4 difftool: avoid memory leak when
run_dir_diff()fails155: d21070d = 5: eeba462 difftool: avoid invalid memory access by an atexit handler
21: 40b7c8a = 6: e4db76a bundle-uri: refuse advertised URIs by protocol
15: b797b89 ! 7: c5d8f07 ci: bump actions/checkout from 6 to 7
@@ .github/workflows/main.yml: jobs: group: windows-build-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 - - uses: git-for-windows/setup-git-for-windows-sdk@v2 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: git-for-windows/setup-git-for-windows-sdk@aed153d1258c311b680b81584a72a1a4807401f0 # v2 - name: Install GCC-compatible Rust target shell: bash @@ .github/workflows/main.yml: jobs: group: vs-build-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 - - uses: git-for-windows/setup-git-for-windows-sdk@v2 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: git-for-windows/setup-git-for-windows-sdk@aed153d1258c311b680b81584a72a1a4807401f0 # v2 - name: initialize vcpkg -- uses: actions/checkout@v6 -+ uses: actions/checkout@v7 +- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 with: repository: 'microsoft/vcpkg' path: 'compat/vcbuild/vcpkg' @@ .github/workflows/main.yml: jobs: group: windows-meson-build-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 - - uses: actions/setup-python@v6 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 - name: Set up dependencies shell: pwsh @@ .github/workflows/main.yml: jobs: group: windows-meson-test-${{ matrix.nr }}-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 - - uses: actions/setup-python@v6 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 - name: Set up dependencies shell: pwsh @@ .github/workflows/main.yml: jobs: TEST_OUTPUT_DIRECTORY: ${{github.workspace}}/t runs-on: ${{matrix.vector.pool}} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - run: ci/install-dependencies.sh - run: ci/run-build-and-tests.sh - name: print test failures @@ .github/workflows/main.yml: jobs: CI_JOB_IMAGE: ubuntu-latest runs-on: ubuntu-latest steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - run: ci/install-dependencies.sh - run: ci/run-build-and-minimal-fuzzers.sh dockerized: @@ .github/workflows/main.yml: jobs: else apt-get -q update && apt-get -q -y install git fi -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - run: ci/install-dependencies.sh - run: useradd builder --create-home - run: chown -R builder . @@ .github/workflows/main.yml: jobs: group: static-analysis-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - run: ci/install-dependencies.sh - run: ci/run-static-analysis.sh - run: ci/check-directional-formatting.bash @@ .github/workflows/main.yml: jobs: group: rust-analysis-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - run: ci/install-dependencies.sh - run: ci/run-rust-checks.sh sparse: @@ .github/workflows/main.yml: jobs: group: sparse-${{ github.ref }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - name: Install other dependencies run: ci/install-dependencies.sh - run: make sparse @@ .github/workflows/main.yml: jobs: CI_JOB_IMAGE: ubuntu-latest runs-on: ubuntu-latest steps: -- - uses: actions/checkout@v6 -+ - uses: actions/checkout@v7 +- - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 ++ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 - run: ci/install-dependencies.sh - run: ci/test-documentation.sh9: 918b0dc = 8: e6fea73 t9350: point out that refs are not updated correctly
11: b22f015 = 9: 0503ba5 transport-helper: add trailing --
16: 206cff3 = 10: 35bff9c remote-helper: check helper status after import/export
22: bb304b1 = 11: 73adedb ci(coverity): bump actions/cache from 5 to 6
3: 38068e6 = 12: 8bc88c5 ci(vs-build): adapt to Visual Studio 2026 default on windows-latest
4: 04f9209 = 13: 1e96a5d vcpkg_install: detect lack of Git
5: 83a7c5b = 14: 042db7a vcpkg_install: add comment regarding slow network connections
6: 5ac97e2 = 15: 424eb9b vcbuild: install ARM64 dependencies when building ARM64 binaries
7: f99f626 = 16: 8bbcbe0 vcbuild: add an option to install individual 'features'
8: 96e57e5 = 17: 7718e0c cmake: allow building for Windows/ARM64
10: 31138ae ! 18: 5f0c2a4 ci(vs-build) also build Windows/ARM64 artifacts
@@ .github/workflows/main.yml: jobs: + group: vs-build-${{ github.ref }}-${{ matrix.arch }} cancel-in-progress: ${{ needs.ci-config.outputs.skip_concurrent == 'yes' }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 @@ .github/workflows/main.yml: jobs: - uses: microsoft/setup-msbuild@v3 + uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3 - name: copy dlls to root shell: cmd - run: compat\vcbuild\vcpkg_copy_dlls.bat release @@ .github/workflows/main.yml: jobs: env: @@ .github/workflows/main.yml: jobs: - name: upload tracked files and build artifacts - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: vs-artifacts + name: vs-artifacts-${{ matrix.arch }} @@ .github/workflows/main.yml: jobs: name: win+VS test @@ .github/workflows/main.yml: jobs: - name: download tracked files and build artifacts - uses: actions/download-artifact@v8 + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 with: - name: vs-artifacts + name: vs-artifacts-x6414: 9d7c88a = 19: 80e1c6c vcbuild: stop hard-coding OpenSSL as a dependency
20: 3a786b7 = 20: c71e976 cmake(): allow setting HOST_CPU for cross-compilation
52: 3e4f533 = 21: 691559f CMake: default Visual Studio generator has changed
12: 3d63813 = 22: 300d7f4 mingw: demonstrate a
git addissue with NTFS junctions56: 3a85713 = 23: 6096f8d .gitignore: add Visual Studio CMakeSetting.json file
13: e878136 = 24: 4404b1a t5505/t5516: allow running without
.git/branches/in the templates17: fc177db = 25: da7dae2 strbuf_realpath(): use platform-dependent API if available
18: 1bb7c82 = 26: b6464b4 http: use new "best effort" strategy for Secure Channel revoke checking
60: 593aae7 = 27: bfa6309 subtree: update
contrib/subtreetesttarget61: 2bd5d62 = 28: fbb2e60 CMakeLists: add default "x64-windows" arch for Visual Studio
62: 92803c6 = 29: 43b6806 setup: properly use "%(prefix)/" when in WSL
63: 3ee2ed2 = 30: b90f04b Add config option
windows.appendAtomically19: 017c05b = 31: 1bfdc62 t5505/t5516: fix white-space around redirectors
23: e654576 = 32: 34dbb1d Always auto-gc after calling a fast-import transport
24: ac0dc06 = 33: 59de056 mingw: prevent regressions with "drive-less" absolute paths
25: 484bcff = 34: dc29514 transport: optionally disable side-band-64k
26: 4e1e01e = 35: 3389173 mingw: fix fatal error working on mapped network drives on Windows
27: c2da1e5 = 36: 77ac3ae clink.pl: fix MSVC compile script to handle libcurl-d.lib
28: 79bc9ce = 37: d40fe5c mingw: implement a platform-specific
strbuf_realpath()29: d453996 = 38: a7474fd t3701: verify that we can add lots of files interactively
30: 143d2ff = 39: 85f2ede commit: accept "scissors" with CR/LF line endings
31: 609693c = 40: d4b99c8 t0014: fix indentation
32: 0b5719d = 41: f0a5de1 git-gui: accommodate for intent-to-add files
33: 5bc4d0f = 42: f7d199b mingw: allow for longer paths in
parse_interpreter()34: bdc5af8 = 43: dde7dab compat/vcbuild: document preferred way to build in Visual Studio
35: 046ba5f = 44: b80a37b http: optionally send SSL client certificate
67: c51a6fd ! 45: b8aeca8 ci: run
contrib/subtreetests in CI builds68: dc1f98a = 46: 057b53f CMake: show Win32 and Generator_platform build-option values
69: 136254e = 47: b73439a compat/mingw.c: do not warn when failing to get owner
70: 43aeff0 = 48: 6b76c01 mingw: $env:TERM="xterm-256color" for newer OSes
71: 6dc31b7 = 49: b8122a4 winansi: check result and Buffer before using Name
72: ed7b77b = 50: 2da0dbb mingw: change core.fsyncObjectFiles = 1 by default
50: 7d688a6 = 51: cc2d935 MinGW: link as terminal server aware
38: 6c42df1 = 52: 70bbfa7 max_tree_depth: lower it for clang builds in general on Windows
40: 96ce121 = 53: a0a4338 mingw: ignore HOMEDRIVE/HOMEPATH if it points to Windows' system directory
43: 46627ed = 54: fe8b62b clink.pl: fix libexpatd.lib link error when using MSVC
45: 36640f3 = 55: 9505878 Makefile: clean up .ilk files when MSVC=1
47: 47a54d9 = 56: 5ec33b2 vcbuild: add support for compiling Windows resource files
49: 641543b = 57: b3a7702 config.mak.uname: add git.rc to MSVC builds
53: 46c831b = 58: b4427ef clink.pl: ignore no-stack-protector arg on MSVC=1 builds
57: 75953cc = 59: c01ddb7 clink.pl: move default linker options for MSVC=1 builds
64: 75c2ed5 = 60: 9e6aaca cmake: install headless-git.
73: 77036ec = 61: 6b452af Fix Windows version resources
74: 3b7acd4 = 62: 658d808 status: fix for old-style submodules with commondir
75: 4d0e492 = 63: f710efb git.rc: include winuser.h
36: 1ab4500 = 64: 79430cc revision: create mark_trees_uninteresting_dense()
37: 1db72dc = 65: dd16082 survey: stub in new experimental 'git-survey' command
39: 1955622 = 66: a91b6e4 survey: add command line opts to select references
41: 3d41022 = 67: 3efa204 survey: start pretty printing data in table form
42: 95022f0 = 68: 1af7215 survey: add object count summary
44: 1fe1b8b = 69: 3ffea60 survey: summarize total sizes by object type
46: 3042869 = 70: d4e06c8 survey: show progress during object walk
48: 2578677 = 71: f120d0b survey: add ability to track prioritized lists
51: 754603f = 72: 068785e survey: add report of "largest" paths
55: a1def63 = 73: e043958 survey: add --top= option and config
59: d6a3407 = 74: dcda932 survey: clearly note the experimental nature in the output
66: c4e0b80 = 75: 677723e repo: split annotated tags out from total tag count in structure
86: 0cd8584 = 76: 95a4561 repo: filter the structure scope via --ref-filter=
77: 146cb0b ! 77: c0158c0 Add a GitHub workflow to verify that Git/Scalar work in Nano Server
78: 5470cbc = 78: cbb78c8 mingw: suggest
windows.appendAtomicallyin more cases79: ae48d95 = 79: 85c04c7 win32: use native ANSI sequence processing, if possible
80: 071d564 = 80: 70e8f5e common-main.c: fflush stdout buffer upon exit
81: 44da6d7 = 81: 2ee213e t5601/t7406(mingw): do run tests with symlink support
82: 5a075cb = 82: 2883bae Fallback to AppData if XDG_CONFIG_HOME is unset
89: 5f4cbe8 ! 83: 1267c7f repo: report top-N paths by count, disk, and inflated size in structure
@@ builtin/repo.c: struct count_objects_data { static void check_largest(struct object_data *data, struct object_id *oid, size_t value) { -@@ builtin/repo.c: static size_t count_tree_entries(struct object *obj) +@@ builtin/repo.c: static size_t count_tree_entries(const struct object_id *oid, return count; } @@ builtin/repo.c: static size_t count_tree_entries(struct object *obj) for (size_t i = 0; i < oids->nr; i++) { @@ builtin/repo.c: static int count_objects(const char *path UNUSED, struct oid_array *oids, - obj = parse_object_buffer(the_repository, &oids->oid[i], type, - inflated, content, &eaten); + continue; + inflated = cast_size_t_to_ulong(inflated_st); + summary.nr++; + summary.disk_size += disk; @@ builtin/repo.c: static int count_objects(const char *path UNUSED, struct oid_arr case OBJ_TAG: stats->type_counts.tags++; @@ builtin/repo.c: static int count_objects(const char *path UNUSED, struct oid_array *oids, - free(content); + } } + if (data->top_nr) {90: 1f37fd2 = 84: 1196809 mingw: make sure
errnois set correctly when socket operations fail91: ed29780 = 85: 36c5184 t5563: verify that NTLM authentication works
95: bd5637f = 86: 026bfc9 t1901: cover the --top option of
git repo structure96: c5bc0d4 = 87: d3ed6b1 compat/mingw: handle WSA errors in strerror
97: 4ff3b12 = 88: b6ed324 http: disallow NTLM authentication by default
101: 3a9a9f8 = 89: 19555c4 repo: read the
--topdefault fromrepo.structure.top102: 1dcd283 = 90: 994f293 compat/mingw: drop outdated comment
103: 0e76203 = 91: 06414dc http: warn if might have failed because of NTLM
107: 38ebd74 = 92: acbe407 git-survey: announce the upcoming pivot into
git repo structure108: 60bde05 = 93: 2d23cb3 t0301: actually test credential-cache on Windows
109: 339bd4e = 94: 1cd5679 credential: advertise NTLM suppression and allow helpers to re-enable
114: eac899e ! 95: c61abb1 survey: turn into a thin shim over
git repo structure@@ Commit message Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> + ## Documentation/config/survey.adoc ## +@@ + survey.*:: +- These variables adjust the default behavior of the `git survey` +- command. The intention is that this command could be run in the +- background with these options. +-+ +--- +- verbose:: +- This boolean value implies the `--[no-]verbose` option. +- progress:: +- This boolean value implies the `--[no-]progress` option. +- top:: +- This integer value implies `--top=<N>`, specifying the +- number of entries in the detail tables. +--- ++ Deprecated and ignored by `git survey`. See the "MIGRATION" section ++ of linkgit:git-survey[1] for replacements and changed defaults. + ## Documentation/git-survey.adoc ## @@ Documentation/git-survey.adoc: NOTE: `git survey` is being superseded by `git repo structure`. New deployments and new features should use `git repo structure`; its @@ Documentation/git-survey.adoc: NOTE: `git survey` is being superseded by `git re Survey the repository and measure various dimensions of scale. +@@ Documentation/git-survey.adoc: Ref Selection + + The following options control the set of refs that `git survey` will examine. + By default, `git survey` will look at tags, local branches, and remote refs. +-If any of the following options are given, the default set is cleared and +-only refs for the given options are added. ++If any ref-selection option other than `--detached` is given, the default ++set is cleared and only refs for the given options are added. + + --all-refs:: + Use all refs. This includes local branches, tags, remote refs, +@@ Documentation/git-survey.adoc: only refs for the given options are added. + Add remote branches (`refs/remote/`) to the set. + + --detached:: +- Add HEAD to the set. ++ Ignored with a warning. This option does not affect ref selection. + + --other:: + Add notes (`refs/notes/`) and stashes (`refs/stash/`) to the set. + ++MIGRATION ++--------- ++`git repo structure` selects all refs by default. To retain the survey ++default scope, pass `--ref-filter='refs/heads/*'`, ++`--ref-filter='refs/tags/*'`, and `--ref-filter='refs/remotes/*'`. ++ ++Neither command separately enumerates detached `HEAD`, even with ++`git survey --all-refs`. To include history reachable only from `HEAD`, ++first create a branch or tag pointing to `HEAD` and include that ref in ++the selection. The new ref is also counted. ++ ++For path detail tables, `git repo structure` defaults to `--top=0`; use ++`--top=10` or `repo.structure.top=10` for the survey default. The shim ++always supplies `--top` (10 unless overridden on its command line), so ++`repo.structure.top` does not change `git survey`'s limit. ++ ++The `git survey` shim ignores all `survey.*` configuration settings. ++When invoking `git repo structure` directly, use `repo.structure.top` ++in place of `survey.top`; this setting does not affect `git survey`. ++Use `--progress` or `--no-progress` instead of `survey.progress`; ++there is no `repo.structure.progress` setting. `survey.verbose` has ++no replacement, and the shim ignores `--verbose` with a warning. ++ + OUTPUT + ------ + ## builtin/survey.c ## @@115: b0d39f3 = 96: fb40e3a credential-cache: handle ECONNREFUSED gracefully
116: 91071a2 = 97: 5963222 reftable: do make sure to use custom allocators
117: 355c62d = 98: eb7beab check-whitespace: avoid alerts about upstream commits
118: 0ceea94 = 99: f3ddbed t/t5571-prep-push-hook.sh: Add test with writing to stderr
119: 8065242 = 100: 66700c8 dir: do not traverse mount points
120: 2107042 = 101: 23a1b58 win32: thread-utils: handle multi-socket systems
121: fcd7636 = 102: 6dd156e t5563: add tests for http.emptyAuth with Negotiate
122: 373d334 = 103: e65ce21 entry: flush fscache after creating directories and writing files
123: 94582b3 ! 104: 73006e8 ci(macos): skip the
git p4tests[diff-too-large]
83: beb6012 = 105: 79566ae mingw: Support
git_terminal_promptwith more terminals84: 78484fe = 106: 443ec14 compat/terminal.c: only use the Windows console if bash 'read -r' fails
88: 27337dd = 107: 0305db1 diff: stop truncating the deflated-binary-diff size on Windows
85: 03c5a21 = 108: 88afcd2 mingw (git_terminal_prompt): do fall back to CONIN$/CONOUT$ method
94: f123d3d = 109: 5f78673 convert: widen gather_convert_stats() helpers to size_t
87: ceb9bac = 110: 368ad7b Win32: symlink: move phantom symlink creation to a separate function
100: 14fe6d7 = 111: 6c8c357 read-cache: stop truncating index blob sizes on Windows
92: b5e4c5f = 112: b5fd846 mingw: introduce code to detect whether we're inside a Windows container
93: 1b0e62f = 113: e23fcb3 Introduce helper to create symlinks that knows about index_state
106: 8b6ef9b = 114: 04d574a xdiff-interface: widen buffer_is_binary() size parameter to size_t
98: 758df87 = 115: 5f8ba33 mingw: when running in a Windows container, try to rename() harder
99: 80813d5 = 116: b86fc07 mingw: allow to specify the symlink type in .gitattributes
112: 4901bd7 = 117: e12421f combine-diff: stop truncating combined-diff blob sizes on Windows
104: 9449cc8 = 118: 04dc6df mingw: move the file_attr_to_st_mode() function definition
105: 9853de1 = 119: 0bf943c Win32: symlink: add test for
symlinkattribute130: 67b5dd7 = 120: e04e48d diff: widen textconv_object() size out-param to size_t
110: 3578b5c = 121: f857fdd mingw: Windows Docker volumes are not symbolic links
111: a4d9b74 = 122: 88274ff clean: do not traverse mount points
128: 9dc71f7 = 123: daea9a9 tree-walk: drop link_len cast in get_tree_entry_follow_symlinks()
113: 4d2c654 = 124: 50344bb pack-bitmap: stop truncating blob sizes used by --filter=blob:limit
132: 9473dfe = 125: f964315 diffcore: widen struct diff_filespec.size to size_t
124: 847ea63 = 126: ed71548 mingw: work around rename() failing on a read-only file
125: 3978bca = 127: 4043052 clean: remove mount points when possible
126: df36504 = 128: 9a63215 mingw: optionally enable wsl compability file mode bits
127: f9871cb = 129: f05125a Refuse to follow invalid paths in
.gitfiles131: 175bcce = 130: dcb4b4b pack-objects: drop the two tree-walk casts in the preferred-base path
134: c902319 = 131: ca811cd commit: widen the commit-buffer API to size_t
135: 85084ea = 132: 3b7634b blame: widen find_line_starts() len parameter to size_t
136: edfa7e1 = 133: 5c2aca7 grep: widen struct grep_source.size and grep_buffer() to size_t
137: 756e4f5 = 134: da1ded1 fast-export: drop the export_blob() size cast and widen anonymize_blob()
138: 512e60e ! 135: 608258a repo: drop the inflated-size cast in count_objects()
139: ad10cd7 ! 136: f3447e1 unpack-objects: widen the size-passing infrastructure to size_t
@@ builtin/unpack-objects.c: static void added_object(unsigned nr, enum object_type unsigned nr) { void *buf = get_data(size); -@@ builtin/unpack-objects.c: static ssize_t zlib_stream_read(struct odb_stream *in_stream, - return buf_len - zstream->avail_out; - } - --static void stream_blob(unsigned long size, unsigned nr) -+static void stream_blob(size_t size, unsigned nr) - { - git_zstream zstream = { 0 }; - struct zlib_stream in_stream = { -@@ builtin/unpack-objects.c: static void stream_blob(unsigned long size, unsigned nr) +@@ builtin/unpack-objects.c: static void stream_blob(size_t size, unsigned nr) } static int resolve_against_held(unsigned nr, const struct object_id *base,140: e1d2644 = 137: 445f491 pack-objects: drop cast_size_t_to_ulong shims in get_delta()
141: ee2e8d7 = 138: 7721cd7 pack-objects: drop cast_size_t_to_ulong shims in try_delta()
142: 7b2fb9e ! 139: 64db661 pack-objects: drop the last size shim in write_no_reuse_object()
143: 45f465b = 140: 5e540ca blame: widen struct blame_scoreboard.final_buf_size to size_t
153: 5be054f = 141: e096fdf coverity: skip building with Rust, for now
268: 5f627c0 = 142: 7079a77 run-command: avoid NULL dereference for missing Windows shell
54: 8f4471e ! 143: f11b1cf http: optionally load libcurl lazily
58: d22b961 = 144: 255983d http: support lazy-loading libcurl also on Windows
65: 3ad122d ! 145: 6c2192a http: when loading libcurl lazily, allow for multiple SSL backends
@@ Commit message Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> ## compat/lazyload-curl.c ## -@@ compat/lazyload-curl.c: static curl_easy_setopt_pointer_type curl_easy_setopt_pointer_func; - typedef CURLcode (*curl_easy_setopt_off_t_type)(CURL *curl, CURLoption opt, curl_off_t value); - static curl_easy_setopt_off_t_type curl_easy_setopt_off_t_func; +@@ compat/lazyload-curl.c: typedef CURLUcode (*curl_url_set_type)(CURLU *u, CURLUPart what, + const char *part, unsigned int flags); + static curl_url_set_type curl_url_set_func; +static char ssl_backend[64]; +76: c10690e = 146: cfe8036 mingw: do load libcurl dynamically by default
129: 08eaa17 (upstream: 53d5cfc) < -: ----------- tree-walk: widen init_tree_desc() and init_tree_desc_gently() to size_t
133: f026774 (upstream: a842e3a) < -: ----------- tree: widen struct tree.size and parse_tree_buffer() to size_t
144: 8e9a0d4 ! 147: a9beae2 fast-import: drop the six size casts in the object-read paths
@@ builtin/fast-import.c: static void parse_from_existing(struct branch *b) oidclr(&b->branch_tree.versions[1].oid, the_repository->hash_algo); } else { - unsigned long size; -- size_t size_st = 0; + size_t size; char *buf; + struct object_entry *e = find_object(&b->oid); - buf = odb_read_object_peeled(the_repository->objects, &b->oid, -- OBJ_COMMIT, &size_st, &b->oid); -- size = cast_size_t_to_ulong(size_st); -+ OBJ_COMMIT, &size, &b->oid); +@@ builtin/fast-import.c: static void parse_from_existing(struct branch *b) + if (e && e->type == OBJ_COMMIT && e->pack_id != MAX_PACK_ID) { + buf = gfi_unpack_entry(e, &size); + } else { +- size_t size_st = 0; + buf = odb_read_object_peeled(the_repository->objects, &b->oid, +- OBJ_COMMIT, &size_st, &b->oid); +- size = cast_size_t_to_ulong(size_st); ++ OBJ_COMMIT, &size, &b->oid); + } parse_from_commit(b, buf, size); free(buf); - } @@ builtin/fast-import.c: static int parse_objectish(struct fast_import_state *state, if (!oideq(&b->oid, &oe->idx.oid)) { oidcpy(&b->oid, &oe->idx.oid);145: 791e1ad = 148: 5aafc33 t/helper/test-pack-deltas: drop the delta_size cast in write_ref_delta()
146: 2af2f15 = 149: fecedc6 Drop the
cast_size_t_to_ulong()helper147: fecdd9f = 150: fe78e61 mingw: handle staging 4GB+ files correctly
148: 267ee30 = 151: e94dbe4 mingw: support unpacking loose 4GB+ objects
150: d92a525 = 152: c3255ad t: add an expensive test to verify that 4GB+ blobs can be staged/read
152: 9ba8c50 = 153: d96cd39 object-file: use size_t for object size in check_object_signature()
154: 76524c2 (upstream: 76524c2) < -: ----------- http: handle curl stripping creds from effective url
156: 3ed9e12 = 154: 99e8bab Win32: make FILETIME conversion functions public
157: 601b270 = 155: 49a46f5 Win32: dirent.c: Move opendir down
158: 83b612e = 156: 4a61810 mingw: make the dirent implementation pluggable
159: 46b1208 = 157: f000428 Win32: make the lstat implementation pluggable
160: 28c57dd = 158: 59710c9 mingw: add infrastructure for read-only file system level caches
161: b1fe55e = 159: 3257cac mingw: add a cache below mingw's lstat and dirent implementations
162: 33adcb5 = 160: 66ce0ec fscache: load directories only once
163: 3ab6e32 = 161: 73bc612 fscache: add key for GIT_TRACE_FSCACHE
164: 6083c94 = 162: bbae870 fscache: remember not-found directories
166: ac3c777 = 163: 1d4eb0b fscache: add a test for the dir-not-found optimization
168: 7150ee0 = 164: 3f8948b add: use preload-index and fscache for performance
169: 08bf12b = 165: b0cb7d8 dir.c: make add_excludes aware of fscache during status
170: ab872d7 = 166: bbecab8 fscache: make fscache_enabled() public
171: 1b91abe = 167: f0076d2 dir.c: regression fix for add_excludes with fscache
165: b7a805c = 168: 60d1324 git-gui--askyesno: fix funny text wrapping
172: fba1a2c = 169: 2038b4b fetch-pack.c: enable fscache for stats under .git/objects
167: a85e947 = 170: c1f4f18 git-gui--askyesno (mingw): use Git for Windows' icon, if available
173: 6b4047f ! 171: f6517f2 checkout.c: enable fscache for checkout again
174: 15d9702 = 172: 8f72925 Enable the filesystem cache (fscache) in refresh_index().
175: 009a927 = 173: 1b33cfb fscache: use FindFirstFileExW to avoid retrieving the short name
176: bedf576 = 174: bc7bbce fscache: add GIT_TEST_FSCACHE support
177: 707933c = 175: c6b402d fscache: add fscache hit statistics
178: 2102373 = 176: fa38d71 unpack-trees: enable fscache for sparse-checkout
179: 871a056 = 177: 29e12c4 status: disable and free fscache at the end of the status command
180: 6d8fad1 = 178: d42062b mem_pool: add GIT_TRACE_MEMPOOL support
181: 618d3ad ! 179: d3973cf fscache: fscache takes an initial size
182: b0f6344 = 180: 2208489 fscache: update fscache to be thread specific instead of global
183: 33d244c = 181: 8b8734a fscache: teach fscache to use mempool
184: 2ddd3a1 = 182: 69c8385 fscache: make fscache_enable() thread safe
185: edc9967 = 183: 212ab8b fscache: teach fscache to use NtQueryDirectoryFile
186: 60b729c = 184: 6af3fc8 fscache: remember the reparse tag for each entry
187: 68d3576 = 185: ab7ec7d fscache: Windows Docker volumes are not symbolic links
188: e097ae3 = 186: 12065c3 fscache: optionally enable wsl compability file mode bits
189: b90454a = 187: faf8266 fscache: implement an FSCache-aware is_mount_point()
190: 9f376c2 = 188: b471b3a clean: make use of FSCache
191: cf53679 = 189: b0db89d compat/poll: do not collect more handles than the wait supports
192: d7b8fab = 190: 7a66f7f parallel-checkout: limit worker count to what poll() can wait on
193: dff4912 = 191: 2602622 run-command: limit concurrent children to what poll() can wait on
194: 534000e ! 192: aa87be2 pack-objects (mingw): demonstrate a segmentation fault with large deltas
195: b0d7481 = 193: 1e66055 mingw: support long paths
196: e891acf = 194: 1fc6165 win32(long path support): leave drive-less absolute paths intact
197: 563f99e = 195: fa9fadd compat/fsmonitor/fsm-*-win32: support long paths
198: c8ae375 = 196: 4a84776 clean: suggest using
core.longPathsif paths are too long to remove199: 8dda5fd = 197: cb497af mingw: explicitly specify with which cmd to prefix the cmdline
200: 8408feb = 198: 9ca5800 mingw: when path_lookup() failed, try BusyBox
201: b7d95f3 = 199: 906b585 test-tool: learn to act as a drop-in replacement for
iconv202: f3c24a8 = 200: 0758375 tests(mingw): if
iconvis unavailable, usetest-helper --iconv203: a3b3d39 = 201: 41a5349 gitattributes: mark .png files as binary
204: fa182b9 = 202: c62cd03 tests: move test PNGs into t/lib-diff/
205: 2e14143 = 203: 1c2037d tests: only override sort & find if there are usable ones in /usr/bin/
206: 094ba33 = 204: ec431ce tests: use the correct path separator with BusyBox
207: 75574ba = 205: 908d039 mingw: only use Bash-ism
builtin pwd -Wwhen available208: 8de4a8f = 206: fa5ff11 tests (mingw): remove Bash-specific pwd option
209: b90e227 = 207: bbe613e test-lib: add BUSYBOX prerequisite
210: d046b71 = 208: 8032247 t5003: use binary file from t/lib-diff/
211: bc27abb = 209: 586ee0b t5532: workaround for BusyBox on Windows
212: d37a447 = 210: 028d458 t5605: special-case hardlink test for BusyBox-w32
213: 149bef9 = 211: cd5ca44 t5813: allow for $PWD to be a Windows path
214: be43eb6 = 212: 7761470 t9200: skip tests when $PWD contains a colon
215: 4fbde9a = 213: f9d7cfa Describe Git for Windows' architecture
216: 3bbe966 ! 214: f98c6e6 Add an AGENTS.md file to help with AI-assisted debugging/development
217: 010f14f = 215: 25f2109 Modify the Code of Conduct for Git for Windows
218: db61eb7 = 216: 2a1001c CONTRIBUTING.md: add guide for first-time contributors
219: 764637d ! 217: 78acf63 README.md: Add a Windows-specific preamble
220: dc3c3b8 = 218: a5f2b7c Partially un-revert "editor: save and reset terminal after calling EDITOR"
221: 31a70d7 = 219: 9e3d0bd Add an issue template
222: 68bd30e = 220: 2470d22 reset: reinstate support for the deprecated --stdin option
223: 750b949 = 221: a618d41 Modify the GitHub Pull Request template (to reflect Git for Windows)
224: e1bea56 ! 222: f49faf6 Add a GitHub workflow to monitor component updates
225: d354087 = 223: 3673d36 fsmonitor: reintroduce core.useBuiltinFSMonitor
226: 27c7158 = 224: 4eb86f3 SECURITY.md: document Git for Windows' policies
227: e031d02 = 225: 9f7f143 dependabot: help keeping GitHub Actions versions up to date
228: 4c0fc26 = 226: c15d9f4 ci: only run the expensive tests in the Windows tests for now
229: d912ae6 = 227: 579c9ff mingw: let
access()handlenulwhether lower-case or not230: cc4dbf7 ! 228: 77b92da ci: bump actions/setup-python from 6 to 7
[diff-too-large]
237: 38fc611 ! 229: 052f3dd ci(dockerized): really do show the result of failing tests again
@@ .github/workflows/main.yml: jobs: + sudo --preserve-env --set-home --user=builder ci/print-test-failures.sh - name: Upload failed tests' directories if: failure() && env.FAILED_TEST_ARTIFACTS != '' - uses: actions/upload-artifact@v7 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7238: 0e9926c = 230: f86a8df fixup! mingw: allow
git.exeto be used instead of the "Git wrapper"231: 77cc8e6 = 231: 318df42 difftool: honor core.symlinks on Windows
254: 3f881a8 = 232: d3f4b96 sha1dc-accel: add a block loop for sha1dc's SHA1_CTX
232: d1e2c74 = 233: 8a33a91 difftool: honor the platform default for symlink support
233: 3b832f0 < -: ----------- fixup! http: optionally load libcurl lazily
234: 5c20f2c < -: ----------- fixup! Add a GitHub workflow to verify that Git/Scalar work in Nano Server
235: f093b8e < -: ----------- fixup! Add an AGENTS.md file to help with AI-assisted debugging/development
236: 35136de < -: ----------- fixup! survey: turn into a thin shim over
git repo structure239: d4089c7 < -: ----------- fixup! README.md: Add a Windows-specific preamble
240: afecfd9 < -: ----------- fixup! README.md: Add a Windows-specific preamble
241: 992304c (upstream: a8dc3aa) < -: ----------- ci: switch away from unsupported i386/ubuntu image
242: fdfbfa9 (upstream: 64172cf) < -: ----------- ci: work around Debian 12's HTTP/2 authentication failures
243: 9327972 (upstream: c9d34ae) < -: ----------- install-dependencies: work around a permission problem
244: 5812916 (upstream: 0efc461) < -: ----------- ci: pin linux32 to ubuntu-24.04 to restore networking
255: 377b9a3 ! 234: 23adb85 sha1dc-accel: vectorize the unavoidable-bitconditions check
246: 7c2360c = 235: b32aeef perf: exercise phantom resolution through a directory symlink
256: de05b96 = 236: 365a3f2 sha1dc-accel: compress with SHA-NI on x86-64
247: 5c74516 = 237: 7abc1b5 mingw: distinguish dangling symlinks from missing paths
257: 66a1f33 ! 238: f35c04c sha1dc-accel: compress with the ARMv8 SHA-1 instructions
248: 7ba0059 = 239: 44ad338 abspath: resolve junctions before missing path components
258: f66a539 = 240: a6d705c sha1dc-accel: bring SHA-NI performance closer to Rust
249: 411404b = 241: 8845d50 mingw: index phantom symlinks with cbtree
261: e75b07d ! 242: 5e60b1c libgitcore: add
sha1dcas an optional feature250: 715244d = 243: f74956a mingw: reuse known directory prefixes for phantom symlinks
262: 089018b ! 244: a1c6c63 sha1dc: allow selecting the C backend without rebuilding
245: fc94eca = 245: b2c6ff6 compat/poll: load user32 only when poll() runs
263: ea290eb = 246: ec708f8 pthread: provide
pthread_once()shims for Windows and for NO_PTHREADS265: ba12488 ! 247: d56f908 fixup! sha1dc: make
sha1dc_init()thread-safe252: af65daf = 248: b38bc27 mingw: reduce stack usage during process-tree cleanup
266: 8da8b2c = 249: 1922ea2 sha1dc: avoid boxing the Rust hasher
253: f373f67 = 250: fb07b48 mingw: avoid terminating unrelated processes during cleanup
267: 7546d35 = 251: a733b1d sha1dc: keep original C as default with runtime alternatives
269: 5031241 = 252: d37892e ci: exercise Rust SHA1DC in Windows artifact tests
251: c486528 = 253: 2e8662a mingw: do not clear the read-only attribute in utime() unless needed
259: 8d060ff < -: ----------- fixup! sha1dc-accel: compress with the ARMv8 SHA-1 instructions
260: 5d55a80 < -: ----------- fixup! sha1dc-accel: vectorize the unavoidable-bitconditions check
264: be32e8c < -: ----------- sha1dc: make
sha1dc_init()thread-safe270: bc270e0 < -: ----------- fixup! libgitcore: add
sha1dcas an optional feature271: 730154c < -: ----------- fixup! Add a GitHub workflow to monitor component updates