]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
4 weeks agoSync with 'master'
Junio C Hamano [Thu, 18 Sep 2025 17:08:31 +0000 (10:08 -0700)] 
Sync with 'master'

4 weeks agoMerge branch 'nb/send-email-no-dup-reply-to' into next
Junio C Hamano [Thu, 18 Sep 2025 17:07:46 +0000 (10:07 -0700)] 
Merge branch 'nb/send-email-no-dup-reply-to' into next

"git send-email --compose --reply-to=<address>" used to add
duplicated Reply-To: header, which made mailservers unhappy.  This
has been corrected.

* nb/send-email-no-dup-reply-to:
  send-email: don't duplicate Reply-to: in intro message

4 weeks agoThe tenth batch
Junio C Hamano [Thu, 18 Sep 2025 17:06:32 +0000 (10:06 -0700)] 
The tenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoMerge branch 'pc/range-diff-memory-limit'
Junio C Hamano [Thu, 18 Sep 2025 17:07:02 +0000 (10:07 -0700)] 
Merge branch 'pc/range-diff-memory-limit'

"git range-diff" learned a way to limit the memory consumed by
O(N*N) cost matrix.

* pc/range-diff-memory-limit:
  range-diff: add configurable memory limit for cost matrix

4 weeks agoMerge branch 'ne/alloc-free-and-null'
Junio C Hamano [Thu, 18 Sep 2025 17:07:02 +0000 (10:07 -0700)] 
Merge branch 'ne/alloc-free-and-null'

The clear_alloc_state() API function was not fully clearing the
structure for reuse, but since nobody reuses it, replace it with a
variant that frees the structure as well, making the callers simpler.

* ne/alloc-free-and-null:
  alloc: fix dangling pointer in alloc_state cleanup

4 weeks agoMerge branch 'jk/curl-global-trace-components'
Junio C Hamano [Thu, 18 Sep 2025 17:07:02 +0000 (10:07 -0700)] 
Merge branch 'jk/curl-global-trace-components'

Adjust to the way newer versions of cURL selectivel enables tracing
options, so that our tests can continue to work.

* jk/curl-global-trace-components:
  curl: add support for curl_global_trace() components

4 weeks agoMerge branch 'ag/doc-sendmail-gmail-example-update'
Junio C Hamano [Thu, 18 Sep 2025 17:07:01 +0000 (10:07 -0700)] 
Merge branch 'ag/doc-sendmail-gmail-example-update'

Doc update.

* ag/doc-sendmail-gmail-example-update:
  docs: update sendmail docs to use more secure SMTP server for Gmail

4 weeks agoMerge branch 'kn/clang-format-bitfields'
Junio C Hamano [Thu, 18 Sep 2025 17:07:01 +0000 (10:07 -0700)] 
Merge branch 'kn/clang-format-bitfields'

CodingGuidelines now spells out how bitfields are to be written.

* kn/clang-format-bitfields:
  Documentation: note styling for bit fields

4 weeks agoMerge branch 'jc/longer-disambiguation-fix'
Junio C Hamano [Thu, 18 Sep 2025 17:07:01 +0000 (10:07 -0700)] 
Merge branch 'jc/longer-disambiguation-fix'

"git rev-parse --short" and friends failed to disambiguate two
objects with object names that share common prefix longer than 32
characters, which has been fixed.

* jc/longer-disambiguation-fix:
  abbrev: allow extending beyond 32 chars to disambiguate

4 weeks agoMerge branch 'sg/line-log-boundary-fixes'
Junio C Hamano [Thu, 18 Sep 2025 17:07:01 +0000 (10:07 -0700)] 
Merge branch 'sg/line-log-boundary-fixes'

A corner case bug in "git log -L..." has been corrected.

* sg/line-log-boundary-fixes:
  line-log: show all line ranges touched by the same diff range
  line-log: fix assertion error

4 weeks agoMerge branch 'jc/doc-includeif-hasconfig-remote-url-fix'
Junio C Hamano [Thu, 18 Sep 2025 17:07:00 +0000 (10:07 -0700)] 
Merge branch 'jc/doc-includeif-hasconfig-remote-url-fix'

Doc mark-up fix.

* jc/doc-includeif-hasconfig-remote-url-fix:
  config: document includeIf conditions consistently

4 weeks agoMerge branch 'ag/send-email-imap-sent'
Junio C Hamano [Thu, 18 Sep 2025 17:07:00 +0000 (10:07 -0700)] 
Merge branch 'ag/send-email-imap-sent'

"git send-email" learned to drive "git imap-send" to store already
sent e-mails in an IMAP folder.

* ag/send-email-imap-sent:
  send-email: enable copying emails to an IMAP folder without actually sending them
  send-email: add ability to send a copy of sent emails to an IMAP folder

4 weeks agoMerge branch 'pw/3.0-commentchar-auto-deprecation'
Junio C Hamano [Thu, 18 Sep 2025 17:07:00 +0000 (10:07 -0700)] 
Merge branch 'pw/3.0-commentchar-auto-deprecation'

"core.commentChar=auto" that attempts to dynamically pick a
suitable comment character is non-workable, as it is too much
trouble to support for little benefit, and is marked as deprecated.

* pw/3.0-commentchar-auto-deprecation:
  commit: print advice when core.commentString=auto
  config: warn on core.commentString=auto
  breaking-changes: deprecate support for core.commentString=auto

4 weeks agoMerge branch 'kh/doc-fast-import-markup-fix'
Junio C Hamano [Thu, 18 Sep 2025 17:07:00 +0000 (10:07 -0700)] 
Merge branch 'kh/doc-fast-import-markup-fix'

Doc mark-up fix.

* kh/doc-fast-import-markup-fix:
  doc: fast-import: replace literal block with paragraph

4 weeks agoSync with 'master'
Junio C Hamano [Wed, 17 Sep 2025 16:33:32 +0000 (09:33 -0700)] 
Sync with 'master'

* master:
  mailmap: consolidate multiple addresses into one

4 weeks agosend-email: don't duplicate Reply-to: in intro message
NeilBrown [Wed, 17 Sep 2025 06:32:26 +0000 (16:32 +1000)] 
send-email: don't duplicate Reply-to: in intro message

If I run

  git send-email --compose --reply-to 'ME <my@address.net>' .....

and edit the intro message, then it will get two copies of the Reply-To
field.  gmail.com rejects such messages.

This happens because send-email reads the edited message examining the
headers.  For recognised headers the content is extracted to use in
constructing the final message and for possible inclusion in the patch
emails.  Unrecognised headers are gathered (in @xh) to be passed through
uninterpreted.

Unfortunately "Reply-To" is not recognised in this process so it is
added to @xh as an uninterpreted header, but also generated from the
$reply_to variable in gen_header(), resulting in two copies

Add parsing to the loop in pre_process_file() to recognise a Reply-to
header and to store the result in $reply_to.  This means that the
intro message will not get a second header and also means that
any changes made to the Reply-To header during editing will be
incorporated in the $reply_to variable and so included in all the
generated email messages.

Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agomailmap: consolidate multiple addresses into one
Greg Hurrell [Tue, 2 Sep 2025 12:30:58 +0000 (12:30 +0000)] 
mailmap: consolidate multiple addresses into one

Merges contributions made from three different addresses:

- win@wincent.com (old address, initial contributions in 2007–2009)
- greg@hurrell.net (personal address matching full name, so this one is
  the "forever" address; contributions made starting in 2018)
- greg.hurrell@datadoghq.com (current work address, used for recent
  contributions)

Signed-off-by: Greg Hurrell <greg.hurrell@datadoghq.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoSync with 'master'
Junio C Hamano [Mon, 15 Sep 2025 16:08:10 +0000 (09:08 -0700)] 
Sync with 'master'

4 weeks agoMerge branch 'cs/subtree-squash-split-fix' into next
Junio C Hamano [Mon, 15 Sep 2025 16:08:02 +0000 (09:08 -0700)] 
Merge branch 'cs/subtree-squash-split-fix' into next

"git subtree" (in contrib/) did not work correctly when splitting
squashed subtrees, which has been improved.

* cs/subtree-squash-split-fix:
  contrib/subtree: fix split with squashed subtrees

4 weeks agoMerge branch 'ps/clar-updates' into next
Junio C Hamano [Mon, 15 Sep 2025 16:08:01 +0000 (09:08 -0700)] 
Merge branch 'ps/clar-updates' into next

Import a newer version of the clar unit testing framework.

* ps/clar-updates:
  t/unit-tests: update clar to fcbed04

4 weeks agoMerge branch 'rs/get-oid-with-flags-cleanup' into next
Junio C Hamano [Mon, 15 Sep 2025 16:08:01 +0000 (09:08 -0700)] 
Merge branch 'rs/get-oid-with-flags-cleanup' into next

Code clean-up.

* rs/get-oid-with-flags-cleanup:
  use repo_get_oid_with_flags()

4 weeks agoMerge branch 'jk/add-i-color' into next
Junio C Hamano [Mon, 15 Sep 2025 16:08:00 +0000 (09:08 -0700)] 
Merge branch 'jk/add-i-color' into next

Some among "git add -p" and friends ignored color.diff and/or
color.ui configuration variables, which is an old regression, which
has been corrected.

* jk/add-i-color:
  contrib/diff-highlight: mention interactive.diffFilter
  add-interactive: manually fall back color config to color.ui
  add-interactive: respect color.diff for diff coloring
  stash: pass --no-color to diff plumbing child processes

4 weeks agoMerge branch 'cc/promisor-remote-capability' into next
Junio C Hamano [Mon, 15 Sep 2025 16:08:00 +0000 (09:08 -0700)] 
Merge branch 'cc/promisor-remote-capability' into next

The "promisor-remote" capability mechanism has been updated to
allow the "partialCloneFilter" settings and the "token" value to be
communicated from the server side.

* cc/promisor-remote-capability:
  promisor-remote: use string_list_split() in mark_remotes_as_accepted()
  promisor-remote: allow a client to check fields
  promisor-remote: use string_list_split() in filter_promisor_remote()
  promisor-remote: refactor how we parse advertised fields
  promisor-remote: use string constants for 'name' and 'url' too
  promisor-remote: allow a server to advertise more fields
  promisor-remote: refactor to get rid of 'struct strvec'

4 weeks agoThe ninth batch
Junio C Hamano [Mon, 15 Sep 2025 15:51:09 +0000 (08:51 -0700)] 
The ninth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 weeks agoMerge branch 'mm/worktree-doc-typofix'
Junio C Hamano [Mon, 15 Sep 2025 15:52:07 +0000 (08:52 -0700)] 
Merge branch 'mm/worktree-doc-typofix'

Docfix.

* mm/worktree-doc-typofix:
  docs: fix typo in worktree.adoc 'extension'

4 weeks agoMerge branch 'rs/object-name-extend-abbrev-len-update'
Junio C Hamano [Mon, 15 Sep 2025 15:52:07 +0000 (08:52 -0700)] 
Merge branch 'rs/object-name-extend-abbrev-len-update'

Code clean-up.

* rs/object-name-extend-abbrev-len-update:
  object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter

4 weeks agoMerge branch 'ps/upload-pack-oom-protection'
Junio C Hamano [Mon, 15 Sep 2025 15:52:06 +0000 (08:52 -0700)] 
Merge branch 'ps/upload-pack-oom-protection'

A broken or malicious "git fetch" can say that it has the same
object for many many times, and the upload-pack serving it can
exhaust memory storing them redundantly, which has been corrected.

* ps/upload-pack-oom-protection:
  upload-pack: don't ACK non-commits repeatedly in protocol v2
  t5530: modernize tests

4 weeks agoMerge branch 'ds/midx-write-fixes'
Junio C Hamano [Mon, 15 Sep 2025 15:52:06 +0000 (08:52 -0700)] 
Merge branch 'ds/midx-write-fixes'

Fixes multiple crashes around midx write-out codepaths.

* ds/midx-write-fixes:
  midx-write: simplify error cases
  midx-write: reenable signed comparison errors
  midx-write: use uint32_t for preferred_pack_idx
  midx-write: use cleanup when incremental midx fails
  midx-write: put failing response value back
  midx-write: only load initialized packs

4 weeks agoMerge branch 'lo/repo-info-step-2'
Junio C Hamano [Mon, 15 Sep 2025 15:52:05 +0000 (08:52 -0700)] 
Merge branch 'lo/repo-info-step-2'

"repo info" learns a short-hand option "-z" that is the same as
"--format=nul", and learns to report the objects format used in the
repository.

* lo/repo-info-step-2:
  repo: add the field objects.format
  repo: add the flag -z as an alias for --format=nul

4 weeks agoMerge branch 'jt/de-global-bulk-checkin'
Junio C Hamano [Mon, 15 Sep 2025 15:52:05 +0000 (08:52 -0700)] 
Merge branch 'jt/de-global-bulk-checkin'

The bulk-checkin code used to depend on a file-scope static
singleton variable, which has been updated to pass an instance
throughout the callchain.

* jt/de-global-bulk-checkin:
  bulk-checkin: use repository variable from transaction
  bulk-checkin: require transaction for index_blob_bulk_checkin()
  bulk-checkin: remove global transaction state
  bulk-checkin: introduce object database transaction structure

5 weeks agoSync with 'master'
Junio C Hamano [Fri, 12 Sep 2025 17:42:46 +0000 (10:42 -0700)] 
Sync with 'master'

5 weeks agoMerge branch 'pc/range-diff-memory-limit' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:36 +0000 (10:42 -0700)] 
Merge branch 'pc/range-diff-memory-limit' into next

"git range-diff" learned a way to limit the memory consumed by
O(N*N) cost matrix.

* pc/range-diff-memory-limit:
  range-diff: add configurable memory limit for cost matrix

5 weeks agoMerge branch 'ne/alloc-free-and-null' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:35 +0000 (10:42 -0700)] 
Merge branch 'ne/alloc-free-and-null' into next

The clear_alloc_state() API function was not fully clearing the
structure for reuse, but since nobody reuses it, replace it with a
variant that frees the structure as well, making the callers simpler.

* ne/alloc-free-and-null:
  alloc: fix dangling pointer in alloc_state cleanup

5 weeks agoMerge branch 'jk/curl-global-trace-components' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:35 +0000 (10:42 -0700)] 
Merge branch 'jk/curl-global-trace-components' into next

Adjust to the way newer versions of cURL selectivel enables tracing
options, so that our tests can continue to work.

* jk/curl-global-trace-components:
  curl: add support for curl_global_trace() components

5 weeks agoMerge branch 'ag/doc-sendmail-gmail-example-update' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:34 +0000 (10:42 -0700)] 
Merge branch 'ag/doc-sendmail-gmail-example-update' into next

Doc update.

* ag/doc-sendmail-gmail-example-update:
  docs: update sendmail docs to use more secure SMTP server for Gmail

5 weeks agoMerge branch 'kn/clang-format-bitfields' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:34 +0000 (10:42 -0700)] 
Merge branch 'kn/clang-format-bitfields' into next

CodingGuidelines now spells out how bitfields are to be written.

* kn/clang-format-bitfields:
  Documentation: note styling for bit fields

5 weeks agoMerge branch 'jc/longer-disambiguation-fix' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:34 +0000 (10:42 -0700)] 
Merge branch 'jc/longer-disambiguation-fix' into next

"git rev-parse --short" and friends failed to disambiguate two
objects with object names that share common prefix longer than 32
characters.

* jc/longer-disambiguation-fix:
  abbrev: allow extending beyond 32 chars to disambiguate

5 weeks agoMerge branch 'sg/line-log-boundary-fixes' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:33 +0000 (10:42 -0700)] 
Merge branch 'sg/line-log-boundary-fixes' into next

Fix for a corner case bug in "git log -L...".

* sg/line-log-boundary-fixes:
  line-log: show all line ranges touched by the same diff range
  line-log: fix assertion error

5 weeks agoMerge branch 'jc/doc-includeif-hasconfig-remote-url-fix' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:33 +0000 (10:42 -0700)] 
Merge branch 'jc/doc-includeif-hasconfig-remote-url-fix' into next

Doc mark-up fix.

* jc/doc-includeif-hasconfig-remote-url-fix:
  config: document includeIf conditions consistently

5 weeks agoMerge branch 'ag/send-email-imap-sent' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:32 +0000 (10:42 -0700)] 
Merge branch 'ag/send-email-imap-sent' into next

"git send-email" learned to drive "git imap-send" to store already
sent e-mails in an IMAP folder.

* ag/send-email-imap-sent:
  send-email: enable copying emails to an IMAP folder without actually sending them
  send-email: add ability to send a copy of sent emails to an IMAP folder

5 weeks agoMerge branch 'pw/3.0-commentchar-auto-deprecation' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:32 +0000 (10:42 -0700)] 
Merge branch 'pw/3.0-commentchar-auto-deprecation' into next

Proposes to deprecate "core.commentChar=auto" that attempts to
dynamically pick a suitable comment character, as it is too much
trouble to support for little benefit.

* pw/3.0-commentchar-auto-deprecation:
  commit: print advice when core.commentString=auto
  config: warn on core.commentString=auto
  breaking-changes: deprecate support for core.commentString=auto

5 weeks agoMerge branch 'kh/doc-fast-import-markup-fix' into next
Junio C Hamano [Fri, 12 Sep 2025 17:42:31 +0000 (10:42 -0700)] 
Merge branch 'kh/doc-fast-import-markup-fix' into next

Doc mark-up fix.

* kh/doc-fast-import-markup-fix:
  doc: fast-import: replace literal block with paragraph

5 weeks agoThe eighth batch
Junio C Hamano [Fri, 12 Sep 2025 17:41:02 +0000 (10:41 -0700)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoMerge branch 'rs/describe-with-lazy-queue-and-oidset'
Junio C Hamano [Fri, 12 Sep 2025 17:41:21 +0000 (10:41 -0700)] 
Merge branch 'rs/describe-with-lazy-queue-and-oidset'

Instead of scanning for the remaining items to see if there are
still commits to be explored in the queue, use khash to remember
which items are still on the queue (an unacceptable alternative is
to reserve one object flag bits).

* rs/describe-with-lazy-queue-and-oidset:
  describe: use oidset in finish_depth_computation()

5 weeks agoMerge branch 'tc/t0450-harden'
Junio C Hamano [Fri, 12 Sep 2025 17:41:21 +0000 (10:41 -0700)] 
Merge branch 'tc/t0450-harden'

Test updates.

* tc/t0450-harden:
  t0450: add allowlist for builtins with missing .adoc
  t0450: fix test for out-of-tree builds

5 weeks agoMerge branch 'kh/doc-markup-fixes'
Junio C Hamano [Fri, 12 Sep 2025 17:41:20 +0000 (10:41 -0700)] 
Merge branch 'kh/doc-markup-fixes'

Doc markup fixes.

* kh/doc-markup-fixes:
  doc: remove extra backtick for inline-verbatim
  doc: add missing backtick for inline-verbatim

5 weeks agoMerge branch 'km/alias-doc-markup-fix'
Junio C Hamano [Fri, 12 Sep 2025 17:41:20 +0000 (10:41 -0700)] 
Merge branch 'km/alias-doc-markup-fix'

Docfix.

* km/alias-doc-markup-fix:
  doc: fix formatting of function-wrap shell alias

5 weeks agoMerge branch 'ps/gitlab-ci-disable-windows-monitoring'
Junio C Hamano [Fri, 12 Sep 2025 17:41:19 +0000 (10:41 -0700)] 
Merge branch 'ps/gitlab-ci-disable-windows-monitoring'

Windows "real-time monitoring" interferes with the execution of
tests and affects negatively in both correctness and performance,
which has been disabled in Gitlab CI.

* ps/gitlab-ci-disable-windows-monitoring:
  gitlab-ci: disable realtime monitoring to unbreak Windows jobs

5 weeks agoMerge branch 'ms/refs-exists'
Junio C Hamano [Fri, 12 Sep 2025 17:41:19 +0000 (10:41 -0700)] 
Merge branch 'ms/refs-exists'

"git refs exists" that works like "git show-ref --exists" has been
added.

* ms/refs-exists:
  t: add test for git refs exists subcommand
  t1422: refactor tests to be shareable
  t1403: split 'show-ref --exists' tests into a separate file
  builtin/refs: add 'exists' subcommand

5 weeks agoMerge branch 'ps/object-store-midx-dedup-info'
Junio C Hamano [Fri, 12 Sep 2025 17:41:18 +0000 (10:41 -0700)] 
Merge branch 'ps/object-store-midx-dedup-info'

Further code clean-up for multi-pack-index code paths.

* ps/object-store-midx-dedup-info:
  midx: compute paths via their source
  midx: stop duplicating info redundant with its owning source
  midx: write multi-pack indices via their source
  midx: load multi-pack indices via their source
  midx: drop redundant `struct repository` parameter
  odb: simplify calling `link_alt_odb_entry()`
  odb: return newly created in-memory sources
  odb: consistently use "dir" to refer to alternate's directory
  odb: allow `odb_find_source()` to fail
  odb: store locality in object database sources

5 weeks agoMerge branch 'je/doc-add'
Junio C Hamano [Fri, 12 Sep 2025 17:41:18 +0000 (10:41 -0700)] 
Merge branch 'je/doc-add'

Documentation for "git add" has been updated.

* je/doc-add:
  doc: rephrase the purpose of the staging area
  doc: git-add: simplify discussion of ignored files
  doc: git-add: clarify intro & add an example

5 weeks agot/unit-tests: update clar to fcbed04
Patrick Steinhardt [Wed, 10 Sep 2025 13:09:58 +0000 (15:09 +0200)] 
t/unit-tests: update clar to fcbed04

Update clar to fcbed04 (Merge pull request #123 from
pks-gitlab/pks-sandbox-ubsan, 2025-09-10). The most significant changes
since the last version include:

  - Fixed platform support for HP-UX.

  - Fixes for how clar handles the `-q` flag.

  - A couple of leak fixes for reported clar errors.

  - A new `cl_invoke()` function that retains line information.

  - New infrastructure to create temporary directories.

  - Improved printing of error messages so that all lines are now
    properly indented.

  - Proper selftests for the clar.

Most of these changes are somewhat irrelevant to us, but neither do we
have to adjust to any of these changes, either. What _is_ interesting to
us though is especially the fixed support for HP-UX, and eventually we
may also want to use `cl_invoke()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agocontrib/subtree: fix split with squashed subtrees
Colin Stagner [Wed, 10 Sep 2025 03:11:24 +0000 (22:11 -0500)] 
contrib/subtree: fix split with squashed subtrees

98ba49ccc2 (subtree: fix split processing with multiple subtrees
present, 2023-12-01) increases the performance of

    git subtree split --prefix=subA

by ignoring subtree merges which are outside of `subA/`. It also
introduces a regression. Subtree merges that should be retained
are incorrectly ignored if they:

1. are nested under `subA/`; and
2. are merged with `--squash`.

For example, a subtree merged like:

    git subtree merge --squash --prefix=subA/subB "$rev"
    #                 ^^^^^^^^          ^^^^

is erroneously ignored during a split of `subA`. This causes
missing tree files and different commit hashes starting in
git v2.44.0-rc0.

The method:

    should_ignore_subtree_split_commit REV

should test only a single commit REV, but the combination of

    git log -1 --grep=...

actually searches all *parent* commits until a `--grep` match is
discovered.

Rewrite this method to test only one REV at a time. Extract commit
information with a single `git` call as opposed to three. The
`test` conditions for rejecting a commit remain unchanged.

Unit tests now cover nested subtrees.

Signed-off-by: Colin Stagner <ask+git@howdoi.land>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoSync with 'master'
Junio C Hamano [Wed, 10 Sep 2025 21:51:31 +0000 (14:51 -0700)] 
Sync with 'master'

5 weeks agodoc: fast-import: replace literal block with paragraph
Kristoffer Haugsbakk [Mon, 8 Sep 2025 20:28:45 +0000 (22:28 +0200)] 
doc: fast-import: replace literal block with paragraph

68061e34702 (fast-import: disallow "feature export-marks" by default,
2019-08-29) added the documentation for this option.  The second
paragraph is a literal block but it looks like it should just be
a regular paragraph.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agouse repo_get_oid_with_flags()
René Scharfe [Wed, 10 Sep 2025 17:16:30 +0000 (19:16 +0200)] 
use repo_get_oid_with_flags()

get_oid_with_context() allows specifying flags and reports object
details via a passed-in struct object_context.  Some callers just want
to specify flags, but don't need any details back.  Convert them to
repo_get_oid_with_flags(), which provides just that and frees them from
dealing with the context structure.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Wed, 10 Sep 2025 21:28:23 +0000 (14:28 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui:
  git-gui: sync Makefiles with git.git
  git-gui: fix error handling of Revert Changes command
  git-gui--askyesno (mingw): use Git for Windows' icon, if available
  git-gui--askyesno: allow overriding the window title
  git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
  git-gui: provide question helper for retry fallback on Windows
  git-gui: simplify using nice(1)
  git-gui: simplify PATH de-duplication

5 weeks agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Wed, 10 Sep 2025 21:27:52 +0000 (14:27 -0700)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk:
  gitk: add README with usage, build, and contribution details
  gitk: fix trackpad scrolling for Tcl/Tk 8.7+
  gitk: use <Button-3> for ctx menus on macOS with Tcl 8.7+

5 weeks agoMerge branch 'mm/worktree-doc-typofix' into next
Junio C Hamano [Tue, 9 Sep 2025 21:58:43 +0000 (14:58 -0700)] 
Merge branch 'mm/worktree-doc-typofix' into next

Docfix.

* mm/worktree-doc-typofix:
  docs: fix typo in worktree.adoc 'extension'

5 weeks agoSync with master
Junio C Hamano [Mon, 8 Sep 2025 22:25:01 +0000 (15:25 -0700)] 
Sync with master

5 weeks agoMerge branch 'rs/object-name-extend-abbrev-len-update' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:43 +0000 (15:24 -0700)] 
Merge branch 'rs/object-name-extend-abbrev-len-update' into next

Code clean-up.

* rs/object-name-extend-abbrev-len-update:
  object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter

5 weeks agoMerge branch 'ps/upload-pack-oom-protection' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:43 +0000 (15:24 -0700)] 
Merge branch 'ps/upload-pack-oom-protection' into next

* ps/upload-pack-oom-protection:
  upload-pack: don't ACK non-commits repeatedly in protocol v2
  t5530: modernize tests

5 weeks agoMerge branch 'ds/midx-write-fixes' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:42 +0000 (15:24 -0700)] 
Merge branch 'ds/midx-write-fixes' into next

Fixes multiple crashes around midx write-out codepaths.

* ds/midx-write-fixes:
  midx-write: simplify error cases
  midx-write: reenable signed comparison errors
  midx-write: use uint32_t for preferred_pack_idx
  midx-write: use cleanup when incremental midx fails
  midx-write: put failing response value back
  midx-write: only load initialized packs

5 weeks agoMerge branch 'lo/repo-info-step-2' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:41 +0000 (15:24 -0700)] 
Merge branch 'lo/repo-info-step-2' into next

"repo info" learns a short-hand option "-z" that is the same as
"--format=nul", and learns to report the objects format used in the
repository.

* lo/repo-info-step-2:
  repo: add the field objects.format
  repo: add the flag -z as an alias for --format=nul

5 weeks agoMerge branch 'jt/de-global-bulk-checkin' into next
Junio C Hamano [Mon, 8 Sep 2025 22:24:40 +0000 (15:24 -0700)] 
Merge branch 'jt/de-global-bulk-checkin' into next

The bulk-checkin code used to depend on a file-scope static
singleton variable, which has been updated to pass an instance
throughout the callchain.

* jt/de-global-bulk-checkin:
  bulk-checkin: use repository variable from transaction
  bulk-checkin: require transaction for index_blob_bulk_checkin()
  bulk-checkin: remove global transaction state
  bulk-checkin: introduce object database transaction structure

5 weeks agoThe seventh batch
Junio C Hamano [Mon, 8 Sep 2025 21:54:20 +0000 (14:54 -0700)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoMerge branch 'tc/last-modified'
Junio C Hamano [Mon, 8 Sep 2025 21:54:35 +0000 (14:54 -0700)] 
Merge branch 'tc/last-modified'

A new command "git last-modified" has been added to show the closest
ancestor commit that touched each path.

* tc/last-modified:
  last-modified: use Bloom filters when available
  t/perf: add last-modified perf script
  last-modified: new subcommand to show when files were last modified

5 weeks agoMerge branch 'ds/ls-files-lazy-unsparse'
Junio C Hamano [Mon, 8 Sep 2025 21:54:34 +0000 (14:54 -0700)] 
Merge branch 'ds/ls-files-lazy-unsparse'

"git ls-files <pathspec>..." should not necessarily have to expand
the index fully if a sparsified directory is excluded by the
pathspec; the code is taught to expand the index on demand to avoid
this.

* ds/ls-files-lazy-unsparse:
  ls-files: conditionally leave index sparse

5 weeks agoMerge branch 'ds/path-walk-repack-fix'
Junio C Hamano [Mon, 8 Sep 2025 21:54:34 +0000 (14:54 -0700)] 
Merge branch 'ds/path-walk-repack-fix'

"git repack --path-walk" lost objects in some corner cases, which
has been corrected.

* ds/path-walk-repack-fix:
  path-walk: create initializer for path lists
  path-walk: fix setup of pending objects

5 weeks agoMerge branch 'am/xdiff-hash-tweak'
Junio C Hamano [Mon, 8 Sep 2025 21:54:34 +0000 (14:54 -0700)] 
Merge branch 'am/xdiff-hash-tweak'

Inspired by Ezekiel's recent effort to showcase Rust interface, the
hash function implementation used to hash lines have been updated
to the one used for ELF symbol lookup by Glibc.

* am/xdiff-hash-tweak:
  xdiff: optimize xdl_hash_record_verbatim
  xdiff: refactor xdl_hash_record()

5 weeks agoMerge branch 'da/cargo-serialize'
Junio C Hamano [Mon, 8 Sep 2025 21:54:33 +0000 (14:54 -0700)] 
Merge branch 'da/cargo-serialize'

Makefile tried to run multiple "cargo build" which would not work
very well; serialize their execution to work it around.

* da/cargo-serialize:
  Makefile: build libgit-rs and libgit-sys serially

5 weeks agocontrib/diff-highlight: mention interactive.diffFilter
Jeff King [Mon, 8 Sep 2025 16:42:42 +0000 (12:42 -0400)] 
contrib/diff-highlight: mention interactive.diffFilter

When the README for diff-highlight was written, there was no way to
trigger it for the `add -p` interactive patch mode. We've since grown a
feature to support that, but it was documented only on the Git side.
Let's also let people coming the other direction, from diff-highlight,
know that it's an option.

Suggested-by: Isaac Oscar Gariano <IsaacOscar@live.com.au>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoadd-interactive: manually fall back color config to color.ui
Jeff King [Mon, 8 Sep 2025 16:42:39 +0000 (12:42 -0400)] 
add-interactive: manually fall back color config to color.ui

Color options like color.interactive and color.diff should fall back to
the value of color.ui if they aren't set. In add-interactive, we check
the specific options (e.g., color.diff) via repo_config_get_value(),
which does not depend on the main command having loaded any color config
via the git_config() callback mechanism.

But then we call want_color() on the result; if our specific config is
unset then that function uses the value of git_use_color_default. That
variable is typically set from color.ui by the git_color_config()
callback, which is called by the main command in its own git_config()
callback function.

This works fine for "add -p", whose add_config() callback calls into
git_color_config(). But it doesn't work for other commands like
"checkout -p", which is otherwise unaware of color at all. People tend
not to notice because the default is "auto", and that's what they'd set
color.ui to as well. But something like:

  git -c color.ui=false checkout -p

should disable color, and it doesn't.

This regression goes back to 0527ccb1b5 (add -i: default to the built-in
implementation, 2021-11-30). In the perl version we got the color config
from "git config --get-colorbool", which did the full lookup for us.

The obvious fix is for git-checkout to add a call to git_color_config()
to its own config callback. But we'd have to do so for every command
with this problem, which is error-prone. Let's see if we can fix it more
centrally.

It is tempting to teach want_color() to look up the value of
repo_config_get_value("color.ui") itself. But I think that would have
disastrous consequences. Plumbing commands, especially older ones, avoid
porcelain config like "color.*" by simply not parsing it in their config
callbacks. Looking up the value of color.ui under the hood would
undermine that.

Instead, let's do that lookup in the add-interactive setup code. We're
already demand-loading other color config there, which is probably fine
(even in a plumbing command like "git reset", the interactive mode is
inherently porcelain-ish). That catches all commands that use the
interactive code, whether they were calling git_color_config()
themselves or not.

Reported-by: Isaac Oscar Gariano <isaacoscar@live.com.au>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoadd-interactive: respect color.diff for diff coloring
Jeff King [Mon, 8 Sep 2025 16:42:36 +0000 (12:42 -0400)] 
add-interactive: respect color.diff for diff coloring

The old perl git-add--interactive.perl script used the color.diff config
option to decide whether to color diffs (and if not set, it fell back to
the value of color.ui via git-config's --get-colorbool option). When we
switched to the builtin version, this was lost: we respect only
color.ui. So for example:

  git -c color.diff=false add -p

would color the diff, even when it should not.

The culprit is this line in add-interactive.c's parse_diff():

  if (want_color_fd(1, -1))

That "-1" means "no config has been set", which causes it to fall back
to the color.ui setting. We should instead be passing the value of
color.diff. But the problem is that we never even parse that config
option!

Instead the builtin interactive code parses only the value of
color.interactive, which is used for prompts and other messages. One
could perhaps argue that this should cover interactive diff coloring,
too, but historically it did not. The perl script treated
color.interactive and color.diff separately. So we should grab the
values for both, keeping separate fields in our add_i_state variable,
rather than a single use_color field.

We also load individual color slots (e.g., color.interactive.prompt),
leaving them as the empty string when color is disabled. This happens
via the init_color() helper in add-interactive, which checks that
use_color field. Now that there are two such fields, we need to pass the
appropriate one for each color.

The colors are mostly easy to divide up; color.interactive.* follows
color.interactive, and color.diff.* follows color.diff. But the "reset"
color is tricky. It is used for both types of coloring, but the two can
be configured independently. So we introduce two separate reset colors,
and use each in the appropriate spot.

There are two new tests. The first enables interactive prompt colors but
disables color.diff. We should see a colored prompt but not a colored
diff, showing that we are now respecting color.diff (and not
color.interactive or color.ui).

The second does the opposite. We disable color.interactive but turn on
color.diff with a custom fragment color. When we split a hunk, the
interactive code has to re-color the hunk header, which lets us check
that we correctly loaded the color.diff.frag config based on color.diff,
not color.interactive.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agostash: pass --no-color to diff plumbing child processes
Jeff King [Mon, 8 Sep 2025 16:42:32 +0000 (12:42 -0400)] 
stash: pass --no-color to diff plumbing child processes

After a partial stash, we may clear out the working tree by capturing
the output of diff-tree and piping it into git-apply (and likewise we
may use diff-index to restore the index). So we most definitely do not
want color diff output from that diff-tree process.  And it normally
would not produce any, since its stdout is not going to a tty, and the
default value of color.ui is "auto".

However, if GIT_PAGER_IN_USE is set in the environment, that overrides
the tty check, and we'll produce a colorized diff that chokes git-apply:

  $ echo y | GIT_PAGER_IN_USE=1 git stash -p
  [...]
  Saved working directory and index state WIP on main: 4f2e2bb foo
  error: No valid patches in input (allow with "--allow-empty")
  Cannot remove worktree changes

Setting this variable is a relatively silly thing to do, and not
something most users would run into. But we sometimes do it in our tests
to stimulate color. And it is a user-visible bug, so let's fix it rather
than work around it in the tests.

The root issue here is that diff-tree (and other diff plumbing) should
probably not ever produce color by default. It does so not by parsing
color.ui, but because of the baked-in "auto" default from 4c7f1819b3
(make color.ui default to 'auto', 2013-06-10). But changing that is
risky; we've had discussions back and forth on the topic over the years.
E.g.:

  https://lore.kernel.org/git/86D0A377-8AFD-460D-A90E-6327C6934DFC@gmail.com/.

So let's accept that as the status quo for now and protect ourselves by
passing --no-color to the child processes. This is the same thing we did
for add-interactive itself in 1c6ffb546b (add--interactive.perl: specify
--no-color explicitly, 2020-09-07).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: use string_list_split() in mark_remotes_as_accepted()
Christian Couder [Mon, 8 Sep 2025 05:30:53 +0000 (07:30 +0200)] 
promisor-remote: use string_list_split() in mark_remotes_as_accepted()

Previous commits replaced some strbuf_split*() calls with calls to
string_list_split*() in "promisor-remote.c".

For consistency, let's also replace the strbuf_split_str() call in
mark_remotes_as_accepted() with a call to string_list_split(), as we
don't need the splitted strings to be managed by a `struct strbuf`.
Using the lighter-weight `string_list` API is enough for our needs.

While at it let's remove a useless call to `strbuf_strip_suffix()`.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: allow a client to check fields
Christian Couder [Mon, 8 Sep 2025 05:30:52 +0000 (07:30 +0200)] 
promisor-remote: allow a client to check fields

A previous commit allowed a server to pass additional fields through
the "promisor-remote" protocol capability after the "name" and "url"
fields, specifically the "partialCloneFilter" and "token" fields.

Let's make it possible for a client to check if these fields match
what it expects before accepting a promisor remote.

We allow this by introducing a new "promisor.checkFields"
configuration variable. It should contain a comma or space separated
list of fields that will be checked.

By limiting the protocol to specific well-defined fields, we ensure
both server and client have a shared understanding of field
semantics and usage.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: use string_list_split() in filter_promisor_remote()
Christian Couder [Mon, 8 Sep 2025 05:30:51 +0000 (07:30 +0200)] 
promisor-remote: use string_list_split() in filter_promisor_remote()

A previous commit introduced a new parse_one_advertised_remote()
function that takes a `const char *` argument. This function is called
from filter_promisor_remote() and parses all the fields for one remote.

This means that in filter_promisor_remote() we no longer need to split
the remote information that will be passed to
parse_one_advertised_remote() into an array of relatively heavy and
complex `struct strbuf`.

To use something lighter, let's then replace strbuf_split_str() with
string_list_split() in filter_promisor_remote() to parse the remote
information that is passed to parse_one_advertised_remote().

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: refactor how we parse advertised fields
Christian Couder [Mon, 8 Sep 2025 05:30:50 +0000 (07:30 +0200)] 
promisor-remote: refactor how we parse advertised fields

In a follow up commit we are going to parse more fields, like a filter
and a token, coming from the server when it advertises promisor remotes
using the "promisor-remote" capability.

To prepare for this, let's refactor the code that parses the advertised
fields coming from the server into a new parse_one_advertised_remote()
function that will populate a `struct promisor_info` with the content
of the fields it parsed.

While at it, let's also pass this `struct promisor_info` to the
should_accept_remote() function, instead of passing it the parsed name
and url.

These changes will make it simpler to both parse more fields and access
the content of these parsed fields in follow up commits.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: use string constants for 'name' and 'url' too
Christian Couder [Mon, 8 Sep 2025 05:30:49 +0000 (07:30 +0200)] 
promisor-remote: use string constants for 'name' and 'url' too

A previous commit started to define `promisor_field_filter` and
`promisor_field_token`, and used them instead of the
"partialCloneFilter" and "token" string literals.

Let's do the same for "name" and "url" to avoid repeating them
several times and for consistency with the other fields.

For skipping "name=" or "url=" in advertisements, let's introduce
a skip_field_name_prefix() helper function to keep parsing clean
and easy to understand.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: allow a server to advertise more fields
Christian Couder [Mon, 8 Sep 2025 05:30:48 +0000 (07:30 +0200)] 
promisor-remote: allow a server to advertise more fields

For now the "promisor-remote" protocol capability can only pass "name"
and "url" information from a server to a client in the form
"name=<remote_name>,url=<remote_url>".

To allow clients to make more informed decisions about which promisor
remotes they accept, let's make it possible to pass more information
by introducing a new "promisor.sendFields" configuration variable.

On the server side, information about a remote `foo` is stored in
configuration variables named `remote.foo.<variable-name>`. To make
it clearer and simpler, we use `field` and `field name` like this:

  * `field name` refers to the <variable-name> part of such a
    configuration variable, and

  * `field` refers to both the `field name` and the value of such a
    configuration variable.

The "promisor.sendFields" configuration variable should contain a
comma or space separated list of field names that will be looked up
in the configuration of the remote on the server to find the values
that will be passed to the client.

Only a set of predefined field names are allowed. The only field
names in this set are "partialCloneFilter" and "token". The
"partialCloneFilter" field name specifies the filter definition used
by the promisor remote, and the "token" field name can provide an
authentication credential for accessing it.

For example, if "promisor.sendFields" is set to "partialCloneFilter",
and the server has the "remote.foo.partialCloneFilter" config
variable set to a value, then that value will be passed in the
"partialCloneFilter" field in the form "partialCloneFilter=<value>"
after the "name" and "url" fields.

A following commit will allow the client to use the information to
decide if it accepts the remote or not. For now the client doesn't do
anything with the additional information it receives.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agopromisor-remote: refactor to get rid of 'struct strvec'
Christian Couder [Mon, 8 Sep 2025 05:30:47 +0000 (07:30 +0200)] 
promisor-remote: refactor to get rid of 'struct strvec'

In a following commit, we will use the new 'promisor-remote' protocol
capability introduced by d460267613 (Add 'promisor-remote' capability
to protocol v2, 2025-02-18) to pass and process more information
about promisor remotes than just their name and url.

For that purpose, we will need to store information about other
fields, especially information that might or might not be available
for different promisor remotes. Unfortunately using 'struct strvec',
as we currently do, to store information about the promisor remotes
with one 'struct strvec' for each field like "name" or "url" does not
scale easily in that case. We would need one 'struct strvec' for each
new field, and then we would have to pass all these 'struct strvec'
around.

Let's refactor this and introduce a new 'struct promisor_info'.

It will only store promisor remote information in its members. For now
it has only a 'name' member for the promisor remote name and an 'url'
member for its URL. We will use a 'struct string_list' to store the
instances of 'struct promisor_info'. For each 'item' in the
string_list, 'item->string' will point to the promisor remote name and
'item->util' will point to the corresponding 'struct promisor_info'
instance.

Explicit members are used within 'struct promisor_info' for type
safety and clarity regarding the specific information being handled,
rather than a generic key-value store. We want to specify and document
each field and its content, so adding new members to the struct as
more fields are supported is fine.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agogit-gui: sync Makefiles with git.git
Adam Dinwoodie [Sat, 15 Feb 2025 21:19:03 +0000 (21:19 +0000)] 
git-gui: sync Makefiles with git.git

In git.git, commit 5309c1e9fb39 (Makefile: set default goals in
makefiles, 2025-02-15) touched two Makefiles in the git-git/ directory.
Import these changes, so that the trees can converge again with the
next merge of this repository into git.git.

Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
6 weeks agoMerge branch 'ml/misc-simplifications'
Johannes Sixt [Sat, 6 Sep 2025 09:59:19 +0000 (11:59 +0200)] 
Merge branch 'ml/misc-simplifications'

* ml/misc-simplifications:
  git-gui: simplify using nice(1)
  git-gui: simplify PATH de-duplication

6 weeks agoMerge branch 'js/ask-yesno'
Johannes Sixt [Sat, 6 Sep 2025 09:59:09 +0000 (11:59 +0200)] 
Merge branch 'js/ask-yesno'

* js/ask-yesno:
  git-gui--askyesno (mingw): use Git for Windows' icon, if available
  git-gui--askyesno: allow overriding the window title
  git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
  git-gui: provide question helper for retry fallback on Windows

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
6 weeks agoupload-pack: don't ACK non-commits repeatedly in protocol v2
Patrick Steinhardt [Fri, 5 Sep 2025 06:18:02 +0000 (08:18 +0200)] 
upload-pack: don't ACK non-commits repeatedly in protocol v2

When a client performs a fetch or clone they can optionally send "have"
lines to tell the server which objects they already have available
locally. These object IDs are stored by the server in an object array so
that it can remember any objects it doesn't have to include in the pack
sent to the client.

While there isn't any reason to do so, clients are free to send the same
"have" line repeatedly. git-upload-pack(1) already knows to handle this
well: every commit it has seen via a "have" line gets marked with the
`THEY_HAVE` flag, and if such a commit is seen repeatedly we know to not
process it another time. This also has the effect that we only store the
object ID once, only, in the `have_obj` array.

There is an edge case though: if the client sends an object ID that does
not refer to a commit we neither store nor check the `THEY_HAVE` flag.
This means that we repeatedly store the same object ID in our `have_obj`
array, with two consequences:

  - In protocol v2 we deduplicate ACKs for commits, but not for any
    other objects as we send ACKs for every object ID in the `have_obj`
    array.

  - The `have_obj` array can grow in size indefinitely with both
    protocols.

The potentially-more-serious issue is the second one, as we basically
have a way for an adversary to allocate arbitrarily large buffers now.
Ultimately, this doesn't seem to be all that serious though: on my
machine, the growth of that array is at around 4MB/s, and after roughly
five minutes I was only at 1GB RSS. So this is concerning, but only
mildly so.

Fix this bug by storing the `THEY_HAVE` flag independent of the object
type so that we don't store duplicate object IDs in `have_obj` anymore.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agot5530: modernize tests
Patrick Steinhardt [Fri, 5 Sep 2025 06:18:01 +0000 (08:18 +0200)] 
t5530: modernize tests

Refactor tests to follow modern best practices:

  - Merge together tests that set up and verify a single use case.

  - Drop empty newlines at the beginning and end of test bodies.

  - Don't change directories in the main test body.

  - Remove an unused `D` variable.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agomidx-write: simplify error cases
Derrick Stolee [Fri, 5 Sep 2025 19:26:18 +0000 (19:26 +0000)] 
midx-write: simplify error cases

The write_midx_internal() method uses gotos to jump to a cleanup section to
clear memory before returning 'result'. Since these jumps are more common
for error conditions, initialize 'result' to -1 and then only set it to 0
before returning with success. There are a couple places where we return
with success via a jump.

This has the added benefit that the method now returns -1 on error instead
of an inconsistent 1 or -1.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agomidx-write: reenable signed comparison errors
Derrick Stolee [Fri, 5 Sep 2025 19:26:17 +0000 (19:26 +0000)] 
midx-write: reenable signed comparison errors

Remove the remaining signed comparison warnings in midx-write.c so that
they can be enforced as errors in the future. After the previous change,
the remaining errors are due to iterator variables named 'i'.

The strategy here involves defining the variable within the for loop
syntax to make sure we use the appropriate bitness for the loop
sentinel. This matters in at least one method where the variable was
compared to uint32_t in some loops and size_t in others.

While adjusting these loops, there were some where the loop boundary was
checking against a uint32_t value _plus one_. These were replaced with
non-strict comparisons, but also the value is checked to not be
UINT32_MAX. Since the value is the number of incremental multi-pack-
indexes, this is not a meaningful restriction. The new die() is about
defensive programming more than it being realistically possible.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agomidx-write: use uint32_t for preferred_pack_idx
Derrick Stolee [Fri, 5 Sep 2025 19:26:16 +0000 (19:26 +0000)] 
midx-write: use uint32_t for preferred_pack_idx

midx-write.c has the DISABLE_SIGN_COMPARE_WARNINGS macro defined for a
few reasons, but the biggest one is the use of a signed
preferred_pack_idx member inside the write_midx_context struct. The code
currently uses -1 to indicate an unset preferred pack but pack int ids
are normally handled as uint32_t. There are also a few loops that search
for the preferred pack by name and those iterators will need updates to
uint32_t in the next change.

For now, replace the use of -1 with a 'NO_PREFERRED_PACK' macro and an
equality check. The macro stores the max value of a uint32_t, so we
cannot store a preferred pack that appears last in a list of 2^32 total
packs, but that's expected to be unreasonable already. Furthermore, with
this change we end up extending the range from 2^31 possible packs to
2^32-1.

There are some careful things to worry about with initializing the
preferred pack in the struct and using that value when searching for a
preferred pack that was already incorrect but accidentally working when
the index was initialized to zero.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agomidx-write: use cleanup when incremental midx fails
Derrick Stolee [Fri, 5 Sep 2025 19:26:15 +0000 (19:26 +0000)] 
midx-write: use cleanup when incremental midx fails

The incremental mode of writing a multi-pack-index has a few extra
conditions that could lead to failure, but these are currently
short-ciruiting with 'return -1' instead of setting the method's
'result' variable and going to the cleanup tag.

Replace these returns with gotos to avoid memory issues when exiting
early due to error conditions.

Unfortunately, these error conditions are difficult to reproduce with
test cases, which is perhaps one reason why the memory loss was not
caught by existing test cases in memory tracking modes.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agomidx-write: put failing response value back
Derrick Stolee [Fri, 5 Sep 2025 19:26:14 +0000 (19:26 +0000)] 
midx-write: put failing response value back

This instance of setting the result to 1 before going to cleanup was
accidentally removed in fcb2205b77 (midx: implement support for writing
incremental MIDX chains, 2024-08-06). Build upon a test that already deletes
a packfile to verify that this error propagates to full command failure.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agomidx-write: only load initialized packs
Derrick Stolee [Fri, 5 Sep 2025 19:26:13 +0000 (19:26 +0000)] 
midx-write: only load initialized packs

The fill_packs_from_midx() method was refactored in fcb2205b77 (midx:
implement support for writing incremental MIDX chains, 2024-08-06) to
allow for preferred packfiles and incremental multi-pack-indexes.
However, this led to some conditions that can cause improperly
initialized memory in the context's list of packfiles.

The conditions caring about the preferred pack name or the incremental
flag are currently necessary to load a packfile. But the context is
still being populated with pack_info structs based on the packfile array
for the existing multi-pack-index even if prepare_midx_pack() isn't
called.

Add a new test that breaks under --stress when compiled with
SANITIZE=address. The chosen number of 100 packfiles was selected to get
the --stress output to fail about 50% of the time, while 50 packfiles
could not get a failure in most --stress runs.

The test case is marked as EXPENSIVE not only because of the number of
packfiles it creates, but because some CI environments were reporting
errors during the test that I could not reproduce, specifically around
being unable to open the packfiles or their pack-indexes.

When it fails under SANITIZE=address, it provides the following error:

AddressSanitizer:DEADLYSIGNAL
=================================================================
==3263517==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000027
==3263517==The signal is caused by a READ memory access.
==3263517==Hint: address points to the zero page.
    #0 0x562d5d82d1fb in close_pack_windows packfile.c:299
    #1 0x562d5d82d3ab in close_pack packfile.c:354
    #2 0x562d5d7bfdb4 in write_midx_internal midx-write.c:1490
    #3 0x562d5d7c7aec in midx_repack midx-write.c:1795
    #4 0x562d5d46fff6 in cmd_multi_pack_index builtin/multi-pack-index.c:305
    ...

This failure stack trace is disconnected from the real fix because the bad
pointers are accessed later when closing the packfiles from the context.

There are a few different aspects to this fix that are worth noting:

 1. We return to the previous behavior of fill_packs_from_midx to not
    rely on the incremental flag or existence of a preferred pack.

 2. The behavior to scan all layers of an incremental midx is kept, so
    this is not a full revert of the change.

 3. We skip allocating more room in the pack_info array if the pack
    fails prepare_midx_pack().

 4. The method has always returned 0 for success and 1 for failure, but
    the condition checking for error added a check for a negative result
    for failure, so that is now updated.

 5. The call to open_pack_index() is removed, but this is needed later
    in the case of a preferred pack. That call is moved to immediately
    before its result is needed (checking for the object count).

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agoalloc: fix dangling pointer in alloc_state cleanup
ノウラ | Flare [Thu, 4 Sep 2025 17:44:16 +0000 (17:44 +0000)] 
alloc: fix dangling pointer in alloc_state cleanup

All callers of clear_alloc_state() immediately free what they
cleared, so currently it does not hurt anybody that the
alloc_state is left in an unreusable state, but it is an
error-prone API. Replace it with a new function that clears but
in addition frees the structure, as well as NULLing the pointer
that points at it and adjust existing callers.

As it is a moral equivalent of FREE_AND_NULL(), except that what it
frees has internal structure that needs to be cleaned, allow the
helper to be called twice in a row, by making a call with a pointer
to a pointer variable that already is NULLed.

While at it, rename allocate_alloc_state() and name the new
function alloc_state_free_and_null(), to follow more closely the
function naming convention specified in the CodingGuidelines
(namely, functions about S are named with S_ prefix and then
verb).

Signed-off-by: ノウラ | Flare <nouraellm@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agoobject-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
René Scharfe [Thu, 4 Sep 2025 17:58:25 +0000 (19:58 +0200)] 
object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter

Expose the expected type of the second parameter of extend_abbrev_len()
instead of casting a void pointer internally.  Just a single caller
passes in a void pointer, the rest pass the correct type.  Let the
compiler help keeping it that way.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agorepo: add the field objects.format
Lucas Seiki Oshiro [Thu, 4 Sep 2025 13:40:17 +0000 (10:40 -0300)] 
repo: add the field objects.format

The flag `--show-object-format` from git-rev-parse is used for
retrieving the object storage format. This way, it is used for
querying repository metadata, fitting in the purpose of git-repo-info.

Add a new field `objects.format` to the git-repo-info subcommand
containing that information.

Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agorepo: add the flag -z as an alias for --format=nul
Lucas Seiki Oshiro [Thu, 4 Sep 2025 13:40:16 +0000 (10:40 -0300)] 
repo: add the flag -z as an alias for --format=nul

Other Git commands that have nul-terminated output (e.g. git-config,
git-status, git-ls-files) have a flag `-z` for using the null character
as the record separator.

Add the `-z` flag to git-repo-info as an alias for `--format=nul`,
making it consistent with the behavior of the other commands.

Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 weeks agoMerge branch 'rs/describe-with-lazy-queue-and-oidset' into next
Junio C Hamano [Thu, 4 Sep 2025 16:01:03 +0000 (09:01 -0700)] 
Merge branch 'rs/describe-with-lazy-queue-and-oidset' into next

Instead of scanning for the remaining items to see if there are
still commits to be explored in the queue, use khash to remember
which items are still on the queue (an unacceptable alternative is
to reserve one object flag bits).

* rs/describe-with-lazy-queue-and-oidset:
  describe: use oidset in finish_depth_computation()

6 weeks agoMerge branch 'tc/t0450-harden' into next
Junio C Hamano [Thu, 4 Sep 2025 16:01:03 +0000 (09:01 -0700)] 
Merge branch 'tc/t0450-harden' into next

Test updates.

* tc/t0450-harden:
  t0450: add allowlist for builtins with missing .adoc
  t0450: fix test for out-of-tree builds

6 weeks agoMerge branch 'kh/doc-markup-fixes' into next
Junio C Hamano [Wed, 3 Sep 2025 21:54:38 +0000 (14:54 -0700)] 
Merge branch 'kh/doc-markup-fixes' into next

Doc markup fixes.

* kh/doc-markup-fixes:
  doc: remove extra backtick for inline-verbatim
  doc: add missing backtick for inline-verbatim