Git log: commit bfdd0c8290187d5a21c65e3a8a6e0d519b246190
Merge: 95da7e4da9 325a9cefb0
Author: Jonathan Nieder <jrnieder@gmail.com>
Date: Sat Mar 15 19:15:34 2025 +0100
Merge branch 'debian-sid' into debian-experimental
* debian-sid:
debian: Standards-Version: 4.7.0
debian: new upstream release
NMU for CVE-2024-50349 and CVE-2024-52006
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
commit 95da7e4da90e1284d554933a2839a59207d29da8
Author: Jonathan Nieder <jrnieder@gmail.com>
Date: Sat Mar 15 19:10:00 2025 +0100
debian: new "next" snapshot
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
commit 325a9cefb0494055d370639d261b361199389ee8
Author: Jonathan Nieder <jrnieder@gmail.com>
Date: Sat Mar 15 18:50:05 2025 +0100
debian: Standards-Version: 4.7.0
The main change this brings for us is that doc-base support is now
optional (and hence we drop it).
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
commit 804061d051ef4795da621f5a57672457b317cfee
Author: Jonathan Nieder <jrnieder@gmail.com>
Date: Sat Mar 15 18:43:35 2025 +0100
debian: new upstream release
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
commit 9141f91f4445fbc1bc14a3a2f86d3cb0eb02a353
Merge: 4954718790 12beb8f557
Author: Jonathan Nieder <jrnieder@gmail.com>
Date: Sat Mar 15 18:26:27 2025 +0100
Merge branch 'next' of https://kernel.googlesource.com/pub/scm/git/git into debian-experimental
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
commit 07ab309e7c63bf2e5f36698fe02c81f75c536161
Merge: 32a5e12354 683c54c999
Author: Jonathan Nieder <jrnieder@gmail.com>
Date: Sat Mar 15 18:13:57 2025 +0100
Merge tag 'v2.49.0' into debian-sid
Git 2.49
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
commit 12beb8f557ceb4a6dcea497ea420e7576a3aeca0
Merge: d1b26642da 683c54c999
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Mar 14 15:23:21 2025 -0700
Sync with Git 2.49
commit d1b26642dacc169ed6e4a1495e3fa114e8b27faa
Merge: e278b902bb c9d3534de3
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 13 12:04:35 2025 -0700
Sync with 'master'
commit e278b902bb770b75d0295eb776545312351efd36
Merge: 8d6641a77e 4b68faf6b9
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Mar 12 12:08:23 2025 -0700
Sync with 'master'
commit 8d6641a77e891bbd2c9283a0e589fe05e6231cfd
Merge: 67ce5e4795 227c4f33a0
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 11 16:40:36 2025 -0700
Merge branch 'ja/doc-block-delimiter-markup-fix' into next
Doc markup updates.
* ja/doc-block-delimiter-markup-fix:
doc: add a blank line around block delimiters
commit 67ce5e479569658232f7da791d9da710e3dfca8e
Merge: f6994c5077 0d03fda6a5
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 11 16:40:35 2025 -0700
Merge branch 'pb/doc-follow-remote-head' into next
Doc updates.
* pb/doc-follow-remote-head:
config/remote.txt: improve wording for 'remote.<name>.followRemoteHEAD'
config/remote.txt: reunite 'severOption' description paragraphs
commit f6994c50774be5ae419733b56ded2b23fb85798a
Merge: 29657bf057 83b278ef74
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 10 13:10:46 2025 -0700
Merge branch 'ma/clone-doc-markup-fix' into next
* ma/clone-doc-markup-fix:
git-clone doc: fix indentation
commit 227c4f33a0351d12b04660a9f03ca96dbab1310a
Author: Jean-Noël Avila <jn.avila@free.fr>
Date: Sun Mar 9 19:45:11 2025 +0000
doc: add a blank line around block delimiters
The documentation is using the historical mode for titles, which is a
setext-style (i.e., two-line) section title.
The issue with this mode is that starting block delimiters (e.g.,
`----`) can be confused with a section title when they are exactly the
same length as the preceding line. In the original documentation, this
is taken care of for English by the writer, but it is not the case for
translations where these delimiters are hidden. A translator can
generate a line that is exactly the same length as the following block
delimiter, which leads to this line being considered as a title.
To safeguard against this issue, add a blank line before and after
block delimiters where block is at root level, else add a "+" line
before block delimiters to link it to the preceding paragraph.
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 29657bf05791b91f723daea0f035b33ae8ef21c3
Merge: c00cd54a64 87a0bdbf0f
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 10 09:01:08 2025 -0700
Sync with Git 2.49-rc2
commit c00cd54a64c68bb7fc6417cdb91accf2eb89eb27
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 10 08:41:57 2025 -0700
Revert "Merge branch 'jk/use-wunreachable-code-for-devs' into next"
This reverts commit b5c54fea6a6a4c2cba774466a76c40d0348f7a2b, reversing
changes made to 4cd33545ba4fa82324b454aa5bf2748b40a572fb.
Clang used on osx CI seems to be too clever and complains about a
defensive programming like
if (sigfillset(&all))
die_errno("sigfillset");
as it knows that the call would never fail on that platform.
commit 01f2b845292a11ef1d0a77a705fb003137259cb0
Merge: 9432ccae14 09cbf1597e
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Mar 7 16:56:41 2025 -0800
Merge branch 'ua/some-builtins-wo-the-repository' into next
A handful of built-in command implementations have been rewritten
to use the repository instance supplied by git.c:run_builtin(), its
caller.
* ua/some-builtins-wo-the-repository:
builtin/checkout-index: stop using `the_repository`
builtin/for-each-ref: stop using `the_repository`
builtin/ls-files: stop using `the_repository`
builtin/pack-refs: stop using `the_repository`
builtin/send-pack: stop using `the_repository`
builtin/verify-commit: stop using `the_repository`
builtin/verify-tag: stop using `the_repository`
config: teach repo_config to allow `repo` to be NULL
commit 9432ccae14b2e7d6f02ecab0f3d450d325e940e3
Merge: 7c075d304c bd52d9a058
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Mar 7 16:56:40 2025 -0800
Merge branch 'tb/fetch-follow-tags-fix' into next
* tb/fetch-follow-tags-fix:
fetch: fix following tags when fetching specific OID
commit 7c075d304c5a215465fa1962b95dd8b3ee6520cc
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Mar 7 16:56:28 2025 -0800
Revert "Merge branch 'ua/some-builtins-wo-the-repository' into next"
This reverts commit b0520af5047038f5c257ad8ba5f74e981aaf07e4, reversing
changes made to 50707f29dbb2fce94666d9fcd390d64079dbf547.
commit 09cbf1597edde2b0200ecbf469c78689c4dcb12f
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:07 2025 +0530
builtin/checkout-index: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/checkout-index.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_checkout_index()` function with `repo`
set to NULL and then early in the function, `show_usage_with_options_if_asked()`
call will give the options help and exit.
Pass an instance of "struct index_state" available in the calling
context to both `checkout_all()` and `checkout_file()` to remove their
dependency on the global `the_repository` variable.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit d9dce89192504c63787b98961ee514937af88e61
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:06 2025 +0530
builtin/for-each-ref: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/for-each-ref.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_for_each_ref()` function with `repo`
set to NULL and then early in the function, `parse_options()` call will
give the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit d9c5cfb18f4dff87db7d28846bd754c009f6043d
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:05 2025 +0530
builtin/ls-files: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/ls-files.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_ls_files()` function with `repo` set
to NULL and then early in the function, `show_usage_with_options_if_asked()`
call will give the options help and exit.
Pass the repository available in the calling context to both
`expand_objectsize()` and `show_ru_info()` to remove their
dependency on the global `the_repository` variable.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 72fe8bfac832a1f1b9b7cdc4efa793c48e13933e
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:04 2025 +0530
builtin/pack-refs: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/pack-refs.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_pack_refs()` function with `repo` set
to NULL and then early in the function, `parse_options()` call will give
the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 1c14b1aedec6e9307e0c73276b8c1c283413ea41
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:03 2025 +0530
builtin/send-pack: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/send-pack.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_send_pack()` function with `repo` set
to NULL and then early in the function, `parse_options()` call will give
the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit db58d5a351031ec51817c1a6566ec5672ba17138
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:02 2025 +0530
builtin/verify-commit: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/verify-commit.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_verify_commit()` function with `repo`
set to NULL and then early in the function, `parse_options()` call will
give the options help and exit.
Pass the repository available in the calling context to `verify_commit()`
to remove it's dependency on the global `the_repository` variable.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 43a839197795a7f0582efd66bc249dac89f86b68
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:01 2025 +0530
builtin/verify-tag: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/verify-tag.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_verify_tag()` function with `repo` set
to NULL and then early in the function, `parse_options()` call will give
the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit f29f1990b5605f8dbed65324d8e92b67d4dd1713
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Sat Mar 8 05:05:00 2025 +0530
config: teach repo_config to allow `repo` to be NULL
The `repo` value can be NULL if a builtin command is run outside
any repository. The current implementation of `repo_config()` will
fail if `repo` is NULL.
If the `repo` is NULL the `repo_config()` can ignore the repository
configuration but it should read the other configuration sources like
the system-side configuration instead of failing.
Teach the `repo_config()` to allow `repo` to be NULL by calling the
`read_very_early_config()` which read config but only enumerate system
and global settings.
This will be useful in the following commits.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit e13861b9f18e0a3644d159aba6621b29e0505143
Merge: b5c54fea6a 2b1e0f8cd5
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Mar 7 15:33:43 2025 -0800
Merge branch 'tc/zlib-ng-fix' into next
* tc/zlib-ng-fix:
help: print zlib-ng version number
help: include git-zlib.h to print zlib version
commit b5c54fea6a6a4c2cba774466a76c40d0348f7a2b
Merge: 4cd33545ba 38ca78d9da
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Mar 7 15:33:43 2025 -0800
Merge branch 'jk/use-wunreachable-code-for-devs' into next
* jk/use-wunreachable-code-for-devs:
config.mak.dev: enable -Wunreachable-code
commit 38ca78d9da8179a7f5e1b69ec9f05ecd2000295e
Author: Jeff King <peff@peff.net>
Date: Fri Mar 7 17:54:44 2025 -0500
config.mak.dev: enable -Wunreachable-code
Having the compiler point out unreachable code can help avoid bugs, like
the one discussed in:
https://lore.kernel.org/git/20250307195057.GA3675279@coredump.intra.peff.net/
In that case it was found by Coverity, but finding it earlier saves
everybody time and effort.
We can use -Wunreachable-code to get some help from the compiler here.
Interestingly, this is a noop in gcc. It was a real warning up until gcc
4.x, when it was removed for being too flaky, but they left the
command-line option to avoid breaking users. See:
https://stackoverflow.com/questions/17249934/why-does-gcc-not-warn-for-unreachable-code
However, clang does implement this option, and it finds the case
mentioned above (and no other cases within the code base). And since we
run clang in several of our CI jobs, that's enough to get an early
warning of breakage.
We could enable it only for clang, but since gcc is happy to ignore it,
it's simpler to just turn it on for all developer builds.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 4cd33545ba4fa82324b454aa5bf2748b40a572fb
Merge: 8f38331e32 a36e024e98
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 6 14:10:39 2025 -0800
Sync with 'master'
commit 8f38331e32f8ce20b45be4edef428dcecf6a768a
Merge: b0520af504 3adba40858
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 6 14:10:30 2025 -0800
Merge branch 'en/merge-process-renames-crash-fix' into next
The merge-recursive and merge-ort machinery crashed in corner cases
when certain renames are involved.
* en/merge-process-renames-crash-fix:
merge-ort: fix slightly overzealous assertion for rename-to-self
t6423: add a testcase causing a failed assertion in process_renames
commit b0520af5047038f5c257ad8ba5f74e981aaf07e4
Merge: 50707f29db b6e37a70b0
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 6 14:10:29 2025 -0800
Merge branch 'ua/some-builtins-wo-the-repository' into next
A handful of built-in command implementations have been rewritten
to use the repository instance supplied by git.c:run_builtin(), its
caller.
* ua/some-builtins-wo-the-repository:
builtin/checkout-index: stop using `the_repository`
builtin/for-each-ref: stop using `the_repository`
builtin/ls-files: stop using `the_repository`
builtin/pack-refs: stop using `the_repository`
builtin/send-pack: stop using `the_repository`
builtin/verify-commit: stop using `the_repository`
builtin/verify-tag: stop using `the_repository`
config: teach repo_config to allow `repo` to be NULL
commit 50707f29dbb2fce94666d9fcd390d64079dbf547
Merge: 7583a8b724 10e8a9352b
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 6 14:10:29 2025 -0800
Merge branch 'tb/refs-exclude-fixes' into next
The refname exclusion logic in the packed-ref backend has been
broken for some time, which confused upload-pack to advertise
different set of refs. This has been corrected.
* tb/refs-exclude-fixes:
refs.c: stop matching non-directory prefixes in exclude patterns
refs.c: remove empty '--exclude' patterns
commit 7583a8b724bd38889376a90fb593cadbd8a97e9c
Merge: 2de1596002 9709163687
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 6 10:45:49 2025 -0800
Merge branch 'js/win-2.49-build-fixes' into next
* js/win-2.49-build-fixes:
cmake: generalize the handling of the `CLAR_TEST_OBJS` list
meson: fix sorting
ident: stop assuming that `gw_gecos` is writable
commit 2de15960026972a7a1d933881dad8a3879471155
Merge: 551580e959 92f8da8de3
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Mar 6 10:45:48 2025 -0800
Merge branch 'pw/repo-layout-doc-update' into next
Some future breaking changes would remove certain parts of the
default repository, which were still described even when the
documents were built for the future with WITH_BREAKING_CHANGES.
* pw/repo-layout-doc-update:
docs: fix repository-layout when building with breaking changes
commit b6e37a70b033824f389746e747eae4f8fdbcc5eb
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:52 2025 +0530
builtin/checkout-index: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/checkout-index.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_checkout_index()` function with `repo`
set to NULL and then early in the function, `show_usage_with_options_if_asked()`
call will give the options help and exit.
Pass the repository available in the calling context to both `checkout_all()`
and `checkout_file()` to remove their dependency on the global
`the_repository` variable.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 31c747e0be7828de7d391fb927d069302b7f3816
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:51 2025 +0530
builtin/for-each-ref: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/for-each-ref.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_for_each_ref()` function with `repo`
set to NULL and then early in the function, `parse_options()` call will
give the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 70bdbde0d8d43ac32506877ab3a45783cb38651f
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:50 2025 +0530
builtin/ls-files: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/ls-files.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_ls_files()` function with `repo` set
to NULL and then early in the function, `show_usage_with_options_if_asked()`
call will give the options help and exit.
Pass the repository available in the calling context to both
`expand_objectsize()` and `show_ru_info()` to remove their
dependency on the global `the_repository` variable.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 3dc7f0777a17a184029228c661ca0a505b737aed
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:49 2025 +0530
builtin/pack-refs: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/pack-refs.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_pack_refs()` function with `repo` set
to NULL and then early in the function, `parse_options()` call will give
the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 8abf3ad23cb1008aeadaa2e1ed68a2649be74bb0
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:48 2025 +0530
builtin/send-pack: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/send-pack.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_send_pack()` function with `repo` set
to NULL and then early in the function, `parse_options()` call will give
the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 2cf14d1bfd6cdf6629e56046dd30d1ef15175fc9
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:47 2025 +0530
builtin/verify-commit: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/verify-commit.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_verify_commit()` function with `repo`
set to NULL and then early in the function, `parse_options()` call will
give the options help and exit.
Pass the repository available in the calling context to `verify_commit()`
to remove it's dependency on the global `the_repository` variable.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit a7eb054c60a11246e86641152a4b8caf0723ef35
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:46 2025 +0530
builtin/verify-tag: stop using `the_repository`
Remove the_repository global variable in favor of the repository
argument that gets passed in "builtin/verify-tag.c".
When `-h` is passed to the command outside a Git repository, the
`run_builtin()` will call the `cmd_verify_tag()` function with `repo` set
to NULL and then early in the function, `parse_options()` call will give
the options help and exit.
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 0d885f2101631a09ef10c11cdb9dc1227dfa96e6
Author: Usman Akinyemi <usmanakinyemi202@gmail.com>
Date: Thu Mar 6 20:05:45 2025 +0530
config: teach repo_config to allow `repo` to be NULL
The `repo` value can be NULL if a builtin command is run outside
any repository. The current implementation of `repo_config()` will
fail if `repo` is NULL.
If the `repo` is NULL the `repo_config()` can ignore the repository
configuration but it should read the other configuration sources like
the system-side configuration instead of failing.
Teach the `repo_config()` to allow `repo` to be NULL by calling the
`read_very_early_config()` which read config but only enumerate system
and global settings.
This will be useful in the following commits.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 3adba40858036a5a44f550aaab5287ad135f5f87
Author: Elijah Newren <newren@gmail.com>
Date: Thu Mar 6 15:30:27 2025 +0000
merge-ort: fix slightly overzealous assertion for rename-to-self
merge-ort has a number of sanity checks on the file it is processing in
process_renames(). One of these sanity checks was slightly overzealous
because it indirectly assumed that a renamed file always ended up at a
different path than where it started. That is normally an entirely fair
assumption, but directory rename detection can make things interesting.
As a quick refresher, if one side of history renames directory A/ -> B/,
and the other side of history adds new files to A/, then directory
rename detection notices and suggests moving those new files to B/. A
similar thing is done for paths renamed into A/, causing them to be
transitively renamed into B/. But, if the file originally came from B/,
then this can end up causing a file to be renamed back to itself.
It turns out the rest of the code following this assertion handled the
case fine; the assertion was just an extra sanity check, not a rigid
precondition. Therefore, simply adjust the assertion to pass under this
special case as well.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 98a1a00d53018c7e664644d886466a820aa5e6d7
Author: Dmitry Goncharov <dgoncharov@users.sf.net>
Date: Thu Mar 6 15:30:26 2025 +0000
t6423: add a testcase causing a failed assertion in process_renames
If one side of history renames a directory A/ -> B/, and the other side
of history adds new files to A/, then directory rename detection notices
and moves or suggests moving those new files to B/. A similar thing is
done for paths renamed into A/, causing them to be transitively renamed
into B/. But, if the file originally came from B/, then this can end up
causing a file to be renamed back to itself. merge-ort crashes under
this special case, due to a slightly overzealous assertion:
git: merge-ort.c:3051: process_renames: Assertion `source_deleted || oldinfo->filemask & old_sidemask' failed.
Aborted (core dumped)
Add a testcase demonstrating this.
Signed-off-by: Dmitry Goncharov <dgoncharov@users.sf.net>
[en: Instead of adding a new testsuite, place it near similar tests in
t6423, adjusting to match the style of those tests. Tweak the commit
message to not repeat the entire testcase, but just describe the bug.
Also update the line number in the error message.]
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 10e8a9352bcc7b21a64e0b321f302cf900ac8c77
Author: Taylor Blau <me@ttaylorr.com>
Date: Thu Mar 6 10:34:53 2025 -0500
refs.c: stop matching non-directory prefixes in exclude patterns
In the packed-refs backend, our implementation of '--exclude' (dating
back to 59c35fac54 (refs/packed-backend.c: implement jump lists to avoid
excluded pattern(s), 2023-07-10)) considers, for example:
$ git for-each-ref --exclude=refs/heads/ba
to exclude "refs/heads/bar", "refs/heads/baz", and so on.
The files backend, which does not implement '--exclude' (and relies on
the caller to cull out results that don't match) naturally will
enumerate "refs/heads/bar" and so on.
So in the above example, 'for-each-ref' will try and see if
"refs/heads/ba" matches "refs/heads/bar" (since the files backend simply
enumerated every loose reference), and, realizing that it does not
match, output the reference as expected. (A caller that did want to
exclude "refs/heads/bar" and "refs/heads/baz" might instead run "git
for-each-ref --exclude='refs/heads/ba*'").
This can lead to strange behavior, like seeing a different set of
references advertised via 'upload-pack' depending on what set of
references were loose versus packed.
So there is a subtle bug with '--exclude' which is that in the
packed-refs backend we will consider "refs/heads/bar" to be a pattern
match against "refs/heads/ba" when we shouldn't. Likewise, the reftable
backend (which in this case is bug-compatible with the packed backend)
exhibits the same broken behavior.
There are a few ways to fix this. One is to tighten the rules in
cmp_record_to_refname(), which is used to determine the start/end-points
of the jump list used by the packed backend. In this new "strict" mode,
the comparison function would handle the case where we've reached the
end of the pattern by introducing a new check like so:
while (1) {
if (*r1 == '\n')
return *r2 ? -1 : 0;
if (!*r2)
if (strict && *r1 != '/') /* <- here */
return 1;
return start ? 1 : -1;
if (*r1 != *r2)
return (unsigned char)*r1 < (unsigned char)*r2 ? -1 : +1;
r1++;
r2++;
}
(eliding out the rest of cmp_record_to_refname()). Equivalently, we
could teach refs/packed-backend::populate_excluded_jump_list() to append
a trailing '/' if one does not already exist, forcing an exclude pattern
like "refs/heads/ba" to only match "refs/heads/ba/abc" and so forth.
But since the same problem exists in reftable, we can fix both at once
by performing this pre-processing step one layer up in refs.c at the
common entrypoint for the two, which is 'refs_ref_iterator_begin()'.
Since that solution is both the simplest and only requires modification
in one spot, let's normalize exclude patterns so that they end with a
trailing slash. This causes us to unify the behavior between all three
backends.
There is some minor test fallout in the "overlapping excluded regions"
test, which happens to use 'refs/ba' as an exclude pattern, and expects
references under the "refs/heads/bar/*" and "refs/heads/baz/*"
hierarchies to be excluded from the results.
But that test fallout is expected, because the test was codifying the
buggy behavior to begin with, and should have never been written that
way. Split that into its own test (since the range is no longer
overlapping under the stricter interpretation of --exclude patterns
presented here). Create a new test which does have overlapping
regions by using a refs/heads/bar/4/... hierarchy and excluding both
"refs/heads/bar" and "refs/heads/bar/4".
Reported-by: SURA <surak8806@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 27be76b230b07360b64aec06d6b0b9bc9e993603
Author: Taylor Blau <me@ttaylorr.com>
Date: Thu Mar 6 10:34:48 2025 -0500
refs.c: remove empty '--exclude' patterns
In 59c35fac54 (refs/packed-backend.c: implement jump lists to avoid
excluded pattern(s), 2023-07-10), the packed-refs backend learned how to
construct "jump lists" to avoid enumerating sections of the packed-refs
file that we know the caller is going to throw out anyway.
This process works by finding the start- and end-points (that is, where
in the packed-refs file corresponds to the range we're going to ignore)
for each exclude pattern, then constructing a jump list based on that.
At enumeration time we'll consult the jump list to skip past everything
in the range(s) found in the previous step, saving time when excluding a
large portion of references.
But when there is a --exclude pattern which is just the empty string,
the behavior is a little funky. When we try and exclude the empty
string, the matched range covers the entire packed-refs file, meaning
that we won't output any packed references. But the empty pattern
doesn't actually match any references to begin with! For example, on my
copy of git.git I can do:
$ git for-each-ref '' | wc -l
0
So "git for-each-ref --exclude=''" shouldn't actually remove anything
from the output, and ought to be equivalent to "git for-each-ref". But
it's not, and in fact:
$ git for-each-ref | wc -l
2229
$ git for-each-ref --exclude='' | wc -l
480
But why does the '--exclude' version output only some of the references
in the repository? Here's a hint:
$ find .git/refs -type f | wc -l
480
Indeed, because the files backend doesn't implement[^1] the same jump
list concept as the packed backend we get the correct result for the
loose references, but none of the packed references.
Since the empty string exclude pattern doesn't match anything, we can
discard them before the packed-refs backend has a chance to even see it
(and likewise for reftable, which also implements a similar concept
since 1869525066 (refs/reftable: wire up support for exclude patterns,
2024-09-16)).
This approach (copying only some of the patterns into a strvec at the
refs.c layer) may seem heavy-handed, but it's setting us up to fix
another bug in the following commit where the fix will involve modifying
the incoming patterns.
[^1]: As noted in 59c35fac54. We technically could avoid opening and
enumerating the contents of, for e.g., "$GIT_DIR/refs/heads/foo/" if
we knew that we were excluding anything under the 'refs/heads/foo'
hierarchy. But the --exclude stuff is all best-effort anyway, since
the caller is expected to cull out any results that they don't want.
Noticed-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 551580e959894626c27474d35a73409be337b82a
Merge: 6bea9376c4 e969bc8759
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Mar 5 13:23:45 2025 -0800
Sync with 'master'
commit 6bea9376c4351ec0c6672131cf3b8c30b520dea3
Merge: 72b47a15e9 c1cf918d3a
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Mar 5 13:23:26 2025 -0800
Merge branch 'sj/ref-consistency-checks-more' into next
"git fsck" becomes more careful when checking the refs.
* sj/ref-consistency-checks-more:
builtin/fsck: add `git refs verify` child process
packed-backend: check whether the "packed-refs" is sorted
packed-backend: add "packed-refs" entry consistency check
packed-backend: check whether the refname contains NUL characters
packed-backend: add "packed-refs" header consistency check
packed-backend: check if header starts with "# pack-refs with: "
packed-backend: check whether the "packed-refs" is regular file
builtin/refs: get worktrees without reading head information
t0602: use subshell to ensure working directory unchanged
commit 72b47a15e918065d3df5ff68594d3890697f3db6
Merge: 831296c557 bad7910399
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 10:53:18 2025 -0800
Merge branch 'rs/reftable-reader-new-leakfix' into next
Leakfix.
* rs/reftable-reader-new-leakfix:
reftable: release name on reftable_reader_new() error
commit 831296c55738229a56ac0eb4be6c0cdaafa821d5
Merge: 1bc1ab6ecc 61cd812130
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 10:53:17 2025 -0800
Merge branch 'tz/doc-txt-to-adoc-fixes' into next
Fallouts from recent renaming of documentation files from .txt
suffix to the new .adoc suffix have been corrected.
* tz/doc-txt-to-adoc-fixes: (38 commits)
xdiff: *.txt -> *.adoc fixes
unpack-trees.c: *.txt -> *.adoc fixes
transport.h: *.txt -> *.adoc fixes
trace2/tr2_sysenv.c: *.txt -> *.adoc fixes
trace2.h: *.txt -> *.adoc fixes
t6434: *.txt -> *.adoc fixes
t6012: *.txt -> *.adoc fixes
t/helper/test-rot13-filter.c: *.txt -> *.adoc fixes
simple-ipc.h: *.txt -> *.adoc fixes
setup.c: *.txt -> *.adoc fixes
refs.h: *.txt -> *.adoc fixes
pseudo-merge.h: *.txt -> *.adoc fixes
parse-options.h: *.txt -> *.adoc fixes
object-name.c: *.txt -> *.adoc fixes
list-objects-filter-options.h: *.txt -> *.adoc fixes
fsck.h: *.txt -> *.adoc fixes
diffcore.h: *.txt -> *.adoc fixes
diff.h: *.txt -> *.adoc fixes
contrib/long-running-filter: *.txt -> *.adoc fixes
config.c: *.txt -> *.adoc fixes
...
commit 1bc1ab6ecc2b71eecec0671746d85bf7036037e8
Merge: fd3038fefd 6a64ac7b01
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 08:21:01 2025 -0800
Sync with 'master'
commit fd3038fefdd56ccacb01f807da193b6b6bbb9e7a
Merge: 3444b4bf36 87eccc3a81
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 08:13:11 2025 -0800
Merge branch 'pw/build-meson-technical-and-howto-docs' into next
Meson-based build procedure forgot to build some docs, which has
been corrected.
* pw/build-meson-technical-and-howto-docs:
meson: fix building technical and howto docs
commit 3444b4bf367e16f70d77ec0fc00e0cc3b587195e
Merge: b0c5685768 6dff5de1da
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 08:13:10 2025 -0800
Merge branch 'kn/ref-migrate-skip-reflog' into next
Usage string of "git refs" has been corrected.
* kn/ref-migrate-skip-reflog:
refs: show --no-reflog in the help text
commit b0c5685768ec6f326550dce42bbb3b6419ca2408
Merge: fa247cfd4e c268e3285d
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 08:13:10 2025 -0800
Merge branch 'jc/breaking-changes-early-adopter-option' into next
Doc update.
* jc/breaking-changes-early-adopter-option:
BreakingChanges: clarify the procedure
commit fa247cfd4e00fafd7c8d3566ee69b6269d42c977
Merge: 627208d89d c84209a8fd
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Mar 4 08:13:10 2025 -0800
Merge branch 'dm/editorconfig-bash-is-like-sh' into next
The editorconfig file is updated to tell us that bash scripts are
similar to general Bourne shell scripts.
* dm/editorconfig-bash-is-like-sh:
editorconfig: add .bash extension
commit 627208d89dea747b35cb848eb5e2c8eddf878dfd
Merge: 663485ae52 db91954e18
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 3 09:19:51 2025 -0800
Sync with 'master'
commit 663485ae52c79430708592789f1bc4d96066e7b3
Merge: 32346e0c3b 5040f9f164
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 3 09:19:12 2025 -0800
Merge branch 'cc/lop-remote' into next
Large-object promisor protocol extension.
* cc/lop-remote:
doc: add technical design doc for large object promisors
promisor-remote: check advertised name or URL
Add 'promisor-remote' capability to protocol v2
commit 32346e0c3be7f2f43d3ef9eb2c4fa68f5ac7460a
Merge: b7a42309b2 cf15095ec5
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 3 09:19:12 2025 -0800
Merge branch 'jt/diff-pairs' into next
A post-processing filter for "diff --raw" output has been
introduced.
* jt/diff-pairs:
builtin/diff-pairs: allow explicit diff queue flush
builtin: introduce diff-pairs command
diff: add option to skip resolving diff statuses
diff: return diff_filepair from diff queue helpers
commit b7a42309b25632b0c63e8f189fd6f4d85dea293e
Merge: 41875498b7 149585079f
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Mar 3 09:19:11 2025 -0800
Merge branch 'sk/unit-test-oid' into next
Convert a few unit tests to the clar framework.
* sk/unit-test-oid:
t/unit-tests: convert oidtree test to use clar test framework
t/unit-tests: convert oidmap test to use clar test framework
t/unit-tests: convert oid-array test to use clar test framework
t/unit-tests: implement clar specific oid helper functions
commit cf15095ec52f1e997ec9eef42bdf275d2a68fe66
Author: Justin Tobler <jltobler@gmail.com>
Date: Fri Feb 28 15:33:46 2025 -0600
builtin/diff-pairs: allow explicit diff queue flush
The diffs queued from git-diff-pairs(1) are flushed when stdin is
closed. To enable greater flexibility, allow control over when the diff
queue is flushed by writing a single NUL byte on stdin between input
file pairs. Diff output between flushes is separated by a single NUL
byte.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 5bd10b2adcf3a080169574dd08c5529de81eecb1
Author: Justin Tobler <jltobler@gmail.com>
Date: Fri Feb 28 15:33:45 2025 -0600
builtin: introduce diff-pairs command
Through git-diff(1), a single diff can be generated from a pair of blob
revisions directly. Unfortunately, there is not a mechanism to compute
batches of specific file pair diffs in a single process. Such a feature
is particularly useful on the server-side where diffing between a large
set of changes is not feasible all at once due to timeout concerns.
To facilitate this, introduce git-diff-pairs(1) which acts as a backend
passing its NUL-terminated raw diff format input from stdin through diff
machinery to produce various forms of output such as patch or raw.
The raw format was originally designed as an interchange format and
represents the contents of the diff_queued_diff list making it possible
to break the diff pipeline into separate stages. For example,
git-diff-tree(1) can be used as a frontend to compute file pairs to
queue and feed its raw output to git-diff-pairs(1) to compute patches.
With this, batches of diffs can be progressively generated without
having to recompute renames or retrieve object context. Something like
the following:
git diff-tree -r -z -M $old $new |
git diff-pairs -p -z
should generate the same output as `git diff-tree -p -M`. Furthermore,
each line of raw diff formatted input can also be individually fed to a
separate git-diff-pairs(1) process and still produce the same output.
Based-on-patch-by: Jeff King <peff@peff.net>
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit c8a8e04099a99d6eafbe6e9bb1db3b50996836f8
Author: Justin Tobler <jltobler@gmail.com>
Date: Fri Feb 28 15:33:44 2025 -0600
diff: add option to skip resolving diff statuses
By default, `diffcore_std()` resolves the statuses for queued diff file
pairs by calling `diff_resolve_rename_copy()`. If status information is
already manually set, invoking `diffcore_std()` may change the status
value.
Introduce the `skip_resolving_statuses` diff option that prevents
`diffcore_std()` from resolving file pair statuses when enabled.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 7c67d2a07055150b76e81efa8850221d52705305
Author: Justin Tobler <jltobler@gmail.com>
Date: Fri Feb 28 15:33:43 2025 -0600
diff: return diff_filepair from diff queue helpers
The `diff_addremove()` and `diff_change()` functions set up and queue
diffs, but do not return the `diff_filepair` added to the queue. In a
subsequent commit, modifications to `diff_filepair` need to occur in
certain cases after being queued.
Since the existing `diff_addremove()` and `diff_change()` are also used
for callbacks in `diff_options` as types `add_remove_fn_t` and
`change_fn_t`, modifying the existing function signatures requires
further changes. The diff options for pruning use `file_add_remove()`
and `file_change()` where file pairs do not even get queued. Thus,
separate functions are implemented instead.
Split out the queuing operations into `diff_queue_addremove()` and
`diff_queue_change()` which also return a handle to the queued
`diff_filepair`. Both `diff_addremove()` and `diff_change()` are
reimplemented as thin wrappers around the new functions.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 41875498b7944e2c73e7a8ed9b6a91c9d7001b12
Merge: 7e8431ab25 028f618658
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Feb 28 13:56:15 2025 -0800
Merge branch 'ps/path-sans-the-repository' into next
The path.[ch] API takes an explicit repository parameter passed
throughout the callchain, instead of relying on the_repository
singleton instance.
* ps/path-sans-the-repository:
path: adjust last remaining users of `the_repository`
environment: move access to "core.sharedRepository" into repo settings
environment: move access to "core.hooksPath" into repo settings
repo-settings: introduce function to clear struct
path: drop `git_path()` in favor of `repo_git_path()`
rerere: let `rerere_path()` write paths into a caller-provided buffer
path: drop `git_common_path()` in favor of `repo_common_path()`
worktree: return allocated string from `get_worktree_git_dir()`
path: drop `git_path_buf()` in favor of `repo_git_path_replace()`
path: drop `git_pathdup()` in favor of `repo_git_path()`
path: drop unused `strbuf_git_path()` function
path: refactor `repo_submodule_path()` family of functions
submodule: refactor `submodule_to_gitdir()` to accept a repo
path: refactor `repo_worktree_path()` family of functions
path: refactor `repo_git_path()` family of functions
path: refactor `repo_common_path()` family of functions
commit 7e8431ab257e4492cf65950dd066524370c30347
Merge: ae4b89d849 aea7c185be
Author: Junio C Hamano <gitster@pobox.com>
Date: Fri Feb 28 13:56:14 2025 -0800
Merge branch 'ps/build-meson-fixes' into next
CI fix.
* ps/build-meson-fixes:
gitlab-ci: fix "msvc-meson" test job succeeding despite test failures
commit ae4b89d849ef425bee1157421f2c44071bb9b5c5
Merge: ef18273a2d cb0ae672ae
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 27 15:41:37 2025 -0800
Sync with 'master'
commit ef18273a2d933b31529ea336161a70ddb8738b34
Merge: 839741ad40 63a597dd94
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 27 15:40:32 2025 -0800
Merge branch 'ps/meson-contrib-bits' into next
Update meson-based build procedure to cover contrib/ and other
places as well.
* ps/meson-contrib-bits:
ci: exercise credential helpers
ci: fix propagating UTF-8 test locale in musl-based Meson job
meson: wire up static analysis via Coccinelle
meson: wire up git-contacts(1)
meson: wire up credential helpers
contrib/credential: fix compilation of "osxkeychain" helper
contrib/credential: fix compiling "libsecret" helper
contrib/credential: fix compilation of wincred helper with MSVC
contrib/credential: fix "netrc" tests with out-of-tree builds
GIT-BUILD-OPTIONS: propagate project's source directory
commit 839741ad40b010b4c8ac49a53117562b062e906f
Merge: 8086c4ca60 b07dd9078b
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 27 15:40:31 2025 -0800
Merge branch 'ms/merge-recursive-string-list-micro-optimization' into next
Rename processing in the recursive merge backend has seen a micro
optimization.
* ms/merge-recursive-string-list-micro-optimization:
merge-recursive: optimize time complexity for process_renames
commit 8086c4ca6055b80c96a420b717be6b2915f210a1
Merge: 55aaa8c63e 4ebba56419
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 27 15:40:31 2025 -0800
Merge branch 'lo/doc-merge-submodule-update' into next
What happens to submodules during merge has been documented in a
bit more detail.
* lo/doc-merge-submodule-update:
merge-strategies.adoc: detail submodule merge
commit 55aaa8c63e25a59afc718ae2154f7e3c3064c4a7
Merge: cf8ba1cde5 9350423982
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 27 15:40:30 2025 -0800
Merge branch 'ps/build-meson-fixes-0130' into next
Assorted fixes and improvements to the build procedure based on
meson.
* ps/build-meson-fixes-0130:
gitlab-ci: restrict maximum number of link jobs on Windows
meson: consistently use custom program paths to resolve programs
meson: fix overwritten `git` variable
meson: prevent finding sed(1) in a loop
meson: improve handling of `sane_tool_path` option
meson: improve PATH handling
meson: drop separate version library
meson: stop linking libcurl into all executables
meson: introduce `libgit_curl` dependency
meson: simplify use of the common-main library
meson: inline the static 'git' library
meson: fix OpenSSL fallback when not explicitly required
meson: fix exec path with enabled runtime prefix
commit cf8ba1cde5a673dd7f2354ddd2148f31e4c4e033
Merge: 42c0ae87b1 ce98863204
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 27 15:40:30 2025 -0800
Merge branch 'dk/test-aggregate-results-paste-fix' into next
The use of "paste" command for aggregating the test results have
been corrected.
* dk/test-aggregate-results-paste-fix:
t/aggregate-results: fix paste(1) invocation
commit c1cf918d3adbe832fdaf278a23151502be255bb2
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:07:48 2025 +0800
builtin/fsck: add `git refs verify` child process
At now, we have already implemented the ref consistency checks for both
"files-backend" and "packed-backend". Although we would check some
redundant things, it won't cause trouble. So, let's integrate it into
the "git-fsck(1)" command to get feedback from the users. And also by
calling "git refs verify" in "git-fsck(1)", we make sure that the new
added checks don't break.
Introduce a new function "fsck_refs" that initializes and runs a child
process to execute the "git refs verify" command. In order to provide
the user interface create a progress which makes the total task be 1.
It's hard to know how many loose refs we will check now. We might
improve this later.
Then, introduce the option to allow the user to disable checking ref
database consistency. Put this function in the very first execution
sequence of "git-fsck(1)" due to that we don't want the existing code of
"git-fsck(1)" which would implicitly check the consistency of refs to
die the program.
Last, update the test to exercise the code.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit e1c9548eae406a7aa7274685f8bdbc353827bf16
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:07:40 2025 +0800
packed-backend: check whether the "packed-refs" is sorted
When there is a "sorted" trait in the header of the "packed-refs" file,
it means that each entry is sorted increasingly by comparing the
refname. We should add checks to verify whether the "packed-refs" is
sorted in this case.
Update the "packed_fsck_ref_header" to know whether there is a "sorted"
trail in the header. It may seem that we could record all refnames
during the parsing process and then compare later. However, this is not
a good design due to the following reasons:
1. Because we need to store the state across the whole checking
lifetime, we would consume a lot of memory if there are many entries
in the "packed-refs" file.
2. We cannot reuse the existing compare function "cmp_packed_ref_records"
which cause repetition.
Because "cmp_packed_ref_records" needs an extra parameter "struct
snaphost", extract the common part into a new function
"cmp_packed_ref_records" to reuse this function to compare.
Then, create a new function "packed_fsck_ref_sorted" to parse the file
again and user the new fsck message "packedRefUnsorted(ERROR)" to report
to the user if the file is not sorted.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit e6ba4c07b85a0a8fee84b6ac7ab414d47a5351f2
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:07:17 2025 +0800
packed-backend: add "packed-refs" entry consistency check
"packed-backend.c::next_record" will parse the ref entry to check the
consistency. This function has already checked the following things:
1. Parse the main line of the ref entry to inspect whether the oid is
not correct. Then, check whether the next character is oid. Then
check the refname.
2. If the next line starts with '^', it would continue to parse the
peeled oid and check whether the last character is '\n'.
As we decide to implement the ref consistency check for "packed-refs",
let's port these two checks and update the test to exercise the code.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 5637d5542021294e81cf0d8344fe140368117296
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:07:00 2025 +0800
packed-backend: check whether the refname contains NUL characters
"packed-backend.c::next_record" will use "check_refname_format" to check
the consistency of the refname. If it is not OK, the program will die.
However, it is reported in [1], we cannot catch some corruption. But we
already have the code path and we must miss out something.
We use the following code to get the refname:
strbuf_add(&iter->refname_buf, p, eol - p);
iter->base.refname = iter->refname_buf.buf
In the above code, `p` is the start pointer of the refname and `eol` is
the next newline pointer. We calculate the length of the refname by
subtracting the two pointers. Then we add the memory range between `p`
and `eol` to get the refname.
However, if there are some NUL characters in the memory range between `p`
and `eol`, we will see the refname as a valid ref name as long as the
memory range between `p` and first occurred NUL character is valid.
In order to catch above corruption, create a new function
"refname_contains_nul" by searching the first NUL character. If it is
not at the end of the string, there must be some NUL characters in the
refname.
Use this function in "next_record" function to die the program if
"refname_contains_nul" returns true.
[1] https://lore.kernel.org/git/6cfee0e4-3285-4f18-91ff-d097da9de737@rd10.de/
Reported-by: R. Diez <rdiez-temp3@rd10.de>
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit c92e7e156e6b406e7555fb5df058d18758a0b3f0
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:06:49 2025 +0800
packed-backend: add "packed-refs" header consistency check
In "packed-backend.c::create_snapshot", if there is a header (the line
which starts with '#'), we will check whether the line starts with "#
pack-refs with: ". However, we need to consider other situations and
discuss whether we need to add checks.
1. If the header does not exist, we should not report an error to the
user. This is because in older Git version, we never write header in
the "packed-refs" file. Also, we do allow no header in "packed-refs"
in runtime.
2. If the header content does not start with "# packed-ref with: ", we
should report an error just like what "create_snapshot" does. So,
create a new fsck message "badPackedRefHeader(ERROR)" for this.
3. If the header content is not the same as the constant string
"PACKED_REFS_HEADER". This is expected because we make it extensible
intentionally and runtime "create_snapshot" won't complain about
unknown traits. In order to align with the runtime behavior. There is
no need to report.
As we have analyzed, we only need to check the case 2 in the above. In
order to do this, use "open_nofollow" function to get the file
descriptor and then read the "packed-refs" file via "strbuf_read". Like
what "create_snapshot" and other functions do, we could split the line
by finding the next newline in the buffer. When we cannot find a
newline, we could report an error.
So, create a function "packed_fsck_ref_next_line" to find the next
newline and if there is no such newline, use
"packedRefEntryNotTerminated(ERROR)" to report an error to the user.
Then, parse the first line to apply the checks. Update the test to
exercise the code.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 515579756c8d23ea2f3c6386a9333ecbe84d8a08
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:06:40 2025 +0800
packed-backend: check if header starts with "# pack-refs with: "
We always write a space after "# pack-refs with:" but we don't align
with this rule in the "create_snapshot" method where we would check
whether header starts with "# pack-refs with:". It might seem that we
should undoubtedly tighten this rule, however, we don't have any
technical documentation about this and there is a possibility that we
would break the compatibility for other third-party libraries.
By investigating influential third-party libraries, we could conclude
how these libraries handle the header of "packed-refs" file:
1. libgit2 is fine and always writes the space. It also expects the
whitespace to exist.
2. JGit does not expect th header to have a trailing space, but expects
the "peeled" capability to have a leading space, which is mostly
equivalent because that capability is typically the first one we
write. It always writes the space.
3. gitoxide expects the space t exist and writes it.
4. go-git doesn't create the header by default.
As many third-party libraries expect a single space after "# pack-refs
with:", if we forget to write the space after the colon,
"create_snapshot" won't catch this. And we would break other
re-implementations. So, we'd better tighten the rule by checking whether
the header starts with "# pack-refs with: ".
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit cfea2f2da8d418edd7984e5b5073825834099a27
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:06:24 2025 +0800
packed-backend: check whether the "packed-refs" is regular file
Although "git-fsck(1)" and "packed-backend.c" will check some
consistency and correctness of "packed-refs" file, they never check the
filetype of the "packed-refs". Let's verify that the "packed-refs" has
the expected filetype, confirming it is created by "git pack-refs"
command.
We could use "open_nofollow" wrapper to open the raw "packed-refs" file.
If the returned "fd" value is less than 0, we could check whether the
"errno" is "ELOOP" to report an error to the user. And then we use
"fstat" to check whether the "packed-refs" file is a regular file.
Reuse "FSCK_MSG_BAD_REF_FILETYPE" fsck message id to report the error to
the user if "packed-refs" is not a regular file.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit fdf3820b7ef69dcf887bd86565e2442f89edc7c0
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:06:06 2025 +0800
builtin/refs: get worktrees without reading head information
In "packed-backend.c", there are some functions such as "create_snapshot"
and "next_record" which would check the correctness of the content of
the "packed-ref" file. When anything is bad, the program will die.
It may seem that we have nothing relevant to above feature, because we
are going to read and parse the raw "packed-ref" file without creating
the snapshot and using the ref iterator to check the consistency.
However, when using "get_worktrees" in "builtin/refs", we would parse
the "HEAD" information. If the referent of the "HEAD" is inside the
"packed-ref", we will call "create_snapshot" function to parse the
"packed-ref" to get the information. No matter whether the entry of
"HEAD" in "packed-ref" is correct, "create_snapshot" would call
"verify_buffer_safe" to check whether there is a newline in the last
line of the file. If not, the program will die.
Although this behavior has no harm for the program, it will
short-circuit the program. When the users execute "git refs verify" or
"git fsck", we should avoid reading the head information, which may
execute the read operation in packed backend with stricter checks to die
the program. Instead, we should continue to check other parts of the
"packed-refs" file completely.
Fortunately, in 465a22b338 (worktree: skip reading HEAD when repairing
worktrees, 2023-12-29), we have introduced a function
"get_worktrees_internal" which allows us to get worktrees without
reading head information.
Create a new exposed function "get_worktrees_without_reading_head", then
replace the "get_worktrees" in "builtin/refs" with the new created
function.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 320f2061b63b0157ea8b21362ed12e4ce90258e2
Author: shejialuo <shejialuo@gmail.com>
Date: Fri Feb 28 00:05:55 2025 +0800
t0602: use subshell to ensure working directory unchanged
For every test, we would execute the command "cd repo" in the first but
we never execute the command "cd .." to restore the working directory.
However, it's either not a good idea use above way. Because if any test
fails between "cd repo" and "cd ..", the "cd .." will never be reached.
And we cannot correctly restore the working directory.
Let's use subshell to ensure that the current working directory could be
restored to the correct path.
Mentored-by: Patrick Steinhardt <ps@pks.im>
Mentored-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit 42c0ae87b126c6787791d005ec559bf3f6bc5de7
Merge: 76db3e05d5 08bdfd4535
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Feb 26 09:21:02 2025 -0800
Sync with 'master'
commit 76db3e05d55a7d485e776ee1981179b10871051e
Merge: c2b83ec2e7 887758c998
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Feb 26 09:20:33 2025 -0800
Merge branch 'jc/3.0-branches-remotes-update' into next
Rephrase removal of ".git/branches" and ".git/remotes" support in
the BreakingChanges document.
Comments?
* jc/3.0-branches-remotes-update:
BreakingChanges: clarify branches/ and remotes/
commit c2b83ec2e7b6a02d6c8f4756b4aa5e47010deac7
Merge: 1773f2a2ff 3306edb380
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Feb 26 09:20:33 2025 -0800
Merge branch 'bc/http-push-auth-netrc-fix' into next
The netrc support (via the cURL library) for the HTTP transport has
been re-enabled.
* bc/http-push-auth-netrc-fix:
http: allow using netrc for WebDAV-based HTTP protocol
commit 1773f2a2ff8b122452da2c1a080abadd92d3d4a6
Merge: 6f97affbc4 1ca727f230
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Feb 26 09:20:32 2025 -0800
Merge branch 'rs/clear-commit-marks-optim' into next
A micro-optimization.
* rs/clear-commit-marks-optim:
commit: avoid parent list buildup in clear_commit_marks_many()
commit 6f97affbc47713589631ee58027b956ed723e2a1
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Feb 25 16:12:06 2025 -0800
Revert "Merge branch 'ps/build-meson-fixes-0130' into next"
This reverts commit 6cd5b60792c63fcf958b0a48813a84830a5764d6, reversing
changes made to 89ad48db1442b5f60b4d0bd02a5edf2044ef411b.
commit 4e5a29be8250487b387ff3b254e30b2320407821
Merge: 63db268d47 5a526e5e18
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Feb 25 15:03:41 2025 -0800
Sync with 'master
commit 63db268d4778f250892479e7e517e23c54ac8eda
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Feb 25 15:03:32 2025 -0800
Merge branch 'pw/rebase-i-ff-empty-commit' into next
"git rebase -i" failed to allow rewording an empty commit that has
been fast-forwarded.
* pw/rebase-i-ff-empty-commit:
rebase -i: reword empty commit after fast-forward
commit 4954718790598c65424ba5e57584f337af3d524a
Author: Josh Steadmon <steadmon@google.com>
Date: Fri Feb 14 10:39:14 2025 -0800
debian: new "next" snapshot
Change-Id: I48e8ac0f6c30d017a479833125054f983614d5e0
Signed-off-by: Josh Steadmon <steadmon@google.com>
commit 70e232d442d4f6dfa1e347936fa9c1d9de2b862a
Merge: cdd003511f 4767266eb4
Author: Josh Steadmon <steadmon@google.com>
Date: Fri Feb 14 10:34:11 2025 -0800
Merge branch 'next' into debian-experimental
Change-Id: I23c3b0e3fed049156da231b4d6b0c8d481d7f68f
Signed-off-by: Josh Steadmon <steadmon@google.com>
commit 4767266eb4cedeaf40e4bda87fb9c8b6ae1ef127
Merge: ab142d21e8 3eeed876a9
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 13 13:48:23 2025 -0800
Merge branch 'ac/doc-http-ssl-type-config' into next
Two configuration variables about SSL authentication material that
weren't mentioned in the documentations are now mentioned.
* ac/doc-http-ssl-type-config:
docs: indicate http.sslCertType and sslKeyType
commit ab142d21e83327d8eb26a482349093f1609556ae
Merge: 2069f4865c 832f56f06a
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 13 13:48:23 2025 -0800
Merge branch 'jc/doc-boolean-synonyms' into next
Doc updates.
* jc/doc-boolean-synonyms:
doc: centrally document various ways tospell `true` and `false`
commit 2069f4865c39ed7017d66df693937600eaa8fa2b
Merge: d4e8288c9b 45761988ac
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 13 13:48:22 2025 -0800
Merge branch 'en/doc-renormalize' into next
Doc updates.
* en/doc-renormalize:
doc: clarify the intent of the renormalize option in the merge machinery
commit d4e8288c9b136a078a53c228b9fbad96f5850eea
Merge: 5ffbd7fcf8 62898b8f5e
Author: Junio C Hamano <gitster@pobox.com>
Date: Thu Feb 13 13:48:22 2025 -0800
Merge branch 'ua/update-server-info-sans-the-repository' into next
Code clean-up.
* ua/update-server-info-sans-the-repository:
builtin/update-server-info: remove the_repository global variable
commit 5ffbd7fcf84b313bb07e91246eb9419ebd94a7e7
Merge: d13b5baf06 e2067b49ec
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Feb 12 10:11:08 2025 -0800
Sync with 'master'
commit d13b5baf06b301c3b4297930003759edc1f2edc9
Merge: c4ad516cd7 59d26bd961
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Feb 11 15:45:07 2025 -0800
Merge branch 'bc/contrib-thunderbird-patch-inline-fix' into next
A thunderbird helper script lost its bashism.
* bc/contrib-thunderbird-patch-inline-fix:
thunderbird-patch-inline: avoid bashism
commit c4ad516cd7fc4e722ab73f2fbbd245aaf181b2c9
Merge: 782243c538 f1cc562b77
Author: Junio C Hamano <gitster@pobox.com>
Date: Tue Feb 11 15:45:07 2025 -0800
Merge branch 'lo/t7603-path-is-file-update' into next
Test clean-up.
* lo/t7603-path-is-file-update:
t7603: replace test -f by test_path_is_file
commit 782243c5383dd40d26d75dc97d7fc39900fb60a7
Merge: e22cc108b6 388218fac7
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Feb 10 10:22:52 2025 -0800
Sync with 'master'
commit e22cc108b684920a6e46f924893279c821135d13
Merge: 88955fe5b4 7c2f291943
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Feb 10 10:22:34 2025 -0800
Merge branch 'da/difftool-sans-the-repository' into next
"git difftool" code clean-up.
* da/difftool-sans-the-repository:
difftool: eliminate use of USE_THE_REPOSITORY_VARIABLE
difftool: eliminate use of the_repository
difftool: eliminate use of global variables
commit 88955fe5b4b1dc7505854d9ee138915a27e8210d
Merge: 7d93e5ad97 3295c35398
Author: Junio C Hamano <gitster@pobox.com>
Date: Mon Feb 10 10:22:34 2025 -0800
Merge branch 'jt/rev-list-missing-print-info' into next
"git rev-list --missing=" learned to accept "print-info" that gives
known details expected of the missing objects, like path and type.
* jt/rev-list-missing-print-info:
rev-list: extend print-info to print missing object type
rev-list: add print-info action to print missing object path