]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
39 hours agoMerge branch 'lm/add-p-context' into next next
Junio C Hamano [Tue, 29 Jul 2025 16:28:50 +0000 (09:28 -0700)] 
Merge branch 'lm/add-p-context' into next

"git add/etc -p" now honors diff.context configuration variable,
and learns to honor -U<n> option.

* lm/add-p-context:
  add-patch: add diff.context command line overrides
  add-patch: respect diff.context configuration
  t: use test_config in t4055
  t: use test_grep in t3701 and t4055

39 hours agoMerge branch 'ps/config-wo-the-repository' into next
Junio C Hamano [Tue, 29 Jul 2025 16:28:49 +0000 (09:28 -0700)] 
Merge branch 'ps/config-wo-the-repository' into next

The config API had a set of convenience wrapper functions that
implicitly use the_repository instance; they have been removed and
inlined at the calling sites.

* ps/config-wo-the-repository: (21 commits)
  config: fix sign comparison warnings
  config: move Git config parsing into "environment.c"
  config: remove unused `the_repository` wrappers
  config: drop `git_config_set_multivar()` wrapper
  config: drop `git_config_get_multivar_gently()` wrapper
  config: drop `git_config_set_multivar_in_file_gently()` wrapper
  config: drop `git_config_set_in_file_gently()` wrapper
  config: drop `git_config_set()` wrapper
  config: drop `git_config_set_gently()` wrapper
  config: drop `git_config_set_in_file()` wrapper
  config: drop `git_config_get_bool()` wrapper
  config: drop `git_config_get_ulong()` wrapper
  config: drop `git_config_get_int()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string_multi()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get()` wrapper
  config: drop `git_config_clear()` wrapper
  ...

39 hours agoMerge branch 'kn/for-each-ref-skip-updates' into next
Junio C Hamano [Tue, 29 Jul 2025 16:28:48 +0000 (09:28 -0700)] 
Merge branch 'kn/for-each-ref-skip-updates' into next

Code clean-up.

* kn/for-each-ref-skip-updates:
  ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'
  t6302: add test combining '--start-after' with '--exclude'
  for-each-ref: reword the documentation for '--start-after'
  for-each-ref: fix documentation argument ordering
  ref-cache: use 'size_t' instead of int for length

39 hours agoMerge branch 'jt/switch-restore-no-longer-experimental' into next
Junio C Hamano [Tue, 29 Jul 2025 16:28:48 +0000 (09:28 -0700)] 
Merge branch 'jt/switch-restore-no-longer-experimental' into next

Declare that "git switch" and "git restore" are no longer
experimental.

* jt/switch-restore-no-longer-experimental:
  builtin: unmark git-switch and git-restore as experimental

39 hours agoMerge branch 'jb/t7510-gpg-program-path' into next
Junio C Hamano [Tue, 29 Jul 2025 16:28:48 +0000 (09:28 -0700)] 
Merge branch 'jb/t7510-gpg-program-path' into next

A new test to ensure that a recent change will keep working.

* jb/t7510-gpg-program-path:
  t7510: use $PWD instead of $(pwd) inside PATH

39 hours agoMerge branch 'cc/t9350-cleanup' into next
Junio C Hamano [Tue, 29 Jul 2025 16:28:47 +0000 (09:28 -0700)] 
Merge branch 'cc/t9350-cleanup' into next

Test clean-up.

* cc/t9350-cleanup:
  t9350: redirect input to only fast-import

39 hours agoMerge branch 'hy/blame-simplify-get-commit-info' into next
Junio C Hamano [Tue, 29 Jul 2025 16:28:47 +0000 (09:28 -0700)] 
Merge branch 'hy/blame-simplify-get-commit-info' into next

Code simplification.

* hy/blame-simplify-get-commit-info:
  blame: remove parameter detailed in get_commit_info()

40 hours agoadd-patch: add diff.context command line overrides
Leon Michalak [Tue, 29 Jul 2025 07:01:51 +0000 (07:01 +0000)] 
add-patch: add diff.context command line overrides

This patch compliments the previous commit, where builtins that use
add-patch infrastructure now respect diff.context and
diff.interHunkContext file configurations.

In particular, this patch helps users who don't want to set persistent
context configurations or just want a way to override them on a one-time
basis, by allowing the relevant builtins to accept corresponding command
line options that override the file configurations.

This mimics commands such as diff and log, which allow for both context
file configuration and command line overrides.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
40 hours agoadd-patch: respect diff.context configuration
Leon Michalak [Tue, 29 Jul 2025 07:01:50 +0000 (07:01 +0000)] 
add-patch: respect diff.context configuration

Various builtins that use add-patch infrastructure do not respect
the user's diff.context and diff.interHunkContext file configurations.

The user may be used to seeing their diffs with customized context size,
but not in the patches "git add -p" shows them to pick from.

Teach add-patch infrastructure to read these configuration variables and
pass their values when spawning the underlying plumbing commands as
their command line option.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
40 hours agot: use test_config in t4055
Leon Michalak [Tue, 29 Jul 2025 07:01:49 +0000 (07:01 +0000)] 
t: use test_config in t4055

Use the modern "test_config" test utility instead of manual"git config"
as the former provides clean up on test completion.

This is a prerequisite to the commits that follow which add to this test
file.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
40 hours agot: use test_grep in t3701 and t4055
Leon Michalak [Tue, 29 Jul 2025 07:01:48 +0000 (07:01 +0000)] 
t: use test_grep in t3701 and t4055

As a preparatory clean-up, use the "test_grep" test utility instead of
regular "grep" which provides better debug information if tests fail.

Signed-off-by: Leon Michalak <leonmichalak6@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
41 hours agot7510: use $PWD instead of $(pwd) inside PATH
Jeff King [Fri, 25 Jul 2025 05:13:09 +0000 (01:13 -0400)] 
t7510: use $PWD instead of $(pwd) inside PATH

On Windows, $(pwd) will give us a Windows-style path like "D:/foo".
Putting that into $PATH confuses anybody parsing that variable, since
colon is a separator character in $PATH. Instead, we should use the
Unix-style value we get from $PWD ("/d/foo").

This is similar to the cases fixed by 71dd50472d (t0021, t5615: use $PWD
instead of $(pwd) in PATH-like shell variables, 2016-11-11).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoblame: remove parameter detailed in get_commit_info()
Han Young [Mon, 28 Jul 2025 03:55:48 +0000 (11:55 +0800)] 
blame: remove parameter detailed in get_commit_info()

The get_commit_info() function accepts a parameter that can be used
to stop the commit parsing early.  However, none of the callers use
this feature, and testing proved that the performance gain of
stopping parsing early is negligible and unmeasurable.

Signed-off-by: Han Young <hanyang.tony@bytedance.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoSync with 'master'
Junio C Hamano [Mon, 28 Jul 2025 21:26:42 +0000 (14:26 -0700)] 
Sync with 'master'

2 days agoMerge branch 'hl/test-helper-fd-close' into next
Junio C Hamano [Mon, 28 Jul 2025 21:26:32 +0000 (14:26 -0700)] 
Merge branch 'hl/test-helper-fd-close' into next

A few file descriptors left unclosed upon program completion in a
few test helper programs are now closed.

* hl/test-helper-fd-close:
  test-delta: close output descriptor after use
  test-delta: use strbufs to hold input files
  test-delta: handle errors with die()
  t/helper/test-truncate: close file descriptor after truncation

2 days agoMerge branch 'ow/rebase-verify-insn-fmt-before-initializing-state' into next
Junio C Hamano [Mon, 28 Jul 2025 21:26:32 +0000 (14:26 -0700)] 
Merge branch 'ow/rebase-verify-insn-fmt-before-initializing-state' into next

"git rebase -i" with bogus rebase.instructionFormat configuration
failed to produce the todo file after recording the state files,
leading to confused "git status"; this has been corrected.

* ow/rebase-verify-insn-fmt-before-initializing-state:
  rebase: write script before initializing state

2 days agoMerge branch 'ps/object-store-midx' into next
Junio C Hamano [Mon, 28 Jul 2025 21:26:31 +0000 (14:26 -0700)] 
Merge branch 'ps/object-store-midx' into next

Redefine where the multi-pack-index sits in the object subsystem,
which recently was restructured to allow multiple backends that
support a single object source that belongs to one repository.  A
midx does span mulitple "object sources".

* ps/object-store-midx:
  midx: remove now-unused linked list of multi-pack indices
  packfile: stop using linked MIDX list in `get_all_packs()`
  packfile: stop using linked MIDX list in `find_pack_entry()`
  packfile: refactor `get_multi_pack_index()` to work on sources
  midx: stop using linked list when closing MIDX
  packfile: refactor `prepare_packed_git_one()` to work on sources
  midx: start tracking per object database source

2 days agoMerge branch 'kn/for-each-ref-skip' into next
Junio C Hamano [Mon, 28 Jul 2025 21:26:30 +0000 (14:26 -0700)] 
Merge branch 'kn/for-each-ref-skip' into next

"git for-each-ref" learns "--skip-until" option to help
applications that want to page its output.

* kn/for-each-ref-skip:
  ref-cache: set prefix_state when seeking

2 days agobuiltin: unmark git-switch and git-restore as experimental
Justin Tobler [Mon, 28 Jul 2025 19:42:18 +0000 (14:42 -0500)] 
builtin: unmark git-switch and git-restore as experimental

In 4e43b7ff (Declare both git-switch and git-restore experimental,
2019-04-25), the newly introduced git-switch(1) and git-restore(1)
commands were marked as experimental. This was done to provide time to
make breaking changes to the interface. It has now been over six years
since these commands were implemented and there hasn't been much change.
Consequently, users have grown to rely on how these commands work and it
is no longer feasible to make any breaking changes.

Let's remove the experimental label for git-switch(1) and
git-restore(1).

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'
Karthik Nayak [Mon, 28 Jul 2025 20:20:50 +0000 (22:20 +0200)] 
ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'

In the commit 51511d68f4 (for-each-ref: introduce a '--start-after'
option, 2025-07-15), for introducing the '--start-after' flag, the
`ref_iterator_seek()` was modified to also accept a flag. This was to
allow the function to also set the prefix when
'REF_ITERATOR_SEEK_SET_PREFIX' was set.

In `do_filter_refs()` instead of passing the flag, we pass in '1' which
is the value of the flag. While this works, this is definitely hard to
read and introduces inconsistency. Change it to use the flag.

While here, remove the unnecessary 'if (prefix)' clause in the 'else'
statement, since the block already checks for 'prefix'.

Reported-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 days agot6302: add test combining '--start-after' with '--exclude'
Karthik Nayak [Mon, 28 Jul 2025 20:20:49 +0000 (22:20 +0200)] 
t6302: add test combining '--start-after' with '--exclude'

The '--start-after' doesn't explicitly mention being compatible with the
'--exclude' flag, generally only incompatibility is explicitly called
out. However, it would be nice to test the compatibility between the
two to avoid future regressions. Let's do that.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agofor-each-ref: reword the documentation for '--start-after'
Karthik Nayak [Mon, 28 Jul 2025 20:20:48 +0000 (22:20 +0200)] 
for-each-ref: reword the documentation for '--start-after'

The documentation for '--start-after' states that the flag cannot be
used with general pattern matching. This is a bit vague, since there is
no clear understanding about what 'general' means here. Rewrite the
sentence to be more specific.

While here, fix a typo in the 'OPT_STRING'.

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 days agofor-each-ref: fix documentation argument ordering
Karthik Nayak [Mon, 28 Jul 2025 20:20:47 +0000 (22:20 +0200)] 
for-each-ref: fix documentation argument ordering

Improve the 'git-for-each-ref(1)' documentation with two corrections:

1. Add parentheses around `--exclude=<pattern>` to indicate this option
   can be repeated as a complete unit.

2. Move `--stdin | <pattern> ...` to the end, after all flags, since
   `<pattern>` is a positional argument that should appear last in the
   argument list.

While here, change to using the synopsis block which will automatically
format placeholders in italics and keywords in monospace.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoref-cache: use 'size_t' instead of int for length
Karthik Nayak [Mon, 28 Jul 2025 20:20:46 +0000 (22:20 +0200)] 
ref-cache: use 'size_t' instead of int for length

The commit 090eb5336c (refs: selectively set prefix in the seek
functions, 2025-07-15) modified the ref-cache iterator to support
seeking to a specified marker without setting the prefix.

The commit adds and uses an integer 'len' to capture the length of the
seek marker to compare with the entries of a given directory. Since the
type of the variable is 'int', this is met with a typecast of converting
a `strlen` to 'int' so it can be assigned to the 'len' variable.

This is whole operation is a bit wrong:
1. Since the 'len' variable is eventually used in a 'strncmp', it should
have been of type 'size_t'.
2. This also truncates the value provided from 'strlen' to an int, which
could cause a large refname to produce a negative number.

Let's do the correct thing here and simply use 'size_t' for `len`.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoThe fifteenth batch main master
Junio C Hamano [Mon, 28 Jul 2025 19:02:20 +0000 (12:02 -0700)] 
The fifteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 days agoMerge branch 'ac/auto-comment-char-fix'
Junio C Hamano [Mon, 28 Jul 2025 19:02:34 +0000 (12:02 -0700)] 
Merge branch 'ac/auto-comment-char-fix'

"git commit" that concludes a conflicted merge failed to notice and remove
existing comment added automatically (like "# Conflicts:") when the
core.commentstring is set to 'auto'.

* ac/auto-comment-char-fix:
  config: set comment_line_str to "#" when core.commentChar=auto
  commit: avoid scanning trailing comments when 'core.commentChar' is "auto"

2 days agoMerge branch 'rs/pop-recent-commit-with-prio-queue'
Junio C Hamano [Mon, 28 Jul 2025 19:02:34 +0000 (12:02 -0700)] 
Merge branch 'rs/pop-recent-commit-with-prio-queue'

The pop_most_recent_commit() function can have quite expensive
worst case performance characteristics, which has been optimized by
using prio-queue data structure.

* rs/pop-recent-commit-with-prio-queue:
  commit: use prio_queue_replace() in pop_most_recent_commit()
  prio-queue: add prio_queue_replace()
  commit: convert pop_most_recent_commit() to prio_queue

2 days agot9350: redirect input to only fast-import
Christian Couder [Fri, 25 Jul 2025 16:05:36 +0000 (18:05 +0200)] 
t9350: redirect input to only fast-import

A number of tests in "t9350-fast-export.sh" are using sub-shells to
redirect content to a number of commands instead of only
`git fast-import`.

This is confusing and possibly error-prone, so let's change those tests
so that no sub-shell is used and the content goes only to
`git fast-import`.

Reported-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agosync with 'master'
Junio C Hamano [Thu, 24 Jul 2025 23:06:42 +0000 (16:06 -0700)] 
sync with 'master'

6 days agoMerge branch 'sk/reftable-clarify-tests' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:24 +0000 (16:06 -0700)] 
Merge branch 'sk/reftable-clarify-tests' into next

The reftable unit tests are now ported to the "clar" unit testing
framework.

* sk/reftable-clarify-tests:
  t/unit-tests: finalize migration of reftable-related tests
  t/unit-tests: convert reftable stack test to use clar
  t/unit-tests: convert reftable record test to use clar
  t/unit-tests: convert reftable readwrite test to use clar
  t/unit-tests: convert reftable table test to use clar
  t/unit-tests: convert reftable pq test to use clar
  t/unit-tests: convert reftable merged test to use clar
  t/unit-tests: convert reftable block test to use clar
  t/unit-tests: convert reftable basics test to use clar test framework
  t/unit-tests: implement clar specific reftable test helper functions

6 days agoMerge branch 'ly/pull-autostash' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:24 +0000 (16:06 -0700)] 
Merge branch 'ly/pull-autostash' into next

"git pull" learned to pay attention to pull.autostash configuration
variable, which overrides rebase/merge.autostash.

* ly/pull-autostash:
  pull: add pull.autoStash config option

6 days agoMerge branch 'jc/document-test-balloons-in-flight' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:23 +0000 (16:06 -0700)] 
Merge branch 'jc/document-test-balloons-in-flight' into next

To help our developers, document what C99 language features are
being considered for adoption, in addition to what past experiments
have already decided.

* jc/document-test-balloons-in-flight:
  CodingGuidelines: document test balloons in flight

6 days agoMerge branch 'ag/imap-send-list-folders-doc' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:23 +0000 (16:06 -0700)] 
Merge branch 'ag/imap-send-list-folders-doc' into next

Document recently added "git imap-send --list" with an example.

* ag/imap-send-list-folders-doc:
  docs: explain how to use `git imap-send --list` command to get a list of available folders

6 days agoMerge branch 'cb/meson-avoid-broken-macos-pcre2' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:22 +0000 (16:06 -0700)] 
Merge branch 'cb/meson-avoid-broken-macos-pcre2' into next

Build fix for macOS.

* cb/meson-avoid-broken-macos-pcre2:
  meson: work around broken system PCRE2 dependency in macOS

6 days agoMerge branch 'jb/t7510-gpg-program-path' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:22 +0000 (16:06 -0700)] 
Merge branch 'jb/t7510-gpg-program-path' into next

A new test to ensure that a recent change will keep working.

* jb/t7510-gpg-program-path:
  t7510: add test cases for non-absolute gpg program

6 days agoMerge branch 'jc/ci-print-test-failures-fix' into next
Junio C Hamano [Thu, 24 Jul 2025 23:06:22 +0000 (16:06 -0700)] 
Merge branch 'jc/ci-print-test-failures-fix' into next

CI fix.

* jc/ci-print-test-failures-fix:
  ci: allow github-actions print test failures again

6 days agoThe fourteenth batch
Junio C Hamano [Thu, 24 Jul 2025 23:03:41 +0000 (16:03 -0700)] 
The fourteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoMerge branch 'bc/contribution-under-non-real-names'
Junio C Hamano [Thu, 24 Jul 2025 23:03:57 +0000 (16:03 -0700)] 
Merge branch 'bc/contribution-under-non-real-names'

Document that we do not require "real" name when signing your
patches off.

* bc/contribution-under-non-real-names:
  SubmittingPatches: allow non-real name contributions

6 days agoMerge branch 'rj/meson-libexecdir-fix'
Junio C Hamano [Thu, 24 Jul 2025 23:03:57 +0000 (16:03 -0700)] 
Merge branch 'rj/meson-libexecdir-fix'

Meson-based build did not handle libexecdir setting correctly,
which has been corrected.

* rj/meson-libexecdir-fix:
  po/meson.build: add missing 'ga' language code
  meson: fix installation when -Dlibexexdir is set

6 days agoMerge branch 'ss/compat-bswap-revamp'
Junio C Hamano [Thu, 24 Jul 2025 23:03:56 +0000 (16:03 -0700)] 
Merge branch 'ss/compat-bswap-revamp'

Clean-up compat/bswap.h mess.

* ss/compat-bswap-revamp:
  bswap.h: provide a built-in based version of bswap32/64 if possible
  bswap.h: remove optimized x86 version of bswap32/64
  bswap.h: always overwrite ntohl/ ntohll macros
  bswap.h: define GIT_LITTLE_ENDIAN on msvc as little endian
  bswap.h: add support for __BYTE_ORDER__

6 days agoMerge branch 'pw/config-kvi-remove-path'
Junio C Hamano [Thu, 24 Jul 2025 23:03:56 +0000 (16:03 -0700)] 
Merge branch 'pw/config-kvi-remove-path'

Remove a redundant member from kvi struct.

* pw/config-kvi-remove-path:
  config: remove unneeded struct field

6 days agoMerge branch 'kl/test-installed-fix'
Junio C Hamano [Thu, 24 Jul 2025 23:03:55 +0000 (16:03 -0700)] 
Merge branch 'kl/test-installed-fix'

GIT_TEST_INSTALLED was not honored in the recent topic related to
SHA256 hashes, which has been corrected.

* kl/test-installed-fix:
  test-lib: respect GIT_TEST_INSTALLED when querying default hash

6 days agoMerge branch 'pw/adopt-c99-bool-officially'
Junio C Hamano [Thu, 24 Jul 2025 23:03:55 +0000 (16:03 -0700)] 
Merge branch 'pw/adopt-c99-bool-officially'

Declare weather-balloon we raised for "bool" type 18 months ago a
success and officially allow using the type in our codebase.

* pw/adopt-c99-bool-officially:
  strbuf: convert predicates to return bool
  git-compat-util: convert string predicates to return bool
  CodingGuidelines: allow the use of bool

6 days agoref-cache: set prefix_state when seeking
Karthik Nayak [Thu, 24 Jul 2025 22:11:36 +0000 (00:11 +0200)] 
ref-cache: set prefix_state when seeking

In 090eb5336c (refs: selectively set prefix in the seek functions,
2025-07-15) we separated the seeking functionality of reference
iterators from the functionality to set prefix to an iterator. This
allows users of ref iterators to seek to a particular reference to
provide pagination support.

The files-backend, uses the ref-cache iterator to iterate over loose
refs. The iterator tracks directories and entries already processed via
a stack of levels. Each level corresponds to a directory under the files
backend. New levels are added to the stack, and when all entries from a
level is yielded, the corresponding level is popped from the stack.

To accommodate seeking, we need to populate and traverse the levels to
stop the requested seek marker at the appropriate level and its entry
index. Each level also contains a 'prefix_state' which is used for
prefix matching, this allows the iterator to skip levels/entries which
don't match a prefix. The default value of 'prefix_state' is
PREFIX_CONTAINS_DIR, which yields all entries within a level. When
purely seeking without prefix matching, we want to yield all entries.
The commit however, skips setting the value explicitly. This causes the
MemorySanitizer to issue a 'use-of-uninitialized-value' error when
running 't/t6302-for-each-ref-filter'.

Set the value explicitly to avoid to fix the issue.

Reported-by: Kyle Lippincott <spectral@google.com>
Helped-by: Kyle Lippincott <spectral@google.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: finalize migration of reftable-related tests
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:37 +0000 (15:28 +0100)] 
t/unit-tests: finalize migration of reftable-related tests

The old `lib-reftable.{c,h}` implemented helper functions for our
homegrown unit-testing framework. As part of migrating reftable-related
tests to the Clar framework, Clar-specific versions of these functions
in `lib-reftable-clar.{c,h}` were introduced.

Now that all test files using these helpers have been converted to Clar,
we can safely remove the original `lib-reftable.{c,h}` and rename the
Clar- specific versions back to `lib-reftable.{c,h}`. This restores a
clean and consistent naming scheme for shared test utilities.

Finally, update our build system to reflect the changes made and remove
redundant code related to the reftable tests and our old homegrown
unit-testing setup. `test-lib.{c,h}` remains unchanged in our build
system as some files particularly `t/helper/test-example-tap.c` depends
on it in order to run, and removing that would be beyond the scope of
this patch.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable stack test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:36 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable stack test to use clar

Adapt reftable stack test file to use clar by using clar assertions
where necessary.

This marks the end of all unit tests migrated away from the
`unit-tests/t-*.c` pattern, there are no longer any files matching that
glob. Remove the sanity check for `t-*.c` files to prevent Meson
configuration errors during CI and local builds.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable record test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:35 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable record test to use clar

Adapt reftable record test file to use clar by using clar assertions
where necessary.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable readwrite test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:34 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable readwrite test to use clar

Adapt reftable readwrite test file to use clar by using clar assertions
where necessary.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable table test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:33 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable table test to use clar

Adapt reftable table test file to use clar by using clar assertions
where necessary.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable pq test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:32 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable pq test to use clar

Adapt reftable priority queue test file to use clar by using clar
assertions where necessary.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable merged test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:31 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable merged test to use clar

Adapt reftable merged test file to use clar testing framework by using
clar assertions where necessary.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable block test to use clar
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:30 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable block test to use clar

Adapt reftable block test file to use clar testing framework by using
clar assertions where necessary.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: convert reftable basics test to use clar test framework
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:29 +0000 (15:28 +0100)] 
t/unit-tests: convert reftable basics test to use clar test framework

Adapt reftable basics test file to clar by using clar assertions
where necessary.Break up test edge case to improve modularity and
clarity.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agot/unit-tests: implement clar specific reftable test helper functions
Seyi Kuforiji [Thu, 24 Jul 2025 14:28:28 +0000 (15:28 +0100)] 
t/unit-tests: implement clar specific reftable test helper functions

Helper functions defined in `t/unit-tests/lib-reftable.{c,h}` are
required for the reftable-related test files to run. In the current
implementation these functions are designed to conform with our
homegrown unit-testing structure. So in other to convert the reftable
test files, there is need for a clar specific implementation of these
helper functions.

Implement equivalent helper functions in `lib-reftable-clar.{c,h}` to
use clar. These functions conform with the clar testing framework and
become available for all reftable-related test files implemented using
the clar testing framework, which requires them. This will be used by
subsequent commits.

Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agotest-delta: close output descriptor after use
Jeff King [Thu, 24 Jul 2025 00:03:08 +0000 (20:03 -0400)] 
test-delta: close output descriptor after use

After we write to the output file, the program exits. This naturally
closes the descriptor. But we should do an explicit close for two
reasons:

  1. It's possible to hit an error on close(), which we should detect
     and report via our exit code.

  2. Leaking descriptors is a bad practice in general. Even if it isn't
     meaningful here, it sets a bad example.

It is tempting to write:

  if (write_in_full(fd, ...) < 0 || close(fd) < 0)
        die_errno(...);

But that pattern contains a subtle problem that has resulted in
descriptor leaks before. If write_in_full() fails, we'll short-circuit
and never call close(), leaking the descriptor.

That's not a problem here, since our error path dies instead of
returning up the stack. But since we're trying to set a good example,
let's write it out as two separate conditions. As a bonus, that lets us
produce a slightly more specific error message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agotest-delta: use strbufs to hold input files
Jeff King [Thu, 24 Jul 2025 00:02:11 +0000 (20:02 -0400)] 
test-delta: use strbufs to hold input files

We want to read the whole contents of two files into memory. If we
switch from raw ptr/len pairs to strbufs, we can use strbuf_read_file()
to shorten the code.

This incidentally fixes two small bugs:

  1. We stat() the files and allocate our buffers based on st.st_size.
     But that is an off_t which may be larger than the size_t we'd use
     to allocate. We should use xsize_t() to do a checked conversion.
     Otherwise integer truncation (on a file >4GB) could cause us to
     under-allocate (though in practice this does not result in a buffer
     overflow because the same truncation happens when read_in_full()
     also takes a size_t).

  2. We get the size from st.st_size, and then try to read_in_full()
     that many bytes. But it may return fewer bytes than expected (if
     the file changed racily and we get an early EOF), leading us to
     read uninitialized bytes in the allocated buffer. We don't notice
     because we only check the value for error, not that we got the
     expected number of bytes.

The strbuf code doesn't run into this, because it just reads to EOF,
expanding the buffer dynamically as necessary. Neither bug is a big deal
for a test helper, but fixing them is a nice bonus on top of simplifying
the code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agotest-delta: handle errors with die()
Jeff King [Thu, 24 Jul 2025 00:00:56 +0000 (20:00 -0400)] 
test-delta: handle errors with die()

This is a short test helper that does all of its work in the main
function. When we encounter an error, we try to clean up memory and
descriptors and then jump to an error return, which exits the program.

We can get the same effect by just calling die(), which means we do not
have to bother with cleaning up. This simplifies the code, and also
removes some inconsistencies where a few code paths forgot to clean up
descriptors (though in practice it was not a big deal since we were
exiting anyway).

In addition to die() and die_errno(), we'll also use a few of our usual
helpers like xopen() and usage() that make things more ergonomic.

This does change the exit code in these cases from 1 to 128, but I
don't think it matters (and arguably is better, as we'd already exit 128
for other errors like xmalloc() failure).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
6 days agoCodingGuidelines: document test balloons in flight
Junio C Hamano [Wed, 23 Jul 2025 19:31:26 +0000 (12:31 -0700)] 
CodingGuidelines: document test balloons in flight

Due to portability concerns, we do not blindly say "It is in [[this
standard]], so we will make liberal use of it" for many features,
and use of C99 language features follow this same principle.  When
we contemplate adopting a language feature that we haven't used in
our codebase, we typically first raise a test balloon, which

 - is a piece of code that exercises the language feature we are
   trying to see if it is OK to adopt

 - is in a small section of code that we know everybody who cares
   about having a working Git must be compiling

 - is in a fairly stable part of the code, to allow reverting it
   easily if some platforms do not understand it yet.

After a few years, with no breakage report from the community, we'd
declare that the feature is now safe to use in our codebase.  Before
that, we forbid the use of the language construct except for the
designated test balloon code site.

The CodingGuidelines document lists these selected features that we
already have determined that they are safe, and also those features
that we know some platforms had trouble with.

Let's also start listing ongoing test balloons and expected timeline
for adoption.  Recently phillip proposed to adopt the syntax to
spell a structure literally (i.e. compound literal) with a new test
balloon, which Patrick made redundant by pointing out an existing
one we had already.but without documenting it.  Start the new section
with an entry for that test balloon.

Helped-by: Patrick Steinhardt <ps@pks.im>
Helped-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoSync with 'master'
Junio C Hamano [Wed, 23 Jul 2025 23:44:58 +0000 (16:44 -0700)] 
Sync with 'master'

7 days agoMerge branch 'jk/unleak-reflog-expire-entry' into next
Junio C Hamano [Wed, 23 Jul 2025 23:44:36 +0000 (16:44 -0700)] 
Merge branch 'jk/unleak-reflog-expire-entry' into next

Leakfix.

* jk/unleak-reflog-expire-entry:
  reflog: close leak of reflog expire entry

7 days agoMerge branch 'jc/do-not-scan-argv-without-parsing' into next
Junio C Hamano [Wed, 23 Jul 2025 23:44:35 +0000 (16:44 -0700)] 
Merge branch 'jc/do-not-scan-argv-without-parsing' into next

Update a hard-to-read in-code NEEDSWORK comment.

* jc/do-not-scan-argv-without-parsing:
  rev-list: update a NEEDSWORK comment

7 days agoMerge branch 'jk/revision-no-early-output' into next
Junio C Hamano [Wed, 23 Jul 2025 23:44:35 +0000 (16:44 -0700)] 
Merge branch 'jk/revision-no-early-output' into next

Remove unsupported, unused, and unsupportable old option from "git
log".

* jk/revision-no-early-output:
  revision: drop early output option

7 days agoMerge branch 'jc/rev-list-info-cleanup' into next
Junio C Hamano [Wed, 23 Jul 2025 23:44:35 +0000 (16:44 -0700)] 
Merge branch 'jc/rev-list-info-cleanup' into next

Move structure definition from unrelated header file to where it
belongs.

* jc/rev-list-info-cleanup:
  rev-list: make "struct rev_list_info" static to the only user

7 days agoThe thirteenth batch
Junio C Hamano [Wed, 23 Jul 2025 22:45:01 +0000 (15:45 -0700)] 
The thirteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoMerge branch 'cc/fast-import-export-signature-names'
Junio C Hamano [Wed, 23 Jul 2025 22:45:16 +0000 (15:45 -0700)] 
Merge branch 'cc/fast-import-export-signature-names'

Clean up the way how signature on commit objects are exported to
and imported from fast-import stream.

* cc/fast-import-export-signature-names:
  fast-(import|export): improve on commit signature output format

7 days agoMerge branch 'ps/sane-ctype-workaround'
Junio C Hamano [Wed, 23 Jul 2025 22:45:16 +0000 (15:45 -0700)] 
Merge branch 'ps/sane-ctype-workaround'

Our <sane-ctype.h> header file relied on that the system-supplied
<ctype.h> header is not later included, which would override our
macro definitions, but "amazon linux" broke this assumption.  Fix
this by preemptively including <ctype.h> near the beginning of
<sane-ctype.h> ourselves.

* ps/sane-ctype-workaround:
  sane-ctype: fix compiler error on Amazon Linux 2

7 days agoMerge branch 'ly/changed-paths-traversal'
Junio C Hamano [Wed, 23 Jul 2025 22:45:15 +0000 (15:45 -0700)] 
Merge branch 'ly/changed-paths-traversal'

Lift the limitation to use changed-path filter in "git log" so that
it can be used for a pathspec with multiple literal paths.

* ly/changed-paths-traversal:
  bloom: optimize multiple pathspec items in revision
  revision: make helper for pathspec to bloom keyvec
  bloom: replace struct bloom_key * with struct bloom_keyvec
  bloom: rename function operates on bloom_key
  bloom: add test helper to return murmur3 hash

7 days agoconfig: fix sign comparison warnings
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:42 +0000 (16:08 +0200)] 
config: fix sign comparison warnings

There are a couple of -Wsign-compare warnings in "config.c":

  - `prepare_include_condition_pattern()` is returns a signed integer,
    where it either returns a negative error code or the index of the
    last dir separator in a path. That index will always be a
    non-negative number, but we cannot just change the return type to a
    `size_t` due to it being re-used as error code. This is fixed by
    splitting up concerns: the return value is only used as error code,
    and the prefix is now returned via an out-pointer. This fixes a sign
    comparison warning when comparing `text.len < prefix`,

  - We treat `struct config_store_data::seen` as signed integer in
    several places even though it's unsigned.

  - There are multiple trivial sign comparison warnings where we use a
    signed loop index to iterate through an unsigned number of items.

Fix all of these issues and drop the `DISABLE_SIGN_COMPARE_WARNINGS`
macro.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: move Git config parsing into "environment.c"
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:41 +0000 (16:08 +0200)] 
config: move Git config parsing into "environment.c"

In "config.c" we host both the business logic to read and write config
files as well as the logic to parse specific Git-related variables. On
the one hand this is mixing concerns, but even more importantly it means
that we cannot easily remove the dependency on `the_repository` in our
config parsing logic.

Move the logic into "environment.c". This file is a grab bag of all
kinds of global state already, so it is quite a good fit. Furthermore,
it also hosts most of the global variables that we're parsing the config
values into, making this an even better fit.

Note that there is one hidden change: in `parse_fsync_components()` we
use an `int` to iterate through `ARRAY_SIZE(fsync_component_names)`. But
as -Wsign-compare warnings are enabled in this file this causes a
compiler warning. The issue is fixed by using a `size_t` instead.

This change allows us to drop the `USE_THE_REPOSITORY_VARIABLE`
declaration.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: remove unused `the_repository` wrappers
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:40 +0000 (16:08 +0200)] 
config: remove unused `the_repository` wrappers

Remove the last couple of wrapper functions that implicitly depend on
`the_repository`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_set_multivar()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:39 +0000 (16:08 +0200)] 
config: drop `git_config_set_multivar()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_set_multivar()`.
All callsites are adjusted so that they use
`repo_config_set_multivar(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_multivar_gently()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:38 +0000 (16:08 +0200)] 
config: drop `git_config_get_multivar_gently()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove
`git_config_get_multivar_gently()`. All callsites are adjusted so that
they use `repo_config_get_multivar_gently(the_repository, ...)` instead.
While some callsites might already have a repository available, this
mechanical conversion is the exact same as the current situation and
thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_set_multivar_in_file_gently()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:37 +0000 (16:08 +0200)] 
config: drop `git_config_set_multivar_in_file_gently()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove
`git_config_set_multivar_in_file_gently()`. All callsites are adjusted
so that they use
`repo_config_set_multivar_in_file_gently(the_repository, ...)` instead.
While some callsites might already have a repository available, this
mechanical conversion is the exact same as the current situation and
thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_set_in_file_gently()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:36 +0000 (16:08 +0200)] 
config: drop `git_config_set_in_file_gently()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove
`git_config_set_in_file_gently()`. All callsites are adjusted so that
they use `repo_config_set_in_file_gently(the_repository, ...)` instead.
While some callsites might already have a repository available, this
mechanical conversion is the exact same as the current situation and
thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_set()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:35 +0000 (16:08 +0200)] 
config: drop `git_config_set()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_set()`. All
callsites are adjusted so that they use `repo_config_set(the_repository,
...)` instead. While some callsites might already have a repository
available, this mechanical conversion is the exact same as the current
situation and thus cannot cause any regression. Those sites should
eventually be cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_set_gently()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:34 +0000 (16:08 +0200)] 
config: drop `git_config_set_gently()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_set_gently()`.
All callsites are adjusted so that they use
`repo_config_set_gently(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_set_in_file()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:33 +0000 (16:08 +0200)] 
config: drop `git_config_set_in_file()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_set_in_file()`.
All callsites are adjusted so that they use
`repo_config_set_in_file(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_bool()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:32 +0000 (16:08 +0200)] 
config: drop `git_config_get_bool()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_bool()`. All
callsites are adjusted so that they use
`repo_config_get_bool(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_ulong()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:31 +0000 (16:08 +0200)] 
config: drop `git_config_get_ulong()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_ulong()`. All
callsites are adjusted so that they use
`repo_config_get_ulong(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_int()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:30 +0000 (16:08 +0200)] 
config: drop `git_config_get_int()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_int()`. All
callsites are adjusted so that they use
`repo_config_get_int(the_repository, ...)` instead. While some callsites
might already have a repository available, this mechanical conversion is
the exact same as the current situation and thus cannot cause any
regression. Those sites should eventually be cleaned up in a later patch
series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_string()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:29 +0000 (16:08 +0200)] 
config: drop `git_config_get_string()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_string()`.
All callsites are adjusted so that they use
`repo_config_get_string(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_string()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:28 +0000 (16:08 +0200)] 
config: drop `git_config_get_string()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_string()`.
All callsites are adjusted so that they use
`repo_config_get_string(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_string_multi()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:27 +0000 (16:08 +0200)] 
config: drop `git_config_get_string_multi()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove
`git_config_get_string_multi()`. All callsites are adjusted so that they
use `repo_config_get_string_multi(the_repository, ...)` instead. While
some callsites might already have a repository available, this
mechanical conversion is the exact same as the current situation and
thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_value()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:26 +0000 (16:08 +0200)] 
config: drop `git_config_get_value()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_value()`. All
callsites are adjusted so that they use
`repo_config_get_value(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get_value()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:25 +0000 (16:08 +0200)] 
config: drop `git_config_get_value()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_value()`. All
callsites are adjusted so that they use
`repo_config_get_value(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_get()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:24 +0000 (16:08 +0200)] 
config: drop `git_config_get()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get()`. All
callsites are adjusted so that they use `repo_config_get(the_repository,
...)` instead. While some callsites might already have a repository
available, this mechanical conversion is the exact same as the current
situation and thus cannot cause any regression. Those sites should
eventually be cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config_clear()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:23 +0000 (16:08 +0200)] 
config: drop `git_config_clear()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_clear()`. All
callsites are adjusted so that they use
`repo_config_clear(the_repository, ...)` instead. While some callsites
might already have a repository available, this mechanical conversion is
the exact same as the current situation and thus cannot cause any
regression. Those sites should eventually be cleaned up in a later patch
series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoconfig: drop `git_config()` wrapper
Patrick Steinhardt [Wed, 23 Jul 2025 14:08:22 +0000 (16:08 +0200)] 
config: drop `git_config()` wrapper

In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config()`. All callsites
are adjusted so that they use `repo_config(the_repository, ...)`
instead. While some callsites might already have a repository available,
this mechanical conversion is the exact same as the current situation
and thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoreflog: close leak of reflog expire entry
Jacob Keller [Tue, 22 Jul 2025 23:18:26 +0000 (16:18 -0700)] 
reflog: close leak of reflog expire entry

find_cfg_ent() allocates a struct reflog_expire_entry_option via
FLEX_ALLOC_MEM and inserts it into a linked list in the
reflog_expire_options structure. The entries in this list are never
freed, resulting in a leak in cmd_reflog_expire and the gc reflog expire
maintenance task:

Direct leak of 39 byte(s) in 1 object(s) allocated from:
    #0 0x7ff975ee6883 in calloc (/lib64/libasan.so.8+0xe6883)
    #1 0x0000010edada in xcalloc ../wrapper.c:154
    #2 0x000000df0898 in find_cfg_ent ../reflog.c:28
    #3 0x000000df0898 in reflog_expire_config ../reflog.c:70
    #4 0x00000095c451 in configset_iter ../config.c:2116
    #5 0x0000006d29e7 in git_config ../config.h:724
    #6 0x0000006d29e7 in cmd_reflog_expire ../builtin/reflog.c:205
    #7 0x0000006d504c in cmd_reflog ../builtin/reflog.c:419
    #8 0x0000007e4054 in run_builtin ../git.c:480
    #9 0x0000007e4054 in handle_builtin ../git.c:746
    #10 0x0000007e8a35 in run_argv ../git.c:813
    #11 0x0000007e8a35 in cmd_main ../git.c:953
    #12 0x000000441e8f in main ../common-main.c:9
    #13 0x7ff9754115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4)
    #14 0x7ff9754116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7)
    #15 0x000000444184 in _start (/home/jekeller/libexec/git-core/git+0x444184)

Close this leak by adding a reflog_clear_expire_config() function which
iterates the linked list and frees its elements. Call it upon exit of
cmd_reflog_expire() and reflog_expire_condition().

Add a basic test which covers this leak. While at it, cover the
functionality from commit commit 3cb22b8efe (Per-ref reflog expiry
configuration, 2008-06-15). We've had this support for years, but lacked
any tests.

Co-developed-by: Jeff King <peff@peff.net>
Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoSync with 'master'
Junio C Hamano [Tue, 22 Jul 2025 21:28:10 +0000 (14:28 -0700)] 
Sync with 'master'

8 days agoMerge branch 'rs/pop-recent-commit-with-prio-queue' into next
Junio C Hamano [Tue, 22 Jul 2025 21:27:51 +0000 (14:27 -0700)] 
Merge branch 'rs/pop-recent-commit-with-prio-queue' into next

The pop_most_recent_commit() function can have quite expensive
worst case performance characteristics, which has been optimized by
using prio-queue data structure.

* rs/pop-recent-commit-with-prio-queue:
  commit: use prio_queue_replace() in pop_most_recent_commit()
  prio-queue: add prio_queue_replace()
  commit: convert pop_most_recent_commit() to prio_queue

8 days agot/helper/test-truncate: close file descriptor after truncation
Hoyoung Lee [Tue, 22 Jul 2025 17:41:01 +0000 (17:41 +0000)] 
t/helper/test-truncate: close file descriptor after truncation

Fix a resource leak where the file descriptor was not closed after
truncating a file in t/helper/test-truncate.c.

Signed-off-by: Hoyoung Lee <lhywkd22@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Tue, 22 Jul 2025 20:30:52 +0000 (13:30 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui: (26 commits)
  git-gui: eliminate _search_exe
  git-gui: remove procs gitexec and _git_cmd
  git-gui: use dashless 'git cmd' form for read/write
  git-gui: default to full copy for linked worktrees
  git-gui: use git-clone
  git-gui: remove non-ttk code
  git-gui: remove ${NS} indirection for ttk
  git-gui: always use themed widgets from ttk
  git-gui: remove redundant check for Tk >= 8.5
  git-gui: remove unreachable Tk 8.4 code
  git-gui: remove unused git-version
  git-gui: use git_init to create new repository dir
  git-gui: git-remote is always available
  git-gui: git merge understands --strategy=recursive
  git-gui: git-diff knows submodules and textconv
  git-gui: git-blame understands -w and textconv
  git-gui: git rev-parse knows show_toplevel
  git-gui: use git-branch --show-current
  git-gui: git-diff-index always knows submodules
  git-gui: git ls-files knows --exclude-standard
  ...

8 days agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Tue, 22 Jul 2025 20:30:21 +0000 (13:30 -0700)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk: (21 commits)
  gitk: remove header of now empty section "General options"
  gitk: separate upstream refs when using the sort-by-type option
  gitk: make 'sort-refs-by-type' optional and persistent
  gitk: sort by ref type on the 'tags and heads' view
  gitk: choosefont - remove a stray debugging line
  gitk: allow horizontal commit-graph scrolling
  gitk: update aqua scrolling for TclTk 8.6 / TIP171
  gitk: update x11 scrolling for TclTk 8.6 / TIP 171
  gitk: update win32 scrolling for Tk 8.6 / TIP 171
  gitk: mousewheel scrolling functions for Tk 8.6
  gitk: wheel scrolling multiplier preference
  gitk: separate x11 / win32 / aqua Mouse bindings
  gitk: remove non-ttk support code
  gitk: replace ${NS} with ttk
  gitk: always use themed Tk (ttk)
  gitk: use $config_variables as list for save/restore
  gitk: remove implementations for Tcl/Tk < 8.6
  gitk: Make TclTk 8.6 the minimum, allow 8.7
  gitk: remove code targeting git <= 1.7.2
  gitk: require git >= 2.20
  ...

8 days agot7510: add test cases for non-absolute gpg program
Jonas Brandstötter [Tue, 22 Jul 2025 19:09:22 +0000 (21:09 +0200)] 
t7510: add test cases for non-absolute gpg program

These cases cover scenarios where `gpg.program` is set as a program in
`$PATH` or as a path relative to the user's home directory.

Signed-off-by: Jonas Brandstötter <jonas.brandstoetter@gmx.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agogitk: remove header of now empty section "General options"
Johannes Sixt [Fri, 18 Jul 2025 20:49:21 +0000 (22:49 +0200)] 
gitk: remove header of now empty section "General options"

An earlier commit remove the only option that was available under
"General options". We don't need the header for the empty section.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
8 days agoMerge branch 'ml/abandon-old-version' (early part)
Johannes Sixt [Tue, 22 Jul 2025 16:29:54 +0000 (18:29 +0200)] 
Merge branch 'ml/abandon-old-version' (early part)

* 'ml/abandon-old-version' (early part):
  gitk: allow horizontal commit-graph scrolling
  gitk: update aqua scrolling for TclTk 8.6 / TIP171
  gitk: update x11 scrolling for TclTk 8.6 / TIP 171
  gitk: update win32 scrolling for Tk 8.6 / TIP 171
  gitk: mousewheel scrolling functions for Tk 8.6
  gitk: wheel scrolling multiplier preference
  gitk: separate x11 / win32 / aqua Mouse bindings
  gitk: remove non-ttk support code
  gitk: replace ${NS} with ttk
  gitk: always use themed Tk (ttk)
  gitk: use $config_variables as list for save/restore
  gitk: remove implementations for Tcl/Tk < 8.6
  gitk: Make TclTk 8.6 the minimum, allow 8.7
  gitk: remove code targeting git <= 1.7.2
  gitk: require git >= 2.20

8 days agoMerge branch 'mr/sort-refs-by-type'
Johannes Sixt [Tue, 22 Jul 2025 16:13:31 +0000 (18:13 +0200)] 
Merge branch 'mr/sort-refs-by-type'

* mr/sort-refs-by-type:
  gitk: separate upstream refs when using the sort-by-type option
  gitk: make 'sort-refs-by-type' optional and persistent
  gitk: sort by ref type on the 'tags and heads' view

8 days agoMerge branch 'ti/support-sha256'
Johannes Sixt [Tue, 22 Jul 2025 16:04:55 +0000 (18:04 +0200)] 
Merge branch 'ti/support-sha256'

* ti/support-sha256:
  gitk: Add support of SHA256 repositories

8 days agodocs: explain how to use `git imap-send --list` command to get a list of available...
Aditya Garg [Tue, 22 Jul 2025 11:48:42 +0000 (11:48 +0000)] 
docs: explain how to use `git imap-send --list` command to get a list of available folders

The output `git imap-send --list` command can be a bit confusing for new
users since the IMAP LIST command output is very verbose. Help such users
to analyse the same by using an example output.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>