The Windows GitLab CI job has been updated to provision and use the
GNU Rust toolchain for MinGW builds, fixing job failures caused by
incomplete Rust setup and missing linker support.
* js/gitlab-ci-windows-rust:
ci(gitlab,windows): provide GNU Rust's host-linker support
ci(gitlab,windows): fix Rust setup for GitLab's MinGW build
ci(gitlab,windows): preserve exclusions during dependency setup
ci(gitlab,windows): provision GNU Rust for SDK-based MinGW builds
GitLab's MinGW job cannot find `x86_64-w64-mingw32-gcc` when linking
gitcore's build script:
https://gitlab.com/dscho/git1/-/jobs/16593470275
Although gitcore is a static library, Cargo first links `build.rs`
as a host executable. We omitted the GNU MSI's `Gcc` feature, which
supplies the required linker and platform libraries:
https://github.com/rust-lang/rust/blob/1.96.0/src/etc/installer/msi/rust.wxs
Assisted-by: GPT-6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
GitLab's MinGW job fails with "cargo: command not found":
https://gitlab.com/git-scm/git/-/jobs/1657645018286909a94db (ci(windows): build with Rust, 2026-09-13) enabled Rust
in the shared CI configuration, but added the necessary setup only
for GitHub Actions.
The build needs Cargo to be reachable after the minimal SDK's login
profile replaces PATH. Installing the toolchain alone is not enough.
Assisted-by: GPT-6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Creating .git/info/exclude as a file with `New-Item` and `-Force`
truncates existing contents.
When install-dependencies.ps1 follows install-sdk.ps1, this discards
the latter's /git-sdk exclusion and causes ci/lib.sh to reject SDK
files as unignored build artifacts.
Assisted-by: GPT-6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The minimal Git for Windows SDK already supplies Git and GCC. The
MinGW Makefile build needs the GNU Rust toolchain, not another Git
installation or Meson.
Let the dependency installer serve this configuration while keeping
the existing package set for MSVC builds.
Assisted-by: GPT-6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
A bug in git diff --no-index that mishandled reverse (-R) output
when conflicts existed between a file and a directory has been
fixed.
* hd/diff-no-index-reverse-fix:
diff --no-index: fix -R with file/directory conflicts
When a path is a file on one side and a directory on the other,
queue_diff() queues the file separately before recursing into the
directory. This early queue entry bypasses the reverse_diff handling
used for ordinary files.
As a result, comparing directories d and e where d/sub is a file and
e/sub/file is another file reports both paths as deleted with -R.
Reversing the operands reports both paths as added instead.
Swap the filespecs of the early queue entry when reverse_diff is set,
so that -R reverses the file change as well as the directory contents.
Add regression tests for both directions.
Signed-off-by: Haokai Ding <hk_ding@outlook.com>
Reviewed-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The error reporting machinery in the WinANSI compatibility layer has
been simplified to pass the exact Windows error code and correctly
format arguments for fatal errors.
* yt/winansi-die-lasterr-fix:
compat/winansi: fix die_lasterr() argument formatting
During WinANSI initialization, duplicate_handle() reports the handle
when DuplicateHandle() fails. die_lasterr() collects the formatting
arguments in a va_list, but passes that va_list to die_errno() as an
ordinary variadic argument. die_errno() consequently formats part of
the va_list representation instead of the supplied handle, producing
an incorrect fatal message.
The helper also converts GetLastError() to errno, losing the exact
Windows error code.
Remove die_lasterr() and report GetLastError() directly at its four
call sites, following the existing Windows diagnostic style. This
passes the handle to the formatter correctly and preserves the Windows
error code. Keep the existing %li representation of the handle.
With MinGW GCC 13, compat/winansi.o builds with DEVELOPER=1 and the
complete git.exe builds and links.
Signed-off-by: Yongqiang Tian <yqtian668@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The Rust code and its 'Cargo.toml' file have been moved from the
top-level repository root and 'src/' directory into a dedicated
'rust/' subdirectory. This avoids confusing Cargo's packaging
mechanism when the Git repository is included as a submodule in
other Rust projects.
* mh/rust-crate-subdir:
move rust gitcore crate to a different subdirectory
Git on OpenBSD historically lacked an authoritative mechanism to
resolve its executable path, as it doesn't support the
KERN_PROC_PATHNAME sysctl. With OpenBSD 8.0 introducing
getexecpath(3), it is now utilized to provide proper RUNTIME_PREFIX
resolution instead of relying on argv[0] fallback.
* bs/runtime-prefix-obsd-getexecpath:
exec_cmd: RUNTIME_PREFIX on OpenBSD systems
The advice subsystem has been updated to suggest using the
'--global' option when recommending a command snippet to squelch
future advice messages, since global configuration is generally
more appropriate for user-level preferences than per-repository
settings.
* jc/advice-config-set-global:
advice: give cut-and-pasteable advice to squelch
Instead of failing to record conflicts to be resolved immediately,
wait while "rerere gc" is ongoing.
* tb/rerere-wait-for-merge-rr-lock:
rerere: go on at a conflict when the lock stays busy
rerere: wait for MERGE_RR.lock, and let the gc skip it
When 'core.fsyncMethod' is set to 'batch', the ODB transaction
failed to properly flush large blob packfiles residing in the
temporary directory before migrating the directory's contents to the
main object store. The execution sequence has been corrected by
performing the packfile flush before the temporary directory
migration, averting failure.
* jt/object-file-batch-fsync-fix:
object-file: flush transaction packfile before migrating objects
object-file: lift ODB reprepare out of packfile flush
The 'git var' command has been extended to expose individual
identity components ('GIT_AUTHOR_NAME', etc.) and the commit
signing key, and can now accept multiple variables to query at
once, safely formatting the output with a new '-z' option.
* ap/var-broken-down-idents:
var: support broken-down idents, signing key, multiple args, and -z
The --force-if-includes protection for git push has been updated to
consult the reflog of the local branch being pushed, rather than
incorrectly checking the reflog of a local branch that shares the
name of the remote destination branch. The push advice for detached
HEAD scenarios has also been adjusted to indicate that the remote
ref cannot be verified locally.
* tc/push-force-if-includes-fixes:
push: --force-if-includes should allow fast-forward
push: fix --force-if-includes non-branch advice
push: check pushed ref for --force-if-includes
The sequencer machinery (used by 'git rebase', 'git cherry-pick', and
'git revert') has been updated to defer automatic maintenance tasks
until the end of the operation, preventing nested 'git commit', 'git
merge', and 'exec' commands from triggering GC operations that could
contend for locks or delete open packs while the sequence is in
progress.
* tb/rerere-lock-grace:
sequencer: disable auto maintenance in spawned commands
rebase, cherry-pick, revert: run auto maintenance when done
config: add git_config_append_parameter()
The timestamp used for checking the reflog of a remote-tracking
branch during 'git push --force-if-includes' was left uninitialized
when the reflog was completely empty, which has been corrected.
* as/push-force-if-includes-no-reflog:
push: fix --force-if-includes when remote-tracking ref has no reflog
A new 'diff.<driver>.process' configuration has been introduced to
allow a long-running external process to act as a hunk provider,
enabling external tools to control which lines Git considers changed
while leaving all output formatting (word diff, color, blame, etc.) to
Git's standard pipeline.
* mm/diff-process-hunks:
fixup! diff: consult oid-only hunk providers via diff.<driver>.process
diff: consult oid-only hunk providers via diff.<driver>.process
userdiff: add diff.<driver>.process config
sub-process: add a gentle status read
sub-process: separate process lifecycle from hashmap management
blame: read precomputed hunks
diff: read precomputed hunks for stat output
diff: record precomputed hunks during stat output
diff-hunks: add the store format, library, and command
diff: introduce a hunk provider interface
gitattributes: document how external diff drivers relate to diff features
The process of parsing command-line options in commands that
perform an early scan over their arguments (such as 'git bisect',
'git rev-parse', and 'git fast-import') has been unified using a
new early-scan sub-API, which parses and skips known options taking
separate values to prevent logic bugs.
* cc/early-scan-options:
fast-import: use early_scan_options() for --allow-unsafe-features
parse-options: build early scan options from a struct option array
parse-options: add parse_options_takes_argument()
rev-parse: fix "--" detection when it is an option value
bisect: fix "--" detection when a term name is "--"
parse-options: add early_scan_options()
The 'git last-modified' command has been optimized by using Bloom
filters. It now reuses revision walk filtering logic from 'git log'
to pre-filter commits, and maintains per-path Bloom filters even when
wildcard pathspecs are used.
* tc/last-modified-bloom:
last-modified: keep per-path Bloom filters for wildcard pathspecs
last-modified: check pathspec against Bloom filter first
revision: add Bloom check that includes parent directories
bloom: add helper to check if any key in a vector is present
revision: expose check for paths maybe changed in Bloom filter
revision: move bloom keyvec precondition into function
The remote helper documentation for the 'pushcert' option has been
updated to mention that it can also take 'if-asked', reflecting the
existing implementation in the code.
* ll/doc-pushcert-if-asked:
doc: remote-helpers: option pushcert if-asked
The front-end code for 'git checkout', 'git switch', and 'git
restore' has been restructured to cleanly separate their pathspec
and branch handling, eliminating a common bottleneck and paving the
way to libify utility helpers.
* jc/checkout-refactor:
checkout: move post_checkout_hook() to checkout.c
checkout: wrap overly long lines
checkout: restructure switch, restore, and checkout entrypoints
checkout: extract branch setup and tracking helpers
checkout: extract option validation and pathspec helpers
checkout: validate stage and merge option compatibility in checkout_paths()
checkout: validate new branch name in checkout_branch()
checkout: pass cb_option explicitly to branch name parsers
A commit that is emptied by melding a 'fixup!' or 'squash!' commit
during 'git rebase --autosquash' is now handled according to the
'--empty' option, allowing it to be dropped, kept, or to halt the
rebase.
* fz/rebase-autosquash-empty:
sequencer: honor --empty when a fixup!/squash! empties its target
The experimental 'git format-rev' has been taught a few more
formatting options.
* kh/format-rev-more-options:
format-rev: learn --abbrev, --color, and --date
doc: rev-list-options.adoc: factor out --date alts
format-rev: factor option variables into a struct
format-rev: place BUG calls first in callback
format-rev: use lower case for opts description
A new 'uploadpack.lazyFetchTrusted' configuration variable has been
introduced to allow 'upload-pack' to lazily fetch missing objects from
configured promisor remotes when serving trusted repositories.
* cc/lazy-fetch-trusted-bit:
builtin/upload-pack: set GIT_NO_LAZY_FETCH to 0 on trusted repo
promisor-remote: prevent infinite recursion when lazy fetching
upload-pack: read uploadpack.lazyFetchTrusted
setup: extract path_allowlist_apply()
promisor-remote: factor out lazy_fetch_objects()
Repository configuration getters in 'environment.c' have been
simplified by removing redundant NULL checks. The documentation for
these getters in 'environment.h' has been clarified, and inaccurate
section comments inside 'struct repo_config_values' have been removed.
* ty/repo-config-cleanups:
environment: remove inaccurate repo_config_values comments
environment: clarify repository config getter documentation
environment: drop redundant NULL checks in config getters
The parser for hex object names has been updated to reject uppercase
hexadecimal characters when running in the breaking changes mode, in
preparation for Git 3.0.
* bc/restrict-hex-to-lowercase:
hex: allow only lowercase object IDs in breaking changes mode
t5324: adjust tests for corrupt commit-graph
object-name: use hexval
hex: label usages of hex parsing for object IDs
hex: make hex_to_bytes accept kind of hex to use
hex: allow specifying hex type with hex2chr
hex: add functionality for lowercase-only hex
The 'git fetch' command can now configure how submodule fetch errors
are handled via 'fetch.submoduleErrors' and '--submodule-errors',
making them non-fatal. A premature failure during recursive submodule
fetches has been fixed by deferring the error until the OID-based
retry phase fails.
* pz/fetch-submodule-errors-config:
fetch: add fetch.submoduleErrors to make submodule fetch errors non-fatal
submodule: fix premature failure in recursive submodule fetch
The 'git repo info' command has been taught more keys to output
paths of various repository components (such as the working tree
root, superproject working tree, object database, etc.), supporting
both absolute and relative path formats.
* kj/repo-info-more-path-keys:
repo: add path.cdup
repo: add path.git-prefix
repo: add path.grafts with absolute and relative suffixes
repo: add path.index with absolute and relative suffixes
repo: add path.hooks with absolute and relative suffixes
repo: add path.superproject-root with absolute and relative suffixes
repo: add path.toplevel with absolute and relative suffix formatting
Functions like `xstrfmt()` and `xcalloc()` have been banned from use
in the trace2 API codebase to prevent calls to `die()` which lead to
unwanted process exits and recursion when memory allocation fails.
* ds/trace2-tolerate-failed-timestamp:
trace2: remove use of xcalloc()
trace2: remove use of ALLOC_GROW()
trace2: remove use of xstrfmt()
trace2: remove use of ALLOC_ARRAY()
trace2: remove use of xstrdup()
trace2: tolerate failed timestamp formatting
banned-die: create header for banning of functions
The 'git log -L<range>:<path>' command has been taught to limit
various 'diff' operations, such as '--stat', '--check', and '-G', to
the specified range and path.
* mm/line-log-limited-ops:
diffcore-pickaxe: limit -G to the -L tracked range
diff: support --check with -L line ranges
diff: support stat formats with -L
diff: extract a line-range diff helper for reuse
diff: emit -L hunk headers via xdiff's formatter
diff: simplify the line-range filter by classifying removals immediately
diff: rename line-range filter struct and clarify fields
The 'git multi-pack-index write --incremental' command has been
corrected to properly honor the '--base' option. Previously, the
custom base was ignored by the normal write path; packs from layers
above the selected base were incorrectly skipped by the pack exclusion
logic, and reachability closure for bitmaps was broken.
* tb/midx-incremental-custom-base:
midx-write: include packs above custom incremental base
midx: pass custom '--base' through incremental writes
t5334: expose shared `nth_line()` helper
Support for '-m', '-F', '-c', or '-C' options to supply a commit log
message from outside the editor has been added for all 'git commit
--fixup' variations.
* ec/commit-fixup-options:
commit: allow -c/-C for all kinds of --fixup
commit: allow -m/-F for all kinds of --fixup
The 'git range-diff' command has been augmented with a
'--matched-only' option to skip commits that are only present on
one side, allowing users to easily focus on only the commits that
have been retained.
* hn/range-diff-matched-only:
range-diff: add --matched-only to skip one-sided commits
The `git multi-pack-index write` command has been updated to
silently return success when there are no object entries to index.
This avoids writing empty `multi-pack-index` layers, which
previously caused subsequent incremental midx writes using the
`--bitmap` option to fail when attempting to load the missing
reverse index.
* pp/midx-write-skip-empty:
midx-write: skip writes with no object entries
The external merge driver in 'git merge' now uses the tempfile API
to create its temporary files. This ensures that these temporaries
are reliably cleaned up even when the merge driver or its parent Git
process is terminated abruptly.
* jk/merge-ll-tempfile-cleanup:
merge-ll: use tempfile API for external driver files
merge-ll: catch close() errors when writing external tempfiles
merge-ll: use strbuf to read back external merge result
A new linter test has been added to Documentation/lint-manpages.sh
to ensure that all non-command manual pages (guides and developer
interfaces) listed in Documentation/Makefile are present in
command-list.txt, replacing an older comment that reminded
developers to keep them in sync.
* ta/command-list-guides-sync-lint:
lint-docs: check the guide list in command-list.txt
command-list.txt: add gitformat-loose(5) and gitpacking(7)
The git config --global read operations have been updated to respect
both $HOME/.gitconfig and $XDG_CONFIG_HOME/git/config, fixing an
inconsistency where only the former was read when both configuration
files are present.
* dw/config-read-both-global:
config: read global scope via config_sequence
config: let sequence require a successful file
path: use forward slashes in XDG config on Windows
The --recurse-submodules option in 'git branch' has been fixed to
avoid a crash when the start point is not a reference (e.g., a raw
object ID). The creation path now skips setting up tracking and
properly forwards the absent tracking name to the submodule helper.
* vv/branch-recurse-no-start-ref:
branch: allow recursion with no tracking name
branch: do not track a start point with no ref
The codebase has been updated to use the newer utimensat() POSIX
function instead of the obsolescent utime(), allowing
high-precision timestamps while preserving fallback compatibility.
* as/utimensat-utimes:
compat/posix: drop legacy <utime.h> header and shims
treewide: use utimensat(2) instead of legacy utime(3p)
compat/posix: introduce utimensat(2) wrapper
When an HTTP request triggers a redirect and the target yields an
authentication challenge, the WWW-Authenticate headers received
during the redirect are now explicitly preserved across the
credential URL update, fixing an issue where they were incorrectly
cleared.
* ap/http-preserve-wwwauth-redirect:
http: preserve wwwauth_headers across redirects
The shell script implementation of 'git subtree' has been updated to
check for the presence of the configuration file of the new Rust
implementation, preventing users from accidentally running the old
script on repositories already managed by the new tool.
* ij/subtree-reject-v2-config:
git-subtree: Bail out if we find output from Rust rewrite (test)
git-subtree: Bail out if we find output from Rust rewrite
Assorted fixes for code paths that are not careful with boundary and
error conditions.
* js/coverity-fixes:
test-read-midx: check midx_fill_entry() result
oss-fuzz: handle reftable iterator initialization failures
t/unit-tests: check reftable iterator initialization
rerere: do not record failed conflict resolution data
midx: validate incremental MIDX pack IDs
gpg-interface: make signature-prefix matching length-aware
wrapper: guard writev_in_full() against signed overflow
The server-side protocol v2 response order for 'wanted-refs' and
'shallow-info' has been swapped to match the client's expectation,
fixing a fetch failure when the server has 'uploadpack.allowRefInWant'
enabled and the client performs a shallow fetch.
* rr/upload-pack-swap-shallow-wanted-ref:
upload-pack: swap wanted-ref/shallow-info responses
The can_all_from_reach() and can_all_from_reach_with_flag()
functions have been updated to accept a repository context,
preventing bugs where submodule merging incorrectly reads from the
superproject's commit-graph.
* of/commit-reach-repo-awareness:
commit-reach: parse commits in the given repository
The HTTP transport has been taught to check the revocation status of
the server certificate using the stapled OCSP response during the
TLS handshake via a new 'http.sslVerifyStatus' configuration
variable.
* gg/http-ssl-verify-status:
http: add http.sslVerifyStatus to check stapled OCSP responses
The 'Makefile' has been taught to precompile 'git-compat-util.h' to
speed up overall compilation, while excluding sources that do not
include the compatibility header.
* sg/precompile-git-compat-util:
Makefile: precompile "git-compat-util.h"
Makefile: reintroduce REFTABLE_OBJS
cmake: remove any "$(*_OBJS)" variables when parsing Makefile for sources
Makefile: remove XDIFF_OBJS initialization