]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
5 days agoMerge branch 'ps/test-set-e-clean' into next next
Junio C Hamano [Thu, 23 Apr 2026 02:08:25 +0000 (11:08 +0900)] 
Merge branch 'ps/test-set-e-clean' into next

The test suite harness and many individual test scripts have been
updated to work correctly when 'set -e' is in effect, which helps
detect misspelled test commands.

* ps/test-set-e-clean:
  t: detect errors outside of test cases
  t9902: fix use of `read` with `set -e`
  t6002: fix use of `expr` with `set -e`
  t1301: don't fail in case setfacl(1) doesn't exist or fails
  t0008: silence error in subshell when using `grep -v`
  t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`
  t: prepare execution of potentially failing commands for `set -e`
  t: prepare conditional test execution for `set -e`
  t: prepare `git config --unset` calls for `set -e`
  t: prepare `stop_git_daemon ()` for `set -e`
  t: prepare `test_must_fail ()` for `set -e`
  t: prepare `test_match_signal ()` calls for `set -e`

5 days agoMerge branch 'bc/rust-by-default' into next
Junio C Hamano [Thu, 23 Apr 2026 02:08:25 +0000 (11:08 +0900)] 
Merge branch 'bc/rust-by-default' into next

Rust support is enabled by default (but still allows opting out) in
some future version of Git.

* bc/rust-by-default:
  Enable Rust by default
  Linux: link against libdl
  ci: install cargo on Alpine
  docs: update version with default Rust support

5 days agot: detect errors outside of test cases
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:25 +0000 (09:34 +0200)] 
t: detect errors outside of test cases

We have recently merged a patch series that had a simple misspelling of
`test_expect_success`. Instead of making our tests fail though, this
typo went completely undetected and all of our tests passed, which is of
course unfortunate. This is a more general issue with our test suite:
all commands that run outside of a specific test case can fail, and if
we don't explicitly check for such failure then this failure will be
silently ignored.

Improve the status quo by enabling the errexit option so that any such
unchecked failures will cause us to abort immediately.

Note that for now, we only enable this option for Bash 5 and newer. This
is because other shells have wildly different behaviour, and older
versions of Bash (especially on macOS) are buggy. The list of enabled
shells may be extended going forward.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot9902: fix use of `read` with `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:24 +0000 (09:34 +0200)] 
t9902: fix use of `read` with `set -e`

In t9902 we're using the `read` builtin to read some values into a
variable. This is done by using `-d ""`, which cause us to read until
the end of the heredoc. As the read is terminated by EOF, the command
will end up returning a non-zero error code. This hasn't been an issue
until now as we didn't run with `set -e`, but that'll change in a
subsequent commit.

Prepare for this change by not using read at all, as we can simply store
the multi-line value directly.

Suggested-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot6002: fix use of `expr` with `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:23 +0000 (09:34 +0200)] 
t6002: fix use of `expr` with `set -e`

In `test_bisection_diff ()` we use `expr` to perform some math. This
command has some gotchas though in that it will only return success when
the result is neither null nor zero. In some of our cases though it
actually _is_ zero, and that will cause the expressions to fail once we
enable `set -e`.

Prepare for this change by instead using `$(( ))`, which doesn't have
the same issue. While at it, modernize the function a tiny bit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot1301: don't fail in case setfacl(1) doesn't exist or fails
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:22 +0000 (09:34 +0200)] 
t1301: don't fail in case setfacl(1) doesn't exist or fails

In t1301 we're trying to remove any potentially-existing default ACLs
that might exist on the transh directory by executing setfacl(1).
According to 8ed0a740dd (t1301-shared-repo.sh: don't let a default ACL
interfere with the test, 2008-10-16), this is done because we play
around with permissions and umasks in this test suite.

The setfacl(1) binary may not exist on some systems though, even though
tests ultimately still pass. This doesn't matter currently, but will
cause the test to fail once we start running with `set -e`. Silence such
failures by ignoring failures here.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot0008: silence error in subshell when using `grep -v`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:21 +0000 (09:34 +0200)] 
t0008: silence error in subshell when using `grep -v`

In t0008 we use `grep -v` in a subshell, but expect that this command
will sometimes not match anything. This would cause grep(1) to return an
error code, but given that we don't run with `set -e` we swallow this
error.

We're about to enable `set -e`. Prepare for this by ignoring any errors.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare `test_when_finished ()`/`test_atexit()` for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:20 +0000 (09:34 +0200)] 
t: prepare `test_when_finished ()`/`test_atexit()` for `set -e`

Both `test_when_finished ()` and `test_atexit ()` build up a chain of
cleanup commands by prepending each new command to the existing cleanup
string. To preserve the exit code of the test body across cleanup
execution, we append the following logic:

    } && (exit "$eval_ret"); eval_ret=$?; ...

The intent of this is to run the cleanup block and then unconditionally
restore `eval_ret`. The original behaviour of this is is:

   +------------------+---------+------------------------------------+
   |test body         │ cleanup │ old behaviour                      │
   +------------------+---------+------------------------------------+
   │pass (eval_ret=0) | pass    │ && taken -> (exit 0) -> eval_ret=0 |
   +------------------+---------+------------------------------------+
   │pass (eval_ret=0) | fail    │ && not taken -> eval_ret=$?        |
   +------------------+---------+------------------------------------+
   │fail (eval_ret=1) | pass    │ && taken -> (exit 1) -> eval_ret=1 |
   +------------------+---------+------------------------------------+
   │fail (eval_ret=1) | fail    | && not taken -> eval_ret=$?        |
   +------------------+---------+------------------------------------+

This logic will start to fail once we enable `set -e`. When `$eval_ret`
is non-zero, the subshell we create will fail, and with `set -e` we'll
thus bail out without evaluating the logic after the semicolon.

Fix this issue by instead using `|| eval_ret=\$?; ...`. Besides being
a bit simpler, it also retains the original behaviour:

   +------------------+---------+------------------------------------+
   |test body         │ cleanup │ old behaviour                      │
   +------------------+---------+------------------------------------+
   │pass (eval_ret=0) | pass    │ || not taken -> eval_ret unchanged |
   +------------------+---------+------------------------------------+
   │pass (eval_ret=0) | fail    │ || taken -> eval_ret=$?            |
   +------------------+---------+------------------------------------+
   │fail (eval_ret=1) | pass    │ || not taken -> eval_ret unchanged |
   +------------------+---------+------------------------------------+
   │fail (eval_ret=1) | fail    | || taken -> eval_ret=$?            |
   +------------------+---------+------------------------------------+

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare execution of potentially failing commands for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:19 +0000 (09:34 +0200)] 
t: prepare execution of potentially failing commands for `set -e`

Several of our tests verify whether a certain binary can be executed,
potentially skipping tests in case we cannot, for example because the
binary doesn't exist. In those cases we often run the binary outside of
any conditionally.

This will start to fail once we enable `set -e`, as that will cause us
to bail out the test immediately. Improve these tests by executing them
inside of a conditional instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare conditional test execution for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:18 +0000 (09:34 +0200)] 
t: prepare conditional test execution for `set -e`

We have some test in our test suite where we use the pattern of
`test ... && test_expect_succeess` to conditionally execute a test. The
problem is that when we decide to not execute the test, we'll indeed
skip the test, but the overall statement will also be unsuccessful. This
will become a problem once we enable `set -e`.

Prepare for this future by turning this into a proper conditional, which
is also a bit easier to read overall.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare `git config --unset` calls for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:17 +0000 (09:34 +0200)] 
t: prepare `git config --unset` calls for `set -e`

We have a couple of calls to `git config --unset` that ultimately end up
as no-ops as the configuration variables aren't set (anymore) in the
first place. These calls are mostly intended to recover unconditionally
from tests that may have executed only partially, but they'll ultimately
fail during a normal test run.

This hasn't been a problem until now as we aren't running tests with
`set -e`. This is about to change though, so let's silence the case
where we cannot unset the config keys.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare `stop_git_daemon ()` for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:16 +0000 (09:34 +0200)] 
t: prepare `stop_git_daemon ()` for `set -e`

We have a couple of calls to `stop_git_daemon ()` outside of specific
test cases that will kill a backgrounded git-daemon(1) process and
expect the process with a specific error code. While these function
calls do end up killing git-daemon(1), the error handling we have in
those contexts is basically ineffective. So while we expect the process
to exit with a specific error code, we will just continue with any error
in case it doesn't.

This will change once we enable `set -e` in a subsequent commit. There's
two issues though that will make this _always_ fail:

  - Our call to `wait` is expected to fail, but because it's not part of
    a condition it will cause us to bail out immediately with `set -e`.

  - We try to kill git-daemon(1) a second time via the pidfile. We can
    generally expect that this is the same PID though as we had in the
    "GIT_DAEMON_PID" environment variable, and thus it's more likely
    than not that we have already killed it, and the call to kill will
    fail.

Prepare for this change by handling the failure of `wait` with `||` and
by silencing failures of the second call to `kill`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare `test_must_fail ()` for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:15 +0000 (09:34 +0200)] 
t: prepare `test_must_fail ()` for `set -e`

The helper function `test_must_fail ()` executes a specific Git command
that may or may not fail in a specific way. This is done by executing
the command in question and then comparing its exit code against a set
of conditions.

This works, but once we run our test suite with `set -e` we may bail out
of `test_must_fail ()` early in case the command actually fails, even
though we expect it to fail. Prepare for this change by handling the
failed case with `||`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agot: prepare `test_match_signal ()` calls for `set -e`
Patrick Steinhardt [Tue, 21 Apr 2026 07:34:14 +0000 (09:34 +0200)] 
t: prepare `test_match_signal ()` calls for `set -e`

We have a couple of calls to `test_match_signal ()` where we execute a
Git command and expect it to die with a specific signal. These calls
will essentially execute the process in a subshell via `foo; echo $?`,
but as we expect `foo` to fail this will cause the overall subshell to
fail once we `set -e`.

Fix this issue by using `foo && echo 0 || echo $?` instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agoMerge branch 'mc/http-emptyauth-negotiate-fix' into next
Junio C Hamano [Mon, 20 Apr 2026 17:15:04 +0000 (10:15 -0700)] 
Merge branch 'mc/http-emptyauth-negotiate-fix' into next

The 'http.emptyAuth=auto' configuration now correctly attempts
Negotiate authentication before falling back to manual credentials.
This allows seamless Kerberos ticket-based authentication without
requiring users to explicitly set 'http.emptyAuth=true'.

* mc/http-emptyauth-negotiate-fix:
  t5563: add tests for http.emptyAuth with Negotiate
  http: attempt Negotiate auth in http.emptyAuth=auto mode
  http: extract http_reauth_prepare() from retry paths

7 days agoMerge branch 'sb/userdiff-lisp-family' into next
Junio C Hamano [Mon, 20 Apr 2026 17:15:04 +0000 (10:15 -0700)] 
Merge branch 'sb/userdiff-lisp-family' into next

The userdiff driver for the Scheme language has been extended to
cover other Lisp dialects.

* sb/userdiff-lisp-family:
  userdiff: extend Scheme support to cover other Lisp dialects
  userdiff: tighten word-diff test case of the scheme driver

7 days agoMerge branch 'jc/doc-timestamps-in-stat' into next
Junio C Hamano [Mon, 20 Apr 2026 17:15:04 +0000 (10:15 -0700)] 
Merge branch 'jc/doc-timestamps-in-stat' into next

Doc update.

* jc/doc-timestamps-in-stat:
  CodingGuidelines: st_mtimespec vs st_mtim vs st_mtime

8 days agoSync with Git 2.54
Junio C Hamano [Mon, 20 Apr 2026 02:05:49 +0000 (19:05 -0700)] 
Sync with Git 2.54

8 days agoGit 2.54 main master v2.54.0
Junio C Hamano [Mon, 20 Apr 2026 02:01:39 +0000 (19:01 -0700)] 
Git 2.54

Signed-off-by: Junio C Hamano <gitster@pobox.com>
8 days agoMerge tag 'l10n-2.54.0-v2' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 20 Apr 2026 01:59:09 +0000 (18:59 -0700)] 
Merge tag 'l10n-2.54.0-v2' of https://github.com/git-l10n/git-po

l10n-2.54.0-v2

* tag 'l10n-2.54.0-v2' of https://github.com/git-l10n/git-po:
  l10n: bg.po: Updated Bulgarian translation (6226t)
  l10n: zh_TW: update translation for Git 2.54
  l10n: Update Catalan Translation
  l10n: ga.po: update for Git 2.54
  l10n: fr: v2.54.0
  l10n: tr: Update Turkish translations
  l10n: sv.po: Update Swedish translation
  l10n: sv.po: correct various translations
  l10n: zh_CN: updated translation for 2.54
  l10n: bg.po: Updated Bulgarian translation (6226t)
  l10n: zh_CN: post-2.53 code review
  l10n: document AI and PO helper in po/README
  l10n: docs: add review instructions in AGENTS.md
  l10n: docs: add translation instructions in AGENTS.md
  l10n: docs: add update PO instructions in AGENTS.md
  l10n: docs: add AGENTS.md with update POT instructions
  l10n: add .gitattributes to simplify location filtering
  l10n: fix 'zh_TW.po' 'Applying patch'

8 days agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Sun, 19 Apr 2026 23:37:21 +0000 (07:37 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

9 days agol10n: bg.po: Updated Bulgarian translation (6226t)
Alexander Shopov [Sun, 19 Apr 2026 14:07:40 +0000 (16:07 +0200)] 
l10n: bg.po: Updated Bulgarian translation (6226t)

Improvements prompted by AI-assisted review

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
9 days agol10n: zh_TW: update translation for Git 2.54
Yi-Jyun Pan [Sun, 19 Apr 2026 13:52:38 +0000 (21:52 +0800)] 
l10n: zh_TW: update translation for Git 2.54

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
9 days agoMerge branch 'fr_v2.54.0' of github.com:jnavila/git
Jiang Xin [Sun, 19 Apr 2026 10:41:17 +0000 (18:41 +0800)] 
Merge branch 'fr_v2.54.0' of github.com:jnavila/git

* 'fr_v2.54.0' of github.com:jnavila/git:
  l10n: fr: v2.54.0

9 days agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Sun, 19 Apr 2026 10:26:22 +0000 (18:26 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

9 days agol10n: Update Catalan Translation
Mikel Forcada [Fri, 10 Apr 2026 19:55:34 +0000 (21:55 +0200)] 
l10n: Update Catalan Translation

Signed-off-by: Mikel Forcada <mikel.forcada@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
9 days agol10n: ga.po: update for Git 2.54
Aindriú Mac Giolla Eoin [Thu, 9 Apr 2026 14:50:17 +0000 (15:50 +0100)] 
l10n: ga.po: update for Git 2.54

Signed-off-by: Aindriú Mac Giolla Eoin <aindriu80@gmail.com>
9 days agoMerge branch 'master' of github.com:nafmo/git-l10n-sv
Jiang Xin [Sun, 19 Apr 2026 08:54:14 +0000 (16:54 +0800)] 
Merge branch 'master' of github.com:nafmo/git-l10n-sv

* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation
  l10n: sv.po: correct various translations

9 days agoMerge branch 'apply-patch-reject' of github.com:A4-Tacks/git-po
Jiang Xin [Sun, 19 Apr 2026 08:50:58 +0000 (16:50 +0800)] 
Merge branch 'apply-patch-reject' of github.com:A4-Tacks/git-po

* 'apply-patch-reject' of github.com:A4-Tacks/git-po:
  l10n: fix 'zh_TW.po' 'Applying patch'

9 days agoMerge branch 'tr-l10n' of github.com:bitigchi/git-po
Jiang Xin [Sun, 19 Apr 2026 03:13:45 +0000 (11:13 +0800)] 
Merge branch 'tr-l10n' of github.com:bitigchi/git-po

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

9 days agoMerge branch 'zh_CN-2.54' of github.com:jiangxin/git
Jiang Xin [Sun, 19 Apr 2026 03:01:51 +0000 (11:01 +0800)] 
Merge branch 'zh_CN-2.54' of github.com:jiangxin/git

* 'zh_CN-2.54' of github.com:jiangxin/git:
  l10n: zh_CN: updated translation for 2.54

10 days agol10n: fr: v2.54.0
Jean-Noël Avila [Sat, 18 Apr 2026 04:05:05 +0000 (12:05 +0800)] 
l10n: fr: v2.54.0

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
11 days agoSync with 'master'
Junio C Hamano [Fri, 17 Apr 2026 04:28:09 +0000 (21:28 -0700)] 
Sync with 'master'

11 days agoCodingGuidelines: st_mtimespec vs st_mtim vs st_mtime
Junio C Hamano [Fri, 10 Apr 2026 18:10:48 +0000 (11:10 -0700)] 
CodingGuidelines: st_mtimespec vs st_mtim vs st_mtime

Most unfortunately macOS does not support st_[amc]tim for timestamps
down to nanosecond resolution as POSIX systems.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agodoc: fix grammar errors in submodule description
Elijah Newren [Thu, 16 Apr 2026 23:36:31 +0000 (23:36 +0000)] 
doc: fix grammar errors in submodule description

6cc6d1b4c699 (Documentation: update add --force option + ignore=all
config, 2026-02-06) added text describing both the ignore=none and
ignore=all behaviors.  The former had minor formatting and grammatical
errors, while the latter was a bit garbled.  I have tried to tweak the
wording on the latter to make it read as I think was intended, and fixed
the minor grammatical issues with both as well.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agodoc: fix singular/plural mismatch in git-rerere
Elijah Newren [Thu, 16 Apr 2026 23:36:30 +0000 (23:36 +0000)] 
doc: fix singular/plural mismatch in git-rerere

conflict -> conflicts

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agodoc: fix plural agreement in pack.preferBitmapTips
Elijah Newren [Thu, 16 Apr 2026 23:36:29 +0000 (23:36 +0000)] 
doc: fix plural agreement in pack.preferBitmapTips

hierarchies -> hierarchy

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agodoc: fix self-referential config in sendemail.smtpSSLClientKey
Elijah Newren [Thu, 16 Apr 2026 23:36:28 +0000 (23:36 +0000)] 
doc: fix self-referential config in sendemail.smtpSSLClientKey

a8215a205141 (send-email: add client certificate options, 2026-03-02)
added documentation for sendemail.smtpSSLClientKey that says it works
"in conjunction with `sendemail.smtpSSLClientKey`" -- referring to
itself.  It appears that `sendemail.smtpSSLClientCert` was the intended
reference; fix it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoCodingGuidelines: fix subject-verb agreement
Elijah Newren [Thu, 16 Apr 2026 23:36:27 +0000 (23:36 +0000)] 
CodingGuidelines: fix subject-verb agreement

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agoRelNotes/2.54.0: fix typos and grammar
Elijah Newren [Thu, 16 Apr 2026 23:36:26 +0000 (23:36 +0000)] 
RelNotes/2.54.0: fix typos and grammar

Fix various issues in the release notes -- missing/wrong articles, typo,
indentation, quote consistency, and wording improvement or corrections.

Other than the indentation fix for "The way combined list-object filter
options...", this patch is much easier to view with --color-words.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agol10n: tr: Update Turkish translations
Emir SARI [Sat, 4 Apr 2026 19:09:05 +0000 (22:09 +0300)] 
l10n: tr: Update Turkish translations

Signed-off-by: Emir SARI <emir_sari@icloud.com>
11 days agoSync with 'master'
Junio C Hamano [Thu, 16 Apr 2026 22:45:35 +0000 (15:45 -0700)] 
Sync with 'master'

11 days agoMerge branch 'jk/midx-write-v1-by-default'
Junio C Hamano [Thu, 16 Apr 2026 22:43:26 +0000 (15:43 -0700)] 
Merge branch 'jk/midx-write-v1-by-default'

As writing version 2 MIDX files by default breaks older versions of
Git and its reimplementations, use V2 only when necessary.

* jk/midx-write-v1-by-default:
  MIDX: revert the default version to v1

11 days agoMerge branch 'jk/midx-write-v1-by-default' into next
Junio C Hamano [Thu, 16 Apr 2026 21:22:30 +0000 (14:22 -0700)] 
Merge branch 'jk/midx-write-v1-by-default' into next

As writing version 2 MIDX files by default breaks older versions of
Git and its reimplementations, use V2 only when necessary.

* jk/midx-write-v1-by-default:
  MIDX: revert the default version to v1

11 days agoMIDX: revert the default version to v1
Jeff King [Thu, 16 Apr 2026 20:06:59 +0000 (16:06 -0400)] 
MIDX: revert the default version to v1

We introduced midx version 2 in b2ec8e90c2 (midx: do not require packs
to be sorted in lexicographic order, 2026-02-24) and now write it by
default. The rationale was that older versions should ignore the v2 midx
and fall back to using the packs (just like we do for other midx
errors). Unfortunately this is not the case, as we have a hard die()
when we see an unknown midx version.

As a result, writing a midx with Git 2.54-rc2 puts the repository into a
state that is unusable with Git 2.53. And this midx write may happen
behind the scenes as part of normal operations, like fetch.

Let's switch back to writing v1 by default to avoid regressing the case
where multiple versions of Git are used on the same repository.

There is one gotcha, though: the v2 format is required for some new
features, like midx compaction, and running "git multi-pack-index
compact" will complain when asked to write a v1 index. The user must set
midx.version to "2" to make the feature work.

So instead of always using v1, we'll base the default on whether the
requested feature requires v2. That does mean that running midx
compaction will create a repository that can't be read by older versions
of Git. But we never do that by default; only people experimenting with
the new feature will be affected.

We have to adjust the test expectation in t5319, since it will now
generate v1 files. And our "auto-select v2" is covered by the tests in
t5335, which continue to check that compaction works without having to
set midx.version manually (and also explicitly check that asking for v1
with compaction reports the problem).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agot5563: add tests for http.emptyAuth with Negotiate
Matthew John Cheetham [Thu, 16 Apr 2026 09:20:59 +0000 (09:20 +0000)] 
t5563: add tests for http.emptyAuth with Negotiate

Add tests exercising the interaction between http.emptyAuth and
servers that advertise Negotiate (SPNEGO) authentication.

Verify that auto mode gives Negotiate a chance via empty auth
(resulting in two 401 responses before falling through to
credential_fill with Basic credentials), and that false mode
strips Negotiate immediately (only one 401 response).

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agohttp: attempt Negotiate auth in http.emptyAuth=auto mode
Matthew John Cheetham [Thu, 16 Apr 2026 09:20:58 +0000 (09:20 +0000)] 
http: attempt Negotiate auth in http.emptyAuth=auto mode

When a server advertises Negotiate (SPNEGO) authentication, the
"auto" mode of http.emptyAuth should detect this as an "exotic"
method and proactively send empty credentials, allowing libcurl to
use the system Kerberos ticket without prompting the user.

However, two features interact to prevent this from working:

The Negotiate-stripping logic, introduced in 4dbe66464b
(remote-curl: fall back to Basic auth if Negotiate fails,
2015-01-08), removes CURLAUTH_GSSNEGOTIATE from the allowed
methods on the first 401 response. The empty-auth auto-detection,
introduced in 40a18fc77c (http: add an "auto" mode for
http.emptyauth, 2017-02-25), then checks the remaining methods
for anything "exotic" -- but Negotiate has already been removed,
so auto mode never activates for servers whose only non-Basic/Digest
method is Negotiate (e.g., Apache with mod_auth_kerb offering
Basic + Negotiate).

Fix this by delaying the Negotiate stripping in auto mode: on the
first 401, keep Negotiate in the allowed methods so that auto mode
can detect it and retry with empty credentials. If that attempt
fails (no valid Kerberos ticket), strip Negotiate on the second 401
and fall through to credential_fill() as usual.

To support this, also teach http_reauth_prepare() to skip
credential_fill() when empty auth is about to be attempted, since
filling real credentials would bypass the empty-auth mechanism.

The true and false modes are unchanged: true sends empty credentials
on the very first request (before any 401), and false never sends
them.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agohttp: extract http_reauth_prepare() from retry paths
Matthew John Cheetham [Thu, 16 Apr 2026 09:20:57 +0000 (09:20 +0000)] 
http: extract http_reauth_prepare() from retry paths

All three HTTP retry paths (http_request_recoverable, post_rpc,
probe_rpc) call credential_fill() directly when handling
HTTP_REAUTH. Extract this into a helper function so that a
subsequent commit can add pre-fill logic (such as attempting
empty-auth before prompting) in one place.

No functional change.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agol10n: sv.po: Update Swedish translation
Peter Krefting [Thu, 16 Apr 2026 11:30:54 +0000 (12:30 +0100)] 
l10n: sv.po: Update Swedish translation

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
12 days agol10n: sv.po: correct various translations
Stefan Björnelund [Fri, 13 Feb 2026 20:14:23 +0000 (21:14 +0100)] 
l10n: sv.po: correct various translations

- correct translation of pathspec msgs
  Corrects cases where the “pathspec” is translated as if it was a
  path
- correct translation of refspec msgs
  Corrects cases where the “refspec” were not consistently translated
- correct translation of credential msgs
  Corrects cases where the “credential” were not correctly translated

Signed-off-by: Stefan Björnelund <stefan.bjornelund.gnome@gmail.com>
Modified-by: Peter Krefting <peter@softwolves.pp.se>
12 days agol10n: zh_CN: updated translation for 2.54
Jiang Xin [Tue, 31 Mar 2026 02:17:35 +0000 (10:17 +0800)] 
l10n: zh_CN: updated translation for 2.54

Translate 198 previously fuzzy or untranslated messages, bringing the
total number of translated messages to 6226.

Reviewed-by: 依云 <lilydjwg@gmail.com>
Reviewed-by: Fangyi Zhou <me@fangyi.io>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 days agoSync with 'master'
Junio C Hamano [Wed, 15 Apr 2026 21:35:02 +0000 (14:35 -0700)] 
Sync with 'master'

12 days agocodeql: bump actions/cache from 4 to 5
Johannes Schindelin [Mon, 13 Apr 2026 16:24:17 +0000 (16:24 +0000)] 
codeql: bump actions/cache from 4 to 5

Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4...v5)

updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major

Originally-authored-by: dependabot[bot] <support@github.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agol10n: bg.po: Updated Bulgarian translation (6226t)
Alexander Shopov [Tue, 7 Apr 2026 07:32:08 +0000 (09:32 +0200)] 
l10n: bg.po: Updated Bulgarian translation (6226t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
13 days agouserdiff: extend Scheme support to cover other Lisp dialects
Scott L. Burson [Wed, 15 Apr 2026 02:27:43 +0000 (02:27 +0000)] 
userdiff: extend Scheme support to cover other Lisp dialects

Common Lisp has top-level forms, such as 'defun' and 'defmacro', that
are not matched by the current Scheme pattern.  Also, it is more
common in CL, when defining user macros intended as top-level forms,
to prefix their names with "def" instead of "define"; such forms are
also not matched.  And some top-level forms don't even begin with
"def".

On the other hand, it is an established formatting convention in the
Lisp community that only top-level forms start at the left margin.  So
matching any unindented line starting with an open parenthesis is an
acceptable heuristic; false positives will be rare.

However, there are also cases where notionally top-level forms are
grouped together within some containing form.  At least in the Common
Lisp community, it is conventional to indent these by two spaces, or
sometimes one.  But matching just an open parenthesis indented by two
spaces would be too broad; so the pattern added by this commit
requires an indented form to start with "(def".  It is believed that
this strikes a good balance between potential false positives and
false negatives.

Signed-off-by: Scott L. Burson <Scott@sympoiesis.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agouserdiff: tighten word-diff test case of the scheme driver
Johannes Sixt [Wed, 15 Apr 2026 02:27:42 +0000 (02:27 +0000)] 
userdiff: tighten word-diff test case of the scheme driver

The scheme driver separates identifiers only at parentheses of all
sorts and whitespace, except that vertical bars act as brackets that
enclose an identifier.

The test case attempts to demonstrate the vertical bars with a change
from 'some-text' to '|a greeting|'. However, this misses the goal
because the same word coloring would be applied if '|a greeting|'
were parsed as two words.

Have an identifier between vertical bars with a space in both the pre-
and the post-image and change only one side of the space to show that
the single word exists between the vertical bars.

Also add cases that change parentheses of all kinds in a sequence of
parentheses to show that they are their own word each.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Scott L. Burson <Scott@sympoiesis.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoRevert "Merge branch 'hn/git-checkout-m-with-stash' into next"
Junio C Hamano [Tue, 14 Apr 2026 20:34:01 +0000 (13:34 -0700)] 
Revert "Merge branch 'hn/git-checkout-m-with-stash' into next"

This reverts commit b4e5a964fa85a84a9328647486c250706ad6501d, reversing
changes made to 0e6c98f313ae3e75cedad7125c9b4ab3ba1065c2, as the topic
is still getting rerolled.

13 days agoRevert "Merge branch 'pt/fsmonitor-linux' into next"
Junio C Hamano [Tue, 14 Apr 2026 20:33:08 +0000 (13:33 -0700)] 
Revert "Merge branch 'pt/fsmonitor-linux' into next"

This reverts commit 37fa47889d5763ec3876606fb475bb68af9fd90f,
reversing changes made to 289fcba08108603e2370294eeff384fb2090ed6a,
as the tests in the topic was pointed out to be seriously broken.

cf. <ad6hovxCkwMTG11U@szeder.dev>

2 weeks agoSync with Git 2.54-rc2
Junio C Hamano [Tue, 14 Apr 2026 13:30:17 +0000 (06:30 -0700)] 
Sync with Git 2.54-rc2

2 weeks agoGit 2.54-rc2 v2.54.0-rc2
Junio C Hamano [Tue, 14 Apr 2026 13:22:50 +0000 (06:22 -0700)] 
Git 2.54-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoSync with 'master'
Junio C Hamano [Mon, 13 Apr 2026 20:58:31 +0000 (13:58 -0700)] 
Sync with 'master'

2 weeks agoMerge branch 'ar/parallel-hooks' into next
Junio C Hamano [Mon, 13 Apr 2026 20:58:18 +0000 (13:58 -0700)] 
Merge branch 'ar/parallel-hooks' into next

* ar/parallel-hooks:
  t1800: test SIGPIPE with parallel hooks
  hook: allow hook.jobs=-1 to use all available CPU cores
  hook: add hook.<event>.enabled switch
  hook: move is_known_hook() to hook.c for wider use
  hook: warn when hook.<friendly-name>.jobs is set
  hook: add per-event jobs config
  hook: add -j/--jobs option to git hook run
  hook: mark non-parallelizable hooks
  hook: allow pre-push parallel execution
  hook: allow parallel hook execution
  hook: parse the hook.jobs config
  config: add a repo_config_get_uint() helper
  repository: fix repo_init() memleak due to missing _clear()

2 weeks agoMerge branch 'pt/fsmonitor-linux' into next
Junio C Hamano [Mon, 13 Apr 2026 20:58:18 +0000 (13:58 -0700)] 
Merge branch 'pt/fsmonitor-linux' into next

The fsmonitor daemon has been implemented for Linux.

* pt/fsmonitor-linux:
  fsmonitor: convert shown khash to strset in do_handle_client
  fsmonitor: add tests for Linux
  fsmonitor: add timeout to daemon stop command
  fsmonitor: close inherited file descriptors and detach in daemon
  run-command: add close_fd_above_stderr option
  fsmonitor: implement filesystem change listener for Linux
  fsmonitor: rename fsm-settings-darwin.c to fsm-settings-unix.c
  fsmonitor: rename fsm-ipc-darwin.c to fsm-ipc-unix.c
  fsmonitor: use pthread_cond_timedwait for cookie wait
  compat/win32: add pthread_cond_timedwait
  fsmonitor: fix hashmap memory leak in fsmonitor_run_daemon
  fsmonitor: fix khash memory leak in do_handle_client
  t9210, t9211: disable GIT_TEST_SPLIT_INDEX for scalar clone tests

2 weeks agoMerge branch 'cc/promisor-auto-config-url' into next
Junio C Hamano [Mon, 13 Apr 2026 20:58:18 +0000 (13:58 -0700)] 
Merge branch 'cc/promisor-auto-config-url' into next

Promisor remote handling has been refactored and fixed in
preparation for auto-configuration of advertised remotes.

* cc/promisor-auto-config-url:
  t5710: use proper file:// URIs for absolute paths
  promisor-remote: remove the 'accepted' strvec
  promisor-remote: keep accepted promisor_info structs alive
  promisor-remote: refactor accept_from_server()
  promisor-remote: refactor has_control_char()
  promisor-remote: refactor should_accept_remote() control flow
  promisor-remote: reject empty name or URL in advertised remote
  promisor-remote: clarify that a remote is ignored
  promisor-remote: pass config entry to all_fields_match() directly
  promisor-remote: try accepted remotes before others in get_direct()

2 weeks agoMerge branch 'dl/cache-tree-fully-valid-fix' into next
Junio C Hamano [Mon, 13 Apr 2026 20:58:18 +0000 (13:58 -0700)] 
Merge branch 'dl/cache-tree-fully-valid-fix' into next

The check that implements the logic to see if an in-core cache-tree
is fully ready to write out a tree object was broken, which has
been corrected.

* dl/cache-tree-fully-valid-fix:
  cache-tree: fix inverted object existence check in cache_tree_fully_valid

2 weeks agoHopefully the final tweak before -rc2
Junio C Hamano [Mon, 13 Apr 2026 20:54:45 +0000 (13:54 -0700)] 
Hopefully the final tweak before -rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'jc/ci-github-actions-use-checkout-v5'
Junio C Hamano [Mon, 13 Apr 2026 20:54:57 +0000 (13:54 -0700)] 
Merge branch 'jc/ci-github-actions-use-checkout-v5'

CI dependency updates.

* jc/ci-github-actions-use-checkout-v5:
  CI: bump actions/checkout from 4 to 5 for rust-analysis job

2 weeks agoMerge branch 'jk/doc-markup-sub-list-indentation'
Junio C Hamano [Mon, 13 Apr 2026 20:54:57 +0000 (13:54 -0700)] 
Merge branch 'jk/doc-markup-sub-list-indentation'

Doc mark-up update for entries in the glossary with bulleted lists.

* jk/doc-markup-sub-list-indentation:
  gitglossary: fix indentation of sub-lists

2 weeks agoMerge branch 'kh/doc-am-xref'
Junio C Hamano [Mon, 13 Apr 2026 20:54:57 +0000 (13:54 -0700)] 
Merge branch 'kh/doc-am-xref'

Doc update.

* kh/doc-am-xref:
  doc: am: correct to full --no-message-id
  doc: am: revert Message-ID trailer claim

2 weeks agoMerge branch 'jc/ci-github-actions-use-checkout-v5' into next
Junio C Hamano [Mon, 13 Apr 2026 19:07:08 +0000 (12:07 -0700)] 
Merge branch 'jc/ci-github-actions-use-checkout-v5' into next

CI dependency updates.

* jc/ci-github-actions-use-checkout-v5:
  CI: bump actions/checkout from 4 to 5 for rust-analysis job

2 weeks agoMerge branch 'jk/doc-markup-sub-list-indentation' into next
Junio C Hamano [Mon, 13 Apr 2026 19:07:08 +0000 (12:07 -0700)] 
Merge branch 'jk/doc-markup-sub-list-indentation' into next

Doc mark-up update for entries in the glossary with bulleted lists.

* jk/doc-markup-sub-list-indentation:
  gitglossary: fix indentation of sub-lists

2 weeks agogitglossary: fix indentation of sub-lists
Jeff King [Sat, 11 Apr 2026 21:55:18 +0000 (17:55 -0400)] 
gitglossary: fix indentation of sub-lists

The glossary entry is a list of terms and their definitions, so
multi-paragraph definitions need "+" continuation lines to indicate
that they are part of a single entry.

When an entry contains a sub-list (say, a bulleted list), the final "+"
may become ambiguous: is it connecting the next paragraph to the final
entry of the sub-list, or to the original list of definition paragraphs?

Asciidoc generally connects it to the former, even when we mean the
latter, and you end up with the next paragraph indented incorrectly,
like this:

  glob
    ...defines glob...

    Two consecutive asterisks ("**") in patterns matched
    against full pathname may have special meaning:

    - ...some special meaning of **...

    - ...another special meaning of **...

    - Other consecutive asterisks are considered invalid.

      Glob magic is incompatible with literal magic.

That final "Glob magic is incompatible" paragraph is in the wrong spot.
It should be at the same level as "Two consecutive asterisks", as it is
not part of the final "Other consecutive asterisks" bullet point.

The same problem appears in several other spots in the glossary.

Usually we'd fix this by using "--" markers, which put the sub-list into
its own block. But there's a catch: in some of these spots we are
already in an open block, and nesting open blocks is a problem. It seems
to work for me using Asciidoc 10.2.1, but Asciidoctor 2.0.26 makes a
mess of it (our intent to open a new block seems to close the old one).

Fortunately there's a work-around: when using a "+" list-continuation,
the number of empty lines above the continuation indicates which level
of parent list to continue. So by adding an empty line after our
unordered list (before the "+"), we should be able to continue the
definition list item.

But asciidoc being asciidoc, of course that is not the end of the story.
That technique works fine for the "glob" and "attr" lists in this patch,
but under the "refs" item it works for only 1 of the 2 lists! I can't
figure out why, and this may be an asciidoctor bug. But we can work
around it by using "--" open-block markers here, since we're not
already in an open block.

So using the extra blank line for the first two instances, and "--"
markers for the second two, this patch produces identical output from
"doc-diff HEAD^ HEAD" for both --asciidoctor and --asciidoc modes.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoCI: bump actions/checkout from 4 to 5 for rust-analysis job
Junio C Hamano [Mon, 13 Apr 2026 18:24:44 +0000 (11:24 -0700)] 
CI: bump actions/checkout from 4 to 5 for rust-analysis job

GitHub Actions started complaining about use of Node.js 20 and I was
wondering why only one job uses actions/checkout@v4, while everybody
else already uses actions/checkout@v5.

It turns out that it is caused by a semantic mismerge between
e75cd059 (ci: check formatting of our Rust code, 2025-10-15) that
added a new use of actions/checkout@v4 that happened very close to
another change 63541ed9 (build(deps): bump actions/checkout from 4
to 5, 2025-10-16) that updated all uses of actions/checkout@v4 to
use vactions/checkout@v5.

Update the leftover and the last use of actions/checkout@v4 to use
actions/checkout@v5 to help ourselves to move away from Node.js 20.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'hn/git-checkout-m-with-stash' into next
Junio C Hamano [Mon, 13 Apr 2026 15:46:10 +0000 (08:46 -0700)] 
Merge branch 'hn/git-checkout-m-with-stash' into next

"git checkout -m another-branch" was invented to deal with local
changes to paths that are different between the current and the new
branch, but it gave only one chance to resolve conflicts.  The command
was taught to create a stash to save the local changes.

* hn/git-checkout-m-with-stash:
  checkout: -m (--merge) uses autostash when switching branches
  sequencer: teach autostash apply to take optional conflict marker labels
  sequencer: allow create_autostash to run silently
  stash: add --label-ours, --label-theirs, --label-base for apply

2 weeks agoMerge branch 'ja/doc-difftool-synopsis-style' into next
Junio C Hamano [Mon, 13 Apr 2026 15:46:10 +0000 (08:46 -0700)] 
Merge branch 'ja/doc-difftool-synopsis-style' into next

Doc mark-up updates.

* ja/doc-difftool-synopsis-style:
  doc: convert git-describe manual page to synopsis style
  doc: convert git-shortlog manual page to synopsis style
  doc: convert git-range-diff manual page to synopsis style
  doc: convert git-difftool manual page to synopsis style

2 weeks agoMerge branch 'kh/doc-am-xref' into next
Junio C Hamano [Mon, 13 Apr 2026 15:45:03 +0000 (08:45 -0700)] 
Merge branch 'kh/doc-am-xref' into next

Doc update.

* kh/doc-am-xref:
  doc: am: correct to full --no-message-id
  doc: am: revert Message-ID trailer claim

2 weeks agodoc: am: correct to full --no-message-id
Kristoffer Haugsbakk [Sat, 11 Apr 2026 20:20:10 +0000 (22:20 +0200)] 
doc: am: correct to full --no-message-id

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agodoc: am: revert Message-ID trailer claim
Kristoffer Haugsbakk [Sat, 11 Apr 2026 20:15:50 +0000 (22:15 +0200)] 
doc: am: revert Message-ID trailer claim

I claimed in 3c18135b (doc: am: say that --message-id adds a trailer,
2026-02-09) that `git am --message-id` adds a Git trailer. But that
isn’t the case; for the case of a commit message with a subject, body,
and no trailer block:

    <subject>

    <paragrah>

It just appends the line right after `paragraph`:

    <subject>

    <paragraph>
    Message-ID: <message-id_trailer.323@msgid.xyz>

It does work for two other cases though, namely subject-only and with an
existing trailer block.

This is at best an inconsistency and arguably a bug, but we’re at the
trailing end of the release cycle now. So reverting the doc is safer
than making msg-id act as a trailer, for now.

Revert this hunk from commit 3c18135b except the only useful
change (“Also use inline-verbatim for `Message-ID`”).

Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocheckout: -m (--merge) uses autostash when switching branches
Harald Nordgren [Sun, 12 Apr 2026 11:51:45 +0000 (11:51 +0000)] 
checkout: -m (--merge) uses autostash when switching branches

When switching branches with "git checkout -m", local modifications
can block the switch.  Teach the -m flow to create a temporary stash
before switching and reapply it after.  On success, only "Applied
autostash." is shown.  If reapplying causes conflicts, the stash is
kept and the user is told they can resolve and run "git stash drop",
or run "git reset --hard" and later "git stash pop" to recover their
changes.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agosequencer: teach autostash apply to take optional conflict marker labels
Harald Nordgren [Sun, 12 Apr 2026 11:51:44 +0000 (11:51 +0000)] 
sequencer: teach autostash apply to take optional conflict marker labels

Add label_ours, label_theirs, and label_base parameters to the autostash
apply machinery so callers can pass custom conflict marker labels
through to "git stash apply --label-ours/--label-theirs/--label-base".
Introduce apply_autostash_ref_with_labels() for callers that want
to pass labels.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agosequencer: allow create_autostash to run silently
Harald Nordgren [Sun, 12 Apr 2026 11:51:43 +0000 (11:51 +0000)] 
sequencer: allow create_autostash to run silently

Add a silent parameter to create_autostash_internal and introduce
create_autostash_ref_silent so that callers can create an autostash
without printing the "Created autostash" message.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agostash: add --label-ours, --label-theirs, --label-base for apply
Harald Nordgren [Sun, 12 Apr 2026 11:51:42 +0000 (11:51 +0000)] 
stash: add --label-ours, --label-theirs, --label-base for apply

Allow callers of "git stash apply" to pass custom labels for conflict
markers instead of the default "Updated upstream" and "Stashed changes".
Document the new options and add a test.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoSync with 'master'
Junio C Hamano [Fri, 10 Apr 2026 23:48:57 +0000 (16:48 -0700)] 
Sync with 'master'

2 weeks agoMerge branch 'jc/no-writev-does-not-work'
Junio C Hamano [Fri, 10 Apr 2026 23:47:35 +0000 (16:47 -0700)] 
Merge branch 'jc/no-writev-does-not-work'

We used writev() in limited code paths and supplied emulation for
platforms without working writev(), but the emulation was too
faithful to the spec to make the result useless to send even 64kB;
revert the topic and plan to restart the effort later.

* jc/no-writev-does-not-work:
  Revert "compat/posix: introduce writev(3p) wrapper"
  Revert "wrapper: introduce writev(3p) wrappers"
  Revert "sideband: use writev(3p) to send pktlines"
  Revert "cmake: use writev(3p) wrapper as needed"

2 weeks agoSync with 'master'
Junio C Hamano [Fri, 10 Apr 2026 17:09:02 +0000 (10:09 -0700)] 
Sync with 'master'

2 weeks agoMerge branch 'jc/no-writev-does-not-work' into next
Junio C Hamano [Fri, 10 Apr 2026 17:08:51 +0000 (10:08 -0700)] 
Merge branch 'jc/no-writev-does-not-work' into next

We used writev() in limited code paths and supplied emulation for
platforms without working writev(), but the emulation was too
faithful to the spec to make the result useless to send even 64kB;
revert the topic and plan to restart the effort later.

* jc/no-writev-does-not-work:
  Revert "compat/posix: introduce writev(3p) wrapper"
  Revert "wrapper: introduce writev(3p) wrappers"
  Revert "sideband: use writev(3p) to send pktlines"
  Revert "cmake: use writev(3p) wrapper as needed"

2 weeks agoMerge branch 'ps/archive-prefix-doc'
Junio C Hamano [Fri, 10 Apr 2026 17:05:33 +0000 (10:05 -0700)] 
Merge branch 'ps/archive-prefix-doc'

Doc update.

* ps/archive-prefix-doc:
  archive: document --prefix handling of absolute and parent paths

2 weeks agoMerge branch 'bc/ref-storage-default-doc-update'
Junio C Hamano [Fri, 10 Apr 2026 17:05:32 +0000 (10:05 -0700)] 
Merge branch 'bc/ref-storage-default-doc-update'

Doc update.

* bc/ref-storage-default-doc-update:
  docs: correct information about reftable

2 weeks agorust: we are way beyond 2.53
Junio C Hamano [Fri, 10 Apr 2026 14:52:50 +0000 (07:52 -0700)] 
rust: we are way beyond 2.53

Earlier we timelined that we'd tune our build procedures to build
with Rust by default in Git 2.53, but we are already in prerelease
freeze for 2.54 now.  Update the BreakingChanges document to delay
it until Git 2.55 (slated for the end of June 2026).

Noticed-by: brian m. carlson <sandals@crustytoothpaste.net>
Helped-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agot1800: test SIGPIPE with parallel hooks
Jeff King [Fri, 10 Apr 2026 09:06:08 +0000 (12:06 +0300)] 
t1800: test SIGPIPE with parallel hooks

We recently fixed a bug in commit 2226ffaacd (run_processes_parallel():
fix order of sigpipe handling, 2026-04-08) where a hook that caused us
to get SIGPIPE would accidentally trigger the run_processes_parallel()
cleanup handler killing the child processes.

For a single hook, this meant killing the already-exited hook. This case
was triggered by our tests, but was only a problem on some platforms.

But if you have multiple hooks running in parallel, this causes a
problem everywhere, since one hook failing to read its input would take
down all hooks. Now that we have parallel hook support, we can add a
test for this case. It should pass already, due to the existing fix.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: allow hook.jobs=-1 to use all available CPU cores
Adrian Ratiu [Fri, 10 Apr 2026 09:06:07 +0000 (12:06 +0300)] 
hook: allow hook.jobs=-1 to use all available CPU cores

Allow -1 as a value for hook.jobs, hook.<event>.jobs, and the -j
CLI flag to mean "use as many jobs as there are CPU cores", matching
the convention used by fetch.parallel and other Git subsystems.

The value is resolved to online_cpus() at parse time so the rest
of the code always works with a positive resolved count.

Other non-positive values (0, -2, etc) are rejected with a warning
(config) or die (CLI).

Suggested-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: add hook.<event>.enabled switch
Adrian Ratiu [Fri, 10 Apr 2026 09:06:06 +0000 (12:06 +0300)] 
hook: add hook.<event>.enabled switch

Add a hook.<event>.enabled config key that disables all hooks for
a given event, when set to false, acting as a high-level switch
above the existing per-hook hook.<friendly-name>.enabled.

Event-disabled hooks are shown in "git hook list" with an
"event-disabled" tab-separated prefix before the name:

$ git hook list test-hook
event-disabled  hook-1
event-disabled  hook-2

With --show-scope:

$ git hook list --show-scope test-hook
local   event-disabled  hook-1

When a hook is both per-hook disabled and event-disabled, only
"event-disabled" is shown: the event-level switch is the more
relevant piece of information, and the per-hook "disabled" status
will surface once the event is re-enabled.

Using an event name as a friendly-name (e.g. hook.<event>.enabled)
can cause ambiguity, so a fatal error is issued when using a known
event name and a warning is issued for unknown event name, since
a collision cannot be detected with certainty for unknown events.

Suggested-by: Patrick Steinhardt <ps@pks.im>
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: move is_known_hook() to hook.c for wider use
Adrian Ratiu [Fri, 10 Apr 2026 09:06:05 +0000 (12:06 +0300)] 
hook: move is_known_hook() to hook.c for wider use

Move is_known_hook() from builtin/hook.c (static) into hook.c and
export it via hook.h so it can be reused.

Make it return bool and the iterator `h` for clarity (iterate hooks).

Both meson.build and the Makefile are updated to reflect that the
header is now used by libgit, not the builtin sources.

The next commit will use this to reject hook friendly-names that
collide with known event names.

Co-authored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: warn when hook.<friendly-name>.jobs is set
Adrian Ratiu [Fri, 10 Apr 2026 09:06:04 +0000 (12:06 +0300)] 
hook: warn when hook.<friendly-name>.jobs is set

Issue a warning when the user confuses the hook process and event
namespaces by setting hook.<friendly-name>.jobs.

Detect this by checking whether the name carrying .jobs also has
.command, .event, or .parallel configured.  Extract is_friendly_name()
as a helper for this check, to be reused by future per-event config
handling.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: add per-event jobs config
Adrian Ratiu [Fri, 10 Apr 2026 09:06:03 +0000 (12:06 +0300)] 
hook: add per-event jobs config

Add a hook.<event>.jobs count config that allows users to override the
global hook.jobs setting for specific hook events.

This allows finer-grained control over parallelism on a per-event basis.

For example, to run `post-receive` hooks with up to 4 parallel jobs
while keeping other events at their global default:

[hook]
    post-receive.jobs = 4

Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: add -j/--jobs option to git hook run
Emily Shaffer [Fri, 10 Apr 2026 09:06:02 +0000 (12:06 +0300)] 
hook: add -j/--jobs option to git hook run

Expose the parallel job count as a command-line flag so callers can
request parallelism without relying only on the hook.jobs config.

Add tests covering serial/parallel execution and TTY behaviour under
-j1 vs -jN.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: mark non-parallelizable hooks
Emily Shaffer [Fri, 10 Apr 2026 09:06:01 +0000 (12:06 +0300)] 
hook: mark non-parallelizable hooks

Several hooks are known to be inherently non-parallelizable, so initialize
them with RUN_HOOKS_OPT_INIT_FORCE_SERIAL. This pins jobs=1 and overrides
any hook.jobs or runtime -j flags.

These hooks are:
applypatch-msg, pre-commit, prepare-commit-msg, commit-msg, post-commit,
post-checkout, and push-to-checkout.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: allow pre-push parallel execution
Adrian Ratiu [Fri, 10 Apr 2026 09:06:00 +0000 (12:06 +0300)] 
hook: allow pre-push parallel execution

pre-push is the only hook that keeps stdout and stderr separate (for
backwards compatibility with git-lfs and potentially other users). This
prevents parallelizing it because run-command needs stdout_to_stderr=1
to buffer and de-interleave parallel outputs.

Since we now default to jobs=1, backwards compatibility is maintained
without needing any extension or extra config: when no parallelism is
requested, pre-push behaves exactly as before.

When the user explicitly opts into parallelism via hook.jobs > 1,
hook.<event>.jobs > 1, or -jN, they accept the changed output behavior.

Document this and let get_hook_jobs() set stdout_to_stderr=1 automatically
when jobs > 1, removing the need for any extension infrastructure.

Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: allow parallel hook execution
Emily Shaffer [Fri, 10 Apr 2026 09:05:59 +0000 (12:05 +0300)] 
hook: allow parallel hook execution

Hooks always run in sequential order due to the hardcoded jobs == 1
passed to run_process_parallel(). Remove that hardcoding to allow
users to run hooks in parallel (opt-in).

Users need to decide which hooks to run in parallel, by specifying
"parallel = true" in the config, because Git cannot know if their
specific hooks are safe to run or not in parallel (for e.g. two hooks
might write to the same file or call the same program).

Some hooks are unsafe to run in parallel by design: these will marked
in the next commit using RUN_HOOKS_OPT_INIT_FORCE_SERIAL.

The hook.jobs config specifies the default number of jobs applied to all
hooks which have parallelism enabled.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agohook: parse the hook.jobs config
Adrian Ratiu [Fri, 10 Apr 2026 09:05:58 +0000 (12:05 +0300)] 
hook: parse the hook.jobs config

The hook.jobs config is a global way to set hook parallelization for
all hooks, in the sense that it is not per-event nor per-hook.

Finer-grained configs will be added in later commits which can override
it, for e.g. via a per-event type job options. Next commits will also
add to this item's documentation.

Parse hook.jobs config key in hook_config_lookup_all() and store its
value in hook_all_config_cb.jobs, then transfer it into r->jobs after
the config pass completes.

This is mostly plumbing and the cached value is not yet used.

Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>