]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
7 weeks agomidx: do not require packs to be sorted in lexicographic order
Taylor Blau [Tue, 24 Feb 2026 19:00:13 +0000 (14:00 -0500)] 
midx: do not require packs to be sorted in lexicographic order

The MIDX file format currently requires that pack files be identified by
the lexicographic ordering of their names (that is, a pack having a
checksum beginning with "abc" would have a numeric pack_int_id which is
smaller than the same value for a pack beginning with "bcd").

As a result, it is impossible to combine adjacent MIDX layers together
without permuting bits from bitmaps that are in more recent layer(s).

To see why, consider the following example:

          | packs       | preferred pack
  --------+-------------+---------------
  MIDX #0 | { X, Y, Z } | Y
  MIDX #1 | { A, B, C } | B
  MIDX #2 | { D, E, F } | D

, where MIDX #2's base MIDX is MIDX #1, and so on. Suppose that we want
to combine MIDX layers #0 and #1, to create a new layer #0' containing
the packs from both layers. With the original three MIDX layers, objects
are laid out in the bitmap in the order they appear in their source
pack, and the packs themselves are arranged according to the pseudo-pack
order. In this case, that ordering is Y, X, Z, B, A, C.

But recall that the pseudo-pack ordering is defined by the order that
packs appear in the MIDX, with the exception of the preferred pack,
which sorts ahead of all other packs regardless of its position within
the MIDX. In the above example, that means that pack 'Y' could be placed
anywhere (so long as it is designated as preferred), however, all other
packs must be placed in the location listed above.

Because that ordering isn't sorted lexicographically, it is impossible
to compact MIDX layers in the above configuration without permuting the
object-to-bit-position mapping. Changing this mapping would affect all
bitmaps belonging to newer layers, rendering the bitmaps associated with
MIDX #2 unreadable.

One of the goals of MIDX compaction is that we are able to shrink the
length of the MIDX chain *without* invalidating bitmaps that belong to
newer layers, and the lexicographic ordering constraint is at odds with
this goal.

However, packs do not *need* to be lexicographically ordered within the
MIDX. As far as I can gather, the only reason they are sorted lexically
is to make it possible to perform a binary search over the pack names in
a MIDX, necessary to make `midx_contains_pack()`'s performance
logarithmic in the number of packs rather than linear.

Relax this constraint by allowing MIDX writes to proceed with packs that
are not arranged in lexicographic order. `midx_contains_pack()` will
lazily instantiate a `pack_names_sorted` array on the MIDX, which will
be used to implement the binary search over pack names.

This change produces MIDXs which may not be correctly read with external
tools or older versions of Git. Though older versions of Git know how to
gracefully degrade and ignore any MIDX(s) they consider corrupt,
external tools may not be as robust. To avoid unintentionally breaking
any such tools, guard this change behind a version bump in the MIDX's
on-disk format.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agomidx-write.c: introduce `struct write_midx_opts`
Taylor Blau [Tue, 24 Feb 2026 19:00:09 +0000 (14:00 -0500)] 
midx-write.c: introduce `struct write_midx_opts`

In the MIDX writing code, there are four functions which perform some
sort of MIDX write operation. They are:

 - write_midx_file()
 - write_midx_file_only()
 - expire_midx_packs()
 - midx_repack()

All of these functions are thin wrappers over `write_midx_internal()`,
which implements the bulk of these routines. As a result, the
`write_midx_internal()` function takes six arguments.

Future commits in this series will want to add additional arguments, and
in general this function's signature will be the union of parameters
among *all* possible ways to write a MIDX.

Instead of adding yet more arguments to this function to support MIDX
compaction, introduce a `struct write_midx_opts`, which has the same
struct members as `write_midx_internal()`'s arguments.

Adding additional fields to the `write_midx_opts` struct is preferable
to adding additional arguments to `write_midx_internal()`. This is
because the callers below all zero-initialize the struct, so each time
we add a new piece of information, we do not have to pass the zero value
for it in all other call-sites that do not care about it.

For now, no functional changes are included in this patch.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agomidx-write.c: don't use `pack_perm` when assigning `bitmap_pos`
Taylor Blau [Tue, 24 Feb 2026 19:00:05 +0000 (14:00 -0500)] 
midx-write.c: don't use `pack_perm` when assigning `bitmap_pos`

In midx_pack_order(), we compute for each bitmapped pack the first bit
to correspond to an object in that pack, along with how many bits were
assigned to object(s) in that pack.

Initially, each bitmap_nr value is set to zero, and each bitmap_pos
value is set to the sentinel BITMAP_POS_UNKNOWN. This is done to ensure
that there are no packs who have an unknown bit position but a somehow
non-zero number of objects (cf. `write_midx_bitmapped_packs()` in
midx-write.c).

Once the pack order is fully determined, midx_pack_order() sets the
bitmap_pos field for any bitmapped packs to zero if they are still
listed as BITMAP_POS_UNKNOWN.

However, we enumerate the bitmapped packs in order of `ctx->pack_perm`.
This is fine for existing cases, since the only time the
`ctx->pack_perm` array holds a value outside of the addressable range of
`ctx->info` is when there are expired packs, which only occurs via 'git
multi-pack-index expire', which does not support writing MIDX bitmaps.
As a result, the range of ctx->pack_perm covers all values in [0,
`ctx->nr`), so enumerating in this order isn't an issue.

A future change necessary for compaction will complicate this further by
introducing a wrapper around the `ctx->pack_perm` array, which turns the
given `pack_int_id` into one that is relative to the lower end of the
compaction range. As a result, indexing into `ctx->pack_perm` through
this helper, say, with "0" will produce a crash when the lower end of
the compaction range has >0 pack(s) in its base layer, since the
subtraction will wrap around the 32-bit unsigned range, resulting in an
uninitialized read.

But the process is completely unnecessary in the first place: we are
enumerating all values of `ctx->info`, and there is no reason to process
them in a different order than they appear in memory. Index `ctx->info`
directly to reflect that.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agot/t5319-multi-pack-index.sh: fix copy-and-paste error in t5319.39
Taylor Blau [Tue, 24 Feb 2026 19:00:00 +0000 (14:00 -0500)] 
t/t5319-multi-pack-index.sh: fix copy-and-paste error in t5319.39

Commit d4bf1d88b90 (multi-pack-index: verify missing pack, 2018-09-13)
adds a new test to the MIDX test script to test how we handle missing
packs.

While the commit itself describes the test as "verify missing pack[s]",
the test itself is actually called "verify packnames out of order",
despite that not being what it tests.

Likely this was a copy-and-paste of the test immediately above it of the
same name. Correct this by renaming the test to match the commit
message.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agogit-multi-pack-index(1): align SYNOPSIS with 'git multi-pack-index -h'
Taylor Blau [Tue, 24 Feb 2026 18:59:56 +0000 (13:59 -0500)] 
git-multi-pack-index(1): align SYNOPSIS with 'git multi-pack-index -h'

Since c39fffc1c90 (tests: start asserting that *.txt SYNOPSIS matches -h
output, 2022-10-13), the manual page for 'git multi-pack-index' has a
SYNOPSIS section which differs from 'git multi-pack-index -h'.

Correct this while also documenting additional options accepted by the
'write' sub-command.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agogit-multi-pack-index(1): remove non-existent incompatibility
Taylor Blau [Tue, 24 Feb 2026 18:59:52 +0000 (13:59 -0500)] 
git-multi-pack-index(1): remove non-existent incompatibility

Since fcb2205b774 (midx: implement support for writing incremental MIDX
chains, 2024-08-06), the command-line options '--incremental' and
'--bitmap' were declared to be incompatible with one another when
running 'git multi-pack-index write'.

However, since 27afc272c49 (midx: implement writing incremental MIDX
bitmaps, 2025-03-20), that incompatibility no longer exists, despite the
documentation saying so. Correct this by removing the stale reference to
their incompatibility.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agobuiltin/multi-pack-index.c: make '--progress' a common option
Taylor Blau [Tue, 24 Feb 2026 18:59:48 +0000 (13:59 -0500)] 
builtin/multi-pack-index.c: make '--progress' a common option

All multi-pack-index sub-commands (write, verify, repack, and expire)
support a '--progress' command-line option, despite not listing it as
one of the common options in `common_opts`.

As a result each sub-command declares its own `OPT_BIT()` for a
"--progress" command-line option. Centralize this within the
`common_opts` to avoid re-declaring it in each sub-command.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agomidx: introduce `midx_get_checksum_hex()`
Taylor Blau [Tue, 24 Feb 2026 18:59:44 +0000 (13:59 -0500)] 
midx: introduce `midx_get_checksum_hex()`

When trying to print out, say, the hexadecimal representation of a
MIDX's hash, our code will do something like:

    hash_to_hex_algop(midx_get_checksum_hash(m),
                      m->source->odb->repo->hash_algo);

, which is both cumbersome and repetitive. In fact, all but a handful of
callers to `midx_get_checksum_hash()` do exactly the above. Reduce the
repetitive nature of calling `midx_get_checksum_hash()` by having it
return a pointer into a static buffer containing the above result.

For the handful of callers that do need to compare the raw bytes and
don't want to deal with an encoded copy (e.g., because they are passing
it to hasheq() or similar), they may still rely on
`midx_get_checksum_hash()` which returns the raw bytes.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agomidx: rename `get_midx_checksum()` to `midx_get_checksum_hash()`
Taylor Blau [Tue, 24 Feb 2026 18:59:39 +0000 (13:59 -0500)] 
midx: rename `get_midx_checksum()` to `midx_get_checksum_hash()`

Since 541204aabea (Documentation: document naming schema for structs and
their functions, 2024-07-30), we have adopted a naming convention for
functions that would prefer a name like, say, `midx_get_checksum()` over
`get_midx_checksum()`.

Adopt this convention throughout the midx.h API. Since this function
returns a raw (that is, non-hex encoded) hash, let's suffix the function
with "_hash()" to make this clear. As a side effect, this prepares us
for the subsequent change which will introduce a "_hex()" variant that
encodes the checksum itself.

Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 weeks agomidx: mark `get_midx_checksum()` arguments as const
Taylor Blau [Tue, 24 Feb 2026 18:59:34 +0000 (13:59 -0500)] 
midx: mark `get_midx_checksum()` arguments as const

To make clear that the function `get_midx_checksum()` does not do
anything to modify its argument, mark the MIDX pointer as const.

The following commit will rename this function altogether to make clear
that it returns the raw bytes of the checksum, not a hex-encoded copy of
it.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoThe 6th batch
Junio C Hamano [Fri, 20 Feb 2026 18:28:05 +0000 (10:28 -0800)] 
The 6th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoMerge branch 'ak/t9812-test-path-is-helpers'
Junio C Hamano [Fri, 20 Feb 2026 19:36:18 +0000 (11:36 -0800)] 
Merge branch 'ak/t9812-test-path-is-helpers'

Test update.

* ak/t9812-test-path-is-helpers:
  t9812: modernize test path helpers

8 weeks agoMerge branch 'pw/diff-anchored-optim'
Junio C Hamano [Fri, 20 Feb 2026 19:36:18 +0000 (11:36 -0800)] 
Merge branch 'pw/diff-anchored-optim'

"git diff --anchored=<text>" has been optimized.

* pw/diff-anchored-optim:
  diff --anchored: avoid checking unmatched lines

8 weeks agoMerge branch 'jc/doc-cg-c-comment'
Junio C Hamano [Fri, 20 Feb 2026 19:36:18 +0000 (11:36 -0800)] 
Merge branch 'jc/doc-cg-c-comment'

A CodingGuidelines update.

* jc/doc-cg-c-comment:
  CodingGuidelines: document // comments

8 weeks agoMerge branch 'pw/xdiff-cleanups'
Junio C Hamano [Fri, 20 Feb 2026 19:36:17 +0000 (11:36 -0800)] 
Merge branch 'pw/xdiff-cleanups'

Small clean-up of xdiff library to remove unnecessary data
duplication.

* pw/xdiff-cleanups:
  xdiff: remove unused data from xdlclass_t
  xdiff: remove "line_hash" field from xrecord_t

8 weeks agoThe 5th batch
Junio C Hamano [Tue, 17 Feb 2026 21:29:49 +0000 (13:29 -0800)] 
The 5th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoMerge branch 'jc/doc-rerere-update'
Junio C Hamano [Tue, 17 Feb 2026 21:30:43 +0000 (13:30 -0800)] 
Merge branch 'jc/doc-rerere-update'

Doc update.

* jc/doc-rerere-update:
  rerere: minor documantation update

8 weeks agoMerge branch 'sd/t7003-test-path-is-helpers'
Junio C Hamano [Tue, 17 Feb 2026 21:30:43 +0000 (13:30 -0800)] 
Merge branch 'sd/t7003-test-path-is-helpers'

Test updates.

* sd/t7003-test-path-is-helpers:
  t7003: modernize path existence checks using test helpers

8 weeks agoMerge branch 'kh/doc-rerere-options-xref'
Junio C Hamano [Tue, 17 Feb 2026 21:30:43 +0000 (13:30 -0800)] 
Merge branch 'kh/doc-rerere-options-xref'

Doc update.

* kh/doc-rerere-options-xref:
  doc: rerere-options.adoc: link to git-rerere(1)

8 weeks agoMerge branch 'bk/t2003-modernise'
Junio C Hamano [Tue, 17 Feb 2026 21:30:42 +0000 (13:30 -0800)] 
Merge branch 'bk/t2003-modernise'

Test update.

* bk/t2003-modernise:
  t2003: modernize path existence checks using test helpers

8 weeks agoMerge branch 'rs/commit-commit-stack'
Junio C Hamano [Tue, 17 Feb 2026 21:30:42 +0000 (13:30 -0800)] 
Merge branch 'rs/commit-commit-stack'

Code clean-up to use the commit_stack API.

* rs/commit-commit-stack:
  commit: use commit_stack

8 weeks agoMerge branch 'rs/clean-includes'
Junio C Hamano [Tue, 17 Feb 2026 21:30:42 +0000 (13:30 -0800)] 
Merge branch 'rs/clean-includes'

Clean up redundant includes of header files.

* rs/clean-includes:
  remove duplicate includes

8 weeks agoMerge branch 'rs/xdiff-wo-the-repository'
Junio C Hamano [Tue, 17 Feb 2026 21:30:42 +0000 (13:30 -0800)] 
Merge branch 'rs/xdiff-wo-the-repository'

Reduce dependency on the_repository of xdiff-interface layer.

* rs/xdiff-wo-the-repository:
  xdiff-interface: stop using the_repository

8 weeks agoMerge branch 'rs/version-wo-the-repository'
Junio C Hamano [Tue, 17 Feb 2026 21:30:41 +0000 (13:30 -0800)] 
Merge branch 'rs/version-wo-the-repository'

Code clean-up.

* rs/version-wo-the-repository:
  version: stop using the_repository

8 weeks agoMerge branch 'yt/merge-file-outside-a-repository'
Junio C Hamano [Tue, 17 Feb 2026 21:30:41 +0000 (13:30 -0800)] 
Merge branch 'yt/merge-file-outside-a-repository'

"git merge-file" can be run outside a repository, but it ignored
all configuration, even the per-user ones.  The command now uses
available configuration files to find its customization.

* yt/merge-file-outside-a-repository:
  merge-file: honor merge.conflictStyle outside of a repository

8 weeks agoMerge branch 'ja/doc-synopsis-style-even-more'
Junio C Hamano [Tue, 17 Feb 2026 21:30:41 +0000 (13:30 -0800)] 
Merge branch 'ja/doc-synopsis-style-even-more'

A handful of documentation pages have been modernized to use the
"synopsis" style.

* ja/doc-synopsis-style-even-more:
  doc: convert git-show to synopsis style
  doc: fix some style issues in git-clone and for-each-ref-options
  doc: finalize git-clone documentation conversion to synopsis style
  doc: convert git-submodule to synopsis style

8 weeks agoMerge branch 'pc/lockfile-pid'
Junio C Hamano [Tue, 17 Feb 2026 21:30:41 +0000 (13:30 -0800)] 
Merge branch 'pc/lockfile-pid'

Allow recording process ID of the process that holds the lock next
to a lockfile for diagnosis.

* pc/lockfile-pid:
  lockfile: add PID file for debugging stale locks

2 months agoThe 4th batch
Junio C Hamano [Fri, 13 Feb 2026 20:57:32 +0000 (12:57 -0800)] 
The 4th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'sb/merge-ours-sparse'
Junio C Hamano [Fri, 13 Feb 2026 21:39:26 +0000 (13:39 -0800)] 
Merge branch 'sb/merge-ours-sparse'

"git merge-ours" is taught to work better in a sparse checkout.

* sb/merge-ours-sparse:
  merge-ours: integrate with sparse-index
  merge-ours: drop USE_THE_REPOSITORY_VARIABLE

2 months agoMerge branch 'sd/doc-my1c-api-config-reference-fix'
Junio C Hamano [Fri, 13 Feb 2026 21:39:26 +0000 (13:39 -0800)] 
Merge branch 'sd/doc-my1c-api-config-reference-fix'

Docfix.

* sd/doc-my1c-api-config-reference-fix:
  doc: fix repo_config documentation reference

2 months agoMerge branch 'jc/ci-test-contrib-too'
Junio C Hamano [Fri, 13 Feb 2026 21:39:26 +0000 (13:39 -0800)] 
Merge branch 'jc/ci-test-contrib-too'

Test contrib/ things in CI to catch breakages before they enter the
"next" branch.

* jc/ci-test-contrib-too:
  : Some of our downstream folks run more tests than we do and catch
  : breakages in them, namely, where contrib/*/Makefile has "test" target.
  : Let's make sure we fail upon accepting a new topic that break them in
  : 'seen'.
  ci: ubuntu: use GNU coreutils for dirname
  test: optionally test contrib in CI

2 months agoMerge branch 'jt/odb-transaction-per-source'
Junio C Hamano [Fri, 13 Feb 2026 21:39:25 +0000 (13:39 -0800)] 
Merge branch 'jt/odb-transaction-per-source'

Transaction to create objects (or not) is currently tied to the
repository, but in the future a repository can have multiple object
sources, which may have different transaction mechanisms.  Make the
odb transaction API per object source.

* jt/odb-transaction-per-source:
  odb: transparently handle common transaction behavior
  odb: prepare `struct odb_transaction` to become generic
  object-file: rename transaction functions
  odb: store ODB source in `struct odb_transaction`

2 months agoMerge branch 'ps/commit-list-functions-renamed'
Junio C Hamano [Fri, 13 Feb 2026 21:39:25 +0000 (13:39 -0800)] 
Merge branch 'ps/commit-list-functions-renamed'

Rename three functions around the commit_list data structure.

* ps/commit-list-functions-renamed:
  commit: rename `free_commit_list()` to conform to coding guidelines
  commit: rename `reverse_commit_list()` to conform to coding guidelines
  commit: rename `copy_commit_list()` to conform to coding guidelines

2 months agoMerge branch 'tc/last-modified-not-a-tree'
Junio C Hamano [Fri, 13 Feb 2026 21:39:25 +0000 (13:39 -0800)] 
Merge branch 'tc/last-modified-not-a-tree'

Giving "git last-modified" a tree (not a commit-ish) died an
uncontrolled death, which has been corrected.

* tc/last-modified-not-a-tree:
  last-modified: verify revision argument is a commit-ish
  last-modified: remove double error message
  last-modified: fix memory leak when more than one commit is given
  last-modified: rewrite error message when more than one commit given

2 months agoMerge branch 'mc/doc-send-email-signed-off-by-cc'
Junio C Hamano [Fri, 13 Feb 2026 21:39:25 +0000 (13:39 -0800)] 
Merge branch 'mc/doc-send-email-signed-off-by-cc'

Docfix.

* mc/doc-send-email-signed-off-by-cc:
  doc: send-email: correct --no-signed-off-by-cc misspelling

2 months agoMerge branch 'cf/c23-const-preserving-strchr-updates-0'
Junio C Hamano [Fri, 13 Feb 2026 21:39:24 +0000 (13:39 -0800)] 
Merge branch 'cf/c23-const-preserving-strchr-updates-0'

ISO C23 redefines strchr and friends that tradiotionally took
a const pointer and returned a non-const pointer derived from it to
preserve constness (i.e., if you ask for a substring in a const
string, you get a const pointer to the substring).  Update code
paths that used non-const pointer to receive their results that did
not have to be non-const to adjust.

* cf/c23-const-preserving-strchr-updates-0:
  gpg-interface: remove an unnecessary NULL initialization
  global: constify some pointers that are not written to

2 months agoMerge branch 'jc/diff-highlight-main-master-testfix'
Junio C Hamano [Fri, 13 Feb 2026 21:39:24 +0000 (13:39 -0800)] 
Merge branch 'jc/diff-highlight-main-master-testfix'

Test fix (in contrib/)

* jc/diff-highlight-main-master-testfix:
  diff-highlight: allow testing with Git 3.0 breaking changes

2 months agoMerge branch 'cs/subtree-reftable-testfix'
Junio C Hamano [Fri, 13 Feb 2026 21:39:24 +0000 (13:39 -0800)] 
Merge branch 'cs/subtree-reftable-testfix'

Test fix (in contrib/)

* cs/subtree-reftable-testfix:
  contrib/subtree: fix tests with reftable backend

2 months agoMerge branch 'tc/memzero-array'
Junio C Hamano [Fri, 13 Feb 2026 21:39:24 +0000 (13:39 -0800)] 
Merge branch 'tc/memzero-array'

Coccinelle rules update.

* tc/memzero-array:
  cocci: extend MEMZERO_ARRAY() rules

2 months agot9812: modernize test path helpers
Ashwani Kumar Kamal [Thu, 12 Feb 2026 05:45:30 +0000 (11:15 +0530)] 
t9812: modernize test path helpers

Replace assertion-style 'test -f' checks with Git's
test_path_is_file() helper for clearer failures and
consistency.

Signed-off-by: Ashwani Kumar Kamal <ashwanikamal.im421@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodiff --anchored: avoid checking unmatched lines
Phillip Wood [Thu, 12 Feb 2026 15:53:50 +0000 (15:53 +0000)] 
diff --anchored: avoid checking unmatched lines

For a line to be an anchor it has to appear in each of the files being
diffed exactly once. With that in mind lets delay checking whether
a line is an anchor until we know there is exactly one instance of
the line in each file. As each line is checked at most once, there
is no need to cache the result of is_anchor() and we can drop that
field from the hashmap entries. When diffing 5000 recent commits in
git.git this gives a modest speedup of ~2%. In the (rather extreme)
example below that consists largely of deletions the speedup is ~16%.

    seq 0 10000000 >old
    printf '%s\n' 300000 100000 200000 >new
    git diff --no-index --anchored=300000 old new

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Wed, 11 Feb 2026 22:49:53 +0000 (14:49 -0800)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk:
  gitk: fix msgfmt being required
  gitk: fix highlighted remote prefix of branches with directories

2 months agoCodingGuidelines: document // comments
Junio C Hamano [Wed, 11 Feb 2026 19:17:48 +0000 (11:17 -0800)] 
CodingGuidelines: document // comments

We do not use // comments in our C code, which is implied by the
description of multi-line comment rule and its examples, but is not
explicitly spelled out.  Spell it out.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoThe 3rd batch
Junio C Hamano [Wed, 11 Feb 2026 19:53:49 +0000 (11:53 -0800)] 
The 3rd batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'rs/blame-ignore-colors-fix'
Junio C Hamano [Wed, 11 Feb 2026 20:29:08 +0000 (12:29 -0800)] 
Merge branch 'rs/blame-ignore-colors-fix'

"git blame --ignore-revs=... --color-lines" did not account for
ignored revisions passing blame to the same commit an adjacent line
gets blamed for.

* rs/blame-ignore-colors-fix:
  blame: fix coloring for repeated suspects

2 months agoMerge branch 'hs/t9160-test-paths'
Junio C Hamano [Wed, 11 Feb 2026 20:29:07 +0000 (12:29 -0800)] 
Merge branch 'hs/t9160-test-paths'

Test update.

* hs/t9160-test-paths:
  t9160:modernize test path checking

2 months agoMerge branch 'am/doc-github-contributiong-link-to-submittingpatches'
Junio C Hamano [Wed, 11 Feb 2026 20:29:07 +0000 (12:29 -0800)] 
Merge branch 'am/doc-github-contributiong-link-to-submittingpatches'

GitHub repository banner update.

* am/doc-github-contributiong-link-to-submittingpatches:
  .github/CONTRIBUTING.md: link to SubmittingPatches on git-scm.com

2 months agoMerge branch 'kh/doc-shortlog-fix'
Junio C Hamano [Wed, 11 Feb 2026 20:29:07 +0000 (12:29 -0800)] 
Merge branch 'kh/doc-shortlog-fix'

Doc fix.

* kh/doc-shortlog-fix:
  doc: shortlog: put back trailer paragraphs

2 months agoMerge branch 'sp/show-index-warn-fallback'
Junio C Hamano [Wed, 11 Feb 2026 20:29:06 +0000 (12:29 -0800)] 
Merge branch 'sp/show-index-warn-fallback'

When "git show-index" is run outside a repository, it silently
defaults to SHA-1; the tool now warns when this happens.

* sp/show-index-warn-fallback:
  show-index: use gettext wrapping in user facing error messages
  show-index: warn when falling back to SHA-1 outside a repository

2 months agodoc: rerere-options.adoc: link to git-rerere(1)
Kristoffer Haugsbakk [Tue, 10 Feb 2026 19:56:49 +0000 (20:56 +0100)] 
doc: rerere-options.adoc: link to git-rerere(1)

Five commands include these options. Let’s link to the command so that
the curious user can learn more about what “rerere” is about.

It’s also better to consistently refer to things like
e.g. “git-subcommand(1)” over `git subcommand` or `subcommand`.

Also apply the same treatment to git-add(1).

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoxdiff-interface: stop using the_repository
René Scharfe [Mon, 9 Feb 2026 19:24:52 +0000 (20:24 +0100)] 
xdiff-interface: stop using the_repository

Use the algorithm-agnostic is_null_oid() and push the dependency of
read_mmblob() on the_repository->objects to its callers.  This allows it
to be used with arbitrary object databases.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoThe second batch
Junio C Hamano [Mon, 9 Feb 2026 20:08:48 +0000 (12:08 -0800)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'ty/perf-3400-optim'
Junio C Hamano [Mon, 9 Feb 2026 20:09:10 +0000 (12:09 -0800)] 
Merge branch 'ty/perf-3400-optim'

Improve set-up time of a perf test.

* ty/perf-3400-optim:
  t/perf/p3400: speed up setup using fast-import

2 months agoMerge branch 'ac/string-list-sort-u-and-tests'
Junio C Hamano [Mon, 9 Feb 2026 20:09:10 +0000 (12:09 -0800)] 
Merge branch 'ac/string-list-sort-u-and-tests'

The string_list API gains a new helper, string_list_sort_u(), and
new unit tests to extend coverage.

* ac/string-list-sort-u-and-tests:
  string-list: add string_list_sort_u() that mimics "sort -u"
  u-string-list: add unit tests for string-list methods

2 months agoMerge branch 'sb/doc-worktree-prune-expire-improvement'
Junio C Hamano [Mon, 9 Feb 2026 20:09:10 +0000 (12:09 -0800)] 
Merge branch 'sb/doc-worktree-prune-expire-improvement'

The help text and the documentation for the "--expire" option of
"git worktree [list|prune]" have been improved.

* sb/doc-worktree-prune-expire-improvement:
  worktree: clarify that --expire only affects missing worktrees

2 months agoMerge branch 'kn/ref-batch-output-error-reporting-fix'
Junio C Hamano [Mon, 9 Feb 2026 20:09:10 +0000 (12:09 -0800)] 
Merge branch 'kn/ref-batch-output-error-reporting-fix'

A handful of code paths that started using batched ref update API
(after Git 2.51 or so) lost detailed error output, which have been
corrected.

* kn/ref-batch-output-error-reporting-fix:
  fetch: delay user information post committing of transaction
  receive-pack: utilize rejected ref error details
  fetch: utilize rejected ref error details
  update-ref: utilize rejected error details if available
  refs: add rejection detail to the callback function
  refs: skip to next ref when current ref is rejected

2 months agoMerge branch 'pw/replay-drop-empty'
Junio C Hamano [Mon, 9 Feb 2026 20:09:09 +0000 (12:09 -0800)] 
Merge branch 'pw/replay-drop-empty'

"git replay" is taught to drop commits that become empty (not the
ones that are empty in the original).

* pw/replay-drop-empty:
  replay: drop commits that become empty

2 months agoMerge branch 'ps/history'
Junio C Hamano [Mon, 9 Feb 2026 20:09:09 +0000 (12:09 -0800)] 
Merge branch 'ps/history'

"git history" history rewriting UI.

* ps/history:
  builtin/history: implement "reword" subcommand
  builtin: add new "history" command
  wt-status: provide function to expose status for trees
  replay: support updating detached HEAD
  replay: support empty commit ranges
  replay: small set of cleanups
  builtin/replay: move core logic into "libgit.a"
  builtin/replay: extract core logic to replay revisions

2 months agorerere: minor documantation update
Junio C Hamano [Mon, 9 Feb 2026 18:27:29 +0000 (10:27 -0800)] 
rerere: minor documantation update

Let's not call our users "it".  Also "rerere forget \*.c" does not
forget resolutions for just '*.c'; it forgets for all the files
whose filenames end with ".c".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot7003: modernize path existence checks using test helpers
SoutrikDas [Mon, 9 Feb 2026 17:24:45 +0000 (22:54 +0530)] 
t7003: modernize path existence checks using test helpers

Replace direct uses of 'test -f' and 'test -d' with
git's helper functions 'test_path_is_file' ,
'test_path_is_missing' and 'test_path_is_dir'

Signed-off-by: SoutrikDas <valusoutrik@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot2003: modernize path existence checks using test helpers
Burak Kaan Karaçay [Mon, 9 Feb 2026 11:24:44 +0000 (14:24 +0300)] 
t2003: modernize path existence checks using test helpers

The old style 'test -f' and 'test -d' checks are silent on failure,
which makes debugging difficult.

Replace them with the 'test_path_is_*' helpers which provide verbose
error messages when a test fails.

Signed-off-by: Burak Kaan Karaçay <bkkaracay@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoversion: stop using the_repository
René Scharfe [Sun, 8 Feb 2026 17:01:24 +0000 (18:01 +0100)] 
version: stop using the_repository

Actually it has never been used in version.c since cf7ee481902 (agent:
advertise OS name via agent capability, 2025-02-15) added the dependency
macro.  Remove it, along with the also unused struct declaration.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoremove duplicate includes
René Scharfe [Sun, 8 Feb 2026 12:32:22 +0000 (13:32 +0100)] 
remove duplicate includes

The following command reports that some header files are included twice:

   $ git grep '#include' '*.c' | sort | uniq -cd

Remove the second #include line in each case, as it has no effect.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocommit: use commit_stack
René Scharfe [Sun, 8 Feb 2026 11:37:38 +0000 (12:37 +0100)] 
commit: use commit_stack

Use commit_stack instead of open-coding it.  Also convert the loop
counter i to size_t to match the type of the nr member of struct
commit_stack.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agomerge-file: honor merge.conflictStyle outside of a repository
Yannik Tausch [Sat, 7 Feb 2026 21:37:48 +0000 (22:37 +0100)] 
merge-file: honor merge.conflictStyle outside of a repository

When running outside a repository, git merge-file ignores the
merge.conflictStyle configuration variable entirely. Since the
function receives `repo` from the caller (which is NULL outside a
repository), and repo_config() falls back to reading system and user
configuration when passed NULL, pass `repo` to repo_config()
unconditionally.

Also document that merge.conflictStyle is honored.

Signed-off-by: Yannik Tausch <dev@ytausch.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoci: ubuntu: use GNU coreutils for dirname
Colin Stagner [Sat, 7 Feb 2026 04:27:03 +0000 (22:27 -0600)] 
ci: ubuntu: use GNU coreutils for dirname

The uutils version of `dirname` has output that is inconsistent
with GNU coreutils. Prefer the GNU implementation of this command.

Signed-off-by: Colin Stagner <ask+git@howdoi.land>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agomerge-ours: integrate with sparse-index
Sam Bostock [Fri, 6 Feb 2026 19:16:23 +0000 (19:16 +0000)] 
merge-ours: integrate with sparse-index

The merge-ours built-in opens the index to compare it against HEAD.
The machinery used to do this (i.e. run_diff_index()) is capable of
working with a sparse index, but the start-up sequence of this
command does not take the necessary steps, so we end up expanding the
index fully before doing the comparison.

In order to convince sparse-index.c:is_sparse_index_allowed() to
return true, we need to:

 - Read basic configuration with git_default_config so that global
   variables like core_apply_sparse_checkout are populated.
   merge-ours currently does not read configuration at all.

 - Set command_requires_full_index to 0.

With that, the command can work without expanding the index fully
before doing its work.

Signed-off-by: Sam Bostock <sam@sambostock.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agomerge-ours: drop USE_THE_REPOSITORY_VARIABLE
Sam Bostock [Fri, 6 Feb 2026 19:16:22 +0000 (19:16 +0000)] 
merge-ours: drop USE_THE_REPOSITORY_VARIABLE

The merge-ours built-in uses the `the_repository` global to access
the repository. The project is moving away from this global in favor
of the `repo` parameter that is passed to each built-in command.
Since merge-ours is registered with RUN_SETUP, `repo` is guaranteed
to be non-NULL and can be used directly.

Drop the USE_THE_REPOSITORY_VARIABLE macro and use `repo` throughout.

While at it, remove a stray double blank line between the #include
block and the usage string.

Signed-off-by: Sam Bostock <sam@sambostock.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: fix repo_config documentation reference
SoutrikDas [Fri, 6 Feb 2026 06:21:08 +0000 (11:51 +0530)] 
doc: fix repo_config documentation reference

In MyFirstContribution.adoc, the link to the repo_config()
documentation is invalid because the related documentation was moved
to a different file.

Replace the path for the repo_config() documentation from
'Documentation/technical/api-config.h' to 'config.h'.

Signed-off-by: SoutrikDas <valusoutrik@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: convert git-show to synopsis style
Jean-Noël Avila [Fri, 6 Feb 2026 04:12:26 +0000 (04:12 +0000)] 
doc: convert git-show to synopsis style

 * add synopsis block definition in asciidoc.conf.in
 * convert commands to synopsis style
 * use _<placeholder>_ for arguments
 * minor formatting fixes

Reviewed-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: fix some style issues in git-clone and for-each-ref-options
Jean-Noël Avila [Fri, 6 Feb 2026 04:12:25 +0000 (04:12 +0000)] 
doc: fix some style issues in git-clone and for-each-ref-options

 * spell out all forms of --[no-]reject-shallow in git-clone
 * use imperative mood for the first line of options
 * Use asciidoc NOTE macro
 * fix markups

Reviewed-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: finalize git-clone documentation conversion to synopsis style
Jean-Noël Avila [Fri, 6 Feb 2026 04:12:24 +0000 (04:12 +0000)] 
doc: finalize git-clone documentation conversion to synopsis style

Use backticks where appropriate for command-line options

Reviewed-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: convert git-submodule to synopsis style
Jean-Noël Avila [Fri, 6 Feb 2026 04:12:23 +0000 (04:12 +0000)] 
doc: convert git-submodule to synopsis style

 * convert commands to synopsis style
 * use _<placeholder>_ for arguments
 * convert inline lists into proper definition lists
 * minor formatting fixes

Reviewed-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agogpg-interface: remove an unnecessary NULL initialization
Collin Funk [Fri, 6 Feb 2026 01:46:10 +0000 (17:46 -0800)] 
gpg-interface: remove an unnecessary NULL initialization

We assign this variable unconditionally, so we do not need to
initialize it to NULL where it is defined.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoglobal: constify some pointers that are not written to
Collin Funk [Fri, 6 Feb 2026 01:46:09 +0000 (17:46 -0800)] 
global: constify some pointers that are not written to

The recent glibc 2.43 release had the following change listed in its
NEWS file:

    For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
    strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
    pointers into their input arrays now have definitions as macros that
    return a pointer to a const-qualified type when the input argument is
    a pointer to a const-qualified type.

When compiling with GCC 15, which defaults to -std=gnu23, this causes
many warnings like this:

    merge-ort.c: In function ‘apply_directory_rename_modifications’:
    merge-ort.c:2734:36: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
     2734 |                 char *last_slash = strrchr(cur_path, '/');
          |                                    ^~~~~~~

This patch fixes the more obvious ones by making them const when we do
not write to the returned pointer.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoStart 2.54 cycle
Junio C Hamano [Thu, 5 Feb 2026 23:07:22 +0000 (15:07 -0800)] 
Start 2.54 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'sp/t5500-cleanup'
Junio C Hamano [Thu, 5 Feb 2026 23:42:01 +0000 (15:42 -0800)] 
Merge branch 'sp/t5500-cleanup'

Test clean-up.

* sp/t5500-cleanup:
  t5500: simplify test implementation and fix git exit code suppression

2 months agoMerge branch 'tc/last-modified-options-cleanup'
Junio C Hamano [Thu, 5 Feb 2026 23:42:01 +0000 (15:42 -0800)] 
Merge branch 'tc/last-modified-options-cleanup'

The "-z" and "--max-depth" documentation (and implementation of
"-z") in the "git last-modified" command have been updated.

* tc/last-modified-options-cleanup:
  last-modified: change default max-depth to 0
  last-modified: document option '--max-depth'
  last-modified: document option '-z'
  last-modified: clarify in the docs the command takes a pathspec

2 months agoMerge branch 'lp/diff-stat-utf8-display-width-fix'
Junio C Hamano [Thu, 5 Feb 2026 23:42:01 +0000 (15:42 -0800)] 
Merge branch 'lp/diff-stat-utf8-display-width-fix'

The computation of column width made by "git diff --stat" was
confused when pathnames contain non-ASCII characters.

* lp/diff-stat-utf8-display-width-fix:
  t4073: add test for diffstat paths length when containing UTF-8 chars
  diff: improve scaling of filenames in diffstat to handle UTF-8 chars

2 months agoMerge branch 'ac/sparse-checkout-string-list-cleanup'
Junio C Hamano [Thu, 5 Feb 2026 23:42:00 +0000 (15:42 -0800)] 
Merge branch 'ac/sparse-checkout-string-list-cleanup'

Code clean-up.

* ac/sparse-checkout-string-list-cleanup:
  sparse-checkout: optimize string_list construction and add tests to verify deduplication.

2 months agoMerge branch 'sp/myfirstcontribution-include-update'
Junio C Hamano [Thu, 5 Feb 2026 23:42:00 +0000 (15:42 -0800)] 
Merge branch 'sp/myfirstcontribution-include-update'

Doc update.

* sp/myfirstcontribution-include-update:
  doc: MyFirstContribution: fix missing dependencies and clarify build steps

2 months agoMerge branch 'dd/t5403-modernise'
Junio C Hamano [Thu, 5 Feb 2026 23:42:00 +0000 (15:42 -0800)] 
Merge branch 'dd/t5403-modernise'

Test clean-up.

* dd/t5403-modernise:
  t5403: use test_cmp for post-checkout argument checks
  t5403: introduce check_post_checkout helper function

2 months agoMerge branch 'ap/http-probe-rpc-use-auth'
Junio C Hamano [Thu, 5 Feb 2026 23:41:58 +0000 (15:41 -0800)] 
Merge branch 'ap/http-probe-rpc-use-auth'

HTTP transport failed to authenticate in some code paths, which has
been corrected.

* ap/http-probe-rpc-use-auth:
  remote-curl: use auth for probe_rpc() requests too

2 months agoMerge branch 'ar/submodule-gitdir-tweak'
Junio C Hamano [Thu, 5 Feb 2026 23:41:58 +0000 (15:41 -0800)] 
Merge branch 'ar/submodule-gitdir-tweak'

Avoid local submodule repository directory paths overlapping with
each other by encoding submodule names before using them as path
components.

* ar/submodule-gitdir-tweak:
  submodule: detect conflicts with existing gitdir configs
  submodule: hash the submodule name for the gitdir path
  submodule: fix case-folding gitdir filesystem collisions
  submodule--helper: fix filesystem collisions by encoding gitdir paths
  builtin/credential-store: move is_rfc3986_unreserved to url.[ch]
  submodule--helper: add gitdir migration command
  submodule: allow runtime enabling extensions.submodulePathConfig
  submodule: introduce extensions.submodulePathConfig
  builtin/submodule--helper: add gitdir command
  submodule: always validate gitdirs inside submodule_name_to_gitdir
  submodule--helper: use submodule_name_to_gitdir in add_submodule

2 months agoMerge branch 'aa/add-p-previous-decisions'
Junio C Hamano [Thu, 5 Feb 2026 23:41:58 +0000 (15:41 -0800)] 
Merge branch 'aa/add-p-previous-decisions'

"git add -p" and friends note what the current status of the hunk
being shown is.

* aa/add-p-previous-decisions:
  add -p: show user's hunk decision when selecting hunks

2 months agoMerge branch 'jk/remote-tracking-ref-leakfix'
Junio C Hamano [Thu, 5 Feb 2026 23:41:57 +0000 (15:41 -0800)] 
Merge branch 'jk/remote-tracking-ref-leakfix'

Leakfix.

* jk/remote-tracking-ref-leakfix:
  remote: always allocate branch.push_tracking_ref
  remote: fix leak in branch_get_push_1() with invalid "simple" config
  remote: drop const return of tracking_for_push_dest()
  remote: return non-const pointer from error_buf()

2 months agodoc: send-email: correct --no-signed-off-by-cc misspelling
Matěj Cepl [Thu, 5 Feb 2026 16:24:01 +0000 (17:24 +0100)] 
doc: send-email: correct --no-signed-off-by-cc misspelling

There is no option --signed-off-cc (without -by) for git send-email.

Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
[kh: rebased and changed subject to house style]
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
[jc: minor copyedit in the commit message]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agotest: optionally test contrib in CI
Junio C Hamano [Mon, 2 Feb 2026 21:07:58 +0000 (13:07 -0800)] 
test: optionally test contrib in CI

Recently it was reported that a topic merged to 'next' broke build
and test for contrib/subtree part of the system.

Instead of having those who run 'next' or 'master' to hit the build
and test breakage and report to us, make sure we notice breakages in
contrib/ area before they hit my tree at all, during their own
presubmit testing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'pks-meson-fix-missing-msgfmt' of https://github.com/pks-gitlab/gitk
Johannes Sixt [Thu, 5 Feb 2026 12:45:51 +0000 (13:45 +0100)] 
Merge branch 'pks-meson-fix-missing-msgfmt' of https://github.com/pks-gitlab/gitk

* 'pks-meson-fix-missing-msgfmt' of https://github.com/pks-gitlab/gitk:
  gitk: fix msgfmt being required

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 months agogitk: fix msgfmt being required
Patrick Steinhardt [Thu, 5 Feb 2026 11:50:13 +0000 (12:50 +0100)] 
gitk: fix msgfmt being required

While the Meson build instructions already handle the case where msgfmt
wasn't found, we forgot to mark the dependency itself as optional. This
causes an error in case the executable could not be found:

  Project name: gitk
  Project version: undefined
  Program sh found: YES (C:\Program Files\Git\bin\sh.EXE)
  Program wish found: YES (C:\Program Files\Git\mingw64\bin\wish.EXE)
  Program chmod found: YES (C:\Program Files\Git\usr\bin\chmod.EXE)
  Program mv found: YES (C:\Program Files\Git\usr\bin\mv.EXE)
  Program sed found: YES (C:\Program Files\Git\usr\bin\sed.EXE)
  Program msgfmt found: NO

  subprojects\gitk\meson.build:28:3: ERROR: Program 'msgfmt' not found or not executable

Fix the issue by adding the `required: false` parameter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2 months agocontrib/subtree: fix tests with reftable backend
Colin Stagner [Wed, 4 Feb 2026 04:38:11 +0000 (22:38 -0600)] 
contrib/subtree: fix tests with reftable backend

One git-subtree test-case relies on git internals to infer the
default branch name. This test fails with the new reftable
backend.

    GIT_TEST_DEFAULT_REF_FORMAT=reftable \
      meson test t7900-subtree

This test script already sets

    GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main

which eliminates the need to infer a branch name at runtime.
Hardcode the branch name.

Signed-off-by: Colin Stagner <ask+git@howdoi.land>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodiff-highlight: allow testing with Git 3.0 breaking changes
Junio C Hamano [Tue, 3 Feb 2026 21:26:00 +0000 (13:26 -0800)] 
diff-highlight: allow testing with Git 3.0 breaking changes

The diff-highlight (in contrib/) comes with its own test script,
which relies on the initial branch name being 'master'.  This is not
just encoded in the test logic, but in the illustration in the file
that shows the topology of the history.

Force the initial branch name to 'master' to allow it pass.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months ago.mailmap: fix email for Phil Hord
Phil Hord [Tue, 3 Feb 2026 18:12:13 +0000 (10:12 -0800)] 
.mailmap: fix email for Phil Hord

My canonical and old emails were reversed, somehow. Also add
an entry for a new email that may sneak in.

Signed-off-by: Phil Hord <phil.hord@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agococci: extend MEMZERO_ARRAY() rules
Toon Claes [Tue, 3 Feb 2026 10:29:03 +0000 (11:29 +0100)] 
cocci: extend MEMZERO_ARRAY() rules

Recently the MEMZERO_ARRAY() macro was introduced. In that commit also
coccinelle rules were added to capture cases that can be converted to
use that macro.

Later a few more cases were manually converted to use the macro, but
coccinelle didn't capture those. Extend the rules to capture those as
well.

In various cases the code could be further beautified by removing
parentheses which are no longer needed. Modify the coccinelle rules to
optimize those as well and fix them.

During conversion indentation also used spaces where tabs should be
used, fix that in one go.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: shortlog: put back trailer paragraphs
Kristoffer Haugsbakk [Tue, 3 Feb 2026 09:48:52 +0000 (10:48 +0100)] 
doc: shortlog: put back trailer paragraphs

47beb37b (shortlog: match commit trailers with --group, 2020-09-27)
added the `trailer` bullet point with three paragraphs.[1] Later,
3dc95e09 (shortlog: support arbitrary commit format `--group`s,
2022-10-24) put the single-paragraph bullet point about `format` right
after the first paragraph about `trailer`. That meant that the second
and third paragraphs for `trailer` got moved to `format`.

Move the two paragraphs back to `trailer`. We now also need one blank
line before the final bullet point so that it does not get joined with
the second bullet point.

† 1: Technically the bullet list formatting was immediately fixed to
     include all three paragraphs in 63d24fa0 (shortlog: allow multiple
     groups to be specified, 2020-09-27)

Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoodb: transparently handle common transaction behavior
Justin Tobler [Tue, 3 Feb 2026 00:10:02 +0000 (18:10 -0600)] 
odb: transparently handle common transaction behavior

A new ODB transaction is created and returned via
`odb_transaction_begin()` and stored in the ODB. Only a single
transaction may be pending at a time. If the ODB already has a
transaction, the function is expected to return NULL. Similarly, when
committing a transaction via `odb_transaction_commit()` the transaction
being committed must match the pending transaction and upon commit reset
the ODB transaction to NULL.

These behaviors apply regardless of the ODB transaction implementation.
Move the corresponding logic into `odb_transaction_{begin,commit}()`
accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoodb: prepare `struct odb_transaction` to become generic
Justin Tobler [Tue, 3 Feb 2026 00:10:01 +0000 (18:10 -0600)] 
odb: prepare `struct odb_transaction` to become generic

An ODB transaction handles how objects are stored temporarily and
eventually committed. Due to object storage being implemented
differently for a given ODB source, the ODB transactions must be
implemented in a manner specific to the source the objects are being
written to. To provide generic transactions, `struct odb_transaction` is
updated to store a commit callback that can be configured to support a
specific ODB source. For now `struct odb_transaction_files` is the
only transaction type and what is always returned when starting a
transaction.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoobject-file: rename transaction functions
Justin Tobler [Tue, 3 Feb 2026 00:10:00 +0000 (18:10 -0600)] 
object-file: rename transaction functions

In a subsequent commit, ODB transactions are made more generic to
facilitate each ODB source providing its own transaction handling.
Rename `object_file_transaction_{begin,commit}()` to
`odb_transaction_files_{begin,commit}()` to better match the future
source specific transaction implementation.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoodb: store ODB source in `struct odb_transaction`
Justin Tobler [Tue, 3 Feb 2026 00:09:59 +0000 (18:09 -0600)] 
odb: store ODB source in `struct odb_transaction`

Each `struct odb_transaction` currently stores a reference to the
`struct object_database`. Since transactions are handled per object
source, instead store a reference to the source.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoblame: fix coloring for repeated suspects
René Scharfe [Sun, 1 Feb 2026 11:47:53 +0000 (12:47 +0100)] 
blame: fix coloring for repeated suspects

The option --ignore-rev passes the blame to an older commit.  This can
cause adjacent scoreboard entries to blame the same commit.  Currently
we only look at the present entry when determining whether a line needs
to be colored for --color-lines.  Check the previous entry as well.

Reported-by: Seth McDonald <sethmcmail@pm.me>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>