]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
2 days agoThe 12th batch main master
Junio C Hamano [Tue, 23 Dec 2025 01:37:41 +0000 (10:37 +0900)] 
The 12th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoMerge branch 'kn/fix-fetch-backfill-tag-with-batched-ref-updates'
Junio C Hamano [Tue, 23 Dec 2025 02:33:17 +0000 (11:33 +0900)] 
Merge branch 'kn/fix-fetch-backfill-tag-with-batched-ref-updates'

"git fetch" that involves fetching tags, when a tag being fetched
needs to overwrite existing one, failed to fetch other tags, which
has been corrected.

* kn/fix-fetch-backfill-tag-with-batched-ref-updates:
  fetch: fix failed batched updates skipping operations
  fetch: fix non-conflicting tags not being committed
  fetch: extract out reference committing logic

2 days agoMerge branch 'rs/diff-files-r-find-copies-fix'
Junio C Hamano [Tue, 23 Dec 2025 02:33:16 +0000 (11:33 +0900)] 
Merge branch 'rs/diff-files-r-find-copies-fix'

"git diff-files -R --find-copies-harder" has been taught to use
the potential copy sources from the index correctly.

* rs/diff-files-r-find-copies-fix:
  diff-files: fix copy detection

2 days agoMerge branch 'jc/memzero-array'
Junio C Hamano [Tue, 23 Dec 2025 02:33:16 +0000 (11:33 +0900)] 
Merge branch 'jc/memzero-array'

Further application of MEMZERO_ARRAY() macro to the rest of the
code base.

* jc/memzero-array:
  cocci: use MEMZERO_ARRAY() a bit more
  coccicheck: emit the contents of cocci patch

2 days agoMerge branch 'tc/memzero-array'
Junio C Hamano [Tue, 23 Dec 2025 02:33:16 +0000 (11:33 +0900)] 
Merge branch 'tc/memzero-array'

MEMZERO_ARRAY() helper is introduced to avoid clearing only the
first N bytes of an N-element array whose elements are larger than
a byte.

* tc/memzero-array:
  contrib/coccinelle: pass include paths to spatch(1)
  git-compat-util: introduce MEMZERO_ARRAY() macro

2 days agoMerge branch 'jc/completion-no-single-letter-options'
Junio C Hamano [Tue, 23 Dec 2025 02:33:15 +0000 (11:33 +0900)] 
Merge branch 'jc/completion-no-single-letter-options'

In-code comment update to clarify that single-letter options are
outside of the scope of command line completion script.

* jc/completion-no-single-letter-options:
  completion: clarify support for short options and arguments

2 days agoMerge branch 'jc/submodule-add'
Junio C Hamano [Tue, 23 Dec 2025 02:33:15 +0000 (11:33 +0900)] 
Merge branch 'jc/submodule-add'

"git submodule add" to add a submodule under <name> segfaulted,
when a submodule.<name>.something is already in .gitmodules file
without defining where its submodule.<name>.path is, which has been
corrected.

* jc/submodule-add:
  submodule add: sanity check existing .gitmodules

2 days agoMerge branch 'ds/doc-scalar-config'
Junio C Hamano [Tue, 23 Dec 2025 02:33:15 +0000 (11:33 +0900)] 
Merge branch 'ds/doc-scalar-config'

Documentation updates.

* ds/doc-scalar-config:
  scalar: document config settings
  scalar: alphabetize and simplify config
  scalar: remove stale config values
  scalar: use index.skipHash=true for performance
  scalar: annotate config file with "set by scalar"

3 days agoThe 11th batch
Junio C Hamano [Mon, 22 Dec 2025 04:46:36 +0000 (13:46 +0900)] 
The 11th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 days agoMerge branch 'rs/t4014-git-version-string-fix'
Junio C Hamano [Mon, 22 Dec 2025 05:57:49 +0000 (14:57 +0900)] 
Merge branch 'rs/t4014-git-version-string-fix'

Test fix.

* rs/t4014-git-version-string-fix:
  t4014: support Git version strings with spaces

3 days agoMerge branch 'kj/pull-options-decl-cleanup'
Junio C Hamano [Mon, 22 Dec 2025 05:57:48 +0000 (14:57 +0900)] 
Merge branch 'kj/pull-options-decl-cleanup'

Code clean-up.

* kj/pull-options-decl-cleanup:
  pull: move options[] array into function scope

3 days agoMerge branch 'jc/macports-darwinports'
Junio C Hamano [Mon, 22 Dec 2025 05:57:48 +0000 (14:57 +0900)] 
Merge branch 'jc/macports-darwinports'

Makefile in-comment doc update.

* jc/macports-darwinports:
  Makefile: help macOS novices by mentioning MacPorts

3 days agoMerge branch 'rs/replay-wrong-onto-fix'
Junio C Hamano [Mon, 22 Dec 2025 05:57:48 +0000 (14:57 +0900)] 
Merge branch 'rs/replay-wrong-onto-fix'

"git replay --onto=<commit> ...", when <commit> is mistyped,
started to segfault with recent change, which has been corrected.

* rs/replay-wrong-onto-fix:
  replay: move onto NULL check before first use

3 days agoMerge branch 'kh/doc-replay-updates'
Junio C Hamano [Mon, 22 Dec 2025 05:57:48 +0000 (14:57 +0900)] 
Merge branch 'kh/doc-replay-updates'

"git replay" documentation updates.

* kh/doc-replay-updates:
  doc: replay: link section using markup
  replay: improve --contained and add to doc
  doc: replay: mention no output on conflicts

3 days agoMerge branch 'ps/odb-alternates-object-sources'
Junio C Hamano [Mon, 22 Dec 2025 05:57:48 +0000 (14:57 +0900)] 
Merge branch 'ps/odb-alternates-object-sources'

Code refactoring around alternate object store.

* ps/odb-alternates-object-sources:
  odb: write alternates via sources
  odb: read alternates via sources
  odb: drop forward declaration of `read_info_alternates()`
  odb: remove mutual recursion when parsing alternates
  odb: stop splitting alternate in `odb_add_to_alternates_file()`
  odb: move computation of normalized objdir into `alt_odb_usable()`
  odb: resolve relative alternative paths when parsing
  odb: refactor parsing of alternates to be self-contained

8 days agoThe 10th batch
Junio C Hamano [Wed, 17 Dec 2025 05:11:28 +0000 (14:11 +0900)] 
The 10th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge branch 'kh/doc-send-email-paragraph-fix'
Junio C Hamano [Wed, 17 Dec 2025 05:11:53 +0000 (14:11 +0900)] 
Merge branch 'kh/doc-send-email-paragraph-fix'

Docfix.

* kh/doc-send-email-paragraph-fix:
  doc: send-email: fix broken list continuation

8 days agoMerge branch 'mh/doc-config-gui-gcwarning'
Junio C Hamano [Wed, 17 Dec 2025 05:11:53 +0000 (14:11 +0900)] 
Merge branch 'mh/doc-config-gui-gcwarning'

Docfix.

* mh/doc-config-gui-gcwarning:
  config: document 'gui.GCWarning'

8 days agoMerge branch 'kh/doc-pre-commit-fix'
Junio C Hamano [Wed, 17 Dec 2025 05:11:53 +0000 (14:11 +0900)] 
Merge branch 'kh/doc-pre-commit-fix'

Docfix.

* kh/doc-pre-commit-fix:
  doc: join default pre-commit paragraphs

8 days agoMerge branch 'jc/capability-leak'
Junio C Hamano [Wed, 17 Dec 2025 05:11:52 +0000 (14:11 +0900)] 
Merge branch 'jc/capability-leak'

Leakfix.

* jc/capability-leak:
  connect: plug protocol capability leak

9 days agoThe ninth batch
Junio C Hamano [Tue, 16 Dec 2025 02:08:23 +0000 (11:08 +0900)] 
The ninth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agoMerge branch 'rs/ban-mktemp'
Junio C Hamano [Tue, 16 Dec 2025 02:08:34 +0000 (11:08 +0900)] 
Merge branch 'rs/ban-mktemp'

Rewrite the only use of "mktemp()" that is subject to TOCTOU race
and Stop using the insecure "mktemp()" function.

* rs/ban-mktemp:
  compat: remove gitmkdtemp()
  banned.h: ban mktemp(3)
  compat: remove mingw_mktemp()
  compat: use git_mkdtemp()
  wrapper: add git_mkdtemp()

9 days agoMerge branch 'gf/win32-pthread-cond-init'
Junio C Hamano [Tue, 16 Dec 2025 02:08:34 +0000 (11:08 +0900)] 
Merge branch 'gf/win32-pthread-cond-init'

Emulation code clean-up.

* gf/win32-pthread-cond-init:
  win32: pthread_cond_init should return a value

9 days agoMerge branch 'ps/object-read-stream'
Junio C Hamano [Tue, 16 Dec 2025 02:08:34 +0000 (11:08 +0900)] 
Merge branch 'ps/object-read-stream'

The "git_istream" abstraction has been revamped to make it easier
to interface with pluggable object database design.

* ps/object-read-stream:
  streaming: drop redundant type and size pointers
  streaming: move into object database subsystem
  streaming: refactor interface to be object-database-centric
  streaming: move logic to read packed objects streams into backend
  streaming: move logic to read loose objects streams into backend
  streaming: make the `odb_read_stream` definition public
  streaming: get rid of `the_repository`
  streaming: rely on object sources to create object stream
  packfile: introduce function to read object info from a store
  streaming: move zlib stream into backends
  streaming: create structure for filtered object streams
  streaming: create structure for packed object streams
  streaming: create structure for loose object streams
  streaming: create structure for in-core object streams
  streaming: allocate stream inside the backend-specific logic
  streaming: explicitly pass packfile info when streaming a packed object
  streaming: propagate final object type via the stream
  streaming: drop the `open()` callback function
  streaming: rename `git_istream` into `odb_read_stream`

9 days agodiff-files: fix copy detection
René Scharfe [Sun, 14 Dec 2025 15:57:06 +0000 (16:57 +0100)] 
diff-files: fix copy detection

Copy detection cannot work when comparing the index to the working tree
because Git ignores files that it is not explicitly told to track.  It
should work in the other direction, though, i.e. for a reverse diff of
the deletion of a copy from the index.

d1f2d7e8ca (Make run_diff_index() use unpack_trees(), not read_tree(),
2008-01-19) broke it with a seemingly stray change to run_diff_files().

We didn't notice because there's no test for that.  But even if we had
one, it might have gone unnoticed because the breakage only happens
with index preloading, which requires at least 1000 entries (more than
most test repos have) and is racy because it runs in parallel with the
actual command.

Fix copy detection by queuing up-to-date and skip-worktree entries using
diff_same().

While at it, use diff_same() also for queuing unchanged files not
flagged as up-to-date, i.e. clean submodules and entries where
preloading was not done at all or not quickly enough.  It uses less
memory than diff_change() and doesn't unnecessarily set the diff flag
has_changes.

Add two tests to cover running both without and with preloading.  The
first one passes reliably with the original code.  The second one
enables preloading and thus is racy.  It has a good chance to pass even
without the fix, but fails within seconds when running the test script
with --stress.  With the fix it runs fine for several minutes, until
my patience runs out.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 days agoMerge branch 'rs/diff-index-find-copies-harder-optim' into rs/diff-files-r-find-copie...
Junio C Hamano [Tue, 16 Dec 2025 01:22:56 +0000 (10:22 +0900)] 
Merge branch 'rs/diff-index-find-copies-harder-optim' into rs/diff-files-r-find-copies-fix

* rs/diff-index-find-copies-harder-optim:
  diff-index: don't queue unchanged filepairs with diff_change()

9 days agoscalar: document config settings
Derrick Stolee [Fri, 12 Dec 2025 15:15:28 +0000 (15:15 +0000)] 
scalar: document config settings

Add user-facing documentation that justifies the values being set by
'scalar clone', 'scalar register', and 'scalar reconfigure'.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoThe eighth batch
Junio C Hamano [Sun, 14 Dec 2025 08:04:17 +0000 (17:04 +0900)] 
The eighth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoMerge branch 'je/doc-data-model'
Junio C Hamano [Sun, 14 Dec 2025 08:04:38 +0000 (17:04 +0900)] 
Merge branch 'je/doc-data-model'

Docfix.

* je/doc-data-model:
  doc: remove stray text in Git data model

11 days agoMerge branch 'lo/repo-struct-z'
Junio C Hamano [Sun, 14 Dec 2025 08:04:37 +0000 (17:04 +0900)] 
Merge branch 'lo/repo-struct-z'

"git repo struct" learned to take "-z" as a synonym to "--format=nul".

* lo/repo-struct-z:
  repo: add -z as an alias for --format=nul to git-repo-structure
  repo: use [--format=... | -z] instead of [-z] in git-repo-info synopsis
  repo: remove blank line from Documentation/git-repo.adoc

11 days agoMerge branch 'kh/advise-w-git-help-in-branch'
Junio C Hamano [Sun, 14 Dec 2025 08:04:37 +0000 (17:04 +0900)] 
Merge branch 'kh/advise-w-git-help-in-branch'

A help message from "git branch" now mentions "git help" instead of
"man" when suggesting to read some documentation.

* kh/advise-w-git-help-in-branch:
  branch: advice using git-help(1) instead of man(1)

11 days agoMerge branch 'je/doc-pull'
Junio C Hamano [Sun, 14 Dec 2025 08:04:37 +0000 (17:04 +0900)] 
Merge branch 'je/doc-pull'

Doc fixup.

* je/doc-pull:
  doc: git-pull: fix 'git --rebase abort' typo

11 days agoMerge branch 'tc/meson-cross-compile-fix'
Junio C Hamano [Sun, 14 Dec 2025 08:04:37 +0000 (17:04 +0900)] 
Merge branch 'tc/meson-cross-compile-fix'

Build fix.

* tc/meson-cross-compile-fix:
  meson: use is_cross_build() where possible
  meson: only detect ICONV_OMITS_BOM if possible
  meson: ignore subprojects/.wraplock

11 days agoMerge branch 'js/last-modified-with-sparse-checkouts'
Junio C Hamano [Sun, 14 Dec 2025 08:04:36 +0000 (17:04 +0900)] 
Merge branch 'js/last-modified-with-sparse-checkouts'

"git last-modified" used to mishandle "--" to mark the beginning of
pathspec, which has been corrected.

* js/last-modified-with-sparse-checkouts:
  last-modified: support sparse checkouts

11 days agoMerge branch 'rs/diff-index-find-copies-harder-optim'
Junio C Hamano [Sun, 14 Dec 2025 08:04:36 +0000 (17:04 +0900)] 
Merge branch 'rs/diff-index-find-copies-harder-optim'

Halve the memory consumed by artificial filepairs created during
"git diff --find-copioes-harder", also making the operation run
faster.

* rs/diff-index-find-copies-harder-optim:
  diff-index: don't queue unchanged filepairs with diff_change()

11 days agoMerge branch 'tc/last-modified-active-paths-optimization'
Junio C Hamano [Sun, 14 Dec 2025 08:04:36 +0000 (17:04 +0900)] 
Merge branch 'tc/last-modified-active-paths-optimization'

Recent optimization to "last-modified" command introduced use of
uninitialized block of memory, which has been corrected.

* tc/last-modified-active-paths-optimization:
  last-modified: fix use of uninitialized memory

11 days agodoc: replay: link section using markup
Kristoffer Haugsbakk [Sat, 13 Dec 2025 13:46:58 +0000 (14:46 +0100)] 
doc: replay: link section using markup

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoreplay: improve --contained and add to doc
Kristoffer Haugsbakk [Sat, 13 Dec 2025 13:46:57 +0000 (14:46 +0100)] 
replay: improve --contained and add to doc

There is no documentation for `--contained`.

Start by copying the text from `replay_options` in `builtin/
replay.c`. But some people think that the existing text is a
bit unclear; what does it mean for a branch to be contained
in a revision range? Let’s include the implied commits here:
the branches that point at commits in the range.

Also use “update” instead of “advance”. “Update” is the verb
commonly used in this context.

Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
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>
11 days agodoc: replay: mention no output on conflicts
Kristoffer Haugsbakk [Sat, 13 Dec 2025 13:46:56 +0000 (14:46 +0100)] 
doc: replay: mention no output on conflicts

Some commands will produce output on stderr if there are conflicts, but
git-replay(1) is completely silent. Explicitly spell that out.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot4014: support Git version strings with spaces
René Scharfe [Sat, 13 Dec 2025 09:40:42 +0000 (10:40 +0100)] 
t4014: support Git version strings with spaces

git --version reports its version with the prefix "git version ".
Remove precisely this string instead of everything up to and including
the rightmost space to avoid butchering version strings that contain
spaces.  This helps Apple's release of Git, which reports its version
like this: "git version 2.50.1 (Apple Git-155)".

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agococci: use MEMZERO_ARRAY() a bit more
Junio C Hamano [Sat, 13 Dec 2025 01:46:28 +0000 (10:46 +0900)] 
cocci: use MEMZERO_ARRAY() a bit more

Existing code in files that have been fairly stable trigger the
"make coccicheck" suggestions due to the new check.

Rewrite them to use MEMZERO_ARRAY()

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agococcicheck: emit the contents of cocci patch
Junio C Hamano [Sat, 13 Dec 2025 01:46:27 +0000 (10:46 +0900)] 
coccicheck: emit the contents of cocci patch

Telling the user "you got some error messages" without showing what
the errors are is almost useless in CI environment, as the errors
cannot be examined without downloading build artifacts.

Arrange it to spew out the output when it fails.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoMerge branch 'tc/memzero-array' into jc/memzero-array
Junio C Hamano [Sat, 13 Dec 2025 01:39:23 +0000 (10:39 +0900)] 
Merge branch 'tc/memzero-array' into jc/memzero-array

* tc/memzero-array:
  contrib/coccinelle: pass include paths to spatch(1)
  git-compat-util: introduce MEMZERO_ARRAY() macro
  last-modified: fix use of uninitialized memory

12 days agoscalar: alphabetize and simplify config
Derrick Stolee [Fri, 12 Dec 2025 15:15:27 +0000 (15:15 +0000)] 
scalar: alphabetize and simplify config

The config values set by Scalar went through an audit in the previous
changes, so now reorganize the settings and simplify their purpose.

First, alphabetize the config options, except put the platform-specific
options at the end. This groups two Windows-specific settings and only
one non-Windows setting.

Also, this removes the 'overwrite_on_reconfigure' setting for many of
these options. That setting made nearly all of these options "required"
for scalar enlistments, restricting use for users. Instead, now nearly
all options have removed this setting.

However, there is one setting that still has this, which is
index.skipHash, which was previously being set to _false_ when we
actually prefer the value of true. Keep the overwrite here to help
Scalar users upgrade to the new version. We may remove that overwrite in
the future once we belive that most of the users who have the false
value have upgraded to a version that overwrites that to 'true'.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoscalar: remove stale config values
Derrick Stolee [Fri, 12 Dec 2025 15:15:26 +0000 (15:15 +0000)] 
scalar: remove stale config values

These config values were added in the original Scalar contribution,
d0feac4e8c (scalar: 'register' sets recommended config and starts
maintenance, 2021-12-03), but were never fully checked for validity in
the upstream Git project. At the time, Scalar was only intended for the
contrib/ directory so did not have as rigorous of an investigation.

Each config option has its own justification for removal:

* core.preloadIndex: This value is true by default, now. Removing this
  causes some changes required to the tests that checked this config
  value. Use gui.gcwarning=false instead.

* core.fscache: This config does not exist in the core Git project, but
  is instead a config option for a Git for Windows feature.

* core.multiPackIndex: This config value is now enabled by default, so
  does not need to be called out specifically. It was originally
  included to make sure the background maintenance that created
  multi-pack-indexes would result in the expected performance
  improvements.

* credential.validate: This option is not something specific to Git but
  instead an older version of Git Credential Manager for Windows. That
  software was replaced several years ago by the cross-platform Git
  Credential Manger so this option is no longer needed to help users who
  were on that older software.

* pack.useSparse=true: This value is now Git's default as of de3a864114
  (config: set pack.useSparse=true by default, 2020-03-20) so we don't
  need it set by Scalar.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoscalar: use index.skipHash=true for performance
Derrick Stolee [Fri, 12 Dec 2025 15:15:25 +0000 (15:15 +0000)] 
scalar: use index.skipHash=true for performance

The index.skipHash config option has been set to 'false' by Scalar since
4933152cbb (scalar: enable path-walk during push via config, 2025-05-16)
but that commit message is trying to communicate the exact opposite:
that the 'true' value is what we want instead. This means that we've
been disabling this performance benefit for Scalar repos
unintentionally.

Fix this issue before we add justification for the config options set in
this list.

Oddly, enabling index.skipHash causes a test issue during 'test_commit'
in one of the Scalar tests when GIT_TEST_SPLIT_INDEX is enabled (as
caught by the linux-test-vars build). I'm fixing the test by disabling
the environment variable, but the issue should be resolved in a series
focused on the split index.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoscalar: annotate config file with "set by scalar"
Derrick Stolee [Fri, 12 Dec 2025 15:15:24 +0000 (15:15 +0000)] 
scalar: annotate config file with "set by scalar"

A repo may have config options set by 'scalar clone' or 'scalar
register' and then updated by 'scalar reconfigure'. It can be helpful to
point out which of those options were set by the latest scalar
recommendations.

Add "# set by scalar" to the end of each config option to assist users
in identifying why these config options were set in their repo. Use a new
helper method to simplify the two callsites.

Co-authored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agopull: move options[] array into function scope
K Jayatheerth [Fri, 12 Dec 2025 07:44:33 +0000 (13:14 +0530)] 
pull: move options[] array into function scope

Unless there are good reasons, it is customary to have the options[]
array used with the parse-options API declared in function scope rather
than at file scope.

Move builtin/pull.c:cmd_pull()’s options[] array into the function to
match that convention.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoreplay: move onto NULL check before first use
René Scharfe [Thu, 11 Dec 2025 17:56:54 +0000 (18:56 +0100)] 
replay: move onto NULL check before first use

cmd_replay() aborts if the pointer "onto" is NULL after argument
parsing, e.g. when specifying a non-existing commit with --onto.
15cd4ef1f4 (replay: make atomic ref updates the default behavior,
2025-11-06) added code that dereferences this pointer before the check.
Switch their places to avoid a segmentation fault.

Reported-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoMerge branch 'sa/replay-atomic-ref-updates' into rs/replay-wrong-onto-fix
Junio C Hamano [Fri, 12 Dec 2025 03:41:17 +0000 (12:41 +0900)] 
Merge branch 'sa/replay-atomic-ref-updates' into rs/replay-wrong-onto-fix

* sa/replay-atomic-ref-updates:
  replay: add replay.refAction config option
  replay: make atomic ref updates the default behavior
  replay: use die_for_incompatible_opt2() for option validation

13 days agoMakefile: help macOS novices by mentioning MacPorts
Junio C Hamano [Thu, 11 Dec 2025 02:53:07 +0000 (11:53 +0900)] 
Makefile: help macOS novices by mentioning MacPorts

Since Aug 2006, the DarwinPorts project renamed themselves as
MacPorts.  Those who are not intimately familiar with the Opensource
ecosystem around macOS from olden days, the name DarwinPorts may not
ring a bell, even when they are using MacPorts.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: write alternates via sources
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:17 +0000 (10:30 +0100)] 
odb: write alternates via sources

Refactor writing of alternates so that the actual business logic is
structured around the object database source we want to write the
alternate to. Same as with the preceding commit, this will eventually
allow us to have different logic for writing alternates depending on the
backend used.

Note that after the refactoring we start to call
`odb_add_alternate_recursively()` unconditionally. This is fine though
as we know to skip adding sources that are tracked already.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: read alternates via sources
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:16 +0000 (10:30 +0100)] 
odb: read alternates via sources

Adapt how we read alternates so that the interface is structured around
the object database source we're reading from. This will eventually
allow us to abstract away this behaviour with pluggable object databases
so that every format can have its own mechanism for listing alternates.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: drop forward declaration of `read_info_alternates()`
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:15 +0000 (10:30 +0100)] 
odb: drop forward declaration of `read_info_alternates()`

Now that we have removed the mutual recursion in the preceding commit
it is not necessary anymore to have a forward declaration of the
`read_info_alternates()` function. Move the function and its
dependencies further up so that we can remove it.

Note that this commit also removes the function documentation of
`read_info_alternates()`. It's unclear what it's documenting, but it for
sure isn't documenting the modern behaviour of the function anymore.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: remove mutual recursion when parsing alternates
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:14 +0000 (10:30 +0100)] 
odb: remove mutual recursion when parsing alternates

When adding an alternative object database source we not only have to
consider the added source itself, but we also have to add _its_ sources
to our database. We implement this via mutual recursion:

  1. We first call `link_alt_odb_entries()`.

  2. `link_alt_odb_entries()` calls `parse_alternates()`.

  3. We then add each alternate via `odb_add_alternate_recursively()`.

  4. `odb_add_alternate_recursively()` calls `link_alt_odb_entries()`
     again.

This flow is somewhat hard to follow, but more importantly it means that
parsing of alternates is somewhat tied to the recursive behaviour.

Refactor the function to remove the mutual recursion between adding
sources and parsing alternates. The parsing step thus becomes completely
oblivious to the fact that there is recursive behaviour going on at all.
The recursion is handled by `odb_add_alternate_recursively()` instead,
which now recurses with itself.

This refactoring allows us to move parsing of alternates into object
database sources in a subsequent step.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: stop splitting alternate in `odb_add_to_alternates_file()`
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:13 +0000 (10:30 +0100)] 
odb: stop splitting alternate in `odb_add_to_alternates_file()`

When calling `odb_add_to_alternates_file()` we know to add the newly
added source to the object database in case we have already loaded
alternates. This is done so that we can make its objects accessible
immediately without having to fully reload all alternates.

The way we do this though is to call `link_alt_odb_entries()`, which
adds _multiple_ sources to the object database source in case we have
newline-separated entries. This behaviour is not documented in the
function documentation of `odb_add_to_alternates_file()`, and all
callers only ever pass a single directory to it. It's thus entirely
surprising and a conceptual mismatch.

Fix this issue by directly calling `odb_add_alternate_recursively()`
instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: move computation of normalized objdir into `alt_odb_usable()`
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:12 +0000 (10:30 +0100)] 
odb: move computation of normalized objdir into `alt_odb_usable()`

The function `alt_odb_usable()` receives as input the object database,
the path it's supposed to determine usability for as well as the
normalized path of the main object directory of the repository. The last
part is derived by the function's caller from the object database. As we
already pass the object database to `alt_odb_usable()` it is redundant
information.

Drop the extra parameter and compute the normalized object directory in
the function itself.

While at it, rename the function to `odb_is_source_usable()` to align it
with modern terminology.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: resolve relative alternative paths when parsing
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:11 +0000 (10:30 +0100)] 
odb: resolve relative alternative paths when parsing

Parsing alternates and resolving potential relative paths is currently
handled in two separate steps. This has the effect that the logic to
retrieve alternates is not entirely self-contained. We want it to be
just that though so that we can eventually move the logic to list
alternates into the `struct odb_source`.

Move the logic to resolve relative alternative paths into
`parse_alternates()`. Besides bringing us a step closer towards the
above goal, it also neatly separates concerns of generating the list of
alternatives and linking them into the object database.

Note that we ignore any errors when the relative path cannot be
resolved. This isn't really a change in behaviour though: if the path
cannot be resolved to a directory then `alt_odb_usable()` still knows to
bail out.

While at it, rename the function to `odb_add_alternate_recursively()` to
more clearly indicate what its intent is and to align it with modern
terminology.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoodb: refactor parsing of alternates to be self-contained
Patrick Steinhardt [Thu, 11 Dec 2025 09:30:10 +0000 (10:30 +0100)] 
odb: refactor parsing of alternates to be self-contained

Parsing of the alternates file and environment variable is currently
split up across multiple different functions and is entangled with
`link_alt_odb_entries()`, which is responsible for linking the parsed
object database sources. This results in two downsides:

  - We have mutual recursion between parsing alternates and linking them
    into the object database. This is because we also parse alternates
    that the newly added sources may have.

  - We mix up the actual logic to parse the data and to link them into
    place.

Refactor the logic so that parsing of the alternates file is entirely
self-contained. Note that this doesn't yet fix the above two issues, but
it is a necessary step to get there.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocontrib/coccinelle: pass include paths to spatch(1)
Toon Claes [Wed, 10 Dec 2025 13:13:02 +0000 (14:13 +0100)] 
contrib/coccinelle: pass include paths to spatch(1)

In the previous commit a new coccinelle rule is added. But neiter
`make coccicheck` nor `meson compile coccicheck` did detect a case in
builtin/last-modified.c.

This case involves the field `scratch` in `struct last_modified`. This
field is of type `struct bitmap` and that struct has a member
`eword_t *words`. Both are defined in `ewah/ewok.h`. Now, while
builtin/last-modified.c does include that header (with the subdir in the
#include directive), it seems coccinelle does not process it. So it's
unaware of the type of `words` in the bitmap, and it doesn't recognize
the rule from previous commit that uses:

    type T;
    T *ptr;

Fix coccicheck by passing all possible include paths inside the Git
project so spatch(1) can find the headers and can determine the types.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agogit-compat-util: introduce MEMZERO_ARRAY() macro
Toon Claes [Wed, 10 Dec 2025 13:13:01 +0000 (14:13 +0100)] 
git-compat-util: introduce MEMZERO_ARRAY() macro

Introduce a new macro MEMZERO_ARRAY() that zeroes the memory allocated
by ALLOC_ARRAY() and friends. And add coccinelle rule to enforce the use
of this macro.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'tc/last-modified-active-paths-optimization' into tc/memzero-array
Junio C Hamano [Thu, 11 Dec 2025 05:44:28 +0000 (14:44 +0900)] 
Merge branch 'tc/last-modified-active-paths-optimization' into tc/memzero-array

* tc/last-modified-active-paths-optimization:
  last-modified: fix use of uninitialized memory

2 weeks agofetch: fix failed batched updates skipping operations
Karthik Nayak [Fri, 21 Nov 2025 11:13:47 +0000 (12:13 +0100)] 
fetch: fix failed batched updates skipping operations

Fix a regression introduced with batched updates in 0e358de64a (fetch:
use batched reference updates, 2025-05-19) when fetching references. In
the `do_fetch()` function, we jump to cleanup if committing the
transaction fails, regardless of whether using batched or atomic
updates. This skips three subsequent operations:

  - Update 'FETCH_HEAD' as part of `commit_fetch_head()`.

  - Add upstream tracking information via `set_upstream()`.

  - Setting remote 'HEAD' values when `do_set_head` is true.

For atomic updates, this is expected behavior. For batched updates,
we want to continue with these operations even if some refs fail to
update.

Skipping `commit_fetch_head()` isn't actually a regression because
'FETCH_HEAD' is already updated via `append_fetch_head()` when not
using '--atomic'. However, we add a test to validate this behavior.

Skipping the other two operations (upstream tracking and remote HEAD)
is a regression. Fix this by only jumping to cleanup when using
'--atomic', allowing batched updates to continue with post-fetch
operations. Add tests to prevent future regressions.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agofetch: fix non-conflicting tags not being committed
Karthik Nayak [Fri, 21 Nov 2025 11:13:46 +0000 (12:13 +0100)] 
fetch: fix non-conflicting tags not being committed

The commit 0e358de64a (fetch: use batched reference updates, 2025-05-19)
updated the 'git-fetch(1)' command to use batched updates. This batches
updates to gain performance improvements. When fetching references, each
update is added to the transaction. Finally, when committing, individual
updates are allowed to fail with reason, while the transaction itself
succeeds.

One scenario which was missed here, was fetching tags. When fetching
conflicting tags, the `fetch_and_consume_refs()` function returns '1',
which skipped committing the transaction and directly jumped to the
cleanup section. This mean that no updates were applied. This also
extends to backfilling tags which is done when fetching specific
refspecs which contains tags in their history.

Fix this by committing the transaction when we have an error code and
not using an atomic transaction. This ensures other references are
applied even when some updates fail.

The cleanup section is reached with `retcode` set in several scenarios:

   - `truncate_fetch_head()`, `open_fetch_head()` and `prune_refs()` set
     `retcode` before the transaction is created, so no commit is
     attempted.

   - `fetch_and_consume_refs()` and `backfill_tags()` are the primary
     cases this fix targets, both setting a positive `retcode` to
     trigger the committing of the transaction.

This simplifies error handling and ensures future modifications to
`do_fetch()` don't need special handling for batched updates.

Add tests to check for this regression. While here, add a missing
cleanup from previous test.

Reported-by: David Bohman <debohman@gmail.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoThe seventh batch
Junio C Hamano [Mon, 8 Dec 2025 22:53:51 +0000 (07:53 +0900)] 
The seventh batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'en/replay-doc-revision-range'
Junio C Hamano [Mon, 8 Dec 2025 22:54:56 +0000 (07:54 +0900)] 
Merge branch 'en/replay-doc-revision-range'

The use of "revision" (a connected set of commits) has been
clarified in the "git replay" documentation.

* en/replay-doc-revision-range:
  Documentation/git-replay.adoc: fix errors around revision range

2 weeks agoMerge branch 'yc/xdiff-patience-optim'
Junio C Hamano [Mon, 8 Dec 2025 22:54:55 +0000 (07:54 +0900)] 
Merge branch 'yc/xdiff-patience-optim'

The way patience diff finds LCS has been optimized.

* yc/xdiff-patience-optim:
  xdiff: optimize patience diff's LCS search

2 weeks agoMerge branch 'bc/zsh-testsuite'
Junio C Hamano [Mon, 8 Dec 2025 22:54:54 +0000 (07:54 +0900)] 
Merge branch 'bc/zsh-testsuite'

A few tests have been updated to work under the shell compatible
mode of zsh.

* bc/zsh-testsuite:
  t5564: fix test hang under zsh's sh mode
  t0614: use numerical comparison with test_line_count

2 weeks agoMerge branch 'pw/replay-exclude-gpgsig-fix'
Junio C Hamano [Mon, 8 Dec 2025 22:54:53 +0000 (07:54 +0900)] 
Merge branch 'pw/replay-exclude-gpgsig-fix'

"git replay" forgot to omit the "gpgsig-sha256" extended header
from the resulting commit the same way it omits "gpgsig", which has
been corrected.

* pw/replay-exclude-gpgsig-fix:
  replay: do not copy "gpgsign-sha256" header

2 weeks agoconfig: document 'gui.GCWarning'
Matthew Hughes [Mon, 8 Dec 2025 19:04:35 +0000 (19:04 +0000)] 
config: document 'gui.GCWarning'

While investigating the config options set by 'scalar' I noticed this
one wasn't documented.

Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agodoc: send-email: fix broken list continuation
Kristoffer Haugsbakk [Mon, 8 Dec 2025 17:41:01 +0000 (18:41 +0100)] 
doc: send-email: fix broken list continuation

The list continuation has to be “immediately adjacent to the block
being attached”.[1]

[1]: https://web.archive.org/web/20251208172615/https://docs.asciidoctor.org/asciidoc/latest/lists/continuation/

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoconnect: plug protocol capability leak
Junio C Hamano [Sun, 7 Dec 2025 04:40:46 +0000 (13:40 +0900)] 
connect: plug protocol capability leak

When pushing to a set of remotes using a nickname for the group, the
client initializes the connection to each remote, talks to the
remote and reads and parses capabilities line, and holds the
capabilities in a file-scope static variable server_capabilities_v1.

There are a few other such file-scope static variables, and these
connections cannot be parallelized until they are refactored to a
structure that keeps track of active connections.

Which is *not* the theme of this patch ;-)

For a single connection, the server_capabilities_v1 variable is
initialized to NULL (at the program initialization), populated when
we talk to the other side, used to look up capabilities of the other
side possibly multiple times, and the memory is held by the variable
until program exit, without leaking.  When talking to multiple remotes,
however, the server capabilities from the second connection overwrites
without freeing the one from the first connection, which leaks.

    ==1080970==ERROR: LeakSanitizer: detected memory leaks

    Direct leak of 421 byte(s) in 2 object(s) allocated from:
#0 0x5615305f849e in strdup (/home/gitster/g/git-jch/bin/bin/git+0x2b349e) (BuildId: 54d149994c9e85374831958f694bd0aa3b8b1e26)
#1 0x561530e76cc4 in xstrdup /home/gitster/w/build/wrapper.c:43:14
#2 0x5615309cd7fa in process_capabilities /home/gitster/w/build/connect.c:243:27
#3 0x5615309cd502 in get_remote_heads /home/gitster/w/build/connect.c:366:4
#4 0x561530e2cb0b in handshake /home/gitster/w/build/transport.c:372:3
#5 0x561530e29ed7 in get_refs_via_connect /home/gitster/w/build/transport.c:398:9
#6 0x561530e26464 in transport_push /home/gitster/w/build/transport.c:1421:16
#7 0x561530800bec in push_with_options /home/gitster/w/build/builtin/push.c:387:8
#8 0x5615307ffb99 in do_push /home/gitster/w/build/builtin/push.c:442:7
#9 0x5615307fe926 in cmd_push /home/gitster/w/build/builtin/push.c:664:7
#10 0x56153065673f in run_builtin /home/gitster/w/build/git.c:506:11
#11 0x56153065342f in handle_builtin /home/gitster/w/build/git.c:779:9
#12 0x561530655b89 in run_argv /home/gitster/w/build/git.c:862:4
#13 0x561530652cba in cmd_main /home/gitster/w/build/git.c:984:19
#14 0x5615308dda0a in main /home/gitster/w/build/common-main.c:9:11
#15 0x7f051651bca7 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16

    SUMMARY: AddressSanitizer: 421 byte(s) leaked in 2 allocation(s).

Free the capablities data for the previous server before overwriting
it with the next server to plug this leak.

The added test fails without the freeing with SANITIZE=leak; I
somehow couldn't get it fail reliably with SANITIZE=leak,address
though.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agodoc: join default pre-commit paragraphs
Kristoffer Haugsbakk [Mon, 8 Dec 2025 07:27:11 +0000 (08:27 +0100)] 
doc: join default pre-commit paragraphs

Join two paragraphs that start with the standard “The default <hook>,
when enabled” into one and put it at the end of the “pre-commit”
section.

The trailing whitespace paragraph was added in the first commit for the
doc, in 6d35cc76 (Document hooks., 2005-09-02). Then 3e14dd2c (mention
use of "hooks.allownonascii" in "man githooks", 2019-02-20) updated the
“pre-commit” section to mention the non-ASCII check that was added in
d00e364d.[1] But this paragraph was added one-past the original
“default” paragraph, after the env. variable paragraph, and starts
exactly the same. That causes the flow of this section to feel
off (paragraphs in order):

1. Invoked by <cmd> and what parameters it takes
2. The default 'pre-commit' hook catches introduction of trailing
   whitespace
3. `GIT_EDITOR=:`
4. The default pre-commit' hook catches introduction of non-ASCII
   filenames

Let’s instead join these two paragrahs and explain the whole behavior of
the default script.

† 1: Extend sample pre-commit hook to check for non ascii filenames,
     2009-05-19

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocompletion: clarify support for short options and arguments
Junio C Hamano [Sun, 7 Dec 2025 01:03:56 +0000 (10:03 +0900)] 
completion: clarify support for short options and arguments

The list of supported completions in the header of the file was
mostly written a long time ago when Shawn added the initial version
of this script in 2006.  The list explicitly states that we complete
"common --long-options", which implies that we do not complete
not-so-common ones and single letter options (this text dates back
to May 2007).

Update the description to explicitly state that single-letter
options are not completed.  Also, document that arguments to options
are completed, even for single-letter options (e.g., "git -c <TAB>"
offers configuration variables).

The reason why we do not complete single-letter options is because
it does not seem to help all that much to learn that the command
takes -c, -d, -e options when "git foo -<TAB>" offers these three,
unlike long options that is easier to guess what they are about.

Because this rationale is primarily for our developers, let's leave
it out of the completion script itself, whose messages are entirely
for end-users.  Our developers can run "git blame" to find this
commit as needed.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocompat: remove gitmkdtemp()
René Scharfe [Sat, 6 Dec 2025 13:35:39 +0000 (14:35 +0100)] 
compat: remove gitmkdtemp()

gitmkdtemp() has become a trivial wrapper around git_mkdtemp().  Remove
this now unnecessary layer of indirection.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agobanned.h: ban mktemp(3)
René Scharfe [Sat, 6 Dec 2025 13:29:43 +0000 (14:29 +0100)] 
banned.h: ban mktemp(3)

Older versions of mktemp(3) generate easily guessable file names.  The
function checks if the generated name is used, which is unreliable, as
a file with that name might then be created by some other process before
we can do it ourselves.  The function was dropped from POSIX due to its
security problems.  Forbid its use.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocompat: remove mingw_mktemp()
René Scharfe [Sat, 6 Dec 2025 13:28:26 +0000 (14:28 +0100)] 
compat: remove mingw_mktemp()

Remove the mktemp(3) compatibility function now that its last caller was
removed by the previous commit.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocompat: use git_mkdtemp()
René Scharfe [Sat, 6 Dec 2025 13:27:47 +0000 (14:27 +0100)] 
compat: use git_mkdtemp()

A file might appear at the path returned by mktemp(3) before we call
mkdir(2).  Use the more robust git_mkdtemp() instead, which retries a
number of times and doesn't need to call lstat(2).

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agowrapper: add git_mkdtemp()
René Scharfe [Sat, 6 Dec 2025 13:27:39 +0000 (14:27 +0100)] 
wrapper: add git_mkdtemp()

Extend git_mkstemps_mode() to optionally call mkdir(2) instead of
open(2), then use that ability to create a mkdtemp(3) replacement,
git_mkdtemp().  We'll start using it in the next commit.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoThe sixth batch
Junio C Hamano [Fri, 5 Dec 2025 05:49:13 +0000 (14:49 +0900)] 
The sixth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'rs/config-set-multi-error-message-fix'
Junio C Hamano [Fri, 5 Dec 2025 05:49:59 +0000 (14:49 +0900)] 
Merge branch 'rs/config-set-multi-error-message-fix'

The error message given by "git config set", when the variable
being updated has more than one values defined, used old style "git
config" syntax with an incorrect option in its hint, both of which
have been corrected.

* rs/config-set-multi-error-message-fix:
  config: fix suggestion for failed set of multi-valued option

2 weeks agoMerge branch 'rs/config-unset-opthelp-fix'
Junio C Hamano [Fri, 5 Dec 2025 05:49:59 +0000 (14:49 +0900)] 
Merge branch 'rs/config-unset-opthelp-fix'

The option help text given by "git config unset -h" described
the "--all" option to "replace", not "unset", multiple variables,
which has been corrected.

* rs/config-unset-opthelp-fix:
  config: fix short help of unset flags

2 weeks agoMerge branch 'ps/object-source-management'
Junio C Hamano [Fri, 5 Dec 2025 05:49:58 +0000 (14:49 +0900)] 
Merge branch 'ps/object-source-management'

Code refactoring around object database sources.

* ps/object-source-management:
  odb: handle recreation of quarantine directories
  odb: handle changing a repository's commondir
  chdir-notify: add function to unregister listeners
  odb: handle initialization of sources in `odb_new()`
  http-push: stop setting up `the_repository` for each reference
  t/helper: stop setting up `the_repository` repeatedly
  builtin/index-pack: fix deferred fsck outside repos
  oidset: introduce `oidset_equal()`
  odb: move logic to disable ref updates into repo
  odb: refactor `odb_clear()` to `odb_free()`
  odb: adopt logic to close object databases
  setup: convert `set_git_dir()` to have file scope
  path: move `enter_repo()` into "setup.c"

2 weeks agoMerge branch 'cc/fast-import-strip-if-invalid'
Junio C Hamano [Fri, 5 Dec 2025 05:49:58 +0000 (14:49 +0900)] 
Merge branch 'cc/fast-import-strip-if-invalid'

"git fast-import" learns "--strip-if-invalid" option to drop
invalid cryptographic signature from objects.

* cc/fast-import-strip-if-invalid:
  fast-import: add 'strip-if-invalid' mode to --signed-commits=<mode>
  commit: refactor verify_commit_buffer()
  fast-import: refactor finalize_commit_buffer()

2 weeks agoMerge branch 'js/ci-show-breakage-in-dockerized-jobs'
Junio C Hamano [Fri, 5 Dec 2025 05:49:58 +0000 (14:49 +0900)] 
Merge branch 'js/ci-show-breakage-in-dockerized-jobs'

Dockerised jobs at the GitHub Actions CI have been taught to show
more details of failed tests.

* js/ci-show-breakage-in-dockerized-jobs:
  ci(dockerized): do show the result of failing tests again

2 weeks agoMerge branch 'kh/doc-committer-date-is-author-date'
Junio C Hamano [Fri, 5 Dec 2025 05:49:57 +0000 (14:49 +0900)] 
Merge branch 'kh/doc-committer-date-is-author-date'

The "--committer-date-is-author-date" option of "git am/rebase" is
a misguided one.  The documentation is updated to discourage its
use.

* kh/doc-committer-date-is-author-date:
  doc: warn against --committer-date-is-author-date

2 weeks agoMerge branch 'jc/optional-path'
Junio C Hamano [Fri, 5 Dec 2025 05:49:56 +0000 (14:49 +0900)] 
Merge branch 'jc/optional-path'

"git config get --path" segfaulted on an ":(optional)path" that
does not exist, which has been corrected.

* jc/optional-path:
  config: really treat missing optional path as not configured
  config: really pretend missing :(optional) value is not there
  config: mark otherwise unused function as file-scope static

2 weeks agoMerge branch 'js/strip-scalar-too'
Junio C Hamano [Fri, 5 Dec 2025 05:49:56 +0000 (14:49 +0900)] 
Merge branch 'js/strip-scalar-too'

"make strip" has been taught to strip "scalar" as well as "git".

* js/strip-scalar-too:
  make strip: include `scalar`

2 weeks agoMerge branch 'en/xdiff-cleanup-2'
Junio C Hamano [Fri, 5 Dec 2025 05:49:56 +0000 (14:49 +0900)] 
Merge branch 'en/xdiff-cleanup-2'

Code clean-up.

* en/xdiff-cleanup-2:
  xdiff: rename rindex -> reference_index
  xdiff: change rindex from long to size_t in xdfile_t
  xdiff: make xdfile_t.nreff a size_t instead of long
  xdiff: make xdfile_t.nrec a size_t instead of long
  xdiff: split xrecord_t.ha into line_hash and minimal_perfect_hash
  xdiff: use unambiguous types in xdl_hash_record()
  xdiff: use size_t for xrecord_t.size
  xdiff: make xrecord_t.ptr a uint8_t instead of char
  xdiff: use ptrdiff_t for dstart/dend
  doc: define unambiguous type mappings across C and Rust

2 weeks agorepo: add -z as an alias for --format=nul to git-repo-structure
Lucas Seiki Oshiro [Thu, 4 Dec 2025 20:10:12 +0000 (17:10 -0300)] 
repo: add -z as an alias for --format=nul to git-repo-structure

Other Git commands that have nul-terminated output, such as git-config,
git-status, git-ls-files, and git-repo-info have a flag `-z` for using
the null character as the record separator.

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

Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agorepo: use [--format=... | -z] instead of [-z] in git-repo-info synopsis
Lucas Seiki Oshiro [Thu, 4 Dec 2025 20:10:11 +0000 (17:10 -0300)] 
repo: use [--format=... | -z] instead of [-z] in git-repo-info synopsis

The flag -z is only an alias for --format=null and even though --format
and -z can be used together and repeated, only the last one is
considered.

Replace `[-z]` in the synopsis of git-repo-info by
`[--format=... | -z]`, expliciting that the use of one of those flags
replace the other.

Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agorepo: remove blank line from Documentation/git-repo.adoc
Lucas Seiki Oshiro [Thu, 4 Dec 2025 20:10:10 +0000 (17:10 -0300)] 
repo: remove blank line from Documentation/git-repo.adoc

There was an extra blank line in git-repo-structure documentation, which
led to an unwawnted '+' character after generating an HTML or PDF from
that page. This can be seen, for example, in Git 2.52.0 online docs [1].

Remove that extra line.

[1] https://git-scm.com/docs/git-repo/2.52.0

Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agomeson: use is_cross_build() where possible
Toon Claes [Wed, 3 Dec 2025 14:53:31 +0000 (15:53 +0100)] 
meson: use is_cross_build() where possible

In previous commit the first use of meson.can_run_host_binaries() was
introduced. This is a guard around compiler.run() to ensure it's
actually possible to execute the provided.

In other places we've been having the same issue, but here `not
meson.is_cross_build()` is used as guard. This does the trick, but it
also prevents the code from running even when an exe_wrapper is
configured.

Switch to using meson.can_run_host_binaries() here as well.

There is another place left that still uses `not
meson.is_cross_build()`, but here it's a guard around fs.exists(). That
function will always run on the build machine, so checking for
cross-compilation is still in place here.

Signed-off-by: Toon Claes <toon@iotcl.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agomeson: only detect ICONV_OMITS_BOM if possible
Toon Claes [Tue, 2 Dec 2025 10:48:09 +0000 (11:48 +0100)] 
meson: only detect ICONV_OMITS_BOM if possible

In our Meson setup it automatically detects whether ICONV_OMITS_BOM
should be defined. To check this, a piece of code is compiled and ran.

When cross-compiling, it's not possible to run this piece of code. Guard
this test with a can_run_host_binaries() check to ensure it can run.

Signed-off-by: Toon Claes <toon@iotcl.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agomeson: ignore subprojects/.wraplock
Toon Claes [Tue, 2 Dec 2025 10:48:08 +0000 (11:48 +0100)] 
meson: ignore subprojects/.wraplock

When asking Meson to wrap subprojects, it generates a .wraplock file in
the subprojects/ directory. Ignore this file.

See also https://github.com/mesonbuild/meson/issues/14948.

Signed-off-by: Toon Claes <toon@iotcl.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agolast-modified: support sparse checkouts
Johannes Schindelin [Sat, 29 Nov 2025 13:43:46 +0000 (13:43 +0000)] 
last-modified: support sparse checkouts

In a sparse checkout, a user might want to run `last-modified` on a
directory outside the worktree.

And even in non-sparse checkouts, a user might need to run that command
on a directory that does not exist in the worktree.

These use cases should be supported via the `--` separator between
revision and file arguments, which is even advertised in the
documentation. This patch fixes a tiny bug that prevents that from
working.

This fixes https://github.com/git-for-windows/git/issues/5978

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Derrick Stolee <stolee@gmail.com>
Acked-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agodoc: git-pull: fix 'git --rebase abort' typo
Julia Evans [Wed, 3 Dec 2025 15:34:55 +0000 (15:34 +0000)] 
doc: git-pull: fix 'git --rebase abort' typo

An earlier commit e9d221b0 (doc: git-pull: clarify how to exit a
conflicted merge, 2025-10-15) misspelt `git rebase --abort` to
`git --rebase abort`.  Fix it.

Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agodoc: remove stray text in Git data model
Julia Evans [Tue, 2 Dec 2025 18:11:24 +0000 (18:11 +0000)] 
doc: remove stray text in Git data model

I meant to delete this sentence fragment when rewriting this paragraph,
but accidentally left it in. It's repetitive (since it was meant to be
deleted) and it's causing some formatting issues with the note.

Signed-off-by: Julia Evans <julia@jvns.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agobranch: advice using git-help(1) instead of man(1)
Kristoffer Haugsbakk [Tue, 2 Dec 2025 15:56:51 +0000 (16:56 +0100)] 
branch: advice using git-help(1) instead of man(1)

8fbd903e (branch: advise about ref syntax rules, 2024-03-05) added
an advice about checking git-check-ref-format(1) for the ref syntax
rules. The advice uses man(1). But git(1) is a multi-platform tool and
man(1) may not be available on some platforms. It might also be slightly
jarring to see a suggestion for running a command which is not from
the Git suite.

Let’s instead use git-help(1) in order to stay inside the land of
git(1). This also means that `help.format` (for `man`, `html` or other
formats) will be used if set.

Also change to using single quotes (') to quote the command since that
is more conventional.

While here let’s also update the test to use `{SQ}`, which is more
readable and easier to edit.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoThe fifth batch
Junio C Hamano [Mon, 1 Dec 2025 02:31:24 +0000 (18:31 -0800)] 
The fifth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>