]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
8 days agoodb/source-loose: stub out remaining callbacks
Patrick Steinhardt [Thu, 21 May 2026 08:22:37 +0000 (10:22 +0200)] 
odb/source-loose: stub out remaining callbacks

Stub out remaining callback functions for the "loose" backend.

Note that we also stub out transactions for loose objects. In fact, we
already have the infrastructure in place for those, and we could in
theory implement those, as well. But there are separate efforts ongoing
to polish up transactional interfaces, and doing so now would likely
result in some messiness. This omission will thus be worked on in a
subsequent patch series, once the dust has settled.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `write_object_stream()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:36 +0000 (10:22 +0200)] 
odb/source-loose: wire up `write_object_stream()` callback

Wire up the `write_object_stream()` callback.

Note that we don't move the implementation into "odb/source-loose.c".
This is because most of the logic to write loose objects is still
contained in "object-file.c", and detangling that requires us to do some
refactorings as explained in the preceding commit. So for now, the
implementation of writing an object stream is still located in
"object-file.c".

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoobject-file: refactor writing objects to use loose source
Patrick Steinhardt [Thu, 21 May 2026 08:22:35 +0000 (10:22 +0200)] 
object-file: refactor writing objects to use loose source

The "object-file" subsystem still hosts the majority of logic used to
write loose objects. Eventually, we'll want to move this logic into
"odb/source-loose.c", but this isn't yet easily possible because a lot
of the writing logic is still being shared with `force_object_loose()`.

We will eventually detangle this logic so that we can indeed move all of
it into the "loose" source. Meanwhile though, refactor the code so that
it operates on a `struct odb_source_loose` directly to already make the
dependency explicit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `write_object()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:34 +0000 (10:22 +0200)] 
odb/source-loose: wire up `write_object()` callback

Move `odb_source_loose_write_object()` from "object-file.c" into
"odb/source-loose.c" and wire it up as the `write_object()` callback of
the loose source.

As in preceding commits, this requires us to expose a couple of generic
functions from "object-file.c" as they are used in both subsystems now.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoloose: refactor object map to operate on `struct odb_source_loose`
Patrick Steinhardt [Thu, 21 May 2026 08:22:33 +0000 (10:22 +0200)] 
loose: refactor object map to operate on `struct odb_source_loose`

While the loose object map functions in "loose.c" accept a generic
`struct odb_source *`, they always expect this to be the "files"
backend. Furthermore, the subsystem doesn't even care about the "files"
backend, but only uses it as a stepping stone to get to the "loose"
backend.

This assumption is implicit and thus not immediately obvious. Refactor
the interfaces to instead operate on a `struct odb_source_loose`
instead, which eliminates the implicit dependency and unnecessary detour
via the "files" source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `freshen_object()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:32 +0000 (10:22 +0200)] 
odb/source-loose: wire up `freshen_object()` callback

Move `odb_source_loose_freshen_object()` from "object-file.c" into
"odb/source-loose.c" and wire it up as the `freshen_object()` callback
of the loose source.

As part of the move, `check_and_freshen_source()` is inlined into the
callback function, as it has no other callers anymore.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: drop `odb_source_loose_has_object()`
Patrick Steinhardt [Thu, 21 May 2026 08:22:31 +0000 (10:22 +0200)] 
odb/source-loose: drop `odb_source_loose_has_object()`

The function `odb_source_loose_has_object()` checks whether a specific
object exists as a loose object on disk by using lstat(3p). This
interface is somewhat redundant, as we typically check for object
existence in a generic way via `odb_source_read_object_info()`.

In fact, these two calls are redundant in case the latter is called in a
specific way: when called without an object info request and without the
`OBJECT_INFO_QUICK` flag, then we will end up doing the same call to
lstat(3p) in `read_object_info_from_path()`.

Drop the function and adapt callers to instead use the generic
interface so that its calling conventions align with that of other
sources.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `count_objects()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:30 +0000 (10:22 +0200)] 
odb/source-loose: wire up `count_objects()` callback

Move `odb_source_loose_count_objects()` and its associated helpers from
"object-file.c" into "odb/source-loose.c" and wire it up as the
`count_objects()` callback of the loose source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `find_abbrev_len()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:29 +0000 (10:22 +0200)] 
odb/source-loose: wire up `find_abbrev_len()` callback

Move `odb_source_loose_find_abbrev_len()` and its associated helpers
from "object-file.c" into "odb/source-loose.c" and wire it up as the
`find_abbrev_len` callback of the loose source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `for_each_object()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:28 +0000 (10:22 +0200)] 
odb/source-loose: wire up `for_each_object()` callback

Move `odb_source_loose_for_each_object()` and its associated helpers
from "object-file.c" into "odb/source-loose.c" and wire it up as the
`for_each_object()` callback of the loose source.

Again, as in the preceding commit, we are forced to expose a couple of
functions from "object-file.c" that are now used by both subsystems.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `read_object_stream()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:27 +0000 (10:22 +0200)] 
odb/source-loose: wire up `read_object_stream()` callback

Move `odb_source_loose_read_object_stream()` and its associated helpers
from "object-file.c" into "odb/source-loose.c" and wire it up as the
`read_object_stream()` callback of the loose source.

As part of the move we are also forced to expose a couple of functions
from "object-file.h" that parse object headers in a somewhat-generic
way, as those functions are now used by both subsystems.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `read_object_info()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:26 +0000 (10:22 +0200)] 
odb/source-loose: wire up `read_object_info()` callback

Move `odb_source_loose_read_object_info()` from "object-file.c" into
"odb/source-loose.c" and wire it up as the `read_object_info()` callback
of the loose source. Callers that previously invoked it directly now go
through the generic `odb_source_read_object_info()` interface instead.

The function `read_object_info_from_path()` cannot be moved along with
it because it is still called by `for_each_object_wrapper_cb()`. It is
therefore kept in place, but adjusted to take a loose source to clarify
that it's always operating on this structure.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `close()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:25 +0000 (10:22 +0200)] 
odb/source-loose: wire up `close()` callback

Wire up a new `close()` callback for the loose source and call it from
the "files" source via the generic `odb_source_close()` interface. The
callback itself is a no-op as the loose source has no resources that
need to be released on close.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: wire up `reprepare()` callback
Patrick Steinhardt [Thu, 21 May 2026 08:22:24 +0000 (10:22 +0200)] 
odb/source-loose: wire up `reprepare()` callback

Move `odb_source_loose_reprepare()` from "object-file.c" into
"odb/source-loose.c" and wire it up as the `reprepare()` callback of the
loose source.

While at it, make `odb_source_loose_clear_cache()` static, as it is no
longer needed outside of its file.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: start converting to a proper `struct odb_source`
Patrick Steinhardt [Thu, 21 May 2026 08:22:23 +0000 (10:22 +0200)] 
odb/source-loose: start converting to a proper `struct odb_source`

Start converting `struct odb_source_loose` into a proper pluggable
`struct odb_source` by embedding the base struct and assigning it the
new `ODB_SOURCE_LOOSE` type. Furthermore, wire up lifecycle management
of this source by implementing the `free` callback and taking ownership
of the chdir notifications.

Note that the loose source is not yet functional as a standalone `struct
odb_source`, as it's missing all of the callback implementations. These
will be wired up in subsequent commits.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: store pointer to "files" instead of generic source
Patrick Steinhardt [Thu, 21 May 2026 08:22:22 +0000 (10:22 +0200)] 
odb/source-loose: store pointer to "files" instead of generic source

The `struct odb_source_loose` holds a pointer to its owning parent
source. The way that Git is currently structured, this parent is always
the "files" source. In subsequent commits we're going to detangle that
so that the "loose" source doesn't have any owning parent source at all
so that it can be used as a completely standalone source.

Detangling this mess is somewhat intricate though, and is made even more
intricate because it's not always clear which kind of source one is
holding at a specific point in time -- either the parent "files" source,
or the child "loose" source.

Make this relationship more explicit by storing a pointer to the "files"
source instead of storing a pointer to a generic `struct odb_source`.
This will help make subsequent steps a bit clearer.

Note that this is a temporary step, only. At the end of this series
we will have dropped the parent pointer completely.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoodb/source-loose: move loose source into "odb/" subsystem
Patrick Steinhardt [Thu, 21 May 2026 08:22:21 +0000 (10:22 +0200)] 
odb/source-loose: move loose source into "odb/" subsystem

In subsequent patches we'll be turning `struct odb_source_loose` into a
proper `struct odb_source`. As a first step towards this goal, move its
struct out of "object-file.c" and into "odb/source-loose.c".

This detaches the implementation of the loose object source from the
generic object file code, following the same convention already used by
the "files" and "in-memory" sources.

No functional changes are intended.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge branch 'ps/odb-in-memory' into ps/odb-source-loose
Junio C Hamano [Thu, 21 May 2026 13:34:55 +0000 (22:34 +0900)] 
Merge branch 'ps/odb-in-memory' into ps/odb-source-loose

* ps/odb-in-memory: (24 commits)
  t/unit-tests: add tests for the in-memory object source
  odb: generic in-memory source
  odb/source-inmemory: stub out remaining functions
  odb/source-inmemory: implement `freshen_object()` callback
  odb/source-inmemory: implement `count_objects()` callback
  odb/source-inmemory: implement `find_abbrev_len()` callback
  odb/source-inmemory: implement `for_each_object()` callback
  odb/source-inmemory: convert to use oidtree
  oidtree: add ability to store data
  cbtree: allow using arbitrary wrapper structures for nodes
  odb/source-inmemory: implement `write_object_stream()` callback
  odb/source-inmemory: implement `write_object()` callback
  odb/source-inmemory: implement `read_object_stream()` callback
  odb/source-inmemory: implement `read_object_info()` callback
  odb: fix unnecessary call to `find_cached_object()`
  odb/source-inmemory: implement `free()` callback
  odb: introduce "in-memory" source
  odb/transaction: make `write_object_stream()` pluggable
  object-file: generalize packfile writes to use odb_write_stream
  object-file: avoid fd seekback by checking object size upfront
  ...

9 days agoSync with 'maint'
Junio C Hamano [Thu, 21 May 2026 03:45:24 +0000 (12:45 +0900)] 
Sync with 'maint'

9 days agoStart preparing for 2.54.1 maint
Junio C Hamano [Thu, 21 May 2026 03:40:38 +0000 (12:40 +0900)] 
Start preparing for 2.54.1

Mostly build and CI related updates taken from the 'master' front
are included in here.

We still need to grab a couple more topics once they graduate to
'master', namely

    jk/apply-leakfix
    jk/commit-sign-overflow-fix

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agoMerge branch 'jc/t5551-fix-expensive' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:30:40 +0000 (12:30 +0900)] 
Merge branch 'jc/t5551-fix-expensive' into maint-2.54

Test fix.

* jc/t5551-fix-expensive:
  t5551: "GIT_TEST_LONG=Yes make test" is broken

9 days agoMerge branch 'jh/alias-i18n-fixes' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:30:11 +0000 (12:30 +0900)] 
Merge branch 'jh/alias-i18n-fixes' into maint-2.54

Further update to the i18n alias support to avoid regressions.

* jh/alias-i18n-fixes:
  alias: restore support for simple dotted aliases

9 days agoMerge branch 'js/mingw-no-nedmalloc' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:28:55 +0000 (12:28 +0900)] 
Merge branch 'js/mingw-no-nedmalloc' into maint-2.54

Stop using unmaintained custom allocator in Windows build which was
the last user of the code.

* js/mingw-no-nedmalloc:
  mingw: remove the vendored compat/nedmalloc/ subtree
  mingw: drop the build-system plumbing for nedmalloc
  mingw: stop using nedmalloc

9 days agoMerge branch 'js/maintenance-fix-deadlock-on-win10' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:27:47 +0000 (12:27 +0900)] 
Merge branch 'js/maintenance-fix-deadlock-on-win10' into maint-2.54

To help Windows 10 installations, avoid removing files whose
contents are still mmap()'ed.

* js/maintenance-fix-deadlock-on-win10:
  maintenance(geometric): do release the `.idx` files before repacking
  mingw: optionally use legacy (non-POSIX) delete semantics

9 days agoMerge branch 'js/t5564-socks-use-short-path' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:27:19 +0000 (12:27 +0900)] 
Merge branch 'js/t5564-socks-use-short-path' into maint-2.54

Avoid hitting the pathname limit for socks proxy socket during the
test.

* js/t5564-socks-use-short-path:
  t5564: use a short path for the SOCKS proxy socket

9 days agoMerge branch 'js/ci-github-actions-update' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:26:28 +0000 (12:26 +0900)] 
Merge branch 'js/ci-github-actions-update' into maint-2.54

Update various GitHub Actions versions.

* js/ci-github-actions-update:
  l10n: bump mshick/add-pr-comment from v2 to v3
  ci: bump git-for-windows/setup-git-for-windows-sdk from v1 to v2
  ci: bump actions/checkout from v5 to v6
  ci: bump actions/github-script from v8 to v9
  ci: bump actions/{upload,download}-artifact to v7 and v8
  ci: bump microsoft/setup-msbuild from v2 to v3

9 days agoMerge branch 'jk/revert-aa-reap-transport-child-processes' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:25:55 +0000 (12:25 +0900)] 
Merge branch 'jk/revert-aa-reap-transport-child-processes' into maint-2.54

Revert a recent change that introduced a regression to help mksh users.

* jk/revert-aa-reap-transport-child-processes:
  Revert "transport-helper, connect: use clean_on_exit to reap children on abnormal exit"

9 days agoMerge branch 'ps/clang-w-glibc-2.43-and-_Generic' into maint-2.54
Junio C Hamano [Thu, 21 May 2026 03:23:50 +0000 (12:23 +0900)] 
Merge branch 'ps/clang-w-glibc-2.43-and-_Generic' into maint-2.54

Headers from glibc 2.43 when used with clang does not allow
disabling C11 language features, causing build failures..

* ps/clang-w-glibc-2.43-and-_Generic:
  build: tolerate use of _Generic from glibc 2.43 with Clang

9 days agoThe 6th batch
Junio C Hamano [Thu, 21 May 2026 03:05:44 +0000 (12:05 +0900)] 
The 6th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agoMerge branch 'sp/shallow-deepen-on-non-shallow-repo-fix'
Junio C Hamano [Thu, 21 May 2026 03:06:49 +0000 (12:06 +0900)] 
Merge branch 'sp/shallow-deepen-on-non-shallow-repo-fix'

"git fetch --deepen=<n>" in a full clone truncated the history to <n>
commits deep, which has been corrected to be a no-op instead.

* sp/shallow-deepen-on-non-shallow-repo-fix:
  shallow: fix relative deepen on non-shallow repositories

9 days agoMerge branch 'jc/ci-enable-expensive'
Junio C Hamano [Thu, 21 May 2026 03:06:48 +0000 (12:06 +0900)] 
Merge branch 'jc/ci-enable-expensive'

Enable expensive tests to catch topics that may cause breakages on
integration branches closer to their origin in the contributor PR
builds.

* jc/ci-enable-expensive:
  ci: enable EXPENSIVE for contributor builds

9 days agoMerge branch 'aw/validate-proxy-url-scheme'
Junio C Hamano [Thu, 21 May 2026 03:06:48 +0000 (12:06 +0900)] 
Merge branch 'aw/validate-proxy-url-scheme'

Misspelt proxy URL (e.g., httt://...) did not trigger any warning
or failure, which has been corrected.

* aw/validate-proxy-url-scheme:
  http: reject unsupported proxy URL schemes

9 days agoMerge branch 'mm/git-url-parse'
Junio C Hamano [Thu, 21 May 2026 03:06:48 +0000 (12:06 +0900)] 
Merge branch 'mm/git-url-parse'

The internal URL parsing logic has been made accessible via a new
subcommand "git url-parse".

* mm/git-url-parse:
  t9904: add tests for the new url-parse builtin
  doc: describe the url-parse builtin
  builtin: create url-parse command
  urlmatch: define url_parse function
  url: return URL_SCHEME_UNKNOWN instead of dying
  url: move scheme detection to URL header/source
  url: move url_is_local_not_ssh to url.h
  connect: rename enum protocol to url_scheme

9 days agoMerge branch 'pw/xdiff-shrink-memory-consumption'
Junio C Hamano [Thu, 21 May 2026 03:06:48 +0000 (12:06 +0900)] 
Merge branch 'pw/xdiff-shrink-memory-consumption'

Shrink wasted memory in Myers diff that does not account for common
prefix and suffix removal.

* pw/xdiff-shrink-memory-consumption:
  xdiff: reduce the size of array
  xprepare: simplify error handling
  xdiff: cleanup xdl_clean_mmatch()
  xdiff: reduce size of action arrays

9 days agoMerge branch 'kh/doc-log-decorate-list'
Junio C Hamano [Thu, 21 May 2026 03:06:47 +0000 (12:06 +0900)] 
Merge branch 'kh/doc-log-decorate-list'

Doc update.

* kh/doc-log-decorate-list:
  doc: log: use the same delimiter in description list
  doc: log: fix --decorate description list

9 days agoMerge branch 'kn/refs-generic-helpers'
Junio C Hamano [Thu, 21 May 2026 03:06:47 +0000 (12:06 +0900)] 
Merge branch 'kn/refs-generic-helpers'

Refactor service routines in the ref subsystem backends.

* kn/refs-generic-helpers:
  refs: use peeled tag values in reference backends
  refs: add peeled object ID to the `ref_update` struct
  refs: move object parsing to the generic layer
  update-ref: handle rejections while adding updates
  update-ref: move `print_rejected_refs()` up
  refs: return `ref_transaction_error` from `ref_transaction_update()`
  refs: extract out reflog config to generic layer
  refs: introduce `ref_store_init_options`
  refs: remove unused typedef 'ref_transaction_commit_fn'

9 days agoMerge branch 'za/t2000-modernise-more'
Junio C Hamano [Thu, 21 May 2026 03:06:47 +0000 (12:06 +0900)] 
Merge branch 'za/t2000-modernise-more'

Test update.

* za/t2000-modernise-more:
  t2000: consolidate second scenario into a single test block

10 days agoThe 5th batch
Junio C Hamano [Wed, 20 May 2026 01:30:45 +0000 (10:30 +0900)] 
The 5th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agoMerge branch 'sb/unpack-index-pack-buffer-resize'
Junio C Hamano [Wed, 20 May 2026 01:30:58 +0000 (10:30 +0900)] 
Merge branch 'sb/unpack-index-pack-buffer-resize'

Use a larger buffer size in the code paths to ingest pack stream.

* sb/unpack-index-pack-buffer-resize:
  index-pack, unpack-objects: increase input buffer from 4 KiB to 128 KiB

10 days agoMerge branch 'ps/history-fixup'
Junio C Hamano [Wed, 20 May 2026 01:30:57 +0000 (10:30 +0900)] 
Merge branch 'ps/history-fixup'

"git history" learned "fixup" command.

* ps/history-fixup:
  builtin/history: introduce "fixup" subcommand
  builtin/history: generalize function to commit trees
  replay: allow callers to control what happens with empty commits

10 days agoMerge branch 'jh/alias-i18n-fixes'
Junio C Hamano [Wed, 20 May 2026 01:30:57 +0000 (10:30 +0900)] 
Merge branch 'jh/alias-i18n-fixes'

Further update to the i18n alias support to avoid regressions.

* jh/alias-i18n-fixes:
  alias: restore support for simple dotted aliases

10 days agoMerge branch 'bc/sign-commit-with-custom-encoding'
Junio C Hamano [Wed, 20 May 2026 01:30:57 +0000 (10:30 +0900)] 
Merge branch 'bc/sign-commit-with-custom-encoding'

Signing commit with custom encoding was passing the data to be
signed at a wrong stage in the pipeline, which has been corrected.

* bc/sign-commit-with-custom-encoding:
  commit: sign commit after mutating buffer
  commit: name UTF-8 function appropriately

10 days agoMerge branch 'js/adjust-tests-to-explicitly-access-bare-repo'
Junio C Hamano [Wed, 20 May 2026 01:30:56 +0000 (10:30 +0900)] 
Merge branch 'js/adjust-tests-to-explicitly-access-bare-repo'

Some tests assume that bare repository accesses are by default
allowed; rewrite some of them to avoid the assumption, rewrite
others to explicitly set safe.bareRepository to allow them.

* js/adjust-tests-to-explicitly-access-bare-repo:
  safe.bareRepository: default to "explicit" with WITH_BREAKING_CHANGES
  status tests: filter `.gitconfig` from status output
  ls-files tests: filter `.gitconfig` from `--others` output
  t5601: restore `.gitconfig` after includeIf test
  t1305: use `--git-dir=.` for bare repo in include cycle test
  t1300: remove global config settings injected by test-lib.sh
  t7900: do not let `$HOME/.gitconfig` interfere with XDG tests
  test-lib: allow bare repository access when breaking changes are enabled

10 days agoMerge branch 'en/diffstat-utf8-truncation-fix'
Junio C Hamano [Wed, 20 May 2026 01:30:56 +0000 (10:30 +0900)] 
Merge branch 'en/diffstat-utf8-truncation-fix'

The computation to shorten the filenames shown in diffstat measured
width of individual UTF-8 characters to add up, but forgot to take
into account error cases (e.g., an invalid UTF-8 sequence, or a
control character).

* en/diffstat-utf8-truncation-fix:
  diff: fix out-of-bounds reads and NULL deref in diffstat UTF-8 truncation

10 days agoMerge branch 'js/mingw-no-nedmalloc'
Junio C Hamano [Wed, 20 May 2026 01:30:56 +0000 (10:30 +0900)] 
Merge branch 'js/mingw-no-nedmalloc'

Stop using unmaintained custom allocator in Windows build which was
the last user of the code.

* js/mingw-no-nedmalloc:
  mingw: remove the vendored compat/nedmalloc/ subtree
  mingw: drop the build-system plumbing for nedmalloc
  mingw: stop using nedmalloc

10 days agoMerge branch 'js/objects-larger-than-4gb-on-windows'
Junio C Hamano [Wed, 20 May 2026 01:30:56 +0000 (10:30 +0900)] 
Merge branch 'js/objects-larger-than-4gb-on-windows'

Update code paths that assumed "unsigned long" was long enough for
"size_t".

* js/objects-larger-than-4gb-on-windows:
  ci: run expensive tests on push builds to integration branches
  t5608: mark >4GB tests as EXPENSIVE
  test-tool synthesize: add precomputed SHA-256 pack for 4 GiB + 1
  test-tool synthesize: precompute pack for 4 GiB + 1
  test-tool synthesize: use the unsafe hash for speed
  t5608: add regression test for >4GB object clone
  test-tool: add a helper to synthesize large packfiles
  delta, packfile: use size_t for delta header sizes
  odb, packfile: use size_t for streaming object sizes
  git-zlib: handle data streams larger than 4GB
  index-pack, unpack-objects: use size_t for object size

11 days agoThe 4th batch
Junio C Hamano [Mon, 18 May 2026 12:57:40 +0000 (21:57 +0900)] 
The 4th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoMerge branch 'sj/submodule-update-clone-config-fix'
Junio C Hamano [Tue, 19 May 2026 00:57:46 +0000 (09:57 +0900)] 
Merge branch 'sj/submodule-update-clone-config-fix'

The configuration variable submodule.fetchJobs was not read correctly,
which has been corrected.

* sj/submodule-update-clone-config-fix:
  submodule-config: fix reading submodule.fetchJobs

11 days agoMerge branch 'rs/sideband-clear-line-before-print'
Junio C Hamano [Tue, 19 May 2026 00:57:46 +0000 (09:57 +0900)] 
Merge branch 'rs/sideband-clear-line-before-print'

Tweak the way how sideband messages from remote are printed while
we talk with a remote repository to avoid tickling terminal
emulator glitches.

* rs/sideband-clear-line-before-print:
  sideband: clear full line when printing remote messages

11 days agoMerge branch 'ag/rebase-update-refs-limit-to-branches'
Junio C Hamano [Tue, 19 May 2026 00:57:46 +0000 (09:57 +0900)] 
Merge branch 'ag/rebase-update-refs-limit-to-branches'

"git rebase --update-refs", when used with an rebase.instructionFormat
with "%d" (describe) in it, tried to update local branch HEAD by
mistake, which has been corrected.

* ag/rebase-update-refs-limit-to-branches:
  rebase: ignore non-branch update-refs

11 days agoMerge branch 'kh/doc-restore-double-underscores-fix'
Junio C Hamano [Tue, 19 May 2026 00:57:45 +0000 (09:57 +0900)] 
Merge branch 'kh/doc-restore-double-underscores-fix'

Doc update.

* kh/doc-restore-double-underscores-fix:
  doc: restore: remove double underscore

11 days agoMerge branch 'kh/doc-commit-graph'
Junio C Hamano [Tue, 19 May 2026 00:57:44 +0000 (09:57 +0900)] 
Merge branch 'kh/doc-commit-graph'

Ramifications of turning off commit-graph has been documented a bit
more clearly.

* kh/doc-commit-graph:
  doc: add caveat about turning off commit-graph

11 days agoMerge branch 'kh/name-rev-custom-format'
Junio C Hamano [Tue, 19 May 2026 00:57:44 +0000 (09:57 +0900)] 
Merge branch 'kh/name-rev-custom-format'

A new builtin "git format-rev" is introduced for pretty formatting
one revision expression per line or commit object names found in
running text.

* kh/name-rev-custom-format:
  format-rev: introduce builtin for on-demand pretty formatting
  name-rev: make dedicated --annotate-stdin --name-only test
  name-rev: factor code for sharing with a new command
  name-rev: run clang-format before factoring code
  name-rev: wrap both blocks in braces

11 days agoMerge branch 'sg/t6112-unwanted-tilde-expansion-fix'
Junio C Hamano [Tue, 19 May 2026 00:57:44 +0000 (09:57 +0900)] 
Merge branch 'sg/t6112-unwanted-tilde-expansion-fix'

Test fix.

* sg/t6112-unwanted-tilde-expansion-fix:
  t6112: avoid tilde expansion

11 days agoMerge branch 'en/xdiff-cleanup-3'
Junio C Hamano [Tue, 19 May 2026 00:57:43 +0000 (09:57 +0900)] 
Merge branch 'en/xdiff-cleanup-3'

Preparation of the xdiff/ codebase to work with Rust.

* en/xdiff-cleanup-3:
  xdiff/xdl_cleanup_records: make execution of action easier to follow
  xdiff/xdl_cleanup_records: make setting action easier to follow
  xdiff/xdl_cleanup_records: make limits more clear
  xdiff/xdl_cleanup_records: use unambiguous types
  xdiff: use unambiguous types in xdl_bogo_sqrt()
  xdiff/xdl_cleanup_records: delete local recs pointer

11 days agoMerge branch 'mc/http-emptyauth-negotiate-fix'
Junio C Hamano [Tue, 19 May 2026 00:57:43 +0000 (09:57 +0900)] 
Merge branch 'mc/http-emptyauth-negotiate-fix'

The 'http.emptyAuth=auto' configuration now correctly attempts
Negotiate authentication before falling back to manual credentials.
This allows seamless Kerberos ticket-based authentication without
requiring users to explicitly set 'http.emptyAuth=true'.

* mc/http-emptyauth-negotiate-fix:
  doc: clarify http.emptyAuth values
  t5563: add tests for http.emptyAuth with Negotiate
  http: attempt Negotiate auth in http.emptyAuth=auto mode
  http: extract http_reauth_prepare() from retry paths

12 days agoThe 3rd batch
Junio C Hamano [Sun, 17 May 2026 13:57:55 +0000 (22:57 +0900)] 
The 3rd batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoMerge branch 'rs/grep-column-only-match-fix'
Junio C Hamano [Sun, 17 May 2026 13:58:31 +0000 (22:58 +0900)] 
Merge branch 'rs/grep-column-only-match-fix'

"git grep" update.

* rs/grep-column-only-match-fix:
  grep: fix --column --only-match for 2nd and later matches

12 days agoMerge branch 'hn/git-checkout-m-with-stash'
Junio C Hamano [Sun, 17 May 2026 13:58:30 +0000 (22:58 +0900)] 
Merge branch 'hn/git-checkout-m-with-stash'

"git checkout -m another-branch" was invented to deal with local
changes to paths that are different between the current and the new
branch, but it gave only one chance to resolve conflicts.  The command
was taught to create a stash to save the local changes.

* hn/git-checkout-m-with-stash:
  checkout -m: autostash when switching branches
  checkout: rollback lock on early returns in merge_working_tree
  sequencer: teach autostash apply to take optional conflict marker labels
  sequencer: allow create_autostash to run silently
  stash: add --label-ours, --label-theirs, --label-base for apply

12 days agoMerge branch 'pw/rename-to-get-current-worktree'
Junio C Hamano [Sun, 17 May 2026 13:58:30 +0000 (22:58 +0900)] 
Merge branch 'pw/rename-to-get-current-worktree'

Code clean-up.

* pw/rename-to-get-current-worktree:
  worktree: rename get_worktree_from_repository()

12 days agoMerge branch 'mf/format-patch-cover-letter-format-docfix'
Junio C Hamano [Sun, 17 May 2026 13:58:30 +0000 (22:58 +0900)] 
Merge branch 'mf/format-patch-cover-letter-format-docfix'

Docfix.

* mf/format-patch-cover-letter-format-docfix:
  Fix docs for format.commitListFormat

12 days agoMerge branch 'en/ort-cached-rename-with-trivial-resolution'
Junio C Hamano [Sun, 17 May 2026 13:58:30 +0000 (22:58 +0900)] 
Merge branch 'en/ort-cached-rename-with-trivial-resolution'

"ort" merge backend improvements.

* en/ort-cached-rename-with-trivial-resolution:
  merge-ort: handle cached rename & trivial resolution interaction better

12 days agoMerge branch 'ss/t7004-unhide-git-failures'
Junio C Hamano [Sun, 17 May 2026 13:58:30 +0000 (22:58 +0900)] 
Merge branch 'ss/t7004-unhide-git-failures'

Test clean-up.

* ss/t7004-unhide-git-failures:
  t7004: avoid subshells to capture git exit codes
  t7004: dynamically grab expected state in tests
  t7004: drop hardcoded tag count for state verification

12 days agoMerge branch 'en/backfill-fixes-and-edges'
Junio C Hamano [Sun, 17 May 2026 13:58:29 +0000 (22:58 +0900)] 
Merge branch 'en/backfill-fixes-and-edges'

The 'git backfill' command now rejects revision-limiting options that
are incompatible with its operation, uses standard documentation for
revision ranges, and includes blobs from boundary commits by default
to improve performance of subsequent operations.

* en/backfill-fixes-and-edges:
  backfill: default to grabbing edge blobs too
  backfill: document acceptance of revision-range in more standard manner
  backfill: reject rev-list arguments that do not make sense

2 weeks agot/unit-tests: add tests for the in-memory object source
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:47 +0000 (14:12 +0200)] 
t/unit-tests: add tests for the in-memory object source

While the in-memory object source is a full-fledged source, our code
base only exercises parts of its functionality because we only use it in
git-blame(1). Implement unit tests to verify that the yet-unused
functionality of the backend works as expected.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: generic in-memory source
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:46 +0000 (14:12 +0200)] 
odb: generic in-memory source

Make the in-memory source generic.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: stub out remaining functions
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:45 +0000 (14:12 +0200)] 
odb/source-inmemory: stub out remaining functions

Stub out remaining functions that we either don't need or that are
basically no-ops.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `freshen_object()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:44 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `freshen_object()` callback

Implement the `freshen_object()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `count_objects()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:43 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `count_objects()` callback

Implement the `count_objects()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `find_abbrev_len()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:42 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `find_abbrev_len()` callback

Implement the `find_abbrev_len()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `for_each_object()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:41 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `for_each_object()` callback

Implement the `for_each_object()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: convert to use oidtree
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:40 +0000 (14:12 +0200)] 
odb/source-inmemory: convert to use oidtree

The in-memory source stores its objects in a simple array that we grow as
needed. This has a couple of downsides:

  - The object lookup is O(n). This doesn't matter in practice because
    we only store a small number of objects.

  - We don't have an easy way to iterate over all objects in
    lexicographic order.

  - We don't have an easy way to compute unique object ID prefixes.

Refactor the code to use an oidtree instead. This is the same data
structure used by our loose object source, and thus it means we get a
bunch of functionality for free.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agooidtree: add ability to store data
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:39 +0000 (14:12 +0200)] 
oidtree: add ability to store data

The oidtree data structure is currently only used to store object IDs,
without any associated data. So consequently, it can only really be used
to track which object IDs exist, and we can use the tree structure to
efficiently operate on OID prefixes.

But there are valid use cases where we want to both:

  - Store object IDs in a sorted order.

  - Associated arbitrary data with them.

Refactor the oidtree interface so that it allows us to store arbitrary
payloads within the respective nodes. This will be used in the next
commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocbtree: allow using arbitrary wrapper structures for nodes
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:38 +0000 (14:12 +0200)] 
cbtree: allow using arbitrary wrapper structures for nodes

The cbtree subsystem allows the user to store arbitrary data in a
prefix-free set of strings. This is used by us to store object IDs in a
way that we can easily iterate through them in lexicograph order, and so
that we can easily perform lookups with shortened object IDs.

In its current form, it is not easily possible to store arbitrary data
with the tree nodes. There are a couple of approaches such a caller
could try to use, but none of them really work:

  - One may embed the `struct cb_node` in a custom structure. This does
    not work though as `struct cb_node` contains a flex array, and
    embedding such a struct in another struct is forbidden.

  - One may use a `union` over `struct cb_node` and ones own data type,
    which _is_ allowed even if the struct contains a flex array. This
    does not work though, as the compiler may align members of the
    struct so that the node key would not immediately start where the
    flex array starts.

  - One may allocate `struct cb_node` such that it has room for both its
    key and the custom data. This has the downside though that if the
    custom data is itself a pointer to allocated memory, then the leak
    checker will not consider the pointer to be alive anymore.

Refactor the cbtree to drop the flex array and instead take in an
explicit offset for where to find the key, which allows the caller to
embed `struct cb_node` is a wrapper struct.

Note that this change has the downside that we now have a bit of padding
in our structure, which grows the size from 60 to 64 bytes on a 64 bit
system. On the other hand though, it allows us to get rid of the memory
copies that we previously had to do to ensure proper alignment. This
seems like a reasonable tradeoff.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `write_object_stream()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:37 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `write_object_stream()` callback

Implement the `write_object_stream()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `write_object()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:36 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `write_object()` callback

Implement the `write_object()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `read_object_stream()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:35 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `read_object_stream()` callback

Implement the `read_object_stream()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `read_object_info()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:34 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `read_object_info()` callback

Implement the `read_object_info()` callback function for the in-memory
source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: fix unnecessary call to `find_cached_object()`
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:33 +0000 (14:12 +0200)] 
odb: fix unnecessary call to `find_cached_object()`

The function `odb_pretend_object()` writes an object into the in-memory
object database source. The effect of this is that the object will now
become readable, but it won't ever be persisted to disk.

Before storing the object, we first verify whether the object already
exists. This is done by calling `odb_has_object()` to check all sources,
followed by `find_cached_object()` to check whether we have already
stored the object in our in-memory source.

This is unnecessary though, as `odb_has_object()` already checks the
in-memory source transitively via:

  - `odb_has_object()`
  - `odb_read_object_info_extended()`
  - `do_oid_object_info_extended()`
  - `find_cached_object()`

Drop the explicit call to `find_cached_object()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/source-inmemory: implement `free()` callback
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:32 +0000 (14:12 +0200)] 
odb/source-inmemory: implement `free()` callback

Implement the `free()` callback function for the "in-memory" source.

Note that this requires us to define `struct cached_object_entry` in
"odb/source-inmemory.h", as it is accessed in both "odb.c" and
"odb/source-inmemory.c" now. This will be fixed in subsequent commits
though.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: introduce "in-memory" source
Patrick Steinhardt [Fri, 10 Apr 2026 12:12:31 +0000 (14:12 +0200)] 
odb: introduce "in-memory" source

Next to our typical object database sources, each object database also
has an implicit source of "cached" objects. These cached objects only
exist in memory and some use cases:

  - They contain evergreen objects that we expect to always exist, like
    for example the empty tree.

  - They can be used to store temporary objects that we don't want to
    persist to disk, which is used by git-blame(1) to create a fake
    worktree commit.

Overall, their use is somewhat restricted though. For example, we don't
provide the ability to use it as a temporary object database source that
allows the user to write objects, but discard them after Git exists. So
while these cached objects behave almost like a source, they aren't used
as one.

This is about to change over the following commits, where we will turn
cached objects into a new "in-memory" source. This will allow us to use
it exactly the same as any other source by providing the same common
interface as the "files" source.

For now, the in-memory source only hosts the cached objects and doesn't
provide any logic yet. This will change with subsequent commits, where
we move respective functionality into the source.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'jt/odb-transaction-write' into ps/odb-in-memory
Junio C Hamano [Thu, 14 May 2026 19:50:31 +0000 (04:50 +0900)] 
Merge branch 'jt/odb-transaction-write' into ps/odb-in-memory

* jt/odb-transaction-write:
  odb/transaction: make `write_object_stream()` pluggable
  object-file: generalize packfile writes to use odb_write_stream
  object-file: avoid fd seekback by checking object size upfront
  object-file: remove flags from transaction packfile writes
  odb: update `struct odb_write_stream` read() callback
  odb/transaction: use pluggable `begin_transaction()`
  odb: split `struct odb_transaction` into separate header

2 weeks agoodb/transaction: make `write_object_stream()` pluggable
Justin Tobler [Thu, 14 May 2026 18:37:40 +0000 (13:37 -0500)] 
odb/transaction: make `write_object_stream()` pluggable

How an ODB transaction handles writing objects is expected to vary
between implementations. Introduce a new `write_object_stream()`
callback in `struct odb_transaction` to make this function pluggable.
Rename `index_blob_packfile_transaction()` to
`odb_transaction_files_write_object_stream()` and wire it up for use
with `struct odb_transaction_files` accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoobject-file: generalize packfile writes to use odb_write_stream
Justin Tobler [Thu, 14 May 2026 18:37:39 +0000 (13:37 -0500)] 
object-file: generalize packfile writes to use odb_write_stream

The `index_blob_packfile_transaction()` function streams blob data
directly from an fd. This makes it difficult to reuse as part of a
generic transactional object writing interface.

Refactor the packfile write path to operate on a `struct
odb_write_stream`, allowing callers to supply data from arbitrary
sources.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoobject-file: avoid fd seekback by checking object size upfront
Justin Tobler [Thu, 14 May 2026 18:37:38 +0000 (13:37 -0500)] 
object-file: avoid fd seekback by checking object size upfront

In certain scenarios, Git handles writing blobs that exceed
"core.bigFileThreshold" differently by streaming the object directly
into a packfile. When there is an active ODB transaction, these blobs
are streamed to the same packfile instead of using a separate packfile
for each. If "pack.packSizeLimit" is configured and streaming another
object causes the packfile to exceed the configured limit, the packfile
is truncated back to the previous object and the object write is
restarted in a new packfile.

This works fine, but requires the fd being read from to save a
checkpoint so it becomes possible to rewind the input source via seeking
back to a known offset at the beginning. In a subsequent commit, blob
streaming is converted to use `struct odb_write_stream` as a more
generic input source instead of an fd which doesn't provide a mechanism
for rewinding.

For this use case though, rewinding the fd is not strictly necessary
because the inflated size of the object is known and can be used to
approximate whether writing the object would cause the packfile to
exceed the configured limit prior to writing anything. These blobs
written to the packfile are never deltified thus the size difference
between what is written versus the inflated size is due to zlib
compression. While this does prevent packfiles from being filled to the
potential maximum is some cases, it should be good enough and still
prevents the packfile from exceeding any configured limit.

Use the inflated blob size to determine whether writing an object to a
packfile will exceed the configured "pack.packSizeLimit".

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoobject-file: remove flags from transaction packfile writes
Justin Tobler [Thu, 14 May 2026 18:37:37 +0000 (13:37 -0500)] 
object-file: remove flags from transaction packfile writes

The `index_blob_packfile_transaction()` function handles streaming a
blob from an fd to compute its object ID and conditionally writes the
object directly to a packfile if the INDEX_WRITE_OBJECT flag is set. A
subsequent commit will make these packfile object writes part of the
transaction interface. Consequently, having the object write be
conditional on this flag is a bit awkward.

In preparation for this change, introduce a dedicated
`hash_blob_stream()` helper that only computes the OID from a `struct
odb_write_stream`. This is invoked by `index_fd()` instead when the
INDEX_WRITE_OBJECT is not set. The object write performed via
`index_blob_packfile_transaction()` is made unconditional accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: update `struct odb_write_stream` read() callback
Justin Tobler [Thu, 14 May 2026 18:37:36 +0000 (13:37 -0500)] 
odb: update `struct odb_write_stream` read() callback

The `read()` callback used by `struct odb_write_stream` currently
returns a pointer to an internal buffer along with the number of bytes
read. This makes buffer ownership unclear and provides no way to report
errors.

Update the interface to instead require the caller to provide a buffer,
and have the callback return the number of bytes written to it or a
negative value on error. While at it, also move the `struct
odb_write_stream` definition to "odb/streaming.h". Call sites are
updated accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb/transaction: use pluggable `begin_transaction()`
Justin Tobler [Thu, 14 May 2026 18:37:35 +0000 (13:37 -0500)] 
odb/transaction: use pluggable `begin_transaction()`

Each ODB source is expected to provide an ODB transaction implementation
that should be used when starting a transaction. With d6fc6fe6f8
(odb/source: make `begin_transaction()` function pluggable, 2026-03-05),
the `struct odb_source` now provides a pluggable callback for beginning
transactions. Use the callback provided by the ODB source accordingly.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: split `struct odb_transaction` into separate header
Justin Tobler [Thu, 14 May 2026 18:37:34 +0000 (13:37 -0500)] 
odb: split `struct odb_transaction` into separate header

The current ODB transaction interface is colocated with other ODB
interfaces in "odb.{c,h}". Subsequent commits will expand `struct
odb_transaction` to support write operations on the transaction
directly. To keep things organized and prevent "odb.{c,h}" from becoming
more unwieldy, split out `struct odb_transaction` into a separate
header.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'ps/clang-w-glibc-2.43-and-_Generic'
Junio C Hamano [Wed, 13 May 2026 01:57:55 +0000 (10:57 +0900)] 
Merge branch 'ps/clang-w-glibc-2.43-and-_Generic'

Headers from glibc 2.43 when used with clang does not allow
disabling C11 language features, causing build failures..

* ps/clang-w-glibc-2.43-and-_Generic:
  build: tolerate use of _Generic from glibc 2.43 with Clang

2 weeks agoThe second batch
Junio C Hamano [Tue, 12 May 2026 02:04:30 +0000 (11:04 +0900)] 
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'js/maintenance-fix-deadlock-on-win10'
Junio C Hamano [Tue, 12 May 2026 02:04:45 +0000 (11:04 +0900)] 
Merge branch 'js/maintenance-fix-deadlock-on-win10'

To help Windows 10 installations, avoid removing files whose
contents are still mmap()'ed.

* js/maintenance-fix-deadlock-on-win10:
  maintenance(geometric): do release the `.idx` files before repacking
  mingw: optionally use legacy (non-POSIX) delete semantics

2 weeks agoMerge branch 'jc/t5551-fix-expensive'
Junio C Hamano [Tue, 12 May 2026 02:04:45 +0000 (11:04 +0900)] 
Merge branch 'jc/t5551-fix-expensive'

Test fix.

* jc/t5551-fix-expensive:
  t5551: "GIT_TEST_LONG=Yes make test" is broken

2 weeks agoMerge branch 'js/t5564-socks-use-short-path'
Junio C Hamano [Tue, 12 May 2026 02:04:44 +0000 (11:04 +0900)] 
Merge branch 'js/t5564-socks-use-short-path'

Avoid hitting the pathname limit for socks proxy socket during the
test..

* js/t5564-socks-use-short-path:
  t5564: use a short path for the SOCKS proxy socket

2 weeks agoMerge branch 'js/ci-github-actions-update'
Junio C Hamano [Tue, 12 May 2026 02:04:44 +0000 (11:04 +0900)] 
Merge branch 'js/ci-github-actions-update'

Update various GitHub Actions versions.

* js/ci-github-actions-update:
  l10n: bump mshick/add-pr-comment from v2 to v3
  ci: bump git-for-windows/setup-git-for-windows-sdk from v1 to v2
  ci: bump actions/checkout from v5 to v6
  ci: bump actions/github-script from v8 to v9
  ci: bump actions/{upload,download}-artifact to v7 and v8
  ci: bump microsoft/setup-msbuild from v2 to v3

2 weeks agoMerge branch 'jk/revert-aa-reap-transport-child-processes'
Junio C Hamano [Tue, 12 May 2026 02:04:43 +0000 (11:04 +0900)] 
Merge branch 'jk/revert-aa-reap-transport-child-processes'

Revert a recent change that introduced a regression to help mksh users.

* jk/revert-aa-reap-transport-child-processes:
  Revert "transport-helper, connect: use clean_on_exit to reap children on abnormal exit"

2 weeks agoformat-rev: introduce builtin for on-demand pretty formatting
Kristoffer Haugsbakk [Mon, 11 May 2026 15:45:49 +0000 (17:45 +0200)] 
format-rev: introduce builtin for on-demand pretty formatting

Introduce a new builtin for pretty formatting one revision expression
per line or commit object names found in running text.

Sometimes you want to format commits. Most of the time you’re
walking the graph, e.g. getting a range of commits like
`master..topic`. That’s a job for git-log(1).

But there are times when you want to format commits that you encounter
on demand:

• Full hashes in running text that you might want to pretty-print
• git-last-modified(1) outputs full hashes that you can do the same
  with
• git-cherry(1) has `-v` for commit subject, but maybe you want
  something else?

But now you can’t use git-log(1), git-show(1), or git-rev-list(1):

• You can’t feed commits piecemeal to these commands, one input
  for one output; they block until standard in is closed
• You can’t feed a list of possibly duplicate commits, like the output
  of git-last-modified(1); they effectively deduplicate the output

Beyond these two points there’s also the input massage problem: you
cannot feed mixed input (revisions mixed with arbitrary text).

One might hope that git-cat-file(1) can save us. But it doesn’t
support pretty formats.

But there is one command that already both handles revisions as
arguments, revisions on standard input, and even revisions mixed in
with arbitrary text. Namely git-name-rev(1): the command for outputting
symbolic names for commits.

We made some room in `builtin/name-rev.c` two commits ago. Let’s
now add this new git-format-rev(1) command. Taking inspiration from
git-name-rev(1), there are two modes:

• revs: like git-name-rev(1) in argv mode, but one revision per line
  on standard in
• text: like git-name-rev(1) with `--annotate-stdin`

***

We need to add this command to the exception list in
`t/t1517-outside-repo.sh` because it uses “EXPERIMENTAL!”
in the usage line.

Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoname-rev: make dedicated --annotate-stdin --name-only test
Kristoffer Haugsbakk [Mon, 11 May 2026 15:45:48 +0000 (17:45 +0200)] 
name-rev: make dedicated --annotate-stdin --name-only test

The previous commit split the `--name-only` handling:

1. `--annotate-stdin`: uses the new `struct command`
2. The rest: uses `struct name_ref_data`

But there is no dedicated test for the option combination in (1). That
means that the following tests will fail if you neglect to set
`command.u.name_only` properly:

    name-rev --annotate-stdin works with commitGraph
    name-rev --annotate-stdin works with non-monotonic timestamps

even though it has nothing to do with what these tests are supposed
to test.

Let’s add another regression test now that it is relevant.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoname-rev: factor code for sharing with a new command
Kristoffer Haugsbakk [Mon, 11 May 2026 15:45:47 +0000 (17:45 +0200)] 
name-rev: factor code for sharing with a new command

We are about to introduce a new command git-format-rev(1) to this
file. Let’s factor some code so that we can share it with the new
command.

We want to be able to format commits found in freeform text, and
git-name-rev(1) already has a function for that but for symbolic
names. Let’s use a tagged union for the command-specific payload.

No functional changes.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoname-rev: run clang-format before factoring code
Kristoffer Haugsbakk [Mon, 11 May 2026 15:45:46 +0000 (17:45 +0200)] 
name-rev: run clang-format before factoring code

We are about to move code around to prepare for adding a new
command. Let’s deal with clang-format changes first in the affected
areas.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>