Commit Graph

82503 Commits (3575e65682c012b5f902adc09f1a0a92c8a512dc)

Author SHA1 Message Date
Junio C Hamano 3575e65682 Merge branch 'tz/doc-override-less-env' into next
The documentation for core.pager has been updated to provide
examples of overriding the LESS environment variable for custom
pagers by prefixing the pager command in the configuration.

* tz/doc-override-less-env:
  doc: add more examples of overriding LESS in core.pager
2026-10-08 10:52:21 -07:00
Junio C Hamano 1721845755 Merge branch 'gm/filter-branch-state-map-fix' into next
The commit map populated from the state branch in 'git
filter-branch' has been corrected to parse the map using the
original-to-rewritten order.

* gm/filter-branch-state-map-fix:
  filter-branch: fix commit map init from state branch
2026-10-08 10:52:21 -07:00
Junio C Hamano 81a30ca417 Merge branch 'pw/stash-all-parseopt-fix' into next
Fix definition for the "--all" option to use symbolic constant
in the options[] array passed to parse_options API.

* pw/stash-all-parseopt-fix:
  stash: use named constant when parsing "--all"
2026-10-08 10:52:21 -07:00
Junio C Hamano 584c36229d Merge branch 'kh/format-patch-range-diff-notes' into next
The 'format-patch' command has been updated with options to
configure notes specifically for range-diff output, allowing them to
differ from the notes displayed on the patches themselves.

* kh/format-patch-range-diff-notes:
  format-patch: learn --[no-]range-diff-notes
  format-patch: simplify get_notes_arg parameters
2026-10-07 07:29:22 -07:00
Junio C Hamano 6e21340c28 Merge branch 'kh/doc-trailers-cmd-examples' into next
The documentation for 'git interpret-trailers' has been updated to
fix the grammatical errors in the descriptions of command examples.

* kh/doc-trailers-cmd-examples:
  doc: interpret-trailers: fix cmd examples
2026-10-07 07:29:22 -07:00
Junio C Hamano 4c9fc0083d Merge branch 'mg/doc-remote-set-head' into next
The documentation for 'git remote set-head' has been updated to
clarify that it only modifies the local repository's remote-tracking
symbolic reference, and does not alter the target remote
repository's own 'HEAD'.

* mg/doc-remote-set-head:
  doc: remote: say that it only affects the local repository
2026-10-07 07:29:22 -07:00
Junio C Hamano f4db8b50d0 Merge branch 'kz/doc-user-manual-typo' into next
A grammatically incorrect capitalization in user-manual.adoc has
been corrected.

* kz/doc-user-manual-typo:
  doc: fix typo in user manual
2026-10-07 07:29:21 -07:00
Junio C Hamano e5809bb3ae Merge branch 'ps/parse-options-subcommand-groups' into next
The parse-options API has been updated to support grouping
subcommands, and the 'git refs' command has been updated to use this
new feature to categorize its subcommands in its help output.

* ps/parse-options-subcommand-groups:
  builtin/refs: introduce subcommand groups
  parse-options: allow grouping subcommands
  parse-options: extract functions to print single option
  parse-options: fix completion format when first option is skipped
2026-10-07 07:29:21 -07:00
Junio C Hamano 4945de0395 Merge branch 'hn/object-name-push-short' into next
The @{upstream} notation had short-hand @{u} from the beginning,
and @{push} learned corresponding @{p} to match.

* hn/object-name-push-short:
  object-name: accept @{p} as short for @{push}
2026-10-07 07:29:21 -07:00
Junio C Hamano 9e5833e2a0 Merge branch 'bc/git-contacts-stdin' into next
The 'git-contacts' program (in contrib/) has been taught to read
patches from the standard input stream when an explicit dash ('-') is
passed in place of a file.

* bc/git-contacts-stdin:
  git-contacts: allow inputting patch via stdin
2026-10-07 07:29:21 -07:00
Junio C Hamano 6ae874acdf Merge branch 'ap/var-broken-down-idents' into next
The 'git var' command has been updated to output individual components
of the author and committer identities, take multiple keys on the
command-line, and support NUL-delimited output with the '-z' option.

* ap/var-broken-down-idents:
  var: add broken-out identity variables
  var: accept more than one variable
  var: add "-z" output mode
  var: represent multi-valued variables with a string_list
2026-10-07 07:29:21 -07:00
Junio C Hamano 0c9605a025 Merge branch 'dk/stash-apply-index-incore' into next
The handling of index conflicts in 'git stash apply --index' has
been optimized.  Instead of relying on expensive external
subprocesses using 'git diff-tree' and 'git apply', the index is now
merged in-core using the merge-ort machinery, which fixes a
concurrent lock file issue with autostash.

* dk/stash-apply-index-incore:
  builtin/stash: merge index in-core
  t3903: test failed "stash apply --index"
  stash: prepare merge options earlier
  builtin/stash: remove unused header
2026-10-07 07:29:20 -07:00
Junio C Hamano dfa7f97344 Merge branch 'jk/xdiff-size_t' into next
The internal diff and merge machinery has been updated to use
standard size_t types rather than signed longs for buffer
allocations and offsets, preventing subtle overflow issues on LLP64
architectures, and plugging uninitialized memory leaks along error
paths.

* jk/xdiff-size_t:
  merge-ll: report an error when reading external merge results fails
  merge-ll: handle external driver status before reading result
  merge-ll: use read_mmfile() to read external merge results
  xdiff: NUL-terminate buffers read by read_mmfile()
  xdiff: use size_t for buffer sizes
  xdiff: replace mmbuffer_t with mmfile_t
  xdiff: clean up read_mmfile() allocations on error
2026-10-07 07:29:20 -07:00
Junio C Hamano f924c1566d Merge branch 'ps/reftable-reflog-timezone' into next
The internal representation of timezones in the reflog for the
reftable format has been fixed to match the specification, which
dictates an offset in minutes rather than the parsed "+HHMM" integer
representation.

* ps/reftable-reflog-timezone:
  refs/reftable: fix on-disk representation of reflog timezones
  t/helper: fix segfault in "dump-reftable -t"
  date: add helpers to convert between "+HHMM" timezones and minutes
2026-10-07 07:29:20 -07:00
Junio C Hamano 68be8c611a Merge branch 'tb/t5520-reflog-expire' into next
The `t5520` test script has been updated to disable reflog expiration.
This prevents test flakiness caused by the auto-maintenance
reflog-expire task, which would otherwise immediately expire the
test's reflogs due to them carrying hardcoded timestamps from 2005.

* tb/t5520-reflog-expire:
  t5520: don't expire reflogs where it matters
2026-10-07 07:29:20 -07:00
Junio C Hamano 2300c151d3 Merge branch 'td/ci-large-test-resources' into next
CI resource exhaustion during test runs on GitHub Actions has been
mitigated by switching a comparison of a huge output to use a binary
comparison, and by capping the parallel jobs on Linux to the number
of available CPUs.

* td/ci-large-test-resources:
  ci: use twice the CPU count on both providers
  t4205: compare huge output without diff
2026-10-07 07:29:19 -07:00
Junio C Hamano 2b3488dc63 Merge branch 'ps/meson-improvements' into next
The build configurations for Meson have been optimized to avoid
recompiling HTTP sources multiple times and to utilize precompiled
headers for test-helpers and unit tests, reducing clean build times.
Additionally, the shell completion tests and GitLab CI MSVC runner
jobs have been fixed.

* ps/meson-improvements:
  gitlab-ci: fix hanging MSVC jobs
  meson: update wrappers
  meson: fix outdated completion helpers
  meson: use precompiled headers for unit tests
  meson: use precompiled headers for our test-helper
  meson: don't recompile git-remote-http(1) multiple times for tests
  meson: avoid recompiling HTTP sources several times
2026-10-07 07:29:19 -07:00
Junio C Hamano 6de20f6092 The 4th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-06 10:13:32 -07:00
Junio C Hamano c679abf7d2 Merge branch 'as/push-force-if-includes-no-reflog'
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
2026-10-06 10:13:31 -07:00
Junio C Hamano 38d6f3b3fd Merge branch 'js/p5551-fetch-rescan-fix'
The performance test for `git fetch` pack-dir rescans has been
updated to use the `--no-deref` option when cleaning up
remote-tracking branches.  This prevents `git update-ref` from
failing with a multiple updates error when both a symref and its
target are deleted in the same transaction.

* js/p5551-fetch-rescan-fix:
  p5551: fix repeated runs with update-ref --no-deref
2026-10-06 10:13:31 -07:00
Junio C Hamano 1bed40ea8c Merge branch 'jk/http-curl-strip-creds'
The HTTP transport has been updated to handle changes in recent curl
versions that strip credentials from the effective URL, preventing
unnecessary credential prompts during redirects.

* jk/http-curl-strip-creds:
  http: handle curl stripping creds from effective url
2026-10-06 10:13:31 -07:00
Junio C Hamano 0c53db4bcb Merge branch 'kz/doc-add-rm-typofix'
Typofixes.

* kz/doc-add-rm-typofix:
  doc: remove unnecessary commas in git-add and git-rm documentation
2026-10-06 10:13:31 -07:00
Junio C Hamano 5308423996 Merge branch 'jk/merge-ll-tempfile-cleanup'
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
2026-10-06 10:13:31 -07:00
Junio C Hamano 76514ee87b Merge branch 'js/gitlab-ci-windows-rust'
The Windows GitLab CI job has been updated to provision and use the
GCC-targeting 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
2026-10-06 10:13:31 -07:00
Junio C Hamano 5a7d1e8045 The 3rd batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-05 13:52:30 -07:00
Junio C Hamano 8fff639433 Merge branch 'jk/name-rev-update-hash-descriptions'
The documentation for 'git-name-rev' has been updated to refer to
object IDs instead of SHA-1, to more accurately reflect that the
active hash algorithm is used.

* jk/name-rev-update-hash-descriptions:
  name-rev: update hash descriptions
2026-10-05 13:52:30 -07:00
Junio C Hamano 9ac1e81458 Merge branch 'jk/parse-revision-opt-fixes'
The command-line parsing of revision options has been updated to
properly distinguish between malformed and unknown options, and to
correctly report the name of unknown options after they have been
moved during the option parsing process.

* jk/parse-revision-opt-fixes:
  revision: handle argv movement in parse_revision_opt()
  revision: avoid reporting known options as unknown on error
2026-10-05 13:52:29 -07:00
Junio C Hamano 053d5d2365 Merge branch 'rs/dir-skip-nested-repo-fix'
The directory traversal logic has been updated to correctly evaluate
pathspecs for ignored directories containing nested repositories,
and has been fortified to gracefully handle null pathspecs during
checkout operations.

* rs/dir-skip-nested-repo-fix:
  dir: skip excluded directory with nested repo on prefix match
2026-10-05 13:52:29 -07:00
Junio C Hamano 075eedb150 Merge branch 'je/doc-asciidoc-xrefs'
Various documentation files have been updated to use explicit
'<<TARGET,TARGET>>' AsciiDoc cross-references instead of plain text
references.  This improves rendering on the web and avoids broken
links when manual pages are included into other pages.

* je/doc-asciidoc-xrefs:
  doc: add more AsciiDoc cross-references
2026-10-05 13:52:29 -07:00
Junio C Hamano 0f1778a8d5 Merge branch 'yn/worktree-repair-completion'
The command-line completion script (in 'contrib/') has been taught
to complete the 'repair' subcommand for 'git worktree'.

* yn/worktree-repair-completion:
  completion: complete 'git worktree repair'
2026-10-05 13:52:29 -07:00
Junio C Hamano 8983b6ac7a Merge branch 'kn/ci-unit-tests-on-windows-fix'
The CI script has been updated to check for one-indexed slice numbers
when deciding to run unit tests on Windows, mirroring the behaviour in
the modern GitHub and GitLab workflows.

* kn/ci-unit-tests-on-windows-fix:
  ci: fix unit tests not running on windows
2026-10-05 13:52:29 -07:00
Junio C Hamano 0d1374ead3 Merge branch 'ps/reflog-expiry-fix'
The default expiry periods for both reachable and unreachable reflog
entries have been corrected from a past regression that swapped
them.

* ps/reflog-expiry-fix:
  reflog: fix default expiry periods
2026-10-05 13:52:28 -07:00
Junio C Hamano 3906479d13 Merge branch 'js/ci-debian-12-http2-workaround'
The Debian 12 CI job has been updated to skip a half-auth clone test
that occasionally fails due to a bug in the packaged curl version
handling early HTTP/2 responses.

* js/ci-debian-12-http2-workaround:
  ci: work around Debian 12's HTTP/2 authentication failures
2026-10-05 13:52:28 -07:00
Junio C Hamano d2bda356b7 Merge branch 'jt/object-file-batch-fsync-fix'
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
2026-10-05 13:52:28 -07:00
Junio C Hamano cfbffcd204 Merge branch 'tb/rerere-lock-grace'
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()
2026-10-05 13:52:28 -07:00
Junio C Hamano de66ba8633 Merge branch 'yt/winansi-die-lasterr-fix'
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
2026-10-05 13:52:28 -07:00
Kristoffer Haugsbakk 5008bde990 format-patch: learn --[no-]range-diff-notes
git-format-patch(1) passes on the notes behavior that it is using for
the patches to git-range-diff(1). In turn you get the same Git notes
displayed in the range diff as the ones you used to generate the
patches. And that makes sense in most cases.

However, I often make notes between series versions that mostly prepend
to the original. They end up looking like this:

    v3:
    [desc.]
    v2:
    [descr.]
    v1:
    [descr.]

These notes are meant for the git-format-patch(1) output since they
document the iterations. But including them also includes them in the
range diff. And they have nothing useful to say there.

Let’s teach git-format-patch(1) `--[no-]range-diff-notes` so that we
can pass in different notes refs to the range diff, or just turn them
off entirely.

In addition to storing the list of notes, we also need a boolean
`override` to distinguish these two cases:

1. No such options were given and empty list (use `--notes`)
2. Options were given and empty list (`--no-...` given; don’t use notes)

Unlike `--creation-factor`, `--[no-]range-diff-notes` does not error out
when used without `--range-diff`. This flexibility accommodates
workflows where users might configure default options in aliases or
wrapper scripts, allowing `--range-diff` to be toggled independently.

Add two tests here for the single-patch case, i.e. the case where the
range diff is on the patch and not in the cover letter. These are meant
as regression tests based on my encounter with single-patch range diff
notes handling bug.[1]

† 1: 155986b4 (format-patch: handle range-diff on notes correctly for
     single patches, 2025-09-25)

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-04 14:24:27 -07:00
Kristoffer Haugsbakk 4ddd9f289d format-patch: simplify get_notes_arg parameters
85bd88a7 (revision: add rdiff_log_arg to rev_info, 2025-09-25) added
`rdiff_log_arg` to `struct rev_info`. `get_notes_arg` was changed to
take a second parameter, namely that member:

    get_notes_args(&(rev.rdiff_log_arg), &rev);

But this is obviously unnecessary; we can just use `&rev`.

Now is also a good time to format this `for_each...` line since it’s
gotten quite long.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-04 14:24:27 -07:00
Phillip Wood 28699cf581 stash: use named constant when parsing "--all"
The code that stashes all untracked files compares the value of the
"include_untracked" variable to the constant "INCLUDE_ALL_FILES",
however the option parsing code for "--all" uses a hard coded integer
instead. Replace the integer with the named constant.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-04 14:17:12 -07:00
Kristoffer Haugsbakk 42017ff979 doc: interpret-trailers: fix cmd examples
Fix `trailer.<key-alias>.cmd` examples which have remained unchanged
since they were written in c364b7ef (trailer: add new .cmd config
option, 2021-05-03). (Modulo formatting changes.)

Steal how the `see` example is phrased and use that as a template:

    Configure a `see` trailer with a command to show the subject of a
    commit that is related, and show how it works:

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-04 09:03:30 -07:00
Junio C Hamano 8103b44651 The 2nd batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-03 21:45:55 -07:00
Junio C Hamano f85fa0c567 Merge branch 'jk/pull-null-merge-head'
'git pull' has been taught to fail more gracefully instead of
segfaulting when lookup_commit_reference() fails on unparseable
objects.

* jk/pull-null-merge-head:
  pull: avoid segfault when commit lookup fails
2026-10-03 21:45:55 -07:00
Junio C Hamano 6c698d827d Merge branch 'hd/diff-no-index-reverse-fix'
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
2026-10-03 21:45:55 -07:00
Junio C Hamano 8bc9c7fcfd Merge branch 'js/coverity-fixes'
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
2026-10-03 21:45:55 -07:00
Junio C Hamano 2fd3d524ea Merge branch 'rr/upload-pack-swap-shallow-wanted-ref'
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
2026-10-03 21:45:55 -07:00
Junio C Hamano 61bd247fa1 Merge branch 'of/commit-reach-repo-awareness'
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
2026-10-03 21:45:54 -07:00
Junio C Hamano 30cc6c91b6 Merge branch 'sg/precompile-git-compat-util'
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
2026-10-03 21:45:54 -07:00
Todd Zullinger c7860da7db doc: add more examples of overriding LESS in core.pager
We set the LESS environment variable unconditionally which can surprise
users of pagers which respect it but presume we'd only set LESS when
`core.pager` calls less.

Provide examples of setting LESS in `core.pager` as an additional way to
override the options we set in LESS.

Reported-by: Francisco Boni <boboniboni@gmail.com>
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-02 20:45:09 -07:00
Grant Moyer 4811dabed7 filter-branch: fix commit map init from state branch
The "--state-branch" option asks git-filter-branch(1) to write a
mapping from old to new objects into a branch to enable incremental
processing of large histories. This object mapping is stored as
a simple blob at "$state_branch:filter.map" with one object pair
per line in the format "$from_commit:$to_commit". Before processing
commits in a subsequent run, the state branch is used to populate an
object mapping directory, where each file is named "map/$from_commit"
and has contents "$to_commit".

In f6d855091e (filter-branch: stop depending on Perl, 2025-04-16),
we refactored git-filter-branch(1) to no longer require Perl,
but accidentally started to interpret object pairs in reverse (as
"$to_commit:$from_commit") when populating the map directory from
the state branch. This can cause all kinds of bad behavior from the
state-branch being effectively ignored to previously filtered objects
accidentally being mapped back to unfiltered objects. One especially
evident case occurs when "git filter-branch --prune-empty ..." maps
some commits to nothing, then on subsequent runs outputs many errors
while trying to create files with empty names, like:

> /usr/lib/git-core/git-filter-branch: line 305: ../map/: Is a directory

This regression went unnoticed because, since the introduction of
the only test for "--state-branch" in 709cfe848a (filter-branch: skip
commits present on --state-branch, 2018-06-26), the test accidentally
passes even if commits are not skipped. The test checks that after
populating a state branch with git-filter-branch(1), then running
it again with that state branch, the resulting filtered commits for
the first run and second run match. However since the filter used is
deterministic, the commits always match, even if the commits in the
state branch are re-filtered.

Fix the population of the object mapping dir by interpreting
object pairs as "$from_commit:$to_commit". Also fix the existing
"--state-branch" test by directly exiting with a non-zero code if
any commits from the state branch aren't skipped. Finally, add a new
"--state-branch" test which directly checks that a commit from the
state branch is used when incrementally filtering a repo.

Tested-by: Michele Locati <michele@locati.it>
Co-authored-by: Michele Locati <michele@locati.it>
Signed-off-by: Michele Locati <michele@locati.it>
Signed-off-by: Grant Moyer <dev@grantmoyer.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-02 20:43:21 -07:00
Khan Zimov 778c73948a doc: fix typo in user manual
The sentence following the git tag command continues the
preceding sentence, so "You" should be lowercase.

Signed-off-by: Khan Zimov <kaliugov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-02 09:46:18 -07:00