80330 Commits

Author SHA1 Message Date
Junio C Hamano
41688c1a23 The 21st batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-25 12:58:05 -07:00
Junio C Hamano
8e2964dc89 Merge branch 'ps/object-counting'
The logic to count objects has been cleaned up.

* 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-25 12:58:05 -07:00
Junio C Hamano
105a22cf69 Merge branch 'tb/incremental-midx-part-3.2'
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-25 12:58:04 -07:00
Junio C Hamano
ce74208c2f The 20th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-24 12:31:34 -07:00
Junio C Hamano
253ddb6016 Merge branch 'dd/cocci-do-not-pass-strbuf-by-value'
Add a coccinelle rule to break the build when "struct strbuf" gets
passed by value.

* dd/cocci-do-not-pass-strbuf-by-value:
  stash: do not pass strbuf by value
  coccinelle: detect struct strbuf passed by value
2026-03-24 12:31:34 -07:00
Junio C Hamano
c006399b73 Merge branch 'ty/doc-diff-u-wo-number'
"git diff -U<num>" was too lenient in its command line parsing and
took an empty string as a valid <num>.

* ty/doc-diff-u-wo-number:
  diff: document -U without <n> as using default context
2026-03-24 12:31:34 -07:00
Junio C Hamano
8023abc632 Merge branch 'ps/upload-pack-buffer-more-writes'
Reduce system overhead "git upload-pack" spends on relaying "git
pack-objects" output to the "git fetch" running on the other end of
the connection.

* 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-24 12:31:34 -07:00
Junio C Hamano
231f8100c4 Merge branch 'yc/histogram-hunk-shift-fix'
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-24 12:31:34 -07:00
Junio C Hamano
7f13e5c8c7 Merge branch 'mf/t0008-cleanup'
Test clean-up.

* mf/t0008-cleanup:
  t0008: improve test cleanup to fix failing test
2026-03-24 12:31:33 -07:00
Junio C Hamano
448cea8de0 Merge branch 'pb/t4200-test-path-is-helpers'
Test clean-up.

* pb/t4200-test-path-is-helpers:
  t4200: convert test -[df] checks to test_path_* helpers
2026-03-24 12:31:33 -07:00
Junio C Hamano
067ee91920 Merge branch 'jk/transport-color-leakfix'
Leakfix.

* jk/transport-color-leakfix:
  transport: plug leaks in transport_color_config()
2026-03-24 12:31:33 -07:00
Junio C Hamano
b9c55cff8a Merge branch 'rj/pack-refs-tests-path-is-helpers'
Test updates.

* rj/pack-refs-tests-path-is-helpers:
  t/pack-refs-tests: use test_path_is_missing
2026-03-24 12:31:33 -07:00
Junio C Hamano
9d9cd3830f Merge branch 'ps/clar-wo-path-max'
Clar (unit testing framework) update from the upstream.

* ps/clar-wo-path-max:
  clar: update to fix compilation on platforms without PATH_MAX
2026-03-24 12:31:32 -07:00
Junio C Hamano
04a7124af0 Merge branch 'gj/user-manual-fix-grep-example'
Fix an example in the user-manual.

* gj/user-manual-fix-grep-example:
  doc: fix git grep args order in Quick Reference
2026-03-24 12:31:32 -07:00
Junio C Hamano
49e6a7cd63 Merge branch 'ps/history-split'
"git history" learned the "split" subcommand.

* ps/history-split:
  builtin/history: implement "split" subcommand
  builtin/history: split out extended function to create commits
  cache-tree: allow writing in-memory index as tree
  add-patch: allow disabling editing of hunks
  add-patch: add support for in-memory index patching
  add-patch: remove dependency on "add-interactive" subsystem
  add-patch: split out `struct interactive_options`
  add-patch: split out header from "add-interactive.h"
2026-03-24 12:31:32 -07:00
Junio C Hamano
dd33e738a4 Merge branch 'ss/t0410-delete-object-cleanup'
Test clean-up.

* ss/t0410-delete-object-cleanup:
  t0410: modernize delete_object helper
2026-03-24 12:31:32 -07:00
Junio C Hamano
410ab9a257 Merge branch 'jt/fast-import-sign-again'
"git fast-import" learned to optionally replace signature on
commits whose signatures get invalidated due to replaying by
signing afresh.

* jt/fast-import-sign-again:
  fast-import: add mode to sign commits with invalid signatures
  gpg-interface: allow sign_buffer() to use default signing key
  commit: remove unused forward declaration
2026-03-24 12:31:31 -07:00
Junio C Hamano
1080981ddb The 19th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-23 09:20:31 -07:00
Junio C Hamano
04b3115bd8 Merge branch 'ty/mktree-wo-the-repository'
Code clean-up.

* ty/mktree-wo-the-repository:
  builtin/mktree: remove USE_THE_REPOSITORY_VARIABLE
2026-03-23 09:20:31 -07:00
Junio C Hamano
74137b733e Merge branch 'bb/imap-send-openssl-4.0-prep'
"imap-send" used to use functions whose use is going to be removed
with OpenSSL 4.0; rewrite them using public API that has been
available since OpenSSL 1.1 since 2016 or so.

* bb/imap-send-openssl-4.0-prep:
  imap-send: move common code into function host_matches()
  imap-send: use the OpenSSL API to access the subject common name
  imap-send: use the OpenSSL API to access the subject alternative names
2026-03-23 09:20:31 -07:00
Junio C Hamano
133a880df6 Merge branch 'ac/help-sort-correctly'
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-23 09:20:30 -07:00
Junio C Hamano
05f91df704 Merge branch 'jc/test-allow-sed-with-ere'
Adjust test-lint to allow "sed -E" to use ERE in the patterns.

* jc/test-allow-sed-with-ere:
  t: allow use of "sed -E"
2026-03-23 09:20:30 -07:00
Junio C Hamano
859132edb9 Merge branch 'ng/submodule-default-remote'
Instead of hardcoded 'origin', use the configured default remote
when fetching from submodules.

* ng/submodule-default-remote:
  submodule: fetch missing objects from default remote
2026-03-23 09:20:30 -07:00
Junio C Hamano
d10d042656 Merge branch 'ms/t7605-test-path-is-helpers'
Test updates.

* ms/t7605-test-path-is-helpers:
  t7605: use test_path_is_file instead of test -f
2026-03-23 09:20:30 -07:00
Junio C Hamano
651847f5bc Merge branch 'cf/constness-fixes'
Small code clean-up around the constness area.

* cf/constness-fixes:
  dir: avoid -Wdiscarded-qualifiers in remove_path()
  bloom: remove a misleading const qualifier
2026-03-23 09:20:29 -07:00
Junio C Hamano
6e8d538aab Merge branch 'master' of https://github.com/j6t/git-gui
* 'master' of https://github.com/j6t/git-gui:
  git-gui: grey out comment lines in commit message
  git-gui: wire up "git-gui--askyesno" with Meson
  git-gui: massage "git-gui--askyesno" with "generate-script.sh"
  git-gui: prefer shell at "/bin/sh" with Meson
  git-gui: fix use of GIT_CEILING_DIRECTORIES
  git-gui: shift tabstops to account for the first column of patch text
2026-03-21 09:25:58 -07:00
Junio C Hamano
b70a02dcc9 Merge branch 'master' of https://github.com/j6t/gitk
* 'master' of https://github.com/j6t/gitk:
  gitk: l10n: make PO headers identify the Gitk project
  gitk: ignore generated POT file
  gitk: i18n: use "Gitk" as package name in POT file
  gitk: commit translation files without file information
  gitk: support link color in the Preferences dialog
  gitk: use config settings for head/tag colors
2026-03-21 09:25:10 -07:00
Johannes Sixt
c8c5df79df Merge branch 'jx/i18n-fix' of github.com:jiangxin/gitk
* 'jx/i18n-fix' of github.com:jiangxin/gitk:
  gitk: l10n: make PO headers identify the Gitk project
  gitk: ignore generated POT file
  gitk: i18n: use "Gitk" as package name in POT file

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2026-03-20 09:23:32 +01:00
Johannes Sixt
056fb617f6 Merge branch 'js/i18n-no-location'
* js/i18n-no-location:
  gitk: commit translation files without file information
2026-03-20 09:20:29 +01:00
Johannes Sixt
696e001e12 Merge branch 'sb/heed-ref-decoration-settings'
* sb/heed-ref-decoration-settings:
  gitk: use config settings for head/tag colors
2026-03-20 09:07:09 +01:00
Jiang Xin
e0f3d08b9b gitk: l10n: make PO headers identify the Gitk project
Commit f697d08 (gitk: i18n: use "Gitk" as package name in POT file,
2026-03-19) updated the generated POT template to use "Gitk" in its
Project-Id-Version header. Several existing PO files still carry older
header values such as "git" or "git-gui", so they do not consistently
identify themselves as Gitk translations.

Update the Project-Id-Version field in all Gitk PO files so that they
identify the Gitk project consistently.

The "Project-Id-Version" field in the PO header helps tools identify
which project a PO file belongs to. For example, Git's
"git-po-helper" uses it to choose project-specific checks and POT
handling rules. Without this change, some Gitk PO files are
misidentified because their headers still refer to other projects.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-03-20 09:42:03 +08:00
Jiang Xin
cc10508b18 gitk: ignore generated POT file
"po/gitk.pot" is generated from the source for translation maintenance.
Ignore it in the working tree so regenerating the template does not
introduce unnecessary noise in `git status`.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-03-20 09:31:04 +08:00
Jiang Xin
f697d08df7 gitk: i18n: use "Gitk" as package name in POT file
Use "Gitk" instead of the placeholder "PACKAGE" in the header of the
generated po/gitk.pot file. In particular, the "Project-Id-Version"
field in the header entry should be set to:

    "Project-Id-Version: Gitk\n"

New PO files generated from this POT file will inherit that package
name.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2026-03-20 09:31:04 +08:00
Junio C Hamano
7ff1e8dc1e The 18th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-19 09:54:57 -07:00
Junio C Hamano
39267c8a7e Merge branch 'ss/submodule--helper-use-xmalloc'
Code clean-up.

* ss/submodule--helper-use-xmalloc:
  submodule--helper: replace malloc with xmalloc
2026-03-19 09:54:57 -07:00
Junio C Hamano
80595ab08e Merge branch 'ps/unit-test-c-escape-names.txt'
The unit test helper function was taught to use backslash +
mnemonic notation for certain control characters like "\t", instead
of octal notation like "\011".

* ps/unit-test-c-escape-names.txt:
  test-lib: print escape sequence names
2026-03-19 09:54:56 -07:00
Junio C Hamano
5a0ee6f793 Merge branch 'jc/doc-wholesale-replace-before-next'
Doc update.

* jc/doc-wholesale-replace-before-next:
  SubmittingPatches: spell out "replace fully to pretend to be perfect"
2026-03-19 09:54:56 -07:00
Junio C Hamano
accd0e107b Merge branch 'lc/rebase-trailer'
"git rebase" learns "--trailer" command to drive the
interpret-trailers machinery.

* 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-19 09:54:56 -07:00
Junio C Hamano
a7a079c2c4 Merge branch 'bk/run-command-wo-the-repository'
The run_command() API lost its implicit dependencyon the singleton
`the_repository` instance.

* bk/run-command-wo-the-repository:
  run-command: wean auto_maintenance() functions off the_repository
  run-command: wean start_command() off the_repository
2026-03-19 09:54:56 -07:00
Junio C Hamano
2ca397fa7c Merge branch 'ps/editorconfig-unanchor'
Editorconfig filename patterns were specified incorrectly, making
many source files inside subdirectories unaffected, which has been
corrected.

* ps/editorconfig-unanchor:
  editorconfig: fix style not applying to subdirs anymore
2026-03-19 09:54:55 -07:00
Junio C Hamano
432282f9cb Merge branch 'ss/t3200-test-zero-oid'
A test now uses the symbolic constant $ZERO_OID instead of 40 "0" to
work better with SHA-256 as well as SHA-1.

* ss/t3200-test-zero-oid:
  t3200: replace hardcoded null OID with $ZERO_OID
2026-03-19 09:54:55 -07:00
Junio C Hamano
17b9c759bd Merge branch 'dd/list-objects-filter-options-wo-strbuf-split'
The way combined list-object filter options are parsed has been
revamped.

* dd/list-objects-filter-options-wo-strbuf-split:
  list-objects-filter-options: avoid strbuf_split_str()
  worktree: do not pass strbuf by value
2026-03-19 09:54:55 -07:00
Junio C Hamano
2d576325c3 Merge branch 'ps/t9200-test-path-is-helpers'
Test update.

* ps/t9200-test-path-is-helpers:
  t9200: replace test -f with modern path helper
  t9200: handle missing CVS with skip_all
2026-03-19 09:54:55 -07:00
Jeff King
2594747ad1 transport: plug leaks in transport_color_config()
We retrieve config values with repo_config_get_string(), which will
allocate a new copy of the string for us. But we don't hold on to those
strings, since they are just fed to git_config_colorbool() and
color_parse(). But nor do we free them, which means they leak.

We can fix this by using the "_tmp" form of repo_config_get_string(),
which just hands us a pointer directly to the internal storage. This is
OK for our purposes, since we don't need it to last for longer than our
parsing calls.

Two interesting side notes here:

  1. Many types already have a repo_config_get_X() variant that handles
     this for us (e.g., repo_config_get_bool()). But neither colorbools
     nor colors themselves have such helpers. We might think about
     adding them, but converting all callers is a larger task, and out
     of scope for this fix.

  2. As far as I can tell, this leak has been there since 960786e761
     (push: colorize errors, 2018-04-21), but wasn't detected by LSan in
     our test suite. It started triggering when we applied dd3693eb08
     (transport-helper, connect: use clean_on_exit to reap children on
     abnormal exit, 2026-03-12) which is mostly unrelated.

     Even weirder, it seems to trigger only with clang (and not gcc),
     and only with GIT_TEST_DEFAULT_REF_FORMAT=reftable. So I think this
     is another odd case where the pointers happened to be hanging
     around in stack memory, but changing the pattern of function calls
     in nearby code was enough for them to be incidentally overwritten.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16 13:31:48 -07:00
PRASHANT S BISHT
d893f3e7cc t4200: convert test -[df] checks to test_path_* helpers
Replace old-style path existence checks in t4200-rerere.sh with
the appropriate test_path_* helper functions. These helpers provide
clearer diagnostic messages on failure than the raw shell test
builtin.

Signed-off-by: Prashant S Bisht <prashantjee2025@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16 13:10:16 -07:00
Mirko Faina
48430e44ac t0008: improve test cleanup to fix failing test
The "large exclude file ignored in tree" test fails. This is due to an
additional warning message that is generated in the test. "warning:
unable to access 'subdir/.gitignore': Too many levels of symbolic
links", the extra warning that is not supposed to be there, happens
because of some leftover files left by previous tests.

To fix this we improve cleanup on "symlinks not respected in-tree", and
because the tests in t0008 in general have poor cleanup, at the start of
"large exclude file ignored in tree" we search for any leftover
.gitignore and remove them before starting the test.

Improve post-test cleanup and add pre-test cleanup to make sure that we
have a workable environment for the test.

Signed-off-by: Mirko Faina <mroik@delayed.space>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16 12:43:37 -07:00
Junio C Hamano
ca1db8a0f7 The 17th batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-03-16 10:48:15 -07:00
Junio C Hamano
9883fcb960 Merge branch 'ty/patch-ids-document-lazy-eval'
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-16 10:48:15 -07:00
Junio C Hamano
3c59f3bc4b Merge branch 'rs/history-ergonomics-updates-fix'
Fix use of uninitialized variable.

* rs/history-ergonomics-updates-fix:
  history: initialize rev_info in cmd_history_reword()
2026-03-16 10:48:15 -07:00
Junio C Hamano
2eec0f5115 Merge branch 'jk/unleak-mmap'
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-16 10:48:15 -07:00