]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 weeks agotest-lib: respect GIT_TEST_INSTALLED when querying default hash
Kyle Lippincott [Tue, 15 Jul 2025 18:57:54 +0000 (18:57 +0000)] 
test-lib: respect GIT_TEST_INSTALLED when querying default hash

$GIT_TEST_INSTALLED can be set to use an "installed" git instead of the
one from $GIT_BUILD_DIR. This is used by my company's internal test
infrastructure, and not using $GIT_TEST_INSTALLED when querying the
default hash meant that the tests were failing because the hash was
effectively set to the empty string (since git didn't execute).

In the two places we attempt to detect/execute git itself prior to
overriding everything and putting it in $PATH, use identical logic for
identifying the git binary to execute. This also has the effect of
including the $X suffix when querying the default hash, but that's not
strictly necessary. You don't need to specify .exe when running a binary
on Windows, just when testing whether it exists or not.

Signed-off-by: Kyle Lippincott <spectral@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 weeks agoMerge branch 'bc/use-sha256-by-default-in-3.0' into kl/test-installed-fix
Junio C Hamano [Tue, 15 Jul 2025 21:31:01 +0000 (14:31 -0700)] 
Merge branch 'bc/use-sha256-by-default-in-3.0' into kl/test-installed-fix

5 weeks agoEnable SHA-256 by default in breaking changes mode
brian m. carlson [Tue, 1 Jul 2025 21:22:37 +0000 (21:22 +0000)] 
Enable SHA-256 by default in breaking changes mode

Our document on breaking changes indicates that we intend to default to
SHA-256 in Git 3.0.  Since most people choose the default option, this
is an important security upgrade to our defaults.

To allow people to test this case, when WITH_BREAKING_CHANGES is set in
the configuration, build Git with SHA-256 as the default hash.  Update
the testsuite to use the build options information to automatically
choose the right value.

Note that if the command substitution for GIT_TEST_BUILTIN_HASH fails,
so does the testsuite—and quite spectacularly at that.  Thus, the case
where the Git binary is somehow subtly broken will not go undetected.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agohelp: add a build option for default hash
brian m. carlson [Tue, 1 Jul 2025 21:22:36 +0000 (21:22 +0000)] 
help: add a build option for default hash

We'd like users to be able to determine the hash algorithm that is the
builtin default in their version of Git.  This is useful for
troubleshooting, especially when we decide to change the default.  Add
an entry for the default hash in the output of git version
--build-options so that users can easily access that information and
include it in bug reports.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agot5300: choose the built-in hash outside of a repo
brian m. carlson [Tue, 1 Jul 2025 21:22:35 +0000 (21:22 +0000)] 
t5300: choose the built-in hash outside of a repo

Right now, the built-in default hash is always SHA-1, but that will
change in a future commit.  Instead of assuming that operating outside
of a repository will always use SHA-1, look up the default hash
algorithm for operating outside of a repository using an appropriate
environment variable, which will always be correct.

Additionally, for operations outside of a repository, use the
DEFAULT_HASH_ALGORITHM prerequisite rather than SHA1.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agot4042: choose the built-in hash outside of a repo
brian m. carlson [Tue, 1 Jul 2025 21:22:34 +0000 (21:22 +0000)] 
t4042: choose the built-in hash outside of a repo

Right now, the built-in default hash is always SHA-1, but that will
change in a future commit.  Instead of assuming that operating outside
of a repository will always use SHA-1, provide constants for both
algorithms and then simply ask test_oid for the built-in hash instead,
which will always be correct.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agot1007: choose the built-in hash outside of a repo
brian m. carlson [Tue, 1 Jul 2025 21:22:33 +0000 (21:22 +0000)] 
t1007: choose the built-in hash outside of a repo

Right now, the built-in default hash is always SHA-1, but that will
change in a future commit.  Instead of assuming that operating outside
of a repository will always use SHA-1, simply ask test_oid for the
built-in hash instead, which will always be correct.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agot: default to compile-time default hash if not set
brian m. carlson [Tue, 1 Jul 2025 21:22:32 +0000 (21:22 +0000)] 
t: default to compile-time default hash if not set

Right now, the default compile-time hash is SHA-1.  However, in the
future, this might change and it would be helpful to gracefully handle
this case in our testsuite.

To avoid making these assumptions, let's introduce a variable that
contains the built-in default hash and use it in our setup code as the
fallback value if no hash was explicitly set.  For now, this is always
SHA-1, but in a future commit, we'll allow adjusting this and the
variable will be more useful.

To allow us to make our tests more robust, allow test_oid to take the
--hash=builtin option to specify this hash, whatever it is.

Additionally, add a DEFAULT_HASH_ALGORITHM prerequisite to check for the
compile-time hash.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agosetup: use the default algorithm to initialize repo format
brian m. carlson [Tue, 1 Jul 2025 21:22:31 +0000 (21:22 +0000)] 
setup: use the default algorithm to initialize repo format

When we define a new repository format with REPOSITORY_FORMAT_INIT, we
always use GIT_HASH_SHA1, and this value ends up getting used as the
default value to initialize a repository if none of the command line,
environment, or config tell us to do otherwise.

Because we might not always want to use SHA-1 as the default, let's
instead specify the default hash algorithm constant so that we will use
whatever the specified default is.

However, we also need to continue to read older repositories.  If we're
in a v0 repository or extensions.objectformat is not set, then we must
continue to default to the original hash algorithm: SHA-1.  If an
algorithm is set explicitly, however, it will override the hash_algo
member of the repository_format struct and we'll get the right value.

Similarly, if the repository was initialized before Git 0.99.3, then it
may lack a core.repositoryformatversion key, and some repositories lack
a config file altogether.  In both cases, format->version is -1 and we
need to assume that SHA-1 is in use.

Because clear_repository_format reinitializes the struct
repository_format and therefore sets the hash_algo member to the default
(which could in the future not be SHA-1), we need to reset this member
explicitly.  We know, however, that at the point we call
read_repository_format, we are actually reading an existing repository
and not initializing a new one or operating outside of a repository, so
we are not changing the default behavior back to SHA-1 if the default
algorithm is different.

It is potentially questionable that we ignore all repository
configuration if there is a config file but it doesn't have
core.repositoryformatversion set, in which case we reset all of the
configuration to the default.  However, it is unclear what the right
thing to do instead with such an old repository is and a simple git init
will add the missing entry, so for now, we simply honor what the
existing code does and reset the value to the default, simply adding our
initialization to SHA-1.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agoUse legacy hash for legacy formats
brian m. carlson [Tue, 1 Jul 2025 21:22:30 +0000 (21:22 +0000)] 
Use legacy hash for legacy formats

We have a large variety of data formats and protocols where no hash
algorithm was defined and the default was assumed to always be SHA-1.
Instead of explicitly stating SHA-1, let's use the constant to represent
the legacy hash algorithm (which is still SHA-1) so that it's clear
for documentary purposes that it's a legacy fallback option and not an
intentional choice to use SHA-1.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agobuiltin: use default hash when outside a repository
brian m. carlson [Tue, 1 Jul 2025 21:22:29 +0000 (21:22 +0000)] 
builtin: use default hash when outside a repository

We have some commands that can operate inside or outside a repository.
If we're operating outside a repository, we clearly cannot use the
repository's hash algorithm as a default since it doesn't exist, so
instead, let's pick the default instead of specifically SHA-1.  Right
now this results in no functional change since the default is SHA-1, but
that may change in the future.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agohash: add a constant for the legacy hash algorithm
brian m. carlson [Tue, 1 Jul 2025 21:22:28 +0000 (21:22 +0000)] 
hash: add a constant for the legacy hash algorithm

We have a a variety of uses of GIT_HASH_SHA1 littered throughout our
code.  Some of these really mean to represent specifically SHA-1, but
some actually represent the original hash algorithm used in Git which is
implied by older, legacy formats and protocols which do not contain hash
information.  For instance, the bundle v1 and v2 formats do not contain
hash algorithm information, and thus SHA-1 is implied by the use of
these formats.

Add a constant for documentary purposes which indicates this value.  It
will always be the same as SHA-1, since this is an essential part of
these formats, but its use indicates this particular reason and not any
other reason why SHA-1 might be used.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 weeks agohash: add a constant for the default hash algorithm
brian m. carlson [Tue, 1 Jul 2025 21:22:27 +0000 (21:22 +0000)] 
hash: add a constant for the default hash algorithm

Right now, SHA-1 is the default hash algorithm in Git.  However, this
may change in the future.

We have many places in our code that use the SHA-1 constant to indicate
the default hash if none is specified, but it will end up being more
practical to specify this explicitly and clearly using a constant for
whatever the default hash algorithm is.  Then, if we decide to change it
in the future, we can simply replace the constant representing the
default with a new value.

For these reasons, introduce GIT_HASH_DEFAULT to represent the default
hash algorithm.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoGit 2.50 v2.50.0
Junio C Hamano [Mon, 16 Jun 2025 04:17:21 +0000 (21:17 -0700)] 
Git 2.50

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoHopefully final bits before 2.50
Junio C Hamano [Fri, 13 Jun 2025 20:28:57 +0000 (13:28 -0700)] 
Hopefully final bits before 2.50

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoMerge branch 'js/github-ci-win-coverity-fix'
Junio C Hamano [Fri, 13 Jun 2025 20:29:14 +0000 (13:29 -0700)] 
Merge branch 'js/github-ci-win-coverity-fix'

Fixes for GitHub Actions Coverity job.

* js/github-ci-win-coverity-fix:
  ci(coverity): output the build log upon error
  ci(coverity): fix building on Windows

8 weeks agoMerge branch 'ss/revert-builtin-bswap-stuff'
Junio C Hamano [Fri, 13 Jun 2025 20:29:14 +0000 (13:29 -0700)] 
Merge branch 'ss/revert-builtin-bswap-stuff'

Revert a botched bswap.h change that broke ntohll() functions on
big-endian systems with __builtin_bswap32/64().

* ss/revert-builtin-bswap-stuff:
  Revert "bswap.h: add support for built-in bswap functions"

8 weeks agoMerge branch 'jc/sed-build-fixes'
Junio C Hamano [Fri, 13 Jun 2025 20:29:14 +0000 (13:29 -0700)] 
Merge branch 'jc/sed-build-fixes'

Build fix.

* jc/sed-build-fixes:
  build: sed portability fixes

8 weeks agoMerge tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po
Junio C Hamano [Fri, 13 Jun 2025 00:31:42 +0000 (17:31 -0700)] 
Merge tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po

l10n-2.50.0-v2

* tag 'l10n-2.50.0-v2' of https://github.com/git-l10n/git-po:
  l10n: zh_TW: update translation for Git 2.50

8 weeks agoMerge branch 'kh/maintenance-missing-tasks-docfix'
Junio C Hamano [Thu, 12 Jun 2025 21:19:10 +0000 (14:19 -0700)] 
Merge branch 'kh/maintenance-missing-tasks-docfix'

Doc mark-up fix for a topic that has graduated to 'master'.

* kh/maintenance-missing-tasks-docfix:
  doc: maintenance: fix linkgit syntax

8 weeks agobuild: sed portability fixes
Junio C Hamano [Thu, 12 Jun 2025 17:04:58 +0000 (10:04 -0700)] 
build: sed portability fixes

Recently generating the version-def.h file and the config-list.h
file have been updated, which broke versions of "sed" that do not
want to be fed a file that ends with an incomplete line, and/or that
do not understand the more recent "-E" option to use extended
regular expression.

Fix them in response to a build-failure reported on Solaris boxes.

cf. https://lore.kernel.org/git/09f954b8-d9c3-418f-ad4b-9cb9b063f4ae@comstyle.com/

Reported-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agoMerge tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po
Junio C Hamano [Thu, 12 Jun 2025 20:35:08 +0000 (13:35 -0700)] 
Merge tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po

l10n-2.50.0-rnd1

* tag 'l10n-2.50.0-rnd1' of https://github.com/git-l10n/git-po:
  l10n: zh_CN: updated translation for 2.50
  l10n: Update German translation
  l10n: uk: add 2.50 translation
  l10n: po-id for 2.50
  l10n: bg.po: Updated Bulgarian translation (5819t)
  l10n: tr: Update Turkish translations for 2.50
  l10n: fr: v2.50 round 1
  l10n: Add full Irish translation (ga.po)

8 weeks agoRevert "bswap.h: add support for built-in bswap functions"
Sebastian Andrzej Siewior [Wed, 11 Jun 2025 22:14:37 +0000 (00:14 +0200)] 
Revert "bswap.h: add support for built-in bswap functions"

Since 6547d1c9 (bswap.h: add support for built-in bswap
functions, 2025-04-23) tweaked the way the bswap32/64 macros are
defined, on platforms with __builtin_bswap32/64 supported, the
bswap32/64 macros are defined even on big endian platforms.

However the rest of this file assumes that bswap32/64() are defined
ONLY on little endian machines and uses that assumption to redefine
ntohl/ntohll macros. The said commit broke t4014-format-patch.sh test,
among many others on s390x.

Revert the commit.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 weeks agol10n: zh_TW: update translation for Git 2.50
Yi-Jyun Pan [Thu, 12 Jun 2025 14:25:39 +0000 (22:25 +0800)] 
l10n: zh_TW: update translation for Git 2.50

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
8 weeks agol10n: zh_CN: updated translation for 2.50
Teng Long [Wed, 11 Jun 2025 14:04:19 +0000 (22:04 +0800)] 
l10n: zh_CN: updated translation for 2.50

Helped-by: 依云 <lilydjwg@gmail.com>
Helped-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
2 months agoMerge branch '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n
Jiang Xin [Thu, 12 Jun 2025 01:53:04 +0000 (09:53 +0800)] 
Merge branch '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n

* '2.50-uk-update' of https://github.com/arkid15r/git-ukrainian-l10n:
  l10n: uk: add 2.50 translation

2 months agoMerge branch 'l10n-de-2.50' of https://github.com/ralfth/git
Jiang Xin [Thu, 12 Jun 2025 01:49:37 +0000 (09:49 +0800)] 
Merge branch 'l10n-de-2.50' of https://github.com/ralfth/git

* 'l10n-de-2.50' of https://github.com/ralfth/git:
  l10n: Update German translation

2 months agoRelNotes/2.50.0: fix typos & other improvements
Kristoffer Haugsbakk [Wed, 11 Jun 2025 17:35:24 +0000 (19:35 +0200)] 
RelNotes/2.50.0: fix typos & other improvements

• Replace with phrases that are more standard (“all-or-nothing”
  instead of “-none”)
• Add coordinating words that make it less likely for you to trip
  over the sentence (“*that* "gc" can do”)
• Use “SMTP” instead of both SMTP and smtp
• Don’t mention `git fsck --reference` since the previous release
  was not affected by this minor bug.  Also say “errored out” since
  the git-refs(1) bug was there in v2.48.0 as well
• Use the more widespread “linked” instead of “secondary worktree”

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoci(coverity): output the build log upon error
Johannes Schindelin [Wed, 11 Jun 2025 15:54:38 +0000 (15:54 +0000)] 
ci(coverity): output the build log upon error

It is quite helpful to know what Coverity said, exactly, in case it
fails to analyze the code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoci(coverity): fix building on Windows
Johannes Schindelin [Wed, 11 Jun 2025 15:54:37 +0000 (15:54 +0000)] 
ci(coverity): fix building on Windows

When I added the Coverity workflow in a56b6230d0b1 (ci: add a GitHub
workflow to submit Coverity scans, 2023-09-25), I merely converted an
Azure Pipeline definition that had been running successfully for ages.

In the meantime, the current Coverity documentation describes a very
different way to install the analysis tool, recommending to add the
`bin/` directory to the _end_ of `PATH` (when originally, IIRC, it was
recommended to add it to the _beginning_ of the `PATH`).

This is crucial! The reason is that the current incarnation of the
Windows variant of Coverity's analysis tools come with a _lot_ of DLL
files in their `bin/` directory, some of them interferring rather badly
with the `gcc.exe` in Git for Windows' SDK that we use to run the
Coverity build. The symptom is a cryptic error message:

  make: *** [Makefile:2960: headless-git.o] Error 1
  make: *** Waiting for unfinished jobs....
  D:\git-sdk-64-minimal\mingw64\bin\windres.exe: preprocessing failed.
  make: *** [Makefile:2679: git.res] Error 1
  make: *** [Makefile:2893: git.o] Error 1
  make: *** [Makefile:2893: builtin/add.o] Error 1
  Attempting to detect unconfigured compilers in build
  |0----------25-----------50----------75---------100|
  ****************************************************
  Warning:  Build command make.exe exited with code 2. Please verify that the build completed successfully.
  Warning:  Emitted 0 C/C++ compilation units (0%) successfully

  0 C/C++ compilation units (0%) are ready for analysis
   For more details, please look at:
      D:/a/git/git/cov-int/build-log.txt

The log (which the workflow is currently not configured to reveal) then
points out that the `windows.h` header cannot be found, which is _still_
not very helpful. The underlying root cause is that the `gcc.exe` in Git
for Windows' SDK determines the location of the header files via the
location of certain DLL files, and finding the "wrong" ones first on the
`PATH` misleads that logic.

Let's fix this problem by following Coverity's current recommendation
and append the `bin/` directory in which `cov-int` can be found to the
_end_ of `PATH`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agol10n: Update German translation
Ralf Thielow [Sat, 31 May 2025 12:40:17 +0000 (14:40 +0200)] 
l10n: Update German translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 months agol10n: uk: add 2.50 translation
Arkadii Yakovets [Wed, 11 Jun 2025 01:23:00 +0000 (18:23 -0700)] 
l10n: uk: add 2.50 translation

Co-authored-by: Kate Golovanova <kate@kgthreads.com>
Co-authored-by: Tamara Lazerka <98753789+aramattamara@users.noreply.github.com>
Signed-off-by: Arkadii Yakovets <ark@cho.red>
Signed-off-by: Kate Golovanova <kate@kgthreads.com>
Signed-off-by: Tamara Lazerka <98753789+aramattamara@users.noreply.github.com>
2 months agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Mon, 9 Jun 2025 23:43:17 +0000 (07:43 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.50

2 months agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Mon, 9 Jun 2025 23:42:34 +0000 (07:42 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5819t)

2 months agoMerge branch 'l10n_fr_v2.50' of github.com:jnavila/git
Jiang Xin [Mon, 9 Jun 2025 23:41:22 +0000 (07:41 +0800)] 
Merge branch 'l10n_fr_v2.50' of github.com:jnavila/git

* 'l10n_fr_v2.50' of github.com:jnavila/git:
  l10n: fr: v2.50 round 1

2 months agoMerge branch 'tr-l10n' of github.com:bitigchi/git-po
Jiang Xin [Mon, 9 Jun 2025 23:39:49 +0000 (07:39 +0800)] 
Merge branch 'tr-l10n' of github.com:bitigchi/git-po

* 'tr-l10n' of github.com:bitigchi/git-po:
  l10n: tr: Update Turkish translations for 2.50

2 months agoMerge branch 'master' of github.com:aindriu80/git-po
Jiang Xin [Mon, 9 Jun 2025 23:37:22 +0000 (07:37 +0800)] 
Merge branch 'master' of github.com:aindriu80/git-po

* 'master' of github.com:aindriu80/git-po:
  l10n: Add full Irish translation (ga.po)

2 months agodoc: maintenance: fix linkgit syntax
Kristoffer Haugsbakk [Mon, 9 Jun 2025 15:59:42 +0000 (17:59 +0200)] 
doc: maintenance: fix linkgit syntax

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoGit 2.50-rc2 v2.50.0-rc2
Junio C Hamano [Mon, 9 Jun 2025 14:17:31 +0000 (07:17 -0700)] 
Git 2.50-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'mm/test-in-absolute-home'
Junio C Hamano [Mon, 9 Jun 2025 14:15:50 +0000 (07:15 -0700)] 
Merge branch 'mm/test-in-absolute-home'

Tests that compare $HOME and $(pwd), which should be the same
directory unless the tests chdir's around, would fail when the user
enters the test directory via symbolic links, which has been
corrected.

* mm/test-in-absolute-home:
  t: run tests from a normalized working directory

2 months agoA bit more before -rc2
Junio C Hamano [Sat, 7 Jun 2025 17:46:34 +0000 (10:46 -0700)] 
A bit more before -rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'js/curl-easy-setopt-typefix'
Junio C Hamano [Sat, 7 Jun 2025 17:46:50 +0000 (10:46 -0700)] 
Merge branch 'js/curl-easy-setopt-typefix'

Adjust to newer version of libcURL.

* js/curl-easy-setopt-typefix:
  curl: pass `long` values where expected

2 months agoMerge branch 'jk/curl-easy-setopt-typefix'
Junio C Hamano [Sat, 7 Jun 2025 17:46:50 +0000 (10:46 -0700)] 
Merge branch 'jk/curl-easy-setopt-typefix'

Adjust to newer version of libcURL.

* jk/curl-easy-setopt-typefix:
  curl: fix symbolic constant typechecks with curl_easy_setopt()
  curl: fix integer variable typechecks with curl_easy_setopt()
  curl: fix integer constant typechecks with curl_easy_setopt()

2 months agoMerge branch 'bs/bsd-wo-specific-xopen-source'
Junio C Hamano [Sat, 7 Jun 2025 17:46:50 +0000 (10:46 -0700)] 
Merge branch 'bs/bsd-wo-specific-xopen-source'

Build fix for BSDs.

* bs/bsd-wo-specific-xopen-source:
  compat: fixes for header handling with OpenBSD / NetBSD

2 months agoMerge branch 'cf/var-completion-obsd-fixes'
Junio C Hamano [Sat, 7 Jun 2025 17:46:49 +0000 (10:46 -0700)] 
Merge branch 'cf/var-completion-obsd-fixes'

Build fix for OpenBSD.

* cf/var-completion-obsd-fixes:
  completion: make sed command that generates config-list.h portable.

2 months agol10n: po-id for 2.50
Bagas Sanjaya [Thu, 29 May 2025 08:39:46 +0000 (15:39 +0700)] 
l10n: po-id for 2.50

Update following components:

  * builtin/cat-file.c
  * builtin/fast-export.c
  * builtin/fsck.c
  * builtin/merge-tree.c
  * builtin/mv.c
  * builtin/reflog.c
  * builtin/repack.c
  * builtin/rev-list.c
  * builtin/update-ref.c
  * command-list.h
  * midx-write.c
  * object-file.c
  * parse-options.c
  * promisor-remote.c
  * refs/packed-backend.c
  * scalar.c
  * t/helper/test-pack-deltas.c
  * git-send-email.perl

Translate following new components:

  * builtin/diff-pairs.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2 months agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Fri, 6 Jun 2025 16:41:59 +0000 (09:41 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui:
  git-gui: don't delete source files when auto_mkindex fails

2 months agocurl: pass `long` values where expected
Johannes Schindelin [Fri, 6 Jun 2025 09:29:24 +0000 (09:29 +0000)] 
curl: pass `long` values where expected

As of Homebrew's update to cURL v8.14.0, there are new compile errors to
be observed in the `osx-gcc` job of Git's CI builds:

  In file included from http.h:8,
                   from imap-send.c:36:
  In function 'setup_curl',
      inlined from 'curl_append_msgs_to_imap' at imap-send.c:1460:9,
      inlined from 'cmd_main' at imap-send.c:1581:9:
  /usr/local/Cellar/curl/8.14.0/include/curl/typecheck-gcc.h:50:15: error: call to '_curl_easy_setopt_err_long' declared with attribute warning: curl_easy_setopt expects a long argument [-Werror=attribute-warning]
     50 |               _curl_easy_setopt_err_long();                             \
        |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/local/Cellar/curl/8.14.0/include/curl/curl.h:54:7: note: in definition of macro 'CURL_IGNORE_DEPRECATION'
     54 |       statements \
        |       ^~~~~~~~~~
  imap-send.c:1423:9: note: in expansion of macro 'curl_easy_setopt'
   1423 |         curl_easy_setopt(curl, CURLOPT_PORT, srvc->port);
        |         ^~~~~~~~~~~~~~~~
  [... many more instances of nearly identical warnings...]

See for example this CI workflow run:
https://github.com/git/git/actions/runs/15454602308/job/43504278284#step:4:307

The most likely explanation is the entry "typecheck-gcc.h: fix the
typechecks" in cURL's release notes (https://curl.se/ch/8.14.0.html).

Nearly identical compile errors afflicted recently-updated Debian
setups, which have been addressed by `jk/curl-easy-setopt-typefix`.

However, on macOS Git is built with different build options, which
uncovered more instances of `int` values that need to be cast to
constants, which were not covered by 6f11c42e8edc (curl: fix integer
constant typechecks with curl_easy_setopt(), 2025-06-04). Let's
explicitly convert even those remaining `int` constants in
`curl_easy_setopt()` calls to `long` parameters.

In addition to looking at the compile errors of the `osx-gcc` job, I
verified that there are no other instances of the same issue that need
to be handled in this manner (and that might not be caught by our CI
builds because of yet other build options that might skip those code
parts), I ran the following command and inspected all 23 results
manually to ensure that the fix is now actually complete:

  git grep -n curl_easy_setopt |
  grep -ve ',.*, *[A-Za-z_"&]' \
    -e ',.*, *[-0-9]*L)' \
    -e ',.*,.* (long)'

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agogit-gui: don't delete source files when auto_mkindex fails
Johannes Sixt [Fri, 6 Jun 2025 05:41:42 +0000 (07:41 +0200)] 
git-gui: don't delete source files when auto_mkindex fails

Commit 2cc5b0facfa4 (git-gui: extract script to generate "tclIndex",
2025-03-11) converted commands in a Makefile rule to a shell script.
In this process, the Makefile variable $@ had to be replaced by the
file name that it represents, 'lib/tclIndex'. However, the occurrence
in `rm -f $@` was missed. In a shell script, $@ expands to all
command line arguments, which happen to be the source files lib/*.tcl
in this case. Needless to say that we do not want to remove source
files during a build. Replace $@ by the intended 'lib/tclIndex'.

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 months agoMerge branch 'js/t5410-tee-hang-workaround'
Junio C Hamano [Thu, 5 Jun 2025 18:56:29 +0000 (11:56 -0700)] 
Merge branch 'js/t5410-tee-hang-workaround'

* js/t5410-tee-hang-workaround:
  t5410: avoid hangs in CI runs in the win+Meson test jobs

2 months agot5410: avoid hangs in CI runs in the win+Meson test jobs
Johannes Schindelin [Thu, 5 Jun 2025 10:16:45 +0000 (10:16 +0000)] 
t5410: avoid hangs in CI runs in the win+Meson test jobs

In the GitHub workflow used in Git's CI builds, the `vs test` jobs use a
subset of a specific revision of Git for Windows' SDK to run Git's test
suite. This revision is validated by another CI workflow to ensure that
said revision _can_ run Git's test suite successfully, skipping buggy
updates in Git for Windows' SDK.

The `win+Meson test` jobs do things differently, quite differently. They
use the Bash of the Git for Windows version that is installed on the
runners to run Git's test suite.

This difference has consequences.

When 68cb0b5253a0 (builtin/receive-pack: add option to skip connectivity
check, 2025-05-20) introduced a test case that uses `tee <file> | git
receive-pack` as `--receive-pack` parameter (imitating an existing
pattern in the same test script), it hit just the sweet spot to trigger
a bug in the MSYS2 runtime shipped in Git for Windows v2.49.0. This
version is the one currently installed on GitHub's runners.

The problem is that the `git receive-pack` process finishes while the
`tee` process does not need to write anything anymore and therefore does
not receive an EOF. Instead, it should receive a SIGPIPE, but the bug in
the MSYS2 runtime prevents that from working as intended. As a
consequence, the `tee` process waits for more input from the `git.exe
send-pack` process but none is coming, and the test script patiently
waits until the 6h timeout hits.

Only every once in a while, the `git receive-pack` process manages to
send an EOF to the `tee` process and no hang occurs. Therefore, the
problem can be worked around by cancelling the clearly-hanging job after
twenty or so minutes and re-running it, repeating the process about half
a dozen times, until the hang was successfully avoided.

This bug in the MSYS2 runtime has been fixed in the meantime, which is
the reason why the same test case causes no problems in the `win test`
and the `vs test` jobs.

This will continue to be the case until the Git for Windows version on
the GitHub runners is upgraded to a version that distributes a newer
MSYS2 runtime version. However, as of time of writing, this _is_ the
latest Git for Windows version, and will be for another 1.5 weeks, until
Git v2.50.0 is scheduled to appear (and shortly thereafter Git for
Windows v2.50.0). Traditionally it takes a while before the runners pick
up the new version.

We could just wait it out, six hours at a time.

Here, I opt for an alternative: Detect the buggy MSYS2 runtime and
simply skip the test case. It's not like the `receive-pack` test cases
are specific to Windows, and even then, to my chagrin the CI runs in
git-for-windows/git spend around ten hours of compute time each and
every time to run the entire test suite on all the platforms, even the
tests that cover cross-platform code, and for Windows alone we do that
three times: with GCC, with MSVC, and with MSVC via Meson. Therefore, I
deem it more than acceptable to skip this test case in one of those
matrices.

For good luck, also the preceding test case is skipped in that scenario,
as it uses the same `--receive-pack=tee <file> | git receive-pack`
pattern, even though I never observed that test case to hang in
practice.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'jk/curl-easy-setopt-typefix' into js/curl-easy-setopt-typefix
Junio C Hamano [Thu, 5 Jun 2025 15:56:57 +0000 (08:56 -0700)] 
Merge branch 'jk/curl-easy-setopt-typefix' into js/curl-easy-setopt-typefix

* jk/curl-easy-setopt-typefix:
  curl: fix symbolic constant typechecks with curl_easy_setopt()
  curl: fix integer variable typechecks with curl_easy_setopt()
  curl: fix integer constant typechecks with curl_easy_setopt()

2 months agoMerge branch 'bs/config-mak-openbsd'
Junio C Hamano [Wed, 4 Jun 2025 21:30:28 +0000 (14:30 -0700)] 
Merge branch 'bs/config-mak-openbsd'

Build fix for OpenBSD

* bs/config-mak-openbsd:
  config.mak.uname: update settings for OpenBSD

2 months agocurl: fix symbolic constant typechecks with curl_easy_setopt()
Jeff King [Wed, 4 Jun 2025 20:56:22 +0000 (16:56 -0400)] 
curl: fix symbolic constant typechecks with curl_easy_setopt()

As with the previous two commits, we should be passing long integers,
not regular ones, to curl_easy_setopt(), and compiling against curl 8.14
loudly complains if we don't.

This patch catches the remaining cases, which are ones where we pass
curl's own symbolic constants. We'll cast them to long manually in each
call.

It seems kind of weird to me that curl doesn't define these constants as
longs, since the point of them is to pass to curl_easy_setopt(). But in
the curl documentation and examples, they clearly show casting them as
part of the setopt calls. It may be that there is some reason not to
push the type into the macro, like backwards compatibility. I didn't
dig, as it doesn't really matter: we have to follow what existing curl
versions ask for anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocurl: fix integer variable typechecks with curl_easy_setopt()
Jeff King [Wed, 4 Jun 2025 20:55:52 +0000 (16:55 -0400)] 
curl: fix integer variable typechecks with curl_easy_setopt()

As discussed in the previous commit, we should be passing long integers,
not regular ones, to curl_easy_setopt(), and compiling against curl 8.14
loudly complains if we don't.

That patch fixed integer constants by adding an "L". This one deals with
actual variables.

Arguably these variables could just be declared as "long" in the first
place. But it's actually kind of awkward due to other code which uses
them:

  - port is conceptually a short, and we even call htons() on it (though
    weirdly it is defined as a regular int).

  - ssl_verify is conceptually a bool, and we assign to it from
    git_config_bool().

So I think we could probably switch these out for longs without hurting
anything, but it just feels a bit weird. Doubly so because if you don't
set USE_CURL_FOR_IMAP_SEND set, then the current types are fine!

So let's just cast these to longs in the curl calls, which makes what's
going on obvious. There aren't that many spots to modify (and as you can
see from the context, we already have some similar casts).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocurl: fix integer constant typechecks with curl_easy_setopt()
Jeff King [Wed, 4 Jun 2025 20:55:13 +0000 (16:55 -0400)] 
curl: fix integer constant typechecks with curl_easy_setopt()

The curl documentation specifies that curl_easy_setopt() takes either:

  ...a long, a function pointer, an object pointer or a curl_off_t,
  depending on what the specific option expects.

But when we pass an integer constant like "0", it will by default be a
regular non-long int. This has always been wrong, but seemed to work in
practice (I didn't dig into curl's implementation to see whether this
might actually be triggering undefined behavior, but it seems likely and
regardless we should do what the docs say).

This is especially important since curl has a type-checking macro that
causes building against curl 8.14 to produce many warnings. The specific
commit is due to their 79b4e56b3 (typecheck-gcc.h: fix the typechecks,
2025-04-22). Curiously, it does only seem to trigger when compiled with
-O2 for me.

We can fix it by just marking the constants with a long "L".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoGit 2.50-rc1 v2.50.0-rc1
Junio C Hamano [Tue, 3 Jun 2025 15:50:59 +0000 (08:50 -0700)] 
Git 2.50-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'bs/online-cpus-bsd'
Junio C Hamano [Tue, 3 Jun 2025 15:55:24 +0000 (08:55 -0700)] 
Merge branch 'bs/online-cpus-bsd'

Update online_cpus() functrion on BSD variants.

* bs/online-cpus-bsd:
  thread-utils.c: detect online CPU count on OpenBSD / NetBSD

2 months agoMerge branch 'bs/total-ram-bsd'
Junio C Hamano [Tue, 3 Jun 2025 15:55:23 +0000 (08:55 -0700)] 
Merge branch 'bs/total-ram-bsd'

Update total_ram() functrion on BSD variants.

* bs/total-ram-bsd:
  builtin/gc: correct physical memory detection for OpenBSD / NetBSD

2 months agoMerge branch 'kh/doc-column-markup-fix'
Junio C Hamano [Tue, 3 Jun 2025 15:55:23 +0000 (08:55 -0700)] 
Merge branch 'kh/doc-column-markup-fix'

Doc updates.

* kh/doc-column-markup-fix:
  doc: column: fix blank lines around block delimiters

2 months agoMerge branch 'sj/ref-contents-check-fix'
Junio C Hamano [Tue, 3 Jun 2025 15:55:23 +0000 (08:55 -0700)] 
Merge branch 'sj/ref-contents-check-fix'

"git verify-refs" (and hence "git fsck --reference") started
erroring out in a repository in which secondary worktrees were
prepared with Git 2.43 or lower.

* sj/ref-contents-check-fix:
  fsck: ignore missing "refs" directory for linked worktrees

2 months agocompat: fixes for header handling with OpenBSD / NetBSD
Brad Smith [Mon, 2 Jun 2025 07:29:02 +0000 (03:29 -0400)] 
compat: fixes for header handling with OpenBSD / NetBSD

Handle OpenBSD and NetBSD as FreeBSD / DragonFly are. OpenBSD would
need _XOPEN_SOURCE to be set to 700. Its simpler to just not set
_XOPEN_SOURCE.

    CC strbuf.o
strbuf.c:645:6: warning: call to undeclared function 'getdelim'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        r = getdelim(&sb->buf, &sb->alloc, term, fp);
            ^
1 warning generated.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocompletion: make sed command that generates config-list.h portable.
Collin Funk [Mon, 2 Jun 2025 22:31:32 +0000 (15:31 -0700)] 
completion: make sed command that generates config-list.h portable.

The OpenBSD 'sed' command does not support '\n' to represent newlines in
sed expressions. This leads to the follow compiler error:

    In file included from builtin/help.c:15:
    ./config-list.h:282:18: error: use of undeclared identifier 'n'
            "gitcvs.dbUser",n       "gitcvs.dbPass",
                            ^
    1 error generated.
    gmake: *** [Makefile:2821: builtin/help.o] Error 1

We can fix this by documenting related configuration variables
one-per-line instead of listing them separated by commas. This allows us
to remove the unportable part of the sed expression in
generate-configlist.sh.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Jacob Keller <jacob.keller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agofsck: ignore missing "refs" directory for linked worktrees
shejialuo [Mon, 2 Jun 2025 14:41:35 +0000 (22:41 +0800)] 
fsck: ignore missing "refs" directory for linked worktrees

"git refs verify" doesn't work if there are worktrees created on Git
v2.43.0 or older versions. These versions don't automatically create the
"refs" directory, causing the error:

    error: cannot open directory .git/worktrees/<worktree name>/refs:
    No such file or directory

Since 8f4c00de95 (builtin/worktree: create refdb via ref backend,
2024-01-08), we automatically create the "refs" directory for new
worktrees. And in 7c78d819e6 (ref: support multiple worktrees check for
refs, 2024-11-20), we assume that all linked worktrees have this
directory and would wrongly report an error to the user, thus
introducing compatibility issue.

Check for ENOENT errno before reporting directory access errors for
linked worktrees to maintain backward compatibility.

Reported-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: shejialuo <shejialuo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoA bit more before -rc1
Junio C Hamano [Mon, 2 Jun 2025 16:25:22 +0000 (09:25 -0700)] 
A bit more before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'wk/sparse-checkout-doc-fix'
Junio C Hamano [Mon, 2 Jun 2025 16:25:34 +0000 (09:25 -0700)] 
Merge branch 'wk/sparse-checkout-doc-fix'

Doc update.

* wk/sparse-checkout-doc-fix:
  doc: sparse-checkout: use consistent inline list style

2 months agoMerge branch 'jc/signed-fast-export-is-experimental'
Junio C Hamano [Mon, 2 Jun 2025 16:25:33 +0000 (09:25 -0700)] 
Merge branch 'jc/signed-fast-export-is-experimental'

Mark a new feature added during this cycle as experimental and fix
its default so that existing users of the fast-export command is
not broken.

* jc/signed-fast-export-is-experimental:
  fast-export: --signed-commits is experimental

2 months agoMerge branch 'ja/doc-synopsis-style'
Junio C Hamano [Mon, 2 Jun 2025 16:25:33 +0000 (09:25 -0700)] 
Merge branch 'ja/doc-synopsis-style'

Doc mark-up fixes.

* ja/doc-synopsis-style:
  doc: convert git-switch manpage to new synopsis style
  doc: convert git-mergetool options to new synopsis style
  doc: convert git-mergetool manpage to new synopsis style
  doc: switch merge config description to new synopsis format
  doc: convert merge strategies to synopsis format
  doc: merge-options.adoc remove a misleading double negation
  doc: convert merge options to new synopsis format
  doc: convert git-merge manpage to new style
  doc: convert git-checkout manpage to new style

2 months agoconfig.mak.uname: update settings for OpenBSD
Brad Smith [Mon, 2 Jun 2025 03:14:43 +0000 (23:14 -0400)] 
config.mak.uname: update settings for OpenBSD

OpenBSD requires DIR_HAS_BSD_GROUP_SEMANTICS.

OpenBSD has never had the BSD sysctl KERN_PROC_PATHNAME nor
does it support or use the /proc filesystem.

OpenBSD has had strcasestr() since 3.8. OpenBSD has had memmem()
since 5.4.

Signed-off-by: Brad Smith <brad@comstyle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/gc: correct physical memory detection for OpenBSD / NetBSD
Brad Smith [Sun, 1 Jun 2025 08:24:12 +0000 (04:24 -0400)] 
builtin/gc: correct physical memory detection for OpenBSD / NetBSD

OpenBSD / NetBSD use HW_PHYSMEM64 to detect the amount of physical
memory in a system. HW_PHYSMEM will not provide the correct amount
on a system with >=4GB of memory.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: column: fix blank lines around block delimiters
Kristoffer Haugsbakk [Sun, 1 Jun 2025 11:36:53 +0000 (13:36 +0200)] 
doc: column: fix blank lines around block delimiters

227c4f33a03 (doc: add a blank line around block delimiters,
2025-03-09) added blank lines around block delimiters as a
defensive measure.  For each block you had to mind the con-
text (like the commit says):

• Top-level: just add blank lines
• Block: use list continuation (+)

But list continuation was used here at the top level, which
results in literal `+` in the output formats.

Acked-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agothread-utils.c: detect online CPU count on OpenBSD / NetBSD
Brad Smith [Fri, 9 May 2025 06:13:13 +0000 (02:13 -0400)] 
thread-utils.c: detect online CPU count on OpenBSD / NetBSD

OpenBSD / NetBSD use HW_NCPUONLINE to detect the online CPU
count. OpenBSD ships with SMT disabled on X86 systems so
HW_NCPU would provide double the number of CPUs as opposed
to the proper online count.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot: run tests from a normalized working directory
Mark Mentovai [Wed, 28 May 2025 20:17:37 +0000 (16:17 -0400)] 
t: run tests from a normalized working directory

Some tests make git perform actions that produce observable pathnames,
and have expectations on those paths. Tests run with $HOME set to a
$TRASH_DIRECTORY, and with their working directory the same
$TRASH_DIRECTORY, although these paths are logically identical, they do
not observe the same pathname canonicalization rules and thus might not
be represented by strings that compare equal. In particular, no pathname
normalization is applied to $TRASH_DIRECTORY or $HOME, while tests
change their working directory with `cd -P`, which normalizes the
working directory's path by fully resolving symbolic links.

t7900's macOS maintenance tests (which are not limited to running on
macOS) have an expectation on a path that `git maintenance` forms by
using abspath.c strbuf_realpath() to resolve a canonical absolute path
based on $HOME. When t7900 runs from a working directory that contains
symbolic links in its pathname, $HOME will also contain symbolic links,
which `git maintenance` resolves but the test's expectation does not,
causing a test failure.

Align $TRASH_DIRECTORY and $HOME with the normalized path as used for
the working directory by resetting them to match the working directory
after it's established by `cd -P`. With all paths in agreement and
symbolic links resolved, pathname expectations can be set and met based
on string comparison without regard to external environmental factors
such as the presence of symbolic links in a path.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Mark Mentovai <mark@chromium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoA bit more topics for -rc1
Junio C Hamano [Fri, 30 May 2025 18:59:01 +0000 (11:59 -0700)] 
A bit more topics for -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'ps/midx-negative-packfile-cache'
Junio C Hamano [Fri, 30 May 2025 18:59:18 +0000 (11:59 -0700)] 
Merge branch 'ps/midx-negative-packfile-cache'

When a stale .midx file refers to .pack files that no longer exist,
we ended up checking for these non-existent files repeatedly, which
has been optimized by memoizing the non-existence.

* ps/midx-negative-packfile-cache:
  midx: stop repeatedly looking up nonexistent packfiles
  packfile: explain ordering of how we look up auxiliary pack files

2 months agoMerge branch 'kh/notes-doc-fixes'
Junio C Hamano [Fri, 30 May 2025 18:59:17 +0000 (11:59 -0700)] 
Merge branch 'kh/notes-doc-fixes'

"git notes --help" documentation updates.

* kh/notes-doc-fixes:
  doc: notes: use stuck form throughout
  doc: notes: treat --stdin equally between copy/remove
  doc: notes: point out copy --stdin use with argv
  doc: notes: clearly state that --stripspace is the default
  doc: notes: remove stripspace discussion from other options
  doc: notes: rework --[no-]stripspace
  doc: notes: split out options with negated forms
  doc: config: mention core.commentChar on commit.cleanup
  doc: stripspace: mention where the default comes from

2 months agoMerge branch 'mm/apply-reverse-mode-of-deleted-path'
Junio C Hamano [Fri, 30 May 2025 18:59:17 +0000 (11:59 -0700)] 
Merge branch 'mm/apply-reverse-mode-of-deleted-path'

"git apply --index/--cached" when applying a deletion patch in
reverse failed to give the mode bits of the path "removed" by the
patch to the file it creates, which has been corrected.

* mm/apply-reverse-mode-of-deleted-path:
  apply: set file mode when --reverse creates a deleted file
  t4129: test that git apply warns for unexpected mode changes

2 months agoMerge branch 'op/cvsserver-perl-warning'
Junio C Hamano [Fri, 30 May 2025 18:59:16 +0000 (11:59 -0700)] 
Merge branch 'op/cvsserver-perl-warning'

Recent versions of Perl started warning against "! A =~ /pattern/"
which does not negate the result of the matching.  As it turns out
that the problematic function is not even called, it was removed.

* op/cvsserver-perl-warning:
  cvsserver: remove unused escapeRefName function

2 months agoMerge branch 'am/sparse-index-name-hash-fix'
Junio C Hamano [Fri, 30 May 2025 18:59:16 +0000 (11:59 -0700)] 
Merge branch 'am/sparse-index-name-hash-fix'

Avoid adding directory path to a sparse-index tree entries to the
name-hash, since they would bloat the hashtable without anybody
querying for them.  This was done already for a single threaded
part of the code, but now the multi-threaded code also does the
same.

* am/sparse-index-name-hash-fix:
  name-hash: don't add sparse directories in threaded lazy init

2 months agoMerge branch 'pw/midx-repack-overflow-fix'
Junio C Hamano [Fri, 30 May 2025 18:59:16 +0000 (11:59 -0700)] 
Merge branch 'pw/midx-repack-overflow-fix'

Integer overflow fix around code paths for "git multi-pack-index repack"..

* pw/midx-repack-overflow-fix:
  midx docs: clarify tie breaking
  midx: avoid negative array index
  midx repack: avoid potential integer overflow on 64 bit systems
  midx repack: avoid integer overflow on 32 bit systems

2 months agoMerge branch 'cb/reftable-unused-portability-fix'
Junio C Hamano [Fri, 30 May 2025 18:59:15 +0000 (11:59 -0700)] 
Merge branch 'cb/reftable-unused-portability-fix'

Build fix.

* cb/reftable-unused-portability-fix:
  reftable: make REFTABLE_UNUSED C99 compatible

2 months agodoc: sparse-checkout: use consistent inline list style
Wonuk Kim [Fri, 30 May 2025 07:22:36 +0000 (07:22 +0000)] 
doc: sparse-checkout: use consistent inline list style

Fix this inline list to use a single style, namely numeric, instead of
`(1)` followed by `(b)`.

Signed-off-by: Wonuk Kim <kimww0306@gmail.com>
Acked-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agol10n: bg.po: Updated Bulgarian translation (5819t)
Alexander Shopov [Thu, 29 May 2025 18:27:11 +0000 (20:27 +0200)] 
l10n: bg.po: Updated Bulgarian translation (5819t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2 months agoreftable: make REFTABLE_UNUSED C99 compatible
Carlo Marcelo Arenas Belón [Thu, 29 May 2025 10:11:36 +0000 (03:11 -0700)] 
reftable: make REFTABLE_UNUSED C99 compatible

Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED`
annotation, 2025-02-18), the reftable library was migrated to
use an internal version of `UNUSED`, which unconditionally sets
a GNU __attribute__ to avoid warnings function parameters that
are not being used.

Make the definition conditional to prevent breaking the build
with non GNU compilers.

Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'master' of https://github.com/j6t/git-gui
Junio C Hamano [Thu, 29 May 2025 16:03:01 +0000 (09:03 -0700)] 
Merge branch 'master' of https://github.com/j6t/git-gui

* 'master' of https://github.com/j6t/git-gui:
  git-gui: wire up support for the Meson build system
  git-gui: stop including GIT-VERSION-FILE file
  git-gui: extract script to generate macOS app
  git-gui: extract script to generate macOS wrapper
  git-gui: extract script to generate "tclIndex"
  git-gui: extract script to generate "git-gui"
  git-gui: drop no-op GITGUI_SCRIPT replacement
  git-gui: make output of GIT-VERSION-GEN source'able
  git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
  git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS

2 months agoMerge branch 'master' of https://github.com/j6t/gitk
Junio C Hamano [Thu, 29 May 2025 16:02:14 +0000 (09:02 -0700)] 
Merge branch 'master' of https://github.com/j6t/gitk

* 'master' of https://github.com/j6t/gitk:
  gitk: do not hard-code color of search results in commit list
  gitk: place file name arguments after options in msgfmt call
  gitk: Legacy widgets doesn't have combobox

2 months agol10n: tr: Update Turkish translations for 2.50
Emir SARI [Thu, 29 May 2025 08:42:21 +0000 (11:42 +0300)] 
l10n: tr: Update Turkish translations for 2.50

Signed-off-by: Emir SARI <emir_sari@icloud.com>
2 months agol10n: fr: v2.50 round 1
Jean-Noël Avila [Thu, 29 May 2025 10:58:38 +0000 (12:58 +0200)] 
l10n: fr: v2.50 round 1

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2 months agol10n: Add full Irish translation (ga.po)
Aindriú Mac Giolla Eoin [Thu, 15 May 2025 23:25:38 +0000 (00:25 +0100)] 
l10n: Add full Irish translation (ga.po)

- Added complete Irish translation (ga.po).
- Added entry for Irish in po/TEAMS.
- Corrected email format and removed trailing whitespace.
- Translated new strings from Git 2.50.0-rc0

Signed-off-by: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>
2 months agoMerge branch 'pks-meson-support' of github.com:pks-t/git-gui
Johannes Sixt [Thu, 29 May 2025 08:01:14 +0000 (10:01 +0200)] 
Merge branch 'pks-meson-support' of github.com:pks-t/git-gui

* 'pks-meson-support' of github.com:pks-t/git-gui:
  git-gui: wire up support for the Meson build system
  git-gui: stop including GIT-VERSION-FILE file
  git-gui: extract script to generate macOS app
  git-gui: extract script to generate macOS wrapper
  git-gui: extract script to generate "tclIndex"
  git-gui: extract script to generate "git-gui"
  git-gui: drop no-op GITGUI_SCRIPT replacement
  git-gui: make output of GIT-VERSION-GEN source'able
  git-gui: prepare GIT-VERSION-GEN for out-of-tree builds
  git-gui: replace GIT-GUI-VARS with GIT-GUI-BUILD-OPTIONS

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
2 months agofast-export: --signed-commits is experimental
Junio C Hamano [Wed, 28 May 2025 17:29:19 +0000 (10:29 -0700)] 
fast-export: --signed-commits is experimental

As the design of signature handling is still being discussed, it is
likely that the data stream produced by the code in Git 2.50 would
have to be changed in such a way that is not backward compatible.

Mark the feature as experimental and discourge its use for now.

Also flip the default on the generation side to "strip"; users of
existing versions would not have passed --signed-commits=strip and
will be broken by this change if the default is made to abort, and
will be encouraged by the error message to produce data stream with
future breakage guarantees by passing --signed-commits option.

As we tone down the default behaviour, we no longer need the
FAST_EXPORT_SIGNED_COMMITS_NOABORT environment variable, which was
not discoverable enough.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'jt/receive-pack-skip-connectivity-check'
Junio C Hamano [Wed, 28 May 2025 14:59:56 +0000 (07:59 -0700)] 
Merge branch 'jt/receive-pack-skip-connectivity-check'

"git receive-pack" optionally learns not to care about connectivity
check, which can be useful when the repository arranges to ensure
connectivity by some other means.

* jt/receive-pack-skip-connectivity-check:
  builtin/receive-pack: add option to skip connectivity check
  t5410: test receive-pack connectivity check

2 months agoGit 2.50-rc0 v2.50.0-rc0
Junio C Hamano [Wed, 28 May 2025 14:59:41 +0000 (07:59 -0700)] 
Git 2.50-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMerge branch 'kn/passing-leak-tests'
Junio C Hamano [Wed, 28 May 2025 14:59:55 +0000 (07:59 -0700)] 
Merge branch 'kn/passing-leak-tests'

Remove the leftover hints to the test framework to mark tests that
do not pass the leak checker tests, as they should no longer be
needed.

* kn/passing-leak-tests:
  t: remove unexpected SANITIZE_LEAK variables

2 months agomidx: stop repeatedly looking up nonexistent packfiles
Patrick Steinhardt [Wed, 28 May 2025 12:24:11 +0000 (14:24 +0200)] 
midx: stop repeatedly looking up nonexistent packfiles

The multi-pack index acts as a cache across a set of packfiles so that
we can quickly look up which of those packfiles contains a given object.
As such, the multi-pack index naturally needs to be updated every time
one of the packfiles goes away, or otherwise the multi-pack index has
grown stale.

A stale multi-pack index should be handled gracefully by Git though, and
in fact it is: if the indexed pack cannot be found we simply ignore it
and eventually we fall back to doing the object lookup by just iterating
through all packs, even if those aren't indexed.

But while this fallback works, it has one significant downside: we don't
cache the fact that a pack has vanished. This leads to us repeatedly
trying to look up the same pack only to realize that it (still) doesn't
exist.

This issue can be easily demonstrated by creating a repository with a
stale multi-pack index and a couple of objects. We do so by creating a
repository with two packfiles, both of which are indexed by the
multi-pack index, and then repack those two packfiles. Note that we have
to move the multi-pack-index before doing the final repack, as Git knows
to delete it otherwise.

    $ git init repo
    $ cd repo/
    $ git config set maintenance.auto false
    $ for i in $(seq 1000); do printf "%d-original" $i >file-$i; done
    $ git add .
    $ git commit -moriginal
    $ git repack -dl
    $ for i in $(seq 1000); do printf "%d-modified" $i >file-$i; done
    $ git commit -a -mmodified
    $ git repack -dl
    $ git multi-pack-index write
    $ mv .git/objects/pack/multi-pack-index .
    $ git repack -Adl
    $ mv multi-pack-index .git/objects/pack/

Commands that cause a lot of objects lookups will now repeatedly invoke
`add_packed_git()`, which leads to three failed access(3p) calls as well
as one failed stat(3p) call. The following strace for example is done
for `git log --patch` in the above repository:

    % time     seconds  usecs/call     calls    errors syscall
    ------ ----------- ----------- --------- --------- ----------------
     74.67    0.024693           1     18038     18031 access
     25.33    0.008378           1      6045      6017 newfstatat
    ------ ----------- ----------- --------- --------- ----------------
    100.00    0.033071           1     24083     24048 total

Fix the issue by introducing a negative lookup cache for indexed packs.
This cache works by simply storing an invalid pointer for a missing pack
when `prepare_midx_pack()` fails to look up the pack. Most users of the
`packs` array don't need to be adjusted, either, as they all know to
call `prepare_midx_pack()` before accessing the array.

With this change in place we can now see a significantly reduced number
of syscalls:

    % time     seconds  usecs/call     calls    errors syscall
    ------ ----------- ----------- --------- --------- ----------------
     73.58    0.000323           5        60        28 newfstatat
     26.42    0.000116           5        23        16 access
    ------ ----------- ----------- --------- --------- ----------------
    100.00    0.000439           5        83        44 total

Furthermore, this change also results in a speedup:

    Benchmark 1: git log --patch (revision = HEAD~)
      Time (mean ± σ):      50.4 ms ±   2.5 ms    [User: 22.0 ms, System: 24.4 ms]
      Range (min … max):    45.4 ms …  54.9 ms    53 runs

    Benchmark 2: git log --patch (revision = HEAD)
      Time (mean ± σ):      12.7 ms ±   0.4 ms    [User: 11.1 ms, System: 1.6 ms]
      Range (min … max):    12.4 ms …  15.0 ms    191 runs

    Summary
      git log --patch (revision = HEAD) ran
        3.96 ± 0.22 times faster than git log --patch (revision = HEAD~)

In the end, it should in theory never be necessary to have this negative
lookup cache given that we know to update the multi-pack index together
with repacks. But as the change is quite contained and as the speedup
can be significant as demonstrated above, it does feel sensible to have
the negative lookup cache regardless.

Based-on-patch-by: Jeff King <peff@peff.net>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agopackfile: explain ordering of how we look up auxiliary pack files
Patrick Steinhardt [Wed, 28 May 2025 12:24:10 +0000 (14:24 +0200)] 
packfile: explain ordering of how we look up auxiliary pack files

When adding a packfile to an object database we perform four syscalls:

  - Three calls to access(3p) are done to check for auxiliary data
    structures.

  - One call to stat(3p) is done to check for the ".pack" itself.

One curious bit is that we perform the access(3p) calls before checking
for the packfile itself, but if the packfile doesn't exist we discard
all results. The access(3p) calls are thus essentially wasted, so one
may be triggered to reorder those calls so that we can short-circuit the
other syscalls in case the packfile does not exist.

The order in which we look up files is quite important though to help
avoid races:

  - When installing a packfile we move auxiliary data structures into
    place before we install the ".idx" file.

  - When deleting a packfile we first delete the ".idx" and ".pack"
    files before deleting auxiliary data structures.

As such, to avoid any races with concurrently created or deleted packs
we need to make sure that we _first_ read auxiliary data structures
before we read the corresponding ".idx" or ".pack" file. Otherwise it
may easily happen that we return a populated but misclassified pack.

Add a comment to `add_packed_git()` to make future readers aware of this
ordering requirement.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: notes: use stuck form throughout
Kristoffer Haugsbakk [Tue, 27 May 2025 21:19:38 +0000 (23:19 +0200)] 
doc: notes: use stuck form throughout

gitcli(7) recommends the *stuck form*.  `--ref` is the only one which
does not use it.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: notes: treat --stdin equally between copy/remove
Kristoffer Haugsbakk [Tue, 27 May 2025 21:19:37 +0000 (23:19 +0200)] 
doc: notes: treat --stdin equally between copy/remove

46538012d94 (notes remove: --stdin reads from the standard input,
2011-05-18) added `--stdin` for the `remove` subcommand, documenting it
in the “Options” section.  But `copy --stdin` was added before that, in
160baa0d9cb (notes: implement 'git notes copy --stdin', 2010-03-12).

Treat this option equally between the two subcommands:

• remove: mention `--stdin` on the subcommand as well, like for `copy`
• copy: mention it as well under the option documentation

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: notes: point out copy --stdin use with argv
Kristoffer Haugsbakk [Tue, 27 May 2025 21:19:36 +0000 (23:19 +0200)] 
doc: notes: point out copy --stdin use with argv

Unlike `remove --stdin`, this option cannot be combined with object
names given via the command line.

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodoc: notes: clearly state that --stripspace is the default
Kristoffer Haugsbakk [Tue, 27 May 2025 21:19:35 +0000 (23:19 +0200)] 
doc: notes: clearly state that --stripspace is the default

Clearly state when which of the regular and negated form of the
option take effect.[1]

Also mention the subtle behavior that occurs when you mix options like
`-m` and `-C`, including a note that it might be fixed in the future.
The topic was brought up on v8 of the `--separator` series.[2][3]

[1]: https://lore.kernel.org/git/xmqqcyct1mtq.fsf@gitster.g/
[2]: https://lore.kernel.org/git/xmqq4jp326oj.fsf@gitster.g/
† 3: v11 was the version that landed

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