]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
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 agorebase: write script before initializing state
Øystein Walle [Mon, 9 Jun 2025 22:10:55 +0000 (00:10 +0200)] 
rebase: write script before initializing state

If rebase.instructionFormat is invalid the repository is left in a
strange state when the interactive rebase fails. `git status` outputs
boths the same as it would in the normal case *and* something related to
interactive rebase:

    $ git -c rebase.instructionFormat=blah rebase -i
    fatal: invalid --pretty format: blah
    $ git status
    On branch master
    Your branch is ahead of 'upstream/master' by 1 commit.
      (use "git push" to publish your local commits)

    git-rebase-todo is missing.
    No commands done.
    No commands remaining.
    You are currently editing a commit while rebasing branch 'master' on '8db3019401'.
      (use "git commit --amend" to amend the current commit)
      (use "git rebase --continue" once you are satisfied with your changes)

By attempting to write the rebase script before initializing the state
this potential scenario is avoided.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agotest-lib: add missing prerequisites for Darwin
Ramsay Jones [Mon, 9 Jun 2025 17:13:38 +0000 (18:13 +0100)] 
test-lib: add missing prerequisites for Darwin

commit d3d8c601fd ("t7815: fix unexpectedly passing test on macOS",
2025-06-02) added a MACOS prerequisite by adding a 'Darwin' case
label to the 'OS-specific' case statement. However, this commit
forgot to set several prerequisites which appear in the 'default'
case label, in addition to the new MACOS prerequisite. This causes
several tests, which macOS should pass, being skipped.

In order to run all applicable tests on macOS, add the missing
prerequisites to the 'Darwin' case.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agopack-bitmap: remove checks before bitmap_free
Lidong Yan [Mon, 9 Jun 2025 08:18:44 +0000 (08:18 +0000)] 
pack-bitmap: remove checks before bitmap_free

In pack-bitmap.c:find_boundary_objects(), the roots_bitmap is only freed
if cascade_pseudo_merges_1() fails. However, cascade_pseudo_merges_1()
uses roots_bitmap as a mutable reference without taking ownership of it.
As a result, if cascade_pseudo_merges_1() succeeds, roots_bitmap is leaked.
And this leak currently lacks a dedicated test to detect it.

To fix this leak, remove if cascade_pseudo_merges_1() succeed check and
always calling bitmap_free(roots_bitmap);

To trigger this leak, we need roots_bitmap that contains at least one
pseudo merge. So that we can use pseudo merge bitmap when we compute roots
reachable bitmap. Here we create two commits: first A then B. Add A
to the pseudo-merge and perform a traversal over the range A..B.
In this scenario, the "haves" set will be {A}, and cascade_pseudo_merges_1
will succeed, thereby exposing the leak due to the missing roots_bitmap
cleanup.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
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 agobuiltin/submodule--helper: fix leak when remote_submodule_branch() failed
Lidong Yan [Sun, 8 Jun 2025 03:56:59 +0000 (03:56 +0000)] 
builtin/submodule--helper: fix leak when remote_submodule_branch() failed

In builtin/submodule--helper.c:update_submodule(), the variable
remote_name is allocated in get_default_remote_submodule() but
may be leaked if remote_submodule_branch() fails. Although it is
unlikely that remote_submodule_branch() would fail after successfully
obtaining a remote ref name from get_default_remote_submodule(),
it is still possible. To prevent a potential memory leak, add a
call to free(remote_name) at the early exit point.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoconfig.mak.uname: update settings for Solaris 10 and 11
Brad Smith [Sun, 8 Jun 2025 01:26:52 +0000 (21:26 -0400)] 
config.mak.uname: update settings for Solaris 10 and 11

Solaris 10 and newer has strtoumax().

Solaris 11 and newer has mkdtemp(), memmem(), and strcasestr().

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 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 agostash: allow "git stash [<options>] --patch <pathspec>" to assume push
Phillip Wood [Sat, 7 Jun 2025 09:45:26 +0000 (10:45 +0100)] 
stash: allow "git stash [<options>] --patch <pathspec>" to assume push

The support for assuming "push" when "-p" is given introduced in
9e140909f61 (stash: allow pathspecs in the no verb form, 2017-02-28) is
very narrow, neither "git stash -m <message> -p <pathspec>" nor "git
stash --patch <pathspec>" imply "push" and die instead. Relax this by
passing PARSE_OPT_STOP_AT_NON_OPTION when push is being assumed and then
setting "force_assume" if "--patch" was present. This means "git stash
<pathspec> -p" still dies so that it does not assume the user meant
"push" if they mistype a subcommand name but "git stash -m <message> -p
<pathspec>" will now succeed. The test added in the last commit is
adjusted to check that push is still assumed when "--patch" comes after
other options on the command-line.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agostash: allow "git stash -p <pathspec>" to assume push again
Phillip Wood [Sat, 7 Jun 2025 09:45:25 +0000 (10:45 +0100)] 
stash: allow "git stash -p <pathspec>" to assume push again

Historically "git stash [<options>]" was assumed to mean "git stash save
[<options>]". Since 1ada5020b38 (stash: use stash_push for no verb form,
2017-02-28) it is assumed to mean "git stash push [<options>]". As the
push subcommand supports pathspecs, 9e140909f61 (stash: allow pathspecs
in the no verb form, 2017-02-28) allowed "git stash -p <pathspec>" to
mean "git stash push -p <pathspec>". This was broken in 8c3713cede7
(stash: eliminate crude option parsing, 2020-02-17) which failed to
account for "push" being added to the start of argv in cmd_stash()
before it calls push_stash() and kept looking in argv[0] for "-p" after
moving the code to push_stash().

Fix this by regression by checking argv[1] instead of argv[0] and add a
couple of tests to prevent future regressions.

Helped-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agodoc: update references to renamed AsciiDoc files
Jouke Witteveen [Wed, 21 May 2025 19:05:10 +0000 (19:05 +0000)] 
doc: update references to renamed AsciiDoc files

The .txt extensions were changed to .adoc in 1f010d6 (doc: use .adoc
extension for AsciiDoc files, 2025-01-20). References to the renamed
files were not updated yet.

Signed-off-by: Jouke Witteveen <j.witteveen@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 [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 agodiff-generate-patch.adoc: drop spurious backticks
Martin Ågren [Fri, 6 Jun 2025 12:31:36 +0000 (14:31 +0200)] 
diff-generate-patch.adoc: drop spurious backticks

Commit 0b080a70ab (doc: git-diff: apply format changes to
diff-generate-patch, 2024-11-18) wrapped the ".." in

  mode <mode>,<mode>..<mode>

in backticks. Note how the line before is quite similar,

  index <hash>,<hash>..<hash>

but did not get any backticks. Remove the backticks, since they confuse
Asciidoctor.

The exact failure mode changed with c87b2b3a6f (doc: fix asciidoctor
synopsis processing of triple-dots, 2025-04-12), and arguably to the
better. But Asciidoctor (2.0.18) still ends up confused by these
backticks and leaves the manpage rendering as

  index <hash>,<hash>..<hash>
  mode <mode>,<mode>`..__<mode>__
  {empty}`new file mode <mode>

Drop the backticks. This is a no-op with asciidoc (10.2.0).

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agorepo_logmsg_reencode: fix memory leak when use repo_logmsg_reencode ()
Lidong Yan [Thu, 5 Jun 2025 06:27:26 +0000 (06:27 +0000)] 
repo_logmsg_reencode: fix memory leak when use repo_logmsg_reencode ()

pretty.c:repo_logmsg_reencode() allocated memory should be freed with
repo_unuse_commit_buffer(). Callers sometimes forgot free it at exit
point. Add `repo_unuse_commit_buffer()` in insert_records_from_trailers
at builtin/shortlog.c and create_commit at builtin/replay.c

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agobundle-uri: send debug output to given FILE * stream
Jan Mazur [Wed, 4 Jun 2025 17:11:21 +0000 (17:11 +0000)] 
bundle-uri: send debug output to given FILE * stream

d796cedb (bundle-uri: unit test "key=value" parsing, 2022-10-12)
introduced the print_bundle_list() function, which takes a "FILE
*fp" to write the output to.  Later with c93c3d2f (bundle-uri:
parse bundle.heuristic=creationToken, 2023-01-31) the function
started showing additional information, which is always written
to the standard output stream.

It does not look like a deliberate decision to do so, and it
does not hurt, as all callers of the function passes stdout to
it.

We could change the function not to take fp and always write to
the standard output to simplify, but let's use the FILE *fp
provided by the caller consistently to write out output.

Signed-off-by: Jan Mazur <mzr@meta.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocontrib/subtree: add -S/--gpg-sign
Patrik Weiskircher [Wed, 4 Jun 2025 14:16:37 +0000 (14:16 +0000)] 
contrib/subtree: add -S/--gpg-sign

Allows optionally signing the commits that git subtree creates. This can
be necessary when working in a repository that requires gpg signed
commits.

Signed-off-by: Patrik Weiskircher <patrik@pspdfkit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocontrib/subtree: parse using --stuck-long
Patrik Weiskircher [Wed, 4 Jun 2025 14:16:36 +0000 (14:16 +0000)] 
contrib/subtree: parse using --stuck-long

Optional parameter handling only works unambiguous with git rev-parse
--parseopt when using the --stuck-long option. To prepare for future commits
which add flags with optional parameters, parse with --stuck-long.

Signed-off-by: Patrik Weiskircher <patrik@pspdfkit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agosend-email: show the new message id assigned by outlook in the logs
Aditya Garg [Wed, 4 Jun 2025 12:55:14 +0000 (18:25 +0530)] 
send-email: show the new message id assigned by outlook in the logs

Whenever an email is sent, send-email shows a log at last, which
contains all the headers of the email that were received by the
receipients.

In case outlook changes the Message-ID, a log for the same is shown to
the user, but that change is not reflected when the log containing all
the headers is displayed. Here is an example of the log that is shown
when outlook changes the Message-ID:

Outlook reassigned Message-ID to: <PN3PR01MB95973E5ACD7CCFADCB4E298CB865A@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
OK. Log says:
Server: smtp.office365.com
MAIL FROM:<gargaditya08@live.com>
RCPT TO:<negahe7142@nomrista.com>
From: Aditya Garg <gargaditya08@live.com>
To: negahe7142@nomrista.com
Subject: [PATCH] send-email: show the new message id assigned by outlook in the logs
Date: Mon, 26 May 2025 20:28:36 +0530
Message-ID: <20250526145836.4825-1-gargaditya08@live.com>
X-Mailer: git-send-email @GIT_VERSION@
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Result: 250

Fix this by updating the $header variable, which has the message ID we
internally assigned on the "Message-ID:" header, with the message ID the
Outlook server assigned. It should look like this after this patch:

OK. Log says:
Server: smtp.office365.com
MAIL FROM:<gargaditya08@live.com>
RCPT TO:<negahe7142@nomrista.com>
From: Aditya Garg <gargaditya08@live.com>
To: negahe7142@nomrista.com
Subject: [PATCH] send-email: show the new message id assigned by outlook in the logs
Date: Mon, 26 May 2025 20:29:22 +0530
Message-ID: <PN3PR01MB95977486061BD2542BD09B67B865A@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
X-Mailer: git-send-email @GIT_VERSION@
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Result: 250

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agosend-email: fix bug resulting in broken threads if a message is edited
Aditya Garg [Wed, 4 Jun 2025 12:55:13 +0000 (18:25 +0530)] 
send-email: fix bug resulting in broken threads if a message is edited

Whenever we send a thread of emails using send-email, a message number
is internally assigned to each email. This number is used to track the
order of the emails in the thread. Whenever a new message is processed
in a thread, the current script logic increments the message number by
one, which is intended.

But, if a message is edited and then resent, its message number again
gets incremented. This is because the script uses the same logic to
process the edited message, which it uses to send the next message.

This minor bug is usually harmless, unless a special situations arises.
That situation is when the first message in a thread is edited and
resent, and an `--in-reply-to` argument is also passed to send-email.
In this case, if the user has chosen shallow threading, the threading
does not work as expected, and all messages become replies to the
Message-ID specified in the `--in-reply-to` argument.

The reason for this bug is hidden in the code for threading itself.

if ($thread) {
if ($message_was_sent &&
  ($chain_reply_to || !defined $in_reply_to || length($in_reply_to) == 0 ||
  $message_num == 1)) {
$in_reply_to = $message_id;
if (length $references > 0) {
$references .= "\n $message_id";
} else {
$references = "$message_id";
}
}
}

Here `$message_num` is the current message number, and `$in_reply_to` is
the Message-ID of the message to which the current message is a reply.
In case `--in-reply-to` is specified, the `$in_reply_to` variable
is set to the value of the `--in-reply-to` argument.

Whenever this whole set of conditions is true, the script sets the
`$in_reply_to` variable to the current message's ID. This is done to
ensure that the next message in the thread is a reply to this message.

In case we specify an `--in-reply-to` argument, and have shallow
threading, the only condition that can make this true is
`$message_num == 1`, which is true for the first message in a thread.
Thus, the `$in_reply_to` variable gets set to the first message's ID.
For subsequent messages, the `$message_num` variable is always
greater than 1, and the whole set of conditions is false. Therefore, the
`$in_reply_to` variable remains as the first message's ID. This is what
we expect in shallow threading. But if the user edits the first message
and resends it, the `$message_num` variable gets incremented by 1, and
thus the condition `$message_num == 1` becomes false. This means that
the `$in_reply_to` variable is not set to the first message's ID. As a
result the next message in the thread is not a reply to the first
message, but to the `--in-reply-to` argument, effectively breaking the
threading.

In case the user does not specify an `--in-reply-to` argument, the
`!defined $in_reply_to` condition is true, and thus the `$in_reply_to`
variable is set to the first message's ID, and the threading works
as expected, regardless of the message number.

To fix this bug, we need to ensure that the `$message_num` variable is
not incremented by 1 when a message is edited and resent. We do this by
decreasing the `$message_num` variable by 1 whenever the request to edit
a message is received. This way, the next message in the thread will
have the same message number as the edited message. Therefore the
threading will work as expected.

The same logic has also been applied in case the user drops a single
message from the thread by choosing the "[n]o" option during
confirmation. By doing this, the next message in the thread is assigned
the message number of the dropped message, and thus the threading
works as expected.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocommit-graph: fix start_delayed_progress() leak
Lidong Yan [Wed, 4 Jun 2025 03:11:15 +0000 (03:11 +0000)] 
commit-graph: fix start_delayed_progress() leak

In commit-graph.c:graph_write(), if read_one_commit() failed,
progress allocated in start_delayed_progress() will leak. Add
stop_progress() before goto cleanup.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/fetch-pack: cleanup before return error
Lidong Yan [Wed, 4 Jun 2025 03:07:54 +0000 (03:07 +0000)] 
builtin/fetch-pack: cleanup before return error

In builtin/fetch-pack.c:cmd_fetch_pack(), if finish_connect() failed,
it returns error code without cleanup which cause memory leak. Add
cleanup label before frees in the end of cmd_fetch_pack(), and add
`goto cleanup` if finish_connect() failed.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocat-file.c: add batch handling for submodules
Victoria Dye [Mon, 2 Jun 2025 18:55:55 +0000 (18:55 +0000)] 
cat-file.c: add batch handling for submodules

When an object specification is passed to 'cat-file --batch[-check]'
referring to a submodule (e.g. 'HEAD:path/to/my/submodule'), the current
behavior of the command is to print the "missing" error message. However, it
is often valuable for callers to distinguish between paths that are actually
missing and "the submodule tree entry exists, but the object does not exist
in the repository".

To disambiguate without needing to invoke a separate Git process (e.g.
'ls-tree'), print the message "<oid> submodule" for such objects instead of
"<object> missing". In addition to the change from "missing" to "submodule",
the new message differs from the old in that it always prints the resolved
tree entry's OID, rather than the input object specification.

Note that this implementation maintains a distinction between submodules
where the commit OID is not present in the repo, and submodules where the
commit OID *is* present; the former will now print "<object> submodule", but
the latter will still print the full object content.

Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agocat-file: add %(objectmode) atom
Victoria Dye [Mon, 2 Jun 2025 18:55:54 +0000 (18:55 +0000)] 
cat-file: add %(objectmode) atom

Add a formatting atom, used with the --batch-check/--batch-command options,
that prints the octal representation of the object mode if a given revision
includes that information, e.g. one that follows the format
<tree-ish>:<path>. If the mode information does not exist, an empty string
is printed instead.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot1006: update 'run_tests' to test generic object specifiers
Victoria Dye [Mon, 2 Jun 2025 18:55:53 +0000 (18:55 +0000)] 
t1006: update 'run_tests' to test generic object specifiers

Update the 'run_tests' test wrapper so that the first argument may refer to
any specifier that uniquely identifies an object (e.g. a ref name,
'<OID>:<path>', '<OID>^{<type>}', etc.), rather than only a full object ID.

Also add tests that use non-OID identifiers, ensuring appropriate parsing in
'cat-file'. The identifiers used in some of the added tests include a space,
which is incompatible with the '%(rest)' atom. To accommodate that without
removing the test case, use 'test_expect_failure' when 'object_name'
includes a space.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
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 agoBUG(): remove leading underscore of the format string
Lidong Yan [Tue, 3 Jun 2025 02:01:14 +0000 (02:01 +0000)] 
BUG(): remove leading underscore of the format string

BUG() is not end-user facing but programmer facing, and we do not
use _("...") in them. Replace all `BUG(_("..."))` with `BUG("...")`

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agosequencer: replace error() with BUG() in update_squash_messages ()
Lidong Yan [Tue, 3 Jun 2025 02:01:13 +0000 (02:01 +0000)] 
sequencer: replace error() with BUG() in update_squash_messages ()

In sequencer.c, caller only pass TODO_SQUASH or TODO_FIXUP to
update_squash_messages(), any other command passed in should be
considered as BUG. Replace `return error('unknown command')`
with `BUG('not a FIXUP or SQUASH')`.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: fix locking race when handling "gc" task
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:20 +0000 (16:01 +0200)] 
builtin/maintenance: fix locking race when handling "gc" task

The "gc" task has a similar locking race as the one that we have fixed
for the "pack-refs" and "reflog-expire" tasks in preceding commits. Fix
this by splitting up the logic of the "gc" task:

  - We execute `gc_before_repack()` in the foreground, which contains
    the logic that git-gc(1) itself would execute in the foreground, as
    well.

  - We spawn git-gc(1) after detaching, but with a new hidden flag that
    suppresses calling `gc_before_repack()`.

Like this we have roughly the same logic as git-gc(1) itself and know to
repack refs and reflogs before detaching, thus fixing the race.

Note that `gc_before_repack()` is renamed to `gc_foreground_tasks()` to
better reflect what this function does.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/gc: avoid global state in `gc_before_repack()`
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:19 +0000 (16:01 +0200)] 
builtin/gc: avoid global state in `gc_before_repack()`

The `gc_before_repack()` should only ever run once in git-gc(1), but we
may end up calling it twice when the "--detach" flag is passed. The
duplicated call is avoided though via a static flag in this function.

This pattern is somewhat unintuitive though. Refactor it to drop the
static flag and instead guard the second call of `gc_before_repack()`
via `opts.detach`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agousage: allow dying without writing an error message
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:18 +0000 (16:01 +0200)] 
usage: allow dying without writing an error message

Sometimes code wants to die in a situation where it already has written
an error message. To use the same error code as `die()` we have to use
`exit(128)`, which is easy to get wrong and leaves magic numbers all
over our codebase.

Teach `die_message_builtin()` to not print any error when passed a
`NULL` pointer as error string. Like this, such users can now call
`die(NULL)` to achieve the same result without any hardcoded error
codes.

Adapt a couple of builtins to use this new pattern to demonstrate that
there is a need for such a helper.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: fix locking race with refs and reflogs tasks
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:17 +0000 (16:01 +0200)] 
builtin/maintenance: fix locking race with refs and reflogs tasks

As explained in the preceding commit, git-gc(1) knows to detach only
after it has already packed references and expired reflogs. This is done
to avoid racing around their respective lockfiles.

Adapt git-maintenance(1) accordingly and run the "pack-refs" and
"reflog-expire" tasks in the foreground. Note that the "gc" task has the
same issue, but the fix is a bit more involved there and will thus be
done in a subsequent commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: split into foreground and background tasks
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:16 +0000 (16:01 +0200)] 
builtin/maintenance: split into foreground and background tasks

Both git-gc(1) and git-maintenance(1) have logic to daemonize so that
the maintenance tasks are performed in the background. git-gc(1) has
some special logic though to not perform _all_ housekeeping tasks in the
background: both references and reflogs are still handled synchronously
in the foreground.

This split exists because otherwise it may easily happen that git-gc(1)
keeps the "packed-refs" file locked for an extended amount of time,
where the next Git command that wants to modify any reference could now
fail. This was especially important in the past, where git-gc(1) was
still executed directly as part of our automatic maintenance: git-gc(1)
was invoked via `git gc --auto --detach`, so we knew to handle most of
the maintenance tasks in the background while doing those parts that may
cause locking issues in the foreground.

We have since moved to git-maintenance(1), which is a more flexible
replacement for git-gc(1). By default this command runs git-gc(1), only,
but it can be configured to run different tasks, as well. This command
does not know about the split between maintenance tasks that should run
before and after detach though, and this has led to several bug reports
about spurious locking errors for the "packed-refs" file.

Prepare for a fix by introducing this split for maintenance tasks. Note
that this commit does not yet change any of the tasks, so there should
not (yet) be a change in behaviour.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: fix typedef for function pointers
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:15 +0000 (16:01 +0200)] 
builtin/maintenance: fix typedef for function pointers

The typedefs for `maintenance_task_fn` and `maintenance_auto_fn` are
somewhat confusingly not true function pointers. As such, any user of
those typedefs needs to manually add the pointer to make use of them.

Fix this by making these true function pointers.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: extract function to run tasks
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:14 +0000 (16:01 +0200)] 
builtin/maintenance: extract function to run tasks

Extract the function to run maintenance tasks. This function will be
reused in a subsequent commit where we introduce a split between
maintenance tasks that run before and after daemonizing the process.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: stop modifying global array of tasks
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:13 +0000 (16:01 +0200)] 
builtin/maintenance: stop modifying global array of tasks

When configuring maintenance tasks run by git-maintenance(1) we do so by
modifying the global array of tasks directly. This is already quite bad
on its own, as global state makes for logic that is hard to follow.

Even more importantly though we use multiple different fields to track
whether or not a task should be run:

  - "enabled" tracks the "maintenance.*.enabled" config key. This field
    disables execution of a task, unless the user has explicitly asked
    for the task.

  - "selected_order" tracks the order in which jobs have been asked for
    by the user via the "--task=" command line option. It overrides
    everything else, but only has an effect if at least one job has been
    selected.

  - "schedule" tracks the schedule priority for a job, that is how often
    it should run. This field only plays a role when the user has passed
    the "--schedule=" command line option.

All of this makes it non-trivial to figure out which job really should
be running right now. The logic to configure these fields and the logic
that interprets them is distributed across multiple functions, making it
even harder to follow it.

Refactor the logic so that we stop modifying global state. Instead, we
now compute which jobs should be run in `initialize_task_config()`,
represented as an array of jobs to run that is stored in the options
structure. Like this, all logic becomes self-contained and any users of
this array only need to iterate through the tasks and execute them one
by one.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: mark "--task=" and "--schedule=" as incompatible
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:12 +0000 (16:01 +0200)] 
builtin/maintenance: mark "--task=" and "--schedule=" as incompatible

The "--task=" option explicitly allows the user to say which maintenance
tasks should be run, whereas "--schedule=" only respects the maintenance
strategy configured for a specific repository. As such, it is not
sensible to accept both options at the same time.

Mark them as incompatible with one another. While at it, also convert
the existing logic that marks "--auto" and "--schedule=" as incompatible
to use `die_for_incompatible_opt2()`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/maintenance: centralize configuration of explicit tasks
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:11 +0000 (16:01 +0200)] 
builtin/maintenance: centralize configuration of explicit tasks

Users of git-maintenance(1) can explicitly ask it to run specific tasks
by passing the `--task=` command line option. This option can be passed
multiple times, which causes us to execute tasks in the same order as
the tasks have been provided by the user.

The order in which tasks are run is computed in `task_option_parse()`:
every time we parse such a command line argument, we modify the global
array of tasks by seting the selected index for that specific task.
This has two downsides:

  - We modify global state, which makes it hard to follow the logic.

  - The configuration of tasks is split across multiple different
    functions, so it is not easy to figure out the different factors
    that play a role in selecting tasks.

Refactor the logic so that `task_option_parse()` does not modify global
state anymore. Instead, this function now only collects the list of
configured tasks. The logic to configure ordering of the respective
tasks is then deferred to `initialize_task_config()`.

This refactoring solves the second problem, that the configuration of
tasks is spread across multiple different locations. The first problem,
that we modify global state, will be fixed in a subsequent commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/gc: drop redundant local variable
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:10 +0000 (16:01 +0200)] 
builtin/gc: drop redundant local variable

We have two different variables that track the quietness for git-gc(1):

  - The local variable `quiet`, which we wire up.

  - The `quiet` field of `struct maintenance_run_opts`.

This leads to confusion which of these variables should be used and what
the respective effect is.

Simplify this logic by dropping the local variable in favor of the
options field.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agobuiltin/gc: use designated field initializers for maintenance tasks
Patrick Steinhardt [Tue, 3 Jun 2025 14:01:09 +0000 (16:01 +0200)] 
builtin/gc: use designated field initializers for maintenance tasks

Convert the array of maintenance tasks to use designated field
initializers. This makes it easier to add more fields to the struct
without having to modify all tasks.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agoMyFirstContribution: add walken.c to meson.build
Lucas Seiki Oshiro [Mon, 2 Jun 2025 20:50:21 +0000 (17:50 -0300)] 
MyFirstContribution: add walken.c to meson.build

Instruct in the documentation to also add an entry in meson.build for
builtin/walken.c, as currently both Meson and Make are supported.

Helped-by: Karthik Nayak <karthik.188@gmail.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agoMyFirstContribution: use struct repository in examples
Lucas Seiki Oshiro [Mon, 2 Jun 2025 20:50:20 +0000 (17:50 -0300)] 
MyFirstContribution: use struct repository in examples

Add the parameter `struct repository *repo` to the cmd_walken function.

Since commit 9b1cb5070f (builtin: add a repository parameter for
builtin functions, 2024-09-13), all the cmd_* have the `repo` parameter
and new commands must follow this convention, so the documentation
should also be changed.

Change the `git_config` calls to `repo_config`, also passing the `repo`
parameter, as since 036876a106 (config: hide functions using
`the_repository` by default, 2024-08-13) the non-repo config functions
are no longer recommended as they use the global `repository` variable.

Helped-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@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 agomeson: parse TAP output generated by our tests
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:50 +0000 (08:44 +0200)] 
meson: parse TAP output generated by our tests

By default, Meson only knows to pay respect to the exit code of tests to
judge whether or not it ran successfully. This can be changed though by
specifying the "protocol" parameter. Next to the default "exitcode"
protocol, Meson also supports the "tap" output that our tests already
know to generate.

Unfortunately, the "tap" protocol was incompatible with `meson test
--interactive` and caused a hang. We have upstreamed a fix [1] though,
so with the recent release of Meson 1.8 that fix is finally out and we
can start using the "tap" protocol when running with a recent-enough
version of this build tool.

With this change in place, Meson now properly detects how many subtests
ran and whether test suites have been skipped:

    ```
    $ meson test t002*
    ninja: Entering directory `/home/pks/Development/git/build'
     1/10 t0024-crlf-archive                  OK              0.17s   2 subtests passed
     2/10 t0022-crlf-rename                   OK              0.18s   2 subtests passed
     3/10 t0029-core-unsetenvvars             SKIP            0.15s
     4/10 t0023-crlf-am                       OK              0.18s   2 subtests passed
     5/10 t0025-crlf-renormalize              OK              0.21s   3 subtests passed
     6/10 t0026-eol-config                    OK              0.25s   5 subtests passed
     7/10 t0020-crlf                          OK              0.81s   36 subtests passed
     8/10 t0028-working-tree-encoding         OK              0.85s   22 subtests passed
     9/10 t0021-conversion                    OK              3.45s   38 subtests passed
    10/10 t0027-auto-crlf                     OK             26.35s   2600 subtests passed

    Ok:                9
    Fail:              0
    Skipped:           1
    ```

Note that when running `meson test --interactive` the test results will
now be marked as "ignored". This is because in interactive mode the file
descriptors will remain connected to the user's terminal, and it is
expected that the user interacts with the tests (e.g., spawn a debugger
or use `test_pause`). As such, the TAP output cannot be parsed reliably
by Meson in that case, so the tests are marked as ignored accordingly.

[1]: https://github.com/mesonbuild/meson/pull/13980

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agomeson: introduce kwargs variable for tests
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:49 +0000 (08:44 +0200)] 
meson: introduce kwargs variable for tests

Meson has the ability to create a kwargs dictionary that can then be
passed to any function call with the `kwargs:` positional argument. This
allows one to deduplicate common parameters that one wishes to pass to
several different function invocations.

Our tests already have one common parameter that we use everywhere,
"timeout", and we're about to add a second common parameter in the next
commit. Let's prepare for this by introducing `test_kwargs` so that we
can deduplicate these common arguments.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agotest-lib: fail on unexpectedly passing tests
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:48 +0000 (08:44 +0200)] 
test-lib: fail on unexpectedly passing tests

When tests are executed via `test_expect_failure` we rather obviously
expect the test itself to fail. If it unexpectedly does not fail then we
count the test as a "fixed" test and announce that a known breakage has
vanished:

    ok 1 - setup
    ok 2 - create refs/heads/main # TODO known breakage vanished
    ok 3 - create refs/heads/main with oldvalue verification
    ...
    ok 299 - update-ref should also create reflog for HEAD
    # 1 known breakage(s) vanished; please update test(s)
    # passed all remaining 298 test(s)
    1..299

While we announce that tests should be updated, the overall test suite
still passes. This makes it quite hard to detect when a test that has
previously failed succeeds now as the developer needs to pay close
attention to the exact output. Even more importantly, tests that only
succeed on _some_ systems are even easier to miss now, as one would have
to explicitly take a look at respective CI jobs to notice that those do
pass now.

Furthermore, we are about to introduce support for parsing TAP output in
Meson. In contrast to prove(1), which treats unexpected passes as a
successful test run, Meson treats those as failure. Neither of these
tools is wrong in doing so. Quoting the TAP specification [1]:

    Should a todo test point begin succeeding, the harness may report it
    in some way that indicates that whatever was supposed to be done has
    been, and it should be promoted to a normal Test Point.

So it is essentially implementation-defined how exactly the unexpected
pass is reported, and whether it should cause the overall test suite to
fail or not. It is unarguably a bad thing for us though if these tools
interpret these differently, as it would mean that test results now
depend on whether the developer uses prove(1) or Meson.

Unify the behaviour by causing a test suite to fail when there are any
unexpected passes. As prove(1) does not consider an unexpected pass to
be an error this leads to somewhat funky output:

    t1400-update-ref.sh ................................ Dubious, test returned 1 (wstat 256, 0x100)
    All 299 subtests passed
            (1 TODO test unexpectedly succeeded)

    ...

    Test Summary Report
    -------------------
    t1400-update-ref.sh                              (Wstat: 256 (exited 1) Tests: 299 Failed: 0)
      TODO passed:   2
      Non-zero exit status: 1

But as we directly announce that the root cause is an unexpected TODO
that has succeeded it's not all that bad.

[1]: https://testanything.org/tap-version-14-specification.html

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot7815: fix unexpectedly passing test on macOS
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:47 +0000 (08:44 +0200)] 
t7815: fix unexpectedly passing test on macOS

In t7815, we have the following test:

    test_expect_failure !CYGWIN 'git grep .fi a' '
        git grep .fi a
    '

The test passes if '.' matches a NUL byte, which we expect to only
happen on Cygwin. The upcoming changes to support parsing TAP output in
Meson surface that this test, surprisingly, passes on macOS as well.

It is unclear how long the test has been passing on macOS already.
064eed36c7f (config.mak.uname: only set NO_REGEX on cygwin for v1.7,
2025-04-17) mentions that the test started to pass for Cygwin. This was
attributed to a new implementation of regcomp(3p) and friends, which was
inherited from FreeBSD. Given the BSD lineage of macOS it is feasible
that it also inherited similar code eventually that made the test pass
now.

It is somewhat dubious what the test actually brings to the table given
that it is quite platform specific. Ideally, we would fix this mess by
having a configure-time check whether regcomp(3p) works as expected,
including NUL bytes, and use our bundled version of the regex library in
case it doesn't. Like this, we could ensure that all platforms work the
same in this edge case and mark the new behaviour as expected.

This change is outside of the scope of this patch series, which only
introduces support for TAP. So instead of fixing the bigger issue,
ignore the test on Darwin like we already do for Cygwin.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/test-lib: fix TAP format for BASH_XTRACEFD warning
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:46 +0000 (08:44 +0200)] 
t/test-lib: fix TAP format for BASH_XTRACEFD warning

When the Bash version is too old to support BASH_XTRACEFD we print a
warning to stderr. This warning is not prefixed with "#", which causes
TAP parsers to (wrongly) interpret the warning as part of the protocol.

Fix this issue by prefixing the warning with a "#" so that it is treated
as comment.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot/test-lib: don't print shell traces to stdout
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:45 +0000 (08:44 +0200)] 
t/test-lib: don't print shell traces to stdout

We have several flags like "--verbose", "--verbose-only" or "-x" that
cause us to generate shell traces. The generated tracing output is split
up in these cases so that the test's stdout is printed to file
descriptor 3 whereas its stderr is printed to file descriptor 4.
Depending on which options have been given, we then end up either:

  - Redirecting both file descriptors to a file.

  - Redirecting them to stdout and stderr, respectively.

  - Closing them in case we're running in none-verbose mode.

The second case causes problems though when passing output to a TAP
parser. We print the test's stdout to the console's stdout, and that
results in broken TAP output.

Fix the issue by instead redirecting the test's stdout to the shell's
stderr. This makes it impossible to discern stdout from stderr, but
going by my own experience I never came across a usecase where I would
have needed this distinction.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot983*: use prereq to check for Python-specific git-p4(1) support
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:44 +0000 (08:44 +0200)] 
t983*: use prereq to check for Python-specific git-p4(1) support

The tests in t9835 and t9836 verify that git-p4(1) works with both
Python 2 and 3, respectively. To determine whether we have those Python
versions in the first place we create a wrapper script that directly
executes the git-p4(1) script with `python2` or `python3` binaries. We
then condition the execution of tests on whether that wrapper script can
be executed successfully.

The logic that does all of this is not contained in a prerequisite block
though, so the output it generates causes us to break the TAP format.
Refactor the logic to use `test_lazy_prereq()` to fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot9822: use prereq to check for ISO-8859-1 support
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:43 +0000 (08:44 +0200)] 
t9822: use prereq to check for ISO-8859-1 support

Tests in t9822 depend on filesystem support for ISO-8859-1 encoding. We
thus have a block of code that acts as a prerequisite -- if we fail to
write a file with an ISO-8859-1-encoded file name to disk then we skip
all tests.

When the prerequisite fails though we end up printing an error message
to stderr, which breaks the TAP format. Fix this by converting the code
to a proper prerequisite, which handles output redirection for us.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot: silence output from `test_create_repo()`
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:42 +0000 (08:44 +0200)] 
t: silence output from `test_create_repo()`

There are a couple users of `test_create_repo()` that use this function
outside of any test case. This function is nowadays only a thin wrapper
around `git init`, which by default prints a message to stdout that the
repository has been initialized. The resulting output may thus confuse
TAP parsers.

Refactor these users to instead create the repository in a "setup" test
case so that we don't explicitly have to silence them. There's one
exception in t1007: we use `push_repo()` and its `pop_repo()` equivalent
multiple times, so to reduce the noise introduced by this patch we
instead silence this invocation.

While at it, convert callsites to use git-init(1) directly as the
`test_create_repo()` function has been deprecated in f0d4d398e28
(test-lib: split up and deprecate test_create_repo(), 2021-05-10).

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agot: stop announcing prereqs
Patrick Steinhardt [Mon, 2 Jun 2025 06:44:41 +0000 (08:44 +0200)] 
t: stop announcing prereqs

We have a couple of cases where our tests end up announcing that a
certain prerequisite is or isn't fulfilled. While this is supposed to
help the developer it has the downside that it breaks the TAP format.

We could convert these cases to just have a "#" prefix, but it feels
rather unlikely that these are generally useful in the first place. We
already do announce why a specific test is being skipped, so we should
try to use this mechanism to the best extent possible.

Stop announcing these prereqs to fix the TAP format. Where possible,
convert the tests to rely on the prerequisites themselves to announce
why a test ran or didn't ran.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 agodocs: make the purpose of using app password for Gmail more clear in send-email
Aditya Garg [Fri, 30 May 2025 15:50:07 +0000 (15:50 +0000)] 
docs: make the purpose of using app password for Gmail more clear in send-email

The current example for Gmail suggests using app passwords for
send-email if user has multi-factor authentication set up for their
account. However, it does not clarify that the user cannot use their
normal password in case they do not have multi-factor authentication
enabled. Most likely the example was written in the days when Google
allowed using normal passwords without multi-factor authentication.

Clarify that regular passwords do not work for Gmail and app-passwords
are the only way for basic authentication. Also encourage users to use
OAuth2.0 as a more secure alternative.

While at it, also prefer using the word "mechanism" over "method" for
`OAUTHBEARER` and `XOAUTH2` since that is what official docs use.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodocs: remove credential helper links for emails from gitcredentials
Aditya Garg [Fri, 30 May 2025 15:50:05 +0000 (15:50 +0000)] 
docs: remove credential helper links for emails from gitcredentials

In a recent attempt to add links of email helpers to git-scm.com [1], I
came to a conclusion that the links in the gitcredentials page are meant
for people needing credential helpers for cloning, fetching and pushing
repositories to remote hosts, and not sending emails. gitcredentials
docs don't even talk about send emails, thus confirming this view.

So, lets remove these links from the gitcredentials page. The links are
still available in the git-send-email documentation, which is the right
place for them.

[1]: https://github.com/git/git-scm.com/pull/2005

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodocs: improve formatting in git-send-email documentation
Aditya Garg [Fri, 30 May 2025 15:50:04 +0000 (15:50 +0000)] 
docs: improve formatting in git-send-email documentation

The current documentation for git-send-email had an inconsistent use of
"", ``, and '' for quoting. This commit improves the formatting by
using the same style throughout the documentation. Missing full stops
have also been added at some places.

Finally, the cpan links of necessary perl modules have been added to
make their installation easier.

While at it, the unecessary use of $ with <num> and <int> placeholders
has also been removed.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 months agodocs: add credential helper for yahoo and link Google's sendgmail tool
Aditya Garg [Fri, 30 May 2025 15:50:02 +0000 (15:50 +0000)] 
docs: add credential helper for yahoo and link Google's sendgmail tool

This commit links `git-credential-yahoo` as a credential helper for
Yahoo accounts. Also, Google's `sendgmail` tool has been linked as an
alternative method for sending emails through Gmail.

Signed-off-by: Aditya Garg <gargaditya08@live.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
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>