Commit Graph

80333 Commits

Author SHA1 Message Date
Junio C Hamano
892ffca84a Merge branch 'cs/subtree-split-recursion' into seen
When processing large history graphs on Debian or Ubuntu, "git
subtree" can die with a "recursion depth reached" error.

Comments?

* cs/subtree-split-recursion:
  contrib/subtree: reduce recursion during split
  contrib/subtree: functionalize split traversal
  contrib/subtree: reduce function side-effects
2026-03-10 16:26:34 -07:00
Junio C Hamano
9441acd1a8 Merge branch 'ar/parallel-hooks' into seen
* ar/parallel-hooks:
  hook: allow runtime enabling extensions.hookStdoutToStderr
  hook: introduce extensions.hookStdoutToStderr
  hook: add per-event jobs config
  hook: add -j/--jobs option to git hook run
  hook: mark non-parallelizable hooks
  hook: allow parallel hook execution
  hook: parse the hook.jobs config
  config: add a repo_config_get_uint() helper
  repository: fix repo_init() memleak due to missing _clear()
2026-03-10 16:26:34 -07:00
Junio C Hamano
aea7e4af6a Merge branch 'ar/config-hook-cleanups' into seen
Code clean-up around the recent "hooks defined in config" topic.

* ar/config-hook-cleanups:
  hook: show disabled hooks in "git hook list"
  hook: show config scope in git hook list
  hook: refactor hook_config_cache from strmap to named struct
  t1800: add test to verify hook execution ordering
  hook: make consistent use of friendly-name in docs
  hook: replace hook_list_clear() -> string_list_clear_func()
  hook: detect & emit two more bugs
  hook: rename cb_data_free/alloc -> hook_data_free/alloc
  hook: fix minor style issues
  hook: move unsorted_string_list_remove() to string-list.[ch]
2026-03-10 16:26:34 -07:00
Junio C Hamano
50cd7e1927 Merge branch 'js/parseopt-subcommand-autocorrection' into seen
The parse-options library learned to auto-correct misspelt
subcommand name.

* js/parseopt-subcommand-autocorrection:
  help: add tests for subcommand autocorrection
  parseopt: enable subcommand autocorrection for git-remote and git-notes
  parseopt: autocorrect mistyped subcommands
  autocorrect: provide config resolution API
  autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINTONLY
  help: move tty check for autocorrection to autocorrect.c
  help: make autocorrect handling reusable
  parseopt: extract subcommand handling from parse_options_step()
2026-03-10 16:26:33 -07:00
Junio C Hamano
3e060b3bfa Merge branch 'jt/fast-import-sign-again' into seen
"git fast-import" learned to optionally replace signature on
commits whose signature gets invalidated due to replaying by
signing afresh.

* jt/fast-import-sign-again:
  fast-import: add mode to re-sign invalid commit signatures
  gpg-interface: introduce sign_buffer_with_key()
  commit: remove unused forward declaration
2026-03-10 16:26:33 -07:00
Junio C Hamano
b91fb8775f Merge branch 'ms/t7605-test-path-is-helpers' into seen
* ms/t7605-test-path-is-helpers:
  t7605: use test_path_is_file instead of test -f
2026-03-10 16:26:28 -07:00
Mansi Singh
69efd53c81 t7605: use test_path_is_file instead of test -f
Replace old-style 'test -f' path checks with the modern
test_path_is_file helper in the merge_c1_to_c2_cmds block.

The helper provides clearer failure messages and is the
established convention in Git's test suite.

Signed-off-by: Mansi Singh <mansimaanu8627@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:25:10 -07:00
Jiamu Sun
92e2a91a77 help: add tests for subcommand autocorrection
These tests cover default behavior (help.autocorrect is unset), no
correction, immediate correction, delayed correction, and rejection
when the typo is too dissimilar.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
94d7bdf646 parseopt: enable subcommand autocorrection for git-remote and git-notes
Add PARSE_OPT_SUBCOMMAND_AUTOCORR to enable autocorrection for
subcommands parsed with PARSE_OPT_SUBCOMMAND_OPTIONAL.

Use it for git-remote and git-notes, so mistyped subcommands can be
automatically corrected, and builtin entry points no longer need to
handle the unknown subcommand error path themselves.

This is safe for these two builtins, because they either resolve to a
single subcommand or take no subcommand at all. This means that if the
subcommand parser encounters an unknown argument, it must be a mistyped
subcommand.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
bdd1ed4ad2 parseopt: autocorrect mistyped subcommands
Try to autocorrect the mistyped mandatory subcommand before showing an
error and exiting. Subcommands parsed with PARSE_OPT_SUBCOMMAND_OPTIONAL
are skipped.

In autocorrect_subcommand(), AUTOCORR_HINTONLY does the same as
AUTOCORR_NEVER, because builtins have a limited number of subcommands.
Those lists are currently not too large. Therefore, displaying all
subcommands via usage_with_options() is good enough here. This also
keeps the autocorrection handling simple.

Use a dynamic threshold for similar_enough() to check if the result is
usable. This can yield more accurate typo corrections. Even though
subcommands are often short, they can still vary across builtins. And in
the current implementation, a fixed threshold can't do better on both
short and long subcommands at the same time.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
46483152a4 autocorrect: provide config resolution API
Add autocorr_resolve(). This resolves and populates the correct values
for autocorrect config.

Make autocorrect config callback internal. The API is meant to provide
a high-level way to retrieve the config. Allowing access to the config
callback from outside violates that intent.

Additionally, in some cases, without access to the config callback, two
config iterations cannot be merged into one, which can hurt performance.
This is fine, as the code path that calls autocorr_resolve() is cold.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
2a48e5668b autocorrect: rename AUTOCORRECT_SHOW to AUTOCORRECT_HINTONLY
AUTOCORRECT_SHOW is ambiguous. Its purpose is to show commands similar
to the unknown one and take no other action. Rename it to fit the
semantics.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
c8ac3d589a help: move tty check for autocorrection to autocorrect.c
TTY checking is the autocorrect config parser's responsibility. It must
ensure the parsed value is correct and reliable. Thus, move the check to
autocorr_resolve_config().

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
db8b01619c help: make autocorrect handling reusable
Move config parsing and prompt/delay handling into autocorrect.c and
expose them in autocorrect.h. This makes autocorrect reusable regardless
of which target links against it.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Jiamu Sun
38ed9faa1d parseopt: extract subcommand handling from parse_options_step()
Move the subcommand branch out of parse_options_step() into a new
handle_subcommand() helper. Also, make parse_subcommand() return a
simple success/failure status.

This removes the switch over impossible parse_opt_result values and
makes the non-option path easier to follow and maintain.

Signed-off-by: Jiamu Sun <39@barroit.sh>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-10 16:21:55 -07:00
Junio C Hamano
be64400f67 Merge branch 'ps/build-tweaks' into jch
* ps/build-tweaks:
  meson: precompile "git-compat-util.h"
  meson: compile compatibility sources separately
  git-compat-util.h: move warning infra to prepare for PCHs
  builds: move build scripts into "tools/"
  contrib: move "update-unicode.sh" script into "tools/"
  contrib: move "coverage-diff.sh" script into "tools/"
  contrib: move "coccinelle/" directory into "tools/"
  Introduce new "tools/" directory
2026-03-10 14:24:07 -07:00
Junio C Hamano
1a762e6c31 Merge branch 'ps/object-counting' into jch
* ps/object-counting:
  odb: introduce generic object counting
  odb/source: introduce generic object counting
  object-file: generalize counting objects
  object-file: extract logic to approximate object count
  packfile: extract logic to count number of objects
  odb: stop including "odb/source.h"
2026-03-10 14:24:04 -07:00
Junio C Hamano
9d9a64660e Merge branch 'ty/doc-diff-u-wo-number' into jch
* ty/doc-diff-u-wo-number:
  diff: document -U without <n> as using default context
2026-03-10 14:24:03 -07:00
Junio C Hamano
f7948e8fb5 Merge branch 'mf/apply-p-no-atoi' into jch
* mf/apply-p-no-atoi:
  apply.c: fix -p argument parsing
2026-03-10 14:24:02 -07:00
Junio C Hamano
cd94ed5f80 Merge branch 'jc/doc-wholesale-replace-before-next' into jch
Doc update.

* jc/doc-wholesale-replace-before-next:
  SubmittingPatches: spell out "replace fully to pretend to be perfect"
2026-03-10 14:24:02 -07:00
Junio C Hamano
d9903d45bd Merge branch 'cf/constness-fixes' into jch
Small code clean-up around constness area.

* cf/constness-fixes:
  dir: avoid -Wdiscarded-qualifiers in remove_path()
  bloom: remove a misleading const qualifier
2026-03-10 14:24:02 -07:00
Junio C Hamano
60595a33b5 Merge branch 'pt/promisor-lazy-fetch-no-recurse' into jch
The mechanism to avoid recursive lazy-fetch from promisor remotes
were not propagated properly to child "git fetch" processes, which
has been corrected.

Comments?

* pt/promisor-lazy-fetch-no-recurse:
  promisor-remote: prevent lazy-fetch recursion in child fetch
2026-03-10 14:24:01 -07:00
Junio C Hamano
0e7d80d609 Merge branch 'pt/fsmonitor-linux' into jch
The fsmonitor daemon has been implemented for Linux.

* pt/fsmonitor-linux:
  fsmonitor: convert shown khash to strset in do_handle_client
  fsmonitor: add tests for Linux
  fsmonitor: add timeout to daemon stop command
  fsmonitor: close inherited file descriptors and detach in daemon
  run-command: add close_fd_above_stderr option
  fsmonitor: implement filesystem change listener for Linux
  fsmonitor: rename fsm-settings-darwin.c to fsm-settings-unix.c
  fsmonitor: rename fsm-ipc-darwin.c to fsm-ipc-unix.c
  fsmonitor: use pthread_cond_timedwait for cookie wait
  compat/win32: add pthread_cond_timedwait
  fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon
  fsmonitor: fix khash memory leak in do_handle_client
2026-03-10 14:24:00 -07:00
Junio C Hamano
3736d7bc02 Merge branch 'ps/upload-pack-buffer-more-writes' into jch
Reduce system overhead "git upload-pack" spends relaying "git
pack-objects" output to the "git fetch" running on the other end of
the connection.

Comments?
cf. <xmqqseaf5k5t.fsf@gitster.g>

* ps/upload-pack-buffer-more-writes:
  builtin/pack-objects: reduce lock contention when writing packfile data
  csum-file: drop `hashfd_throughput()`
  csum-file: introduce `hashfd_ext()`
  sideband: use writev(3p) to send pktlines
  wrapper: introduce writev(3p) wrappers
  compat/posix: introduce writev(3p) wrapper
  upload-pack: reduce lock contention when writing packfile data
  upload-pack: prefer flushing data over sending keepalive
  upload-pack: adapt keepalives based on buffering
  upload-pack: fix debug statement when flushing packfile data
2026-03-10 14:24:00 -07:00
Junio C Hamano
2d8ab72dc9 Merge branch 'tb/incremental-midx-part-3.2' into jch
Further work on incremental repacking using MIDX/bitmap

* tb/incremental-midx-part-3.2:
  midx: enable reachability bitmaps during MIDX compaction
  midx: implement MIDX compaction
  t/helper/test-read-midx.c: plug memory leak when selecting layer
  midx-write.c: factor fanout layering from `compute_sorted_entries()`
  midx-write.c: enumerate `pack_int_id` values directly
  midx-write.c: extract `fill_pack_from_midx()`
  midx-write.c: introduce `midx_pack_perm()` helper
  midx: do not require packs to be sorted in lexicographic order
  midx-write.c: introduce `struct write_midx_opts`
  midx-write.c: don't use `pack_perm` when assigning `bitmap_pos`
  t/t5319-multi-pack-index.sh: fix copy-and-paste error in t5319.39
  git-multi-pack-index(1): align SYNOPSIS with 'git multi-pack-index -h'
  git-multi-pack-index(1): remove non-existent incompatibility
  builtin/multi-pack-index.c: make '--progress' a common option
  midx: introduce `midx_get_checksum_hex()`
  midx: rename `get_midx_checksum()` to `midx_get_checksum_hash()`
  midx: mark `get_midx_checksum()` arguments as const
2026-03-10 14:23:59 -07:00
Junio C Hamano
9bdc6a26dd Merge branch 'lc/rebase-trailer' into jch
"git rebase" learns "--trailer" command to drive the
interpret-trailers machinery.

Comments?

* lc/rebase-trailer:
  rebase: support --trailer
  commit, tag: parse --trailer with OPT_STRVEC
  trailer: append trailers without fork/exec
  trailer: libify a couple of functions
  interpret-trailers: refactor create_in_place_tempfile()
  interpret-trailers: factor trailer rewriting
2026-03-10 14:23:59 -07:00
Junio C Hamano
1606e257e1 Merge branch 'ac/help-sort-correctly' into jch
The code in "git help" that shows configuration items in sorted
order was awkwardly organized and prone to bugs.

* ac/help-sort-correctly:
  help: cleanup the contruction of keys_uniq
2026-03-10 14:23:58 -07:00
Junio C Hamano
88633f2119 Merge branch 'sa/replay-revert' into jch
"git replay" (experimental) learns, in addition to "pick" and
"replay", a new operating mode "revert".

* sa/replay-revert:
  replay: add --revert mode to reverse commit changes
  sequencer: extract revert message formatting into shared function
2026-03-10 14:23:57 -07:00
Junio C Hamano
aeea1954fc Merge branch 'yc/histogram-hunk-shift-fix' into jch
The final clean-up phase of the diff output could turn the result of
histogram diff algorithm suboptimal, which has been corrected.

* yc/histogram-hunk-shift-fix:
  xdiff: re-diff shifted change groups when using histogram algorithm
2026-03-10 14:23:57 -07:00
Junio C Hamano
3ea4f75969 Merge branch 'jc/neuter-sideband-fixup' into jch
Try to resurrect and reboot a stalled "avoid sending risky escape
sequences taken from sideband to the terminal" topic by Dscho.  The
plan is to keep it in 'next' long enough to see if anybody screams
with the "everything dropped except for ANSI color escape sequence"
default.

Comments?

* jc/neuter-sideband-fixup:
  sideband: drop 'default' configuration
  sideband: offer to configure sanitizing on a per-URL basis
  sideband: add options to allow more control sequences to be passed through
  sideband: do allow ANSI color sequences by default
  sideband: introduce an "escape hatch" to allow control characters
  sideband: mask control characters
2026-03-10 14:23:56 -07:00
Junio C Hamano
5a63432aba Merge branch 'ps/t9200-test-path-is-helpers' into jch
Test update.

* ps/t9200-test-path-is-helpers:
  t9200: replace test -f/-d with modern path helpers
2026-03-10 14:23:55 -07:00
Junio C Hamano
81e115e3ae ### match next 2026-03-10 14:23:55 -07:00
Junio C Hamano
a26c6e0f61 Merge branch 'ty/patch-ids-document-lazy-eval' into jch
In-code comment update to record a design decision to allow lazy
computation of patch IDs.

* ty/patch-ids-document-lazy-eval:
  patch-ids: document intentional const-casting in patch_id_neq()
2026-03-10 14:23:55 -07:00
Junio C Hamano
887df64a7d Merge branch 'rs/history-ergonomics-updates-fix' into jch
Fix use of uninitialized variable.

* rs/history-ergonomics-updates-fix:
  history: initialize rev_info in cmd_history_reword()
2026-03-10 14:23:54 -07:00
Junio C Hamano
0b2fcec008 Merge branch 'jk/unleak-mmap' into jch
Plug a few leaks where mmap'ed memory regions are not unmapped.

* jk/unleak-mmap:
  meson: turn on NO_MMAP when building with LSan
  Makefile: turn on NO_MMAP when building with LSan
  object-file: fix mmap() leak in odb_source_loose_read_object_stream()
  pack-revindex: avoid double-loading .rev files
  check_connected(): fix leak of pack-index mmap
  check_connected(): delay opening new_pack
2026-03-10 14:23:53 -07:00
Junio C Hamano
003e933484 Merge branch 'ty/setup-error-tightening' into jch
While discovering a ".git" directory, the code treats any stat()
failure as a sign that a filesystem entity .git does not exist
there, and ignores ".git" that is not a "gitdir" file or a
directory.  The code has been tightened to notice and report
filesystem corruption better.

* ty/setup-error-tightening:
  setup: improve error diagnosis for invalid .git files
2026-03-10 14:23:53 -07:00
Junio C Hamano
b103355813 Merge branch 'os/doc-git-custom-commands' into jch
Doc update.

* os/doc-git-custom-commands:
  doc: make it easier to find custom command information
2026-03-10 14:23:52 -07:00
Junio C Hamano
b236bc6972 Merge branch 'fp/t3310-unhide-git-failures' into jch
The construct 'test "$(command)" = expectation' loses the exit
status from the command, which has been fixed by breaking up the
statement into pieces.

* fp/t3310-unhide-git-failures:
  t3310: avoid hiding failures from rev-parse in command substitutions
2026-03-10 14:23:52 -07:00
Junio C Hamano
a92d5005dd Merge branch 'mf/format-patch-cover-letter-format' into jch
"git format-patch --cover-letter" learns to use a simpler format
instead of the traditional shortlog format to list its commits with
a new --cover-letter-format option and format.commitListFormat
configuration variable.

* mf/format-patch-cover-letter-format:
  docs: add usage for the cover-letter fmt feature
  format-patch: add commitListFormat config
  format-patch: add ability to use alt cover format
  format-patch: move cover letter summary generation
  pretty.c: add %(count) and %(total) placeholders
2026-03-10 14:23:51 -07:00
Junio C Hamano
3ead3f5b11 Merge branch 'jt/repo-structure-extrema' into jch
"git repo structure" command learns to report maximum values on
various aspects of objects it inspects.

* jt/repo-structure-extrema:
  builtin/repo: find tree with most entries
  builtin/repo: find commit with most parents
  builtin/repo: add OID annotations to table output
  builtin/repo: collect largest inflated objects
  builtin/repo: add helper for printing keyvalue output
  builtin/repo: update stats for each object
2026-03-10 14:23:50 -07:00
Junio C Hamano
47522ef445 Merge branch 'sp/wt-status-wo-the-repository' into jch
Reduce dependence on the global the_hash_algo and the_repository
variables of wt-status code path.

* sp/wt-status-wo-the-repository:
  wt-status: use hash_algo from local repository instead of global the_hash_algo
  wt-status: replace uses of the_repository with local repository instances
  wt-status: pass struct repository through function parameters
2026-03-10 14:23:50 -07:00
Junio C Hamano
59e14b0811 Merge branch 'sp/send-email-validate-charset' into jch
"git send-email" has learned to be a bit more careful when it
accepts charset to use from the end-user, to avoid 'y' (mistaken
'yes' when expecting a charset like 'UTF-8') and other nonsense.

* sp/send-email-validate-charset:
  send-email: validate charset name in 8bit encoding prompt
2026-03-10 14:23:49 -07:00
Junio C Hamano
074573bdbb Merge branch 'dt/send-email-client-cert' into jch
"git send-email" learns to support use of client-side certificates.

* dt/send-email-client-cert:
  send-email: add client certificate options
2026-03-10 14:23:48 -07:00
Junio C Hamano
2f651bb4d4 Merge branch 'ps/ci-gitlab-prepare-for-macos-14-deprecation' into jch
Move gitlab CI from macOS 14 images that are being deprecated.

* ps/ci-gitlab-prepare-for-macos-14-deprecation:
  gitlab-ci: update to macOS 15 images
  meson: detect broken iconv that requires ICONV_RESTART_RESET
  meson: simplify iconv-emits-BOM check
2026-03-10 14:23:48 -07:00
Junio C Hamano
329478eb05 Merge branch 'ag/send-email-sasl-with-host-port' into jch
"git send-email" learns to pass hostname/port to Authen::SASL
module.

* ag/send-email-sasl-with-host-port:
  send-email: pass smtp hostname and port to Authen::SASL
2026-03-10 14:23:47 -07:00
Junio C Hamano
2fe4b7bb7e Merge branch 'ss/t9123-setup-inside-test-expect-success' into jch
Test clean-up.

* ss/t9123-setup-inside-test-expect-success:
  t9123: use test_when_finished for cleanup
2026-03-10 14:23:46 -07:00
Junio C Hamano
9fef3f76ff Merge branch 'sk/oidmap-clear-with-custom-free-func' into jch
A bit of OIDmap API enhancement and cleanup.

* sk/oidmap-clear-with-custom-free-func:
  builtin/rev-list: migrate missing_objects cleanup to oidmap_clear_with_free()
  oidmap: make entry cleanup explicit in oidmap_clear
2026-03-10 14:23:45 -07:00
Junio C Hamano
cd32761e82 Merge branch 'ps/odb-sources' into jch
The object source API is getting restructured to allow plugging new
backends.

* ps/odb-sources:
  odb/source: make `begin_transaction()` function pluggable
  odb/source: make `write_alternate()` function pluggable
  odb/source: make `read_alternates()` function pluggable
  odb/source: make `write_object_stream()` function pluggable
  odb/source: make `write_object()` function pluggable
  odb/source: make `freshen_object()` function pluggable
  odb/source: make `for_each_object()` function pluggable
  odb/source: make `read_object_stream()` function pluggable
  odb/source: make `read_object_info()` function pluggable
  odb/source: make `close()` function pluggable
  odb/source: make `reprepare()` function pluggable
  odb/source: make `free()` function pluggable
  odb/source: introduce source type for robustness
  odb: move reparenting logic into respective subsystems
  odb: embed base source in the "files" backend
  odb: introduce "files" source
  odb: split `struct odb_source` into separate header
2026-03-10 14:23:45 -07:00
Junio C Hamano
0d8a8c63c2 Merge branch 'jt/doc-submitting-patches-study-before-sending' into jch
Doc update for our contributors.

* jt/doc-submitting-patches-study-before-sending:
  Documentation: extend guidance for submitting patches
2026-03-10 14:23:41 -07:00
Junio C Hamano
8475b307c3 Merge branch 'hn/status-compare-with-push' into jch
"git status" learned to show comparison between the current branch
and various other branches listed on status.compareBranches
configuration.

* hn/status-compare-with-push:
  status: clarify how status.compareBranches deduplicates
2026-03-10 14:23:41 -07:00