]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
22 hours agoSync with 'master' next
Junio C Hamano [Tue, 30 Dec 2025 04:01:46 +0000 (13:01 +0900)] 
Sync with 'master'

22 hours agoMerge branch 'rs/parse-config-expiry-simplify' into next
Junio C Hamano [Tue, 30 Dec 2025 04:01:36 +0000 (13:01 +0900)] 
Merge branch 'rs/parse-config-expiry-simplify' into next

Code clean-up.

* rs/parse-config-expiry-simplify:
  config: use git_parse_int() in git_config_get_expiry_in_days()

22 hours agoThe 14th batch main master
Junio C Hamano [Mon, 29 Dec 2025 08:43:28 +0000 (17:43 +0900)] 
The 14th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
22 hours agoMerge branch 'jk/test-curl-updates'
Junio C Hamano [Tue, 30 Dec 2025 03:58:22 +0000 (12:58 +0900)] 
Merge branch 'jk/test-curl-updates'

Update HTTP tests to adjust for changes in curl 8.18.0

* jk/test-curl-updates:
  t5563: add missing end-of-line in HTTP header
  t5551: handle trailing slashes in expected cookies output

22 hours agoMerge branch 'jc/object-read-stream-fix'
Junio C Hamano [Tue, 30 Dec 2025 03:58:21 +0000 (12:58 +0900)] 
Merge branch 'jc/object-read-stream-fix'

Fix a performance regression in recently graduated topic.

* jc/object-read-stream-fix:
  odb: do not use "blank" substitute for NULL

22 hours agoMerge branch 'js/test-func-comment-fix'
Junio C Hamano [Tue, 30 Dec 2025 03:58:21 +0000 (12:58 +0900)] 
Merge branch 'js/test-func-comment-fix'

Comment fix.

* js/test-func-comment-fix:
  test_detect_ref_format: fix comment

22 hours agoMerge branch 'gf/clear-path-cache-cleanup'
Junio C Hamano [Tue, 30 Dec 2025 03:58:21 +0000 (12:58 +0900)] 
Merge branch 'gf/clear-path-cache-cleanup'

Code clean-up.

* gf/clear-path-cache-cleanup:
  repository: remove duplicate free of cache->squash_msg

22 hours agoMerge branch 'gf/maintenance-is-needed-fix'
Junio C Hamano [Tue, 30 Dec 2025 03:58:20 +0000 (12:58 +0900)] 
Merge branch 'gf/maintenance-is-needed-fix'

Brown-paper-bag fix to a recently graduated
'kn/maintenance-is-needed' topic.

* gf/maintenance-is-needed-fix:
  refs: dereference the value of the required pointer

22 hours agoMerge branch 'dk/ci-rust-fix'
Junio C Hamano [Tue, 30 Dec 2025 03:58:20 +0000 (12:58 +0900)] 
Merge branch 'dk/ci-rust-fix'

Build fix.

* dk/ci-rust-fix:
  rust: build correctly without GNU sed

22 hours agoMerge branch 'mh/doc-core-attributesfile'
Junio C Hamano [Tue, 30 Dec 2025 03:58:19 +0000 (12:58 +0900)] 
Merge branch 'mh/doc-core-attributesfile'

Doc update.

* mh/doc-core-attributesfile:
  docs: note the type of core.attributesfile

22 hours agoMerge branch 'ps/repack-avoid-noop-midx-rewrite'
Junio C Hamano [Tue, 30 Dec 2025 03:58:19 +0000 (12:58 +0900)] 
Merge branch 'ps/repack-avoid-noop-midx-rewrite'

Even when there is no changes in the packfile and no need to
recompute bitmaps, "git repack" recomputed and updated the MIDX
file, which has been corrected.

* ps/repack-avoid-noop-midx-rewrite:
  midx-write: skip rewriting MIDX with `--stdin-packs` unless needed
  midx-write: extract function to test whether MIDX needs updating
  midx: fix `BUG()` when getting preferred pack without a reverse index

22 hours agoMerge branch 'js/test-symlink-windows'
Junio C Hamano [Tue, 30 Dec 2025 03:58:19 +0000 (12:58 +0900)] 
Merge branch 'js/test-symlink-windows'

Prepare test suite for Git for Windows that supports symbolic
links.

* js/test-symlink-windows:
  t7800: work around the MSYS path conversion on Windows
  t6423: introduce Windows-specific handling for symlinking to /dev/null
  t1305: skip symlink tests that do not apply to Windows
  t1006: accommodate for symlink support in MSYS2
  t0600: fix incomplete prerequisite for a test case
  t0301: another fix for Windows compatibility
  t0001: handle `diff --no-index` gracefully
  mingw: special-case `open(symlink, O_CREAT | O_EXCL)`
  apply: symbolic links lack a "trustable executable bit"
  t9700: accommodate for Windows paths

22 hours agoMerge branch 'jt/doc-rev-list-filter-provided-objects'
Junio C Hamano [Tue, 30 Dec 2025 03:58:19 +0000 (12:58 +0900)] 
Merge branch 'jt/doc-rev-list-filter-provided-objects'

Document "rev-list --filter-provided-objects" better.

* jt/doc-rev-list-filter-provided-objects:
  docs: clarify git-rev-list(1) --filter behavior

22 hours agoMerge branch 'jt/repo-struct-more-objinfo'
Junio C Hamano [Tue, 30 Dec 2025 03:58:19 +0000 (12:58 +0900)] 
Merge branch 'jt/repo-struct-more-objinfo'

More object database related information are shown in "git repo
structure" output.

* jt/repo-struct-more-objinfo:
  builtin/repo: add object disk size info to structure table
  builtin/repo: add disk size info to keyvalue stucture output
  builtin/repo: add inflated object info to structure table
  builtin/repo: add inflated object info to keyvalue structure output
  builtin/repo: humanise count values in structure output
  strbuf: split out logic to humanise byte values
  builtin/repo: group per-type object values into struct

2 days agoSync with 'master'
Junio C Hamano [Sun, 28 Dec 2025 09:15:37 +0000 (18:15 +0900)] 
Sync with 'master'

2 days agoMerge branch 'ar/run-command-hook' into next
Junio C Hamano [Sun, 28 Dec 2025 09:15:28 +0000 (18:15 +0900)] 
Merge branch 'ar/run-command-hook' into next

Use hook API to replace ad-hoc invocation of hook scripts with the
run_command() API.

* ar/run-command-hook:
  receive-pack: convert receive hooks to hook API
  receive-pack: convert update hooks to new API
  hooks: allow callers to capture output
  run-command: allow capturing of collated output
  hook: allow overriding the ungroup option
  reference-transaction: use hook API instead of run-command
  transport: convert pre-push to hook API
  hook: convert 'post-rewrite' hook in sequencer.c to hook API
  hook: provide stdin via callback
  run-command: add stdin callback for parallelization
  run-command: add first helper for pp child states

2 days agoMerge branch 'rs/show-branch-prio-queue' into next
Junio C Hamano [Sun, 28 Dec 2025 09:15:27 +0000 (18:15 +0900)] 
Merge branch 'rs/show-branch-prio-queue' into next

Code clean-up.

* rs/show-branch-prio-queue:
  show-branch: use prio_queue

2 days agoMerge branch 'rs/macos-iconv-workaround' into next
Junio C Hamano [Sun, 28 Dec 2025 09:15:27 +0000 (18:15 +0900)] 
Merge branch 'rs/macos-iconv-workaround' into next

Workaround the "iconv" shipped as part of macOS, which is broken
handling stateful ISO/IEC 2022 encoded strings.

* rs/macos-iconv-workaround:
  macOS: use iconv from Homebrew if needed and present
  macOS: make Homebrew use configurable

2 days agoMerge branch 'bc/checkout-error-message-fix' into next
Junio C Hamano [Sun, 28 Dec 2025 09:15:27 +0000 (18:15 +0900)] 
Merge branch 'bc/checkout-error-message-fix' into next

Message fix.

* bc/checkout-error-message-fix:
  checkout: quote invalid treeish in error message

2 days agoThe 13th batch
Junio C Hamano [Sun, 28 Dec 2025 07:02:48 +0000 (16:02 +0900)] 
The 13th batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoMerge branch 'ap/packfile-promisor-object-optim'
Junio C Hamano [Sun, 28 Dec 2025 08:36:16 +0000 (17:36 +0900)] 
Merge branch 'ap/packfile-promisor-object-optim'

The code path that enumerates promisor objects have been optimized
to skip pointlessly parsing blob objects.

* ap/packfile-promisor-object-optim:
  packfile: skip hash checks in add_promisor_object()
  object: apply skip_hash and discard_tree optimizations to unknown blobs too

2 days agoMerge branch 'ja/doc-misc-fixes'
Junio C Hamano [Sun, 28 Dec 2025 08:36:16 +0000 (17:36 +0900)] 
Merge branch 'ja/doc-misc-fixes'

Various documentation fixes.

* ja/doc-misc-fixes:
  doc: correct minor wording issues
  doc: fix asciidoc markup issues in several files

2 days agoMerge branch 'jc/doc-commit-signoff-config'
Junio C Hamano [Sun, 28 Dec 2025 08:36:16 +0000 (17:36 +0900)] 
Merge branch 'jc/doc-commit-signoff-config'

Documentation update.

* jc/doc-commit-signoff-config:
  signoff-option: linkify the reference to gitfaq
  commit: document that $command.signoff will not be added

2 days agoMerge branch 'jc/c99-fam'
Junio C Hamano [Sun, 28 Dec 2025 08:36:16 +0000 (17:36 +0900)] 
Merge branch 'jc/c99-fam'

Require C99 style flexible array member support from all platforms.

* jc/c99-fam:
  FLEX_ARRAY: require platforms to support the C99 syntax

2 days agoconfig: use git_parse_int() in git_config_get_expiry_in_days()
René Scharfe [Sat, 27 Dec 2025 09:29:35 +0000 (10:29 +0100)] 
config: use git_parse_int() in git_config_get_expiry_in_days()

git_config_get_expiry_in_days() calls git_parse_signed() with the
maximum value of int, which is equivalent to calling git_parse_int().
Do that instead, as its shorter and clearer.

This requires demoting "days" to int to match.  Promote "scale" to
intmax_t in turn to arrive at the same result when multiplying them.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoreceive-pack: convert receive hooks to hook API
Emily Shaffer [Fri, 26 Dec 2025 12:23:34 +0000 (14:23 +0200)] 
receive-pack: convert receive hooks to hook API

This converts the last remaining hooks to the new hook API, for
the same benefits as the previous conversions (no need to toggle
signals, manage custom struct child_process, call find_hook(),
prepares for specifyinig hooks via configs, etc.).

I noticed a performance degradation when processing large amounts
of hook input with just 1 line per callback, due to run-command's
poll loop, therefore I batched 500 lines per callback, to ensure
similar pipe throughput as before and to avoid hook child waiting
on stdin.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoreceive-pack: convert update hooks to new API
Emily Shaffer [Fri, 26 Dec 2025 12:23:33 +0000 (14:23 +0200)] 
receive-pack: convert update hooks to new API

Use the new hook sideband API introduced in the previous commit.

The hook API avoids creating a custom struct child_process and other
internal hook plumbing (e.g. calling find_hook()) and prepares for
the specification of hooks via configs or running parallel hooks.

Execution is still sequential through the current hook.[ch] via the
run_process_parallel_opts.processes=1 arg.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agohooks: allow callers to capture output
Emily Shaffer [Fri, 26 Dec 2025 12:23:32 +0000 (14:23 +0200)] 
hooks: allow callers to capture output

Some server-side hooks will require capturing output to send over
sideband instead of printing directly to stderr. Expose that capability.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agorun-command: allow capturing of collated output
Emily Shaffer [Fri, 26 Dec 2025 12:23:31 +0000 (14:23 +0200)] 
run-command: allow capturing of collated output

Some callers, for example server-side hooks which wish to relay hook
output to clients across a transport, want to capture what would
normally print to stderr and do something else with it. Allow that via a
callback.

By calling the callback regardless of whether there's output available,
we allow clients to send e.g. a keepalive if necessary.

Because we expose a strbuf, not a fd or FILE*, there's no need to create
a temporary pipe or similar - we can just skip the print to stderr and
instead hand it to the caller.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agohook: allow overriding the ungroup option
Adrian Ratiu [Fri, 26 Dec 2025 12:23:30 +0000 (14:23 +0200)] 
hook: allow overriding the ungroup option

When calling run_process_parallel() in run_hooks_opt(), the
ungroup option is currently hardcoded to .ungroup = 1.

This causes problems when ungrouping should be disabled, for
example when sideband-reading collated output from child hooks,
because sideband-reading and ungrouping are mutually exclusive.

Thus a new hook.h option is added to allow overriding.

The existing ungroup=1 behavior is preserved in the run_hooks()
API and the "hook run" command. We could modify these to take
an option if necessary, so I added two code comments there.

Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoreference-transaction: use hook API instead of run-command
Adrian Ratiu [Fri, 26 Dec 2025 12:23:29 +0000 (14:23 +0200)] 
reference-transaction: use hook API instead of run-command

Convert the reference-transaction hook to the new hook API,
so it doesn't need to set up a struct child_process, call
find_hook or toggle the pipe signals.

The stdin feed callback is processing one ref update per
call. I haven't noticed any performance degradation due
to this, however we can batch as many we want in each call,
to ensure a good pipe throughtput (i.e. the child does not
wait after stdin).

Helped-by: Emily Shaffer <nasamuffin@google.com>
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agotransport: convert pre-push to hook API
Emily Shaffer [Fri, 26 Dec 2025 12:23:28 +0000 (14:23 +0200)] 
transport: convert pre-push to hook API

Move the pre-push hook from custom run-command invocations to
the new hook API which doesn't require a custom child_process
structure and signal toggling.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agohook: convert 'post-rewrite' hook in sequencer.c to hook API
Emily Shaffer [Fri, 26 Dec 2025 12:23:27 +0000 (14:23 +0200)] 
hook: convert 'post-rewrite' hook in sequencer.c to hook API

Replace the custom run-command calls used by post-rewrite with
the newer and simpler hook_run_opt(), which does not need to
create a custom 'struct child_process' or call find_hook().

Another benefit of using the hook API is that hook_run_opt()
handles the SIGPIPE toggle logic.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agohook: provide stdin via callback
Emily Shaffer [Fri, 26 Dec 2025 12:23:26 +0000 (14:23 +0200)] 
hook: provide stdin via callback

This adds a callback mechanism for feeding stdin to hooks alongside
the existing path_to_stdin (which slurps a file's content to stdin).

The advantage of this new callback is that it can feed stdin without
going through the FS layer. This helps when feeding large amount of
data and uses the run-command parallel stdin callback introduced in
the preceding commit.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agorun-command: add stdin callback for parallelization
Emily Shaffer [Fri, 26 Dec 2025 12:23:25 +0000 (14:23 +0200)] 
run-command: add stdin callback for parallelization

If a user of the run_processes_parallel() API wants to pipe a large
amount of information to the stdin of each parallel command, that
data could exceed the pipe buffer of the process's stdin and can be
too big to store in-memory via strbuf & friends or to slurp to a file.

Generally this is solved by repeatedly writing to child_process.in
between calls to start_command() and finish_command(). For a specific
pre-existing example of this, see transport.c:run_pre_push_hook().

This adds a generic callback API to run_processes_parallel() to do
exactly that in a unified manner, similar to the existing callback APIs,
which can then be used by hooks.h to convert the remaining hooks to the
new, simpler parallel interface.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agorun-command: add first helper for pp child states
Adrian Ratiu [Fri, 26 Dec 2025 12:23:24 +0000 (14:23 +0200)] 
run-command: add first helper for pp child states

There is a recurring pattern of testing parallel process child states
and file descriptors to determine if a child is running, receiving any
input or if it's ready for cleanup.

Name the pp_child structure and introduce a first helper to make these
checks more readable. Next commits will add more helpers and checks.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoshow-branch: use prio_queue
René Scharfe [Fri, 26 Dec 2025 07:44:28 +0000 (08:44 +0100)] 
show-branch: use prio_queue

Building a list using commit_list_insert_by_date() has quadratic worst
case complexity.  Avoid it by using prio_queue.

Use prio_queue_peek()+prio_queue_replace() instead of prio_queue_get()+
prio_queue_put() if possible, as the former only rebalance the
prio_queue heap once instead of twice.

In sane repositories this won't make much of a difference because the
number of items in the list or queue won't be very high:

Benchmark 1: ./git_v2.52.0 show-branch origin/main origin/next origin/seen origin/todo
  Time (mean ± σ):     538.2 ms ±   0.8 ms    [User: 527.6 ms, System: 9.6 ms]
  Range (min … max):   537.0 ms … 539.2 ms    10 runs

Benchmark 2: ./git show-branch origin/main origin/next origin/seen origin/todo
  Time (mean ± σ):     530.6 ms ±   0.4 ms    [User: 519.8 ms, System: 9.8 ms]
  Range (min … max):   530.1 ms … 531.3 ms    10 runs

Summary
  ./git show-branch origin/main origin/next origin/seen origin/todo ran
    1.01 ± 0.00 times faster than ./git_v2.52.0 show-branch origin/main origin/next origin/seen origin/todo

That number is not limited, though, and in pathological cases like the
one in p6010 we see a sizable improvement:

Test                      v2.52.0           HEAD
------------------------------------------------------------------
6010.4: git show-branch   2.19(2.19+0.00)   0.03(0.02+0.00) -98.6%

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agomacOS: use iconv from Homebrew if needed and present
René Scharfe [Wed, 24 Dec 2025 08:03:01 +0000 (09:03 +0100)] 
macOS: use iconv from Homebrew if needed and present

The library function iconv(3) supplied with macOS versions 15.7.2
(Sequoia) and 26.1 (Tahoe) is unreliable when doing conversions from
ISO-2022-JP to UTF-8 in multiple steps; t3900 reports this breakage:

  not ok 17 - ISO-2022-JP should be shown in UTF-8 now
  not ok 25 - ISO-2022-JP should be shown in UTF-8 now
  not ok 38 - commit --fixup into ISO-2022-JP from UTF-8

As a workaround, use libiconv from Homebrew, if available.  Search it in
its default locations: /opt/homebrew for Apple Silicon and /usr/local
for macOS Intel, with the former taking precedence.  Respect ICONVDIR if
already set by the user, though.

Helped-by: Koji Nakamaru <koji.nakamaru@gree.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agomacOS: make Homebrew use configurable
René Scharfe [Wed, 24 Dec 2025 08:02:45 +0000 (09:02 +0100)] 
macOS: make Homebrew use configurable

On macOS we opportunistically use Homebrew-installed versions of
gettext(3) and msgfmt(1).  Make that behavior configurable by providing
make variables to disable Homebrew usage (NO_HOMEBREW) and to allow
using a non-default installation location (HOMEBREW_PREFIX).

Include and link only the gettext keg via the symlink opt/gettext
pointing to its installed version instead of using the Homebrew prefix.
This is simpler and prevents accidentally including other libraries.

Suggested-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Suggested-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agocheckout: quote invalid treeish in error message
brian m. carlson [Wed, 24 Dec 2025 20:32:53 +0000 (20:32 +0000)] 
checkout: quote invalid treeish in error message

We received a report that invoking "git restore -source my_base_branch"
resulted in the confusing error message "fatal: could not resolve
ource".  This looked like a typo in our error message, but it is
actually because "-source" is missing its second dash and is being
resolved as "-s ource".  However, due to the lack of the quoting
recommended in CodingGuidelines, this is confusing to the reader and
we can do better.

Add the necessary quoting to this message.  With this change, we now get
this less confusing message:

    fatal: could not resolve 'ource'

Reported-by: Zhelyo Zhelev <zhelyo@gmail.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoSync with 'master'
Junio C Hamano [Tue, 23 Dec 2025 03:20:42 +0000 (12:20 +0900)] 
Sync with 'master'

7 days agoMerge branch 'jk/test-curl-updates' into next
Junio C Hamano [Tue, 23 Dec 2025 03:20:31 +0000 (12:20 +0900)] 
Merge branch 'jk/test-curl-updates' into next

Update HTTP tests to adjust for changes in curl 8.18.0

* jk/test-curl-updates:
  t5563: add missing end-of-line in HTTP header
  t5551: handle trailing slashes in expected cookies output

7 days agoMerge branch 'jc/object-read-stream-fix' into next
Junio C Hamano [Tue, 23 Dec 2025 03:20:30 +0000 (12:20 +0900)] 
Merge branch 'jc/object-read-stream-fix' into next

Fix a performance regression in recently graduated topic.

* jc/object-read-stream-fix:
  odb: do not use "blank" substitute for NULL

8 days agoThe 12th batch
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>
8 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

8 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

8 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

8 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

8 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

8 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

8 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"

8 days agoSync with 'master'
Junio C Hamano [Mon, 22 Dec 2025 05:58:40 +0000 (14:58 +0900)] 
Sync with 'master'

8 days agoMerge branch 'js/test-func-comment-fix' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:31 +0000 (14:58 +0900)] 
Merge branch 'js/test-func-comment-fix' into next

Comment fix.

* js/test-func-comment-fix:
  test_detect_ref_format: fix comment

8 days agoMerge branch 'gf/clear-path-cache-cleanup' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:30 +0000 (14:58 +0900)] 
Merge branch 'gf/clear-path-cache-cleanup' into next

Code clean-up.

* gf/clear-path-cache-cleanup:
  repository: remove duplicate free of cache->squash_msg

8 days agoMerge branch 'gf/maintenance-is-needed-fix' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:29 +0000 (14:58 +0900)] 
Merge branch 'gf/maintenance-is-needed-fix' into next

Brown-paper-bag fix to a recently graduated
'kn/maintenance-is-needed' topic.

* gf/maintenance-is-needed-fix:
  refs: dereference the value of the required pointer

8 days agoMerge branch 'dk/ci-rust-fix' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:29 +0000 (14:58 +0900)] 
Merge branch 'dk/ci-rust-fix' into next

Build fix.

* dk/ci-rust-fix:
  rust: build correctly without GNU sed

8 days agoMerge branch 'mh/doc-core-attributesfile' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:29 +0000 (14:58 +0900)] 
Merge branch 'mh/doc-core-attributesfile' into next

Doc update.

* mh/doc-core-attributesfile:
  docs: note the type of core.attributesfile

8 days agoMerge branch 'ps/repack-avoid-noop-midx-rewrite' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:28 +0000 (14:58 +0900)] 
Merge branch 'ps/repack-avoid-noop-midx-rewrite' into next

Even when there is no changes in the packfile and no need to
recompute bitmaps, "git repack" recomputed and updated the MIDX
file, which has been corrected.

* ps/repack-avoid-noop-midx-rewrite:
  midx-write: skip rewriting MIDX with `--stdin-packs` unless needed
  midx-write: extract function to test whether MIDX needs updating
  midx: fix `BUG()` when getting preferred pack without a reverse index

8 days agoMerge branch 'js/test-symlink-windows' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:28 +0000 (14:58 +0900)] 
Merge branch 'js/test-symlink-windows' into next

Prepare test suite for Git for Windows that supports symbolic
links.

* js/test-symlink-windows:
  t7800: work around the MSYS path conversion on Windows
  t6423: introduce Windows-specific handling for symlinking to /dev/null
  t1305: skip symlink tests that do not apply to Windows
  t1006: accommodate for symlink support in MSYS2
  t0600: fix incomplete prerequisite for a test case
  t0301: another fix for Windows compatibility
  t0001: handle `diff --no-index` gracefully
  mingw: special-case `open(symlink, O_CREAT | O_EXCL)`
  apply: symbolic links lack a "trustable executable bit"
  t9700: accommodate for Windows paths

8 days agoMerge branch 'jt/doc-rev-list-filter-provided-objects' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:28 +0000 (14:58 +0900)] 
Merge branch 'jt/doc-rev-list-filter-provided-objects' into next

Document "rev-list --filter-provided-objects" better.

* jt/doc-rev-list-filter-provided-objects:
  docs: clarify git-rev-list(1) --filter behavior

8 days agoMerge branch 'jt/repo-struct-more-objinfo' into next
Junio C Hamano [Mon, 22 Dec 2025 05:58:28 +0000 (14:58 +0900)] 
Merge branch 'jt/repo-struct-more-objinfo' into next

More object database related information are shown in "git repo
structure" output.

* jt/repo-struct-more-objinfo:
  builtin/repo: add object disk size info to structure table
  builtin/repo: add disk size info to keyvalue stucture output
  builtin/repo: add inflated object info to structure table
  builtin/repo: add inflated object info to keyvalue structure output
  builtin/repo: humanise count values in structure output
  strbuf: split out logic to humanise byte values
  builtin/repo: group per-type object values into struct

8 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>
8 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

8 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

8 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

8 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

8 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

8 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

10 days agoMerge branch 'ja/doc-misc-fixes' into next
Junio C Hamano [Sat, 20 Dec 2025 07:01:23 +0000 (16:01 +0900)] 
Merge branch 'ja/doc-misc-fixes' into next

Various documentation fixes.

* ja/doc-misc-fixes:
  doc: correct minor wording issues
  doc: fix asciidoc markup issues in several files

10 days agodoc: correct minor wording issues
Jean-Noël Avila [Fri, 19 Dec 2025 18:54:16 +0000 (18:54 +0000)] 
doc: correct minor wording issues

* use imperative mood for consistency in options descriptions
* add missing parenthesis
* reword verbose phrase in git-repack.adoc

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agodoc: fix asciidoc markup issues in several files
Jean-Noël Avila [Fri, 19 Dec 2025 18:54:15 +0000 (18:54 +0000)] 
doc: fix asciidoc markup issues in several files

* fix incorrect use of backticks for markup in
  git-checkout.adoc, git-worktree.adoc
* switch tabs to spaces in git-send-email.adoc list items

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agoRevert "Merge branch 'ja/doc-misc-fixes' into next"
Junio C Hamano [Sat, 20 Dec 2025 05:55:10 +0000 (14:55 +0900)] 
Revert "Merge branch 'ja/doc-misc-fixes' into next"

This reverts commit d30d8cac712739fdf30273495895b13b3885e7de, reversing
changes made to 27c9ad156ce9ef349746088cf1c4e394d79c84e1.

11 days agoMerge branch 'jc/doc-commit-signoff-config' into next
Junio C Hamano [Fri, 19 Dec 2025 14:07:02 +0000 (23:07 +0900)] 
Merge branch 'jc/doc-commit-signoff-config' into next

Documentation update.

* jc/doc-commit-signoff-config:
  signoff-option: linkify the reference to gitfaq

11 days agosignoff-option: linkify the reference to gitfaq
Junio C Hamano [Fri, 19 Dec 2025 12:51:01 +0000 (21:51 +0900)] 
signoff-option: linkify the reference to gitfaq

The GitFAQ is a proper manual page in the section 7, so refer to it
using the usual linkgit:stuff[7] syntax.

Helped-by: Kristoffer Haugsbakk
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agorust: build correctly without GNU sed
D. Ben Knoble [Thu, 18 Dec 2025 23:25:44 +0000 (18:25 -0500)] 
rust: build correctly without GNU sed

From e509b5b8be (rust: support for Windows, 2025-10-15), we check
cargo's information to decide which library to build. However, that
check mistakenly used "sed -s" ("consider files as separate rather than
as a single, continuous long stream"), which is a GNU extension. The
build thus fails on macOS with "meson -Drust=enabled", which comes with
BSD-derived sed.

Instead, use the intended "sed -n" and print the matching section of the
output. This failure mode likely went unnoticed on systems with GNU sed
(common for developer machines and CI) because, in those instances, the
output being matched by case is the full cargo output (which either
contains the string "-windows-" or doesn't).

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoMerge branch 'ps/ci-rust' into dk/ci-rust-fix
Junio C Hamano [Fri, 19 Dec 2025 08:57:16 +0000 (17:57 +0900)] 
Merge branch 'ps/ci-rust' into dk/ci-rust-fix

* ps/ci-rust:
  rust: support for Windows
  ci: verify minimum supported Rust version
  ci: check for common Rust mistakes via Clippy
  rust/varint: add safety comments
  ci: check formatting of our Rust code
  ci: deduplicate calls to `apt-get update`
  t8020: fix test failure due to indeterministic tag sorting
  gitlab-ci: upload Meson test logs as JUnit reports
  gitlab-ci: drop workaround for Python certificate store on Windows
  gitlab-ci: ignore failures to disable realtime monitoring
  gitlab-ci: dedup instructions to disable realtime monitoring
  ci: enable Rust for breaking-changes jobs
  ci: convert "pedantic" job into full build with breaking changes
  BreakingChanges: announce Rust becoming mandatory
  varint: reimplement as test balloon for Rust
  varint: use explicit width for integers
  help: report on whether or not Rust is enabled
  Makefile: introduce infrastructure to build internal Rust library
  Makefile: reorder sources after includes
  meson: add infrastructure to build internal Rust library

11 days agorefs: dereference the value of the required pointer
Greg Funni [Thu, 18 Dec 2025 16:10:49 +0000 (16:10 +0000)] 
refs: dereference the value of the required pointer

Currently, this always prints yes because required is non-null.

This is the wrong behavior. The boolean must be
dereferenced.

Signed-off-by: Greg Funni <gfunni234@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agorepository: remove duplicate free of cache->squash_msg
Greg Funni [Thu, 18 Dec 2025 15:49:12 +0000 (15:49 +0000)] 
repository: remove duplicate free of cache->squash_msg

Thankfully, it is set to NULL, so no security consequences.
However, this is still a mistake that must be rectified.

Signed-off-by: Greg Funni <gfunni234@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agotest_detect_ref_format: fix comment
Johannes Schindelin [Thu, 18 Dec 2025 15:20:59 +0000 (15:20 +0000)] 
test_detect_ref_format: fix comment

When 58aaf59133b (t: introduce GIT_TEST_DEFAULT_REF_FORMAT envvar,
2023-12-29) copy-edited the `test_detect_hash` function, the code
comment was accidentally left unchanged. Let's adjust it.

Noticed-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agot5563: add missing end-of-line in HTTP header
Jeff King [Thu, 18 Dec 2025 12:18:19 +0000 (07:18 -0500)] 
t5563: add missing end-of-line in HTTP header

In t5563, we test how various oddly-formatted WWW-Authenticate headers
are passed through curl to git's credential subsystem (and ultimately
out to credential helpers). One test, "access using basic auth with
wwwauth header mixed line-endings" does something odd. It does not mix
line endings at all (which must be CRLF according to the RFC anyway),
but omits the line ending entirely for the final header!

This means that the server produces an incomplete response. We send our
final header, and then the newline which is meant to mark the end of
headers (and the start of the body) becomes the line ending for that
header. And there is no header/body separator in the output at all.

Looking at strace, this is what the client reads:

  recvfrom(9, "WWW-Authenticate: FooBar param1=\"value1\"\r\n \r\n\tparam2=\"value2\"\r\nWWW-Authenticate: Basic realm=\"example.com\"", 16384, 0, NULL, NULL) = 106
  recvfrom(9, "\n", 16384, 0, NULL, NULL) = 1
  recvfrom(9, "", 16384, 0, NULL, NULL) = 0

The headers themselves are produced from the custom-auth.challenge file
we write in the test (which is missing the final CRLF), and then the
header/body separator comes from our lib-httpd/nph-custom-auth.sh CGI.
(Ignore for a moment that it is producing a bare newline, which I think
is a bug; it should be a CRLF but curl is happy with either).

Older versions of curl seemed to be OK with the truncated output, but
the upcoming 8.18.0 release seems to get confused. Specifically, since
67ae101666 (http: unfold response headers earlier, 2025-12-12) our
request to the server fails with insufficient credentials. I traced far
enough to see that curl does relay the header back to us, which we then
pass to a credential helper, which gives us the correct
username/password combination. But on our followup request, curl refuses
to send the Authorization header (and so gets an HTTP 401 again).

The change in curl's behavior is a bit unexpected, but since we are
sending it garbage, it is hard to complain too much. Let's add the
missing CRLF to the header. I _think_ this was just an oversight and not
the intent of the test. And that the "mixed line-endings" really meant
"mixed continuations", since we differ from the previous test in
continuing with both space and tab. So I've likewise updated the test
title to match that assumption.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agot5551: handle trailing slashes in expected cookies output
Jeff King [Thu, 18 Dec 2025 12:13:47 +0000 (07:13 -0500)] 
t5551: handle trailing slashes in expected cookies output

We check in t5551 that curl updates the expected list of cookies after
making a request. We do this by telling it to read and write cookies
from a particular text file, and then checking that after curl runs, the
file has the expected content.

However, in the upcoming curl 8.18.0, the output file has changed
slightly: curl will canonicalize the paths it writes, due to commit
a093c93994 (cookie: only keep and use the canonical cleaned up path,
2025-12-07). In particular, it strips trailing slashes from the paths we
see in the cookies.txt file.

This doesn't matter to Git, as the cookie handling is all internal to
curl. But our test is overly brittle and breaks as a result.

We can fix it by matching either format. We'll expect the new format
(without trailing slashes) and strip the slashes from curl's output
before comparing. That lets us pass with both old and new versions (I
tested against curl's 8_17_0 and rc-8_18_0-2 tags, which are
respectively before and after the curl change).

In theory it might be nice to try to future-proof this test more by
looking only for the bits we care about, rather than a byte-wise
comparison of the whole file. But after removing comments and blank
lines (which we already do), we care about most of what's there. So it's
not clear to me what a more liberal test would look like. Given that the
format doesn't change all that often, it's probably OK to stop here and
see if it ever breaks again.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoodb: do not use "blank" substitute for NULL
Junio C Hamano [Thu, 18 Dec 2025 03:35:40 +0000 (12:35 +0900)] 
odb: do not use "blank" substitute for NULL

When various *object_info() functions are given an extended object
info structure as NULL by a caller that does not want any details,
the code uses a file-scope static blank_oi and passes it down to
the helper functions they use, to avoid handling NULL specifically.

The ps/object-read-stream topic graduated to 'master' recently
however had a bug that assumed that two identically named file-scope
static variables in two functions are the same, which of course is
not the case.  This made "git commit" take 0.38 seconds to 1508
seconds in some case, as reported by Aaron Plattner here:

  https://lore.kernel.org/git/f4ba7e89-4717-4b36-921f-56537131fd69@nvidia.com/

We _could_ move the blank_oi variable to the global scope in common
section to fix this regression, but explicitly handling the NULL is
a much safer fix.  It would also reduce the chance of errors that
somebody accidentally writes into blank_oi, making its contents
dirty, which potentially will make subsequent calls into the
function misbehave.  By explicitly handling NULL input, we no longer
have to worry about it.

Reported-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agoMerge branch 'ap/packfile-promisor-object-optim' into next
Junio C Hamano [Thu, 18 Dec 2025 06:28:28 +0000 (15:28 +0900)] 
Merge branch 'ap/packfile-promisor-object-optim' into next

The code path that enumerates promisor objects have been optimized
to skip pointlessly parsing blob objects.

* ap/packfile-promisor-object-optim:
  packfile: skip hash checks in add_promisor_object()
  object: apply skip_hash and discard_tree optimizations to unknown blobs too

12 days agoMerge branch 'ja/doc-misc-fixes' into next
Junio C Hamano [Thu, 18 Dec 2025 06:28:28 +0000 (15:28 +0900)] 
Merge branch 'ja/doc-misc-fixes' into next

Various documentation fixes.

* ja/doc-misc-fixes:
  doc: flock of small fixes to various documentation files

12 days agoMerge branch 'jc/doc-commit-signoff-config' into next
Junio C Hamano [Thu, 18 Dec 2025 06:28:28 +0000 (15:28 +0900)] 
Merge branch 'jc/doc-commit-signoff-config' into next

Documentation update.

* jc/doc-commit-signoff-config:
  commit: document that $command.signoff will not be added

12 days agoMerge branch 'jc/c99-fam' into next
Junio C Hamano [Thu, 18 Dec 2025 06:28:28 +0000 (15:28 +0900)] 
Merge branch 'jc/c99-fam' into next

Require C99 style flexible array member support from all platforms.

* jc/c99-fam:
  FLEX_ARRAY: require platforms to support the C99 syntax

12 days agoMerge branch 'ps/object-read-stream' into jc/object-read-stream-fix
Junio C Hamano [Thu, 18 Dec 2025 03:21:21 +0000 (12:21 +0900)] 
Merge branch 'ps/object-read-stream' into jc/object-read-stream-fix

* ps/object-read-stream: (32 commits)
  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`
  object-file: refactor writing objects via a stream
  ...

13 days agodocs: note the type of core.attributesfile
Matthew Hughes [Wed, 17 Dec 2025 19:59:55 +0000 (19:59 +0000)] 
docs: note the type of core.attributesfile

The previous wording:

> Path expansions are made the same way as for `core.excludesFile`.

required one to check the docs for 'core.excludesFile' and from there
the definition of the pathname variable type to understand the path
expansion behaviour of this variable. Instead, just link directly to the
pathname type.

This change is basically the same rewording as was done to
'core.excludesFile' in dca83abd (config: describe 'pathname' value
type, 2016-04-29).

Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agobuiltin/repo: add object disk size info to structure table
Justin Tobler [Wed, 17 Dec 2025 17:54:04 +0000 (11:54 -0600)] 
builtin/repo: add object disk size info to structure table

Similar to a prior commit, update the table output format for the
git-repo(1) structure command to display the total object disk usage by
object type.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agobuiltin/repo: add disk size info to keyvalue stucture output
Justin Tobler [Wed, 17 Dec 2025 17:54:03 +0000 (11:54 -0600)] 
builtin/repo: add disk size info to keyvalue stucture output

Similar to a prior commit, extend the keyvalue and nul output formats of
the git-repo(1) structure command to additionally provide info regarding
total object disk sizes by object type.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agobuiltin/repo: add inflated object info to structure table
Justin Tobler [Wed, 17 Dec 2025 17:54:02 +0000 (11:54 -0600)] 
builtin/repo: add inflated object info to structure table

Update the table output format for the git-repo(1) structure command to
begin printing the total inflated object size info by object type. To be
more human-friendly, larger values are scaled down and displayed with
the appropriate unit prefix. Output for the keyvalue and nul formats
remains unchanged.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agobuiltin/repo: add inflated object info to keyvalue structure output
Justin Tobler [Wed, 17 Dec 2025 17:54:01 +0000 (11:54 -0600)] 
builtin/repo: add inflated object info to keyvalue structure output

The structure subcommand for git-repo(1) outputs basic count information
for objects and references. Extend this output to also provide
information regarding total size of inflated objects by object type.

For now, object size by object type info is only added to the keyvalue
and nul output formats. In a subsequent commit, this info is also added
to the table format.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agobuiltin/repo: humanise count values in structure output
Justin Tobler [Wed, 17 Dec 2025 17:54:00 +0000 (11:54 -0600)] 
builtin/repo: humanise count values in structure output

The table output format for the git-repo(1) structure subcommand is used
by default and intended to provide output to users in a human-friendly
manner. When the reference/object count values in a repository are
large, it becomes more cumbersome for users to read the values.

For larger values, update the table output format to instead produce
more human-friendly count values that are scaled down with the
appropriate unit prefix. Output for the keyvalue and nul formats remains
unchanged.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agostrbuf: split out logic to humanise byte values
Justin Tobler [Wed, 17 Dec 2025 17:53:59 +0000 (11:53 -0600)] 
strbuf: split out logic to humanise byte values

In a subsequent commit, byte size values displayed in table output for
the git-repo(1) "structure" subcommand will be shown in a more
human-readable format with the appropriate unit prefixes. For this
usecase, the downscaled values and unit strings must be handled
separately to ensure proper column alignment.

Split out logic from strbuf_humanise() to downscale byte values and
determine the corresponding unit prefix into a separate humanise_bytes()
function that provides seperate value and unit strings.

Note that the "byte" string in "t/helper/test-simple-ipc.c" is unmarked
for translation here so that it doesn't conflict with the newly defined
plural "byte/bytes" translation and instead uses it.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agobuiltin/repo: group per-type object values into struct
Justin Tobler [Wed, 17 Dec 2025 17:53:58 +0000 (11:53 -0600)] 
builtin/repo: group per-type object values into struct

The `object_stats` structure stores object counts by type. In a
subsequent commit, additional per-type object measurements will also be
stored. Group per-type object values into a new struct to allow better
reuse.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agot7800: work around the MSYS path conversion on Windows
Johannes Schindelin [Wed, 17 Dec 2025 14:18:46 +0000 (14:18 +0000)] 
t7800: work around the MSYS path conversion on Windows

Git's test suite's relies on Unix shell scripting, which is
understandable, of course, given Git's firm roots (and indeed, ongoing
focus) on Linux.

This fact, combined with Unix shell scripting's natural
habitat -- which is, naturally... *drumroll*... Unix --
often has unintended side effects, where developers expect the test
suite to run in a Unix environment, which is an incorrect assumption.

One instance of this problem can be observed in the 'difftool --dir-diff
handles modified symlinks' test case in `t7800-difftool.sh`, which
assumes that all absolute paths start with a forward slash. That
assumption is incorrect in general, e.g. on Windows, where absolute
paths have many shapes and forms, none of which starts with a forward
slash.

The only saving grace is that this test case is currently not run on
Windows because of the `SYMLINK` prerequisite. However, I am currently
working towards upstreaming symbolic link support from Git for Windows
to upstream Git, which will put a crack into that saving grace.

Let's change that test case so that it does not rely on absolute paths
(which are passed to the "external command" `ls` as parameters and are
therefore part of its output, and which the test case wants to filter
out before verifying that the output is as expected) starting with a
forward slash. Let's instead rely on the much more reliable fact that
`ls` will output the path in a line that ends in a colon, and simply
filter out those lines by matching said colon instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agot6423: introduce Windows-specific handling for symlinking to /dev/null
Johannes Schindelin [Wed, 17 Dec 2025 14:18:45 +0000 (14:18 +0000)] 
t6423: introduce Windows-specific handling for symlinking to /dev/null

The device `/dev/null` does not exist on Windows, it's called `NUL`
there. Calling `ln -s /dev/null my-symlink` in a symlink-enabled MSYS2
Bash will therefore literally link to a file or directory called `null`
that is supposed to be in the current drive's top-level `dev` directory.
Which typically does not exist.

The test, however, really wants the created symbolic link to point to
the NUL device. Let's instead use the `mklink` utility on Windows to
perform that job, and keep using `ln -s /dev/null <target>` on
non-Windows platforms.

While at it, add the missing `SYMLINKS` prereq because this test _still_
would not pass on Windows before support for symbolic links is
upstreamed from Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agot1305: skip symlink tests that do not apply to Windows
Johannes Schindelin [Wed, 17 Dec 2025 14:18:44 +0000 (14:18 +0000)] 
t1305: skip symlink tests that do not apply to Windows

In Git for Windows, the gitdir is canonicalized so that even when the
gitdir is specified via a symbolic link, the `gitdir:` conditional
include will only match the real directory path.

Unfortunately, t1305 codifies a different behavior in two test cases,
which are hereby skipped on Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agot1006: accommodate for symlink support in MSYS2
Johannes Schindelin [Wed, 17 Dec 2025 14:18:43 +0000 (14:18 +0000)] 
t1006: accommodate for symlink support in MSYS2

The MSYS2 runtime (which inherits this trait from the Cygwin runtime,
and which is used by Git for Windows' Bash to emulate POSIX
functionality on Windows, the same Bash that is also used to run Git's
test suite on Windows) has a mode where it can create native symbolic
links on Windows.

Naturally, this is a bit of a strange feature, given that Cygwin goes
out of its way to support Unix-like paths even if no Win32 program
understands those, and the symbolic links have to use Win32 paths
instead (which Win32 programs understand very well).

As a consequence, the symbolic link targets get normalized before the
links are created.

This results in certain quirks that Git's test suite is ill equipped to
accommodate (because Git's test suite expects to be able to use
Unix-like paths even on Windows).

The test script t1006-cat-file.sh contains two prime examples, two test
cases that need to skip a couple assertions because they are simply
wrong in the context of Git for Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agot0600: fix incomplete prerequisite for a test case
Johannes Schindelin [Wed, 17 Dec 2025 14:18:42 +0000 (14:18 +0000)] 
t0600: fix incomplete prerequisite for a test case

The 'symref transaction supports symlinks' test case is guarded by the
`SYMLINK` prerequisite because `core.prefersymlinkrefs = true` requires
symbolic links to be supported.

However, the `preferSymlinkRefs` feature is not supported on Windows,
therefore this test case needs the `MINGW` prerequisite, too.

There's a couple more cases where we set this config key:

  - In a subsequent test in t0600, but there we explicitly set it to
    "false". So this would naturally be supported by Windows.

  - In t7201 we set the value to `yes`, but we never verify that the
    written reference is a symbolic link in the first place. I guess
    that we could rather remove setting the configuration value here, as
    we are about to deprecate support for symrefs via symbolic links in
    the first place. But that's certainly outside of the scope of this
    patch.

  - In t9903 we do the same, but likewise, we don't check whether the
    written file is a symbolic link.

Therefore this seems to be the only instance where the tests actually
need to be adapted.

Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>