git.git
21 hours agoThe third batchmainmaster
Junio C Hamano [Mon, 13 May 2024 17:00:43 +0000 (13 10:00 -0700)]
The third batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
21 hours agoMerge branch 'jc/git-gui-maintainer-update'
Junio C Hamano [Mon, 13 May 2024 17:19:48 +0000 (13 10:19 -0700)]
Merge branch 'jc/git-gui-maintainer-update'

* jc/git-gui-maintainer-update:
  SubmittingPatches: welcome the new maintainer of git-gui part

21 hours agoMerge branch 'fa/p4-error'
Junio C Hamano [Mon, 13 May 2024 17:19:48 +0000 (13 10:19 -0700)]
Merge branch 'fa/p4-error'

P4 update.

* fa/p4-error:
  git-p4: show Perforce error to the user

21 hours agoMerge branch 'ps/ci-fuzzers-at-gitlab-fix'
Junio C Hamano [Mon, 13 May 2024 17:19:47 +0000 (13 10:19 -0700)]
Merge branch 'ps/ci-fuzzers-at-gitlab-fix'

CI fix.

* ps/ci-fuzzers-at-gitlab-fix:
  gitlab-ci: fix installing dependencies for fuzz smoke tests
  gitlab-ci: add smoke test for fuzzers

21 hours agoMerge branch 'jk/ci-test-with-jgit-fix'
Junio C Hamano [Mon, 13 May 2024 17:19:47 +0000 (13 10:19 -0700)]
Merge branch 'jk/ci-test-with-jgit-fix'

CI fix.

* jk/ci-test-with-jgit-fix:
  ci: update coverity runs_on_pool reference

21 hours agoMerge branch 'jk/ci-macos-gcc13-fix'
Junio C Hamano [Mon, 13 May 2024 17:19:47 +0000 (13 10:19 -0700)]
Merge branch 'jk/ci-macos-gcc13-fix'

CI fix.

* jk/ci-macos-gcc13-fix:
  ci: stop installing "gcc-13" for osx-gcc
  ci: avoid bare "gcc" for osx-gcc job
  ci: drop mention of BREW_INSTALL_PACKAGES variable

21 hours agoMerge branch 'jc/no-default-attr-tree-in-bare'
Junio C Hamano [Mon, 13 May 2024 17:19:46 +0000 (13 10:19 -0700)]
Merge branch 'jc/no-default-attr-tree-in-bare'

Git 2.43 started using the tree of HEAD as the source of attributes
in a bare repository, which has severe performance implications.
For now, revert the change, without ripping out a more explicit
support for the attr.tree configuration variable.

* jc/no-default-attr-tree-in-bare:
  stop using HEAD for attributes in bare repository by default

21 hours agoMerge branch 'ps/ci-python-2-deprecation'
Junio C Hamano [Mon, 13 May 2024 17:19:46 +0000 (13 10:19 -0700)]
Merge branch 'ps/ci-python-2-deprecation'

Unbreak CI jobs so that we do not attempt to use Python 2 that has
been removed from the platform.

* ps/ci-python-2-deprecation:
  ci: fix Python dependency on Ubuntu 24.04

21 hours agoMerge branch 'tb/attr-limits'
Junio C Hamano [Mon, 13 May 2024 17:19:46 +0000 (13 10:19 -0700)]
Merge branch 'tb/attr-limits'

The maximum size of attribute files is enforced more consistently.

* tb/attr-limits:
  attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()

21 hours agoMerge branch 'jc/test-workaround-broken-mv'
Junio C Hamano [Mon, 13 May 2024 17:19:45 +0000 (13 10:19 -0700)]
Merge branch 'jc/test-workaround-broken-mv'

Tests that try to corrupt in-repository files in chunked format did
not work well on macOS due to its broken "mv", which has been
worked around.

* jc/test-workaround-broken-mv:
  t/lib-chunk: work around broken "mv" on some vintage of macOS

21 hours agoMerge branch 'ma/win32-unix-domain-socket'
Junio C Hamano [Mon, 13 May 2024 17:19:45 +0000 (13 10:19 -0700)]
Merge branch 'ma/win32-unix-domain-socket'

Build fix.

* ma/win32-unix-domain-socket:
  win32: fix building with NO_UNIX_SOCKETS

2 days agoSubmittingPatches: welcome the new maintainer of git-gui part
Junio C Hamano [Sat, 11 May 2024 18:15:58 +0000 (11 11:15 -0700)]
SubmittingPatches: welcome the new maintainer of git-gui part

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoci: stop installing "gcc-13" for osx-gcc
Jeff King [Thu, 9 May 2024 16:25:44 +0000 (9 12:25 -0400)]
ci: stop installing "gcc-13" for osx-gcc

Our osx-gcc job explicitly asks to install gcc-13. But since the GitHub
runner image already comes with gcc-13 installed, this is mostly doing
nothing (or in some cases it may install an incremental update over the
runner image). But worse, it recently started causing errors like:

    ==> Fetching gcc@13
    ==> Downloading https://ghcr.io/v2/homebrew/core/gcc/13/blobs/sha256:fb2403d97e2ce67eb441b54557cfb61980830f3ba26d4c5a1fe5ecd0c9730d1a
    ==> Pouring gcc@13--13.2.0.ventura.bottle.tar.gz
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    Could not symlink bin/c++-13
    Target /usr/local/bin/c++-13
    is a symlink belonging to gcc. You can unlink it:
      brew unlink gcc

which cause the whole CI job to bail.

I didn't track down the root cause, but I suspect it may be related to
homebrew recently switching the "gcc" default to gcc-14. And it may even
be fixed when a new runner image is released. But if we don't need to
run brew at all, it's one less thing for us to worry about.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoci: avoid bare "gcc" for osx-gcc job
Jeff King [Thu, 9 May 2024 16:24:15 +0000 (9 12:24 -0400)]
ci: avoid bare "gcc" for osx-gcc job

On macOS, a bare "gcc" (without a version) will invoke a wrapper for
clang, not actual gcc. Even when gcc is installed via homebrew, that
only provides version-specific links in /usr/local/bin (like "gcc-13"),
and never a version-agnostic "gcc" wrapper.

As far as I can tell, this has been the case for a long time, and this
osx-gcc job has largely been doing nothing. We can point it at "gcc-13",
which will pick up the homebrew-installed version.

The fix here is specific to the github workflow file, as the gitlab one
does not have a matching job.

It's a little unfortunate that we cannot just ask for the latest version
of gcc which homebrew provides, but as far as I can tell there is no
easy alias (you'd have to find the highest number gcc-* in
/usr/local/bin yourself).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoci: drop mention of BREW_INSTALL_PACKAGES variable
Jeff King [Thu, 9 May 2024 16:23:05 +0000 (9 12:23 -0400)]
ci: drop mention of BREW_INSTALL_PACKAGES variable

The last user of this variable went away in 4a6e4b9602 (CI: remove
Travis CI support, 2021-11-23), so it's doing nothing except making it
more confusing to find out which packages _are_ installed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoci: update coverity runs_on_pool reference
Jeff King [Thu, 9 May 2024 16:15:06 +0000 (9 12:15 -0400)]
ci: update coverity runs_on_pool reference

Commit 2d65e5b6a6 (ci: rename "runs_on_pool" to "distro", 2024-04-12)
renamed this variable for the main CI workflow, as well as in the ci/
scripts. Because the coverity workflow also relies on those scripts to
install dependencies, it needs to be updated, too. Without this patch,
the coverity build fails because we lack libcurl.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agogitlab-ci: fix installing dependencies for fuzz smoke tests
Patrick Steinhardt [Thu, 9 May 2024 08:25:27 +0000 (9 10:25 +0200)]
gitlab-ci: fix installing dependencies for fuzz smoke tests

There was a semantic merge conflict between 9cdeb34b96 (ci: merge
scripts which install dependencies, 2024-04-12), which has merged
"ci/install-docker-dependencies.sh" into "ci/install-dependencies.sh"
and c7b228e000 (gitlab-ci: add smoke test for fuzzers, 2024-04-29),
which has added a new fuzz smoke test job that makes use of the
now-removed script.

Adapt the job to instead use the new script to install dependencies.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 days agoMerge branch 'ps/ci-python-2-deprecation' into ps/ci-fuzzers-at-gitlab-fix
Junio C Hamano [Thu, 9 May 2024 15:45:36 +0000 (9 08:45 -0700)]
Merge branch 'ps/ci-python-2-deprecation' into ps/ci-fuzzers-at-gitlab-fix

* ps/ci-python-2-deprecation:
  ci: fix Python dependency on Ubuntu 24.04

4 days agoMerge branch 'ps/ci-enable-minimal-fuzzers-at-gitlab' into ps/ci-fuzzers-at-gitlab-fix
Junio C Hamano [Thu, 9 May 2024 15:45:29 +0000 (9 08:45 -0700)]
Merge branch 'ps/ci-enable-minimal-fuzzers-at-gitlab' into ps/ci-fuzzers-at-gitlab-fix

* ps/ci-enable-minimal-fuzzers-at-gitlab:
  gitlab-ci: add smoke test for fuzzers

5 days agogit-p4: show Perforce error to the user
Fahad Alrashed [Wed, 8 May 2024 22:11:05 +0000 (8 22:11 +0000)]
git-p4: show Perforce error to the user

During "git p4 clone" if p4 process returns an error from the server,
it will store the message in the 'err' variable. Then it will send a
text command "die-now" to git-fast-import. However, git-fast-import
raises an exception: "fatal: Unsupported command: die-now" and err is
never displayed. This patch ensures that err is shown to the end user.

Signed-off-by: Fahad Alrashed <fahad@keylock.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agoThe second batch
Junio C Hamano [Wed, 8 May 2024 15:41:00 +0000 (8 08:41 -0700)]
The second batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
5 days agoMerge branch 'bb/rgb-12-bit-colors'
Junio C Hamano [Wed, 8 May 2024 17:18:47 +0000 (8 10:18 -0700)]
Merge branch 'bb/rgb-12-bit-colors'

The color parsing code learned to handle 12-bit RGB colors, spelled
as "#RGB" (in addition to "#RRGGBB" that is already supported).

* bb/rgb-12-bit-colors:
  color: add support for 12-bit RGB colors
  t/t4026-color: add test coverage for invalid RGB colors
  t/t4026-color: remove an extra double quote character

5 days agoMerge branch 'rs/diff-parseopts-cleanup'
Junio C Hamano [Wed, 8 May 2024 17:18:46 +0000 (8 10:18 -0700)]
Merge branch 'rs/diff-parseopts-cleanup'

Code clean-up to remove code that is now a noop.

* rs/diff-parseopts-cleanup:
  diff-lib: stop calling diff_setup_done() in do_diff_cache()

5 days agoMerge branch 'dk/zsh-git-repo-path-fix'
Junio C Hamano [Wed, 8 May 2024 17:18:46 +0000 (8 10:18 -0700)]
Merge branch 'dk/zsh-git-repo-path-fix'

Command line completion support for zsh (in contrib/) has been
updated to stop exposing internal state to end-user shell
interaction.

* dk/zsh-git-repo-path-fix:
  completion: zsh: stop leaking local cache variable

5 days agoMerge branch 'bc/zsh-compatibility'
Junio C Hamano [Wed, 8 May 2024 17:18:46 +0000 (8 10:18 -0700)]
Merge branch 'bc/zsh-compatibility'

zsh can pretend to be a normal shell pretty well except for some
glitches that we tickle in some of our scripts. Work them around
so that "vimdiff" and our test suite works well enough with it.

* bc/zsh-compatibility:
  vimdiff: make script and tests work with zsh
  t4046: avoid continue in &&-chain for zsh

5 days agoMerge branch 'rj/add-p-typo-reaction'
Junio C Hamano [Wed, 8 May 2024 17:18:45 +0000 (8 10:18 -0700)]
Merge branch 'rj/add-p-typo-reaction'

When the user responds to a prompt given by "git add -p" with an
unsupported command, list of available commands were given, which
was too much if the user knew what they wanted to type but merely
made a typo.  Now the user gets a much shorter error message.

* rj/add-p-typo-reaction:
  add-patch: response to unknown command
  add-patch: do not show UI messages on stderr

5 days agoMerge branch 'jt/doc-submitting-rerolled-series'
Junio C Hamano [Wed, 8 May 2024 17:18:45 +0000 (8 10:18 -0700)]
Merge branch 'jt/doc-submitting-rerolled-series'

Developer doc update.

* jt/doc-submitting-rerolled-series:
  doc: clarify practices for submitting updated patch versions

5 days agoMerge branch 'rh/complete-symbolic-ref'
Junio C Hamano [Wed, 8 May 2024 17:18:45 +0000 (8 10:18 -0700)]
Merge branch 'rh/complete-symbolic-ref'

Command line completion script (in contrib/) learned to complete
"git symbolic-ref" a bit better (you need to enable plumbing
commands to be completed with GIT_COMPLETION_SHOW_ALL_COMMANDS).

* rh/complete-symbolic-ref:
  completion: add docs on how to add subcommand completions
  completion: improve docs for using __git_complete
  completion: add 'symbolic-ref'

5 days agoMerge branch 'ps/the-index-is-no-more'
Junio C Hamano [Wed, 8 May 2024 17:18:44 +0000 (8 10:18 -0700)]
Merge branch 'ps/the-index-is-no-more'

The singleton index_state instance "the_index" has been eliminated
by always instantiating "the_repository" and replacing references
to "the_index"  with references to its .index member.

* ps/the-index-is-no-more:
  repository: drop `initialize_the_repository()`
  repository: drop `the_index` variable
  builtin/clone: stop using `the_index`
  repository: initialize index in `repo_init()`
  builtin: stop using `the_index`
  t/helper: stop using `the_index`

5 days agoMerge branch 'bc/credential-scheme-enhancement'
Junio C Hamano [Wed, 8 May 2024 17:18:44 +0000 (8 10:18 -0700)]
Merge branch 'bc/credential-scheme-enhancement'

The credential helper protocol, together with the HTTP layer, have
been enhanced to support authentication schemes different from
username & password pair, like Bearer and NTLM.

* bc/credential-scheme-enhancement:
  credential: add method for querying capabilities
  credential-cache: implement authtype capability
  t: add credential tests for authtype
  credential: add support for multistage credential rounds
  t5563: refactor for multi-stage authentication
  docs: set a limit on credential line length
  credential: enable state capability
  credential: add an argument to keep state
  http: add support for authtype and credential
  docs: indicate new credential protocol fields
  credential: add a field called "ephemeral"
  credential: gate new fields on capability
  credential: add a field for pre-encoded credentials
  http: use new headers for each object request
  remote-curl: reset headers on new request
  credential: add an authtype field

5 days agoMerge branch 'ps/ci-test-with-jgit'
Junio C Hamano [Wed, 8 May 2024 17:18:44 +0000 (8 10:18 -0700)]
Merge branch 'ps/ci-test-with-jgit'

Tests to ensure interoperability between reftable written by jgit
and our code have been added and enabled in CI.

* ps/ci-test-with-jgit:
  t0612: add tests to exercise Git/JGit reftable compatibility
  t0610: fix non-portable variable assignment
  t06xx: always execute backend-specific tests
  ci: install JGit dependency
  ci: make Perforce binaries executable for all users
  ci: merge scripts which install dependencies
  ci: fix setup of custom path for GitLab CI
  ci: merge custom PATH directories
  ci: convert "install-dependencies.sh" to use "/bin/sh"
  ci: drop duplicate package installation for "linux-gcc-default"
  ci: skip sudo when we are already root
  ci: expose distro name in dockerized GitHub jobs
  ci: rename "runs_on_pool" to "distro"

5 days agoMerge branch 'ps/reftable-write-optim'
Junio C Hamano [Wed, 8 May 2024 17:18:43 +0000 (8 10:18 -0700)]
Merge branch 'ps/reftable-write-optim'

Code to write out reftable has seen some optimization and
simplification.

* ps/reftable-write-optim:
  reftable/block: reuse compressed array
  reftable/block: reuse zstream when writing log blocks
  reftable/writer: reset `last_key` instead of releasing it
  reftable/writer: unify releasing memory
  reftable/writer: refactorings for `writer_flush_nonempty_block()`
  reftable/writer: refactorings for `writer_add_record()`
  refs/reftable: don't recompute committer ident
  reftable: remove name checks
  refs/reftable: skip duplicate name checks
  refs/reftable: perform explicit D/F check when writing symrefs
  refs/reftable: fix D/F conflict error message on ref copy

7 days agoci: fix Python dependency on Ubuntu 24.04
Patrick Steinhardt [Mon, 6 May 2024 05:35:17 +0000 (6 07:35 +0200)]
ci: fix Python dependency on Ubuntu 24.04

Newer versions of Ubuntu have dropped Python 2 starting with Ubuntu
23.04. By default though, our CI setups will try to use that Python
version on all Ubuntu-based jobs except for the "linux-gcc" one.

We didn't notice this issue due to two reasons:

  - The "ubuntu:latest" tag always points to the latest LTS release.
    Until a few weeks ago this was Ubuntu 22.04, which still had Python
    2.

  - Our Docker-based CI jobs had their own script to install
    dependencies until 9cdeb34b96 (ci: merge scripts which install
    dependencies, 2024-04-12), where we didn't even try to install
    Python at all for many of them.

Since the CI refactorings have originally been implemented, Ubuntu
24.04 was released, and it being an LTS versions means that the "latest"
tag now points to that Python-2-less version. Consequently, those jobs
that use "ubuntu:latest" broke.

Address this by using Python 2 on Ubuntu 20.04, only, whereas we use
Python 3 on all other Ubuntu jobs. Eventually, we should think about
dropping support for Python 2 completely.

Reported-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
7 days agogitlab-ci: add smoke test for fuzzers
Patrick Steinhardt [Mon, 29 Apr 2024 06:13:23 +0000 (29 08:13 +0200)]
gitlab-ci: add smoke test for fuzzers

Our GitLab CI setup has a test gap where the fuzzers aren't exercised at
all. Add a smoke test, similar to the one we have in GitHub Workflows.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agoattr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()
Taylor Blau [Fri, 3 May 2024 19:12:36 +0000 (3 15:12 -0400)]
attr.c: move ATTR_MAX_FILE_SIZE check into read_attr_from_buf()

Commit 3c50032ff52 (attr: ignore overly large gitattributes files,
2022-12-01) added a defense-in-depth check to ensure that .gitattributes
blobs read from the index do not exceed ATTR_MAX_FILE_SIZE (100 MB).

But there were two cases added shortly after 3c50032ff52 was written
which do not apply similar protections:

  - 47cfc9bd7d0 (attr: add flag `--source` to work with tree-ish,
    2023-01-14)

  - 4723ae1007f (attr.c: read attributes in a sparse directory,
    2023-08-11) added a similar

Ensure that we refuse to process a .gitattributes blob exceeding
ATTR_MAX_FILE_SIZE when reading from either an arbitrary tree object or
a sparse directory. This is done by pushing the ATTR_MAX_FILE_SIZE check
down into the low-level `read_attr_from_buf()`.

In doing so, plug a leak in `read_attr_from_index()` where we would
accidentally leak the large buffer upon detecting it is too large to
process.

(Since `read_attr_from_buf()` handles a NULL buffer input, we can remove
a NULL check before calling it in `read_attr_from_index()` as well).

Co-authored-by: Jeff King <peff@peff.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agostop using HEAD for attributes in bare repository by default
Junio C Hamano [Fri, 3 May 2024 15:34:27 +0000 (3 08:34 -0700)]
stop using HEAD for attributes in bare repository by default

With 23865355 (attr: read attributes from HEAD when bare repo,
2023-10-13), we started to use the HEAD tree as the default
attribute source in a bare repository.  One argument for such a
behaviour is that it would make things like "git archive" run in
bare and non-bare repositories for the same commit consistent.
This changes was merged to Git 2.43 but without an explicit mention
in its release notes.

It turns out that this change destroys performance of shallowly
cloning from a bare repository.  As the "server" installations are
expected to be mostly bare, and "git pack-objects", which is the
core of driving the other side of "git clone" and "git fetch" wants
to see if a path is set not to delta with blobs from other paths via
the attribute system, the change forces the server side to traverse
the tree of the HEAD commit needlessly to find if each and every
paths the objects it sends out has the attribute that controls the
deltification.  Given that (1) most projects do not configure such
an attribute, and (2) it is dubious for the server side to honor
such an end-user supplied attribute anyway, this was a poor choice
of the default.

To mitigate the current situation, let's revert the change that uses
the tree of HEAD in a bare repository by default as the attribute
source.  This will help most people who have been happy with the
behaviour of Git 2.42 and before.

Two things to note:

 * If you are stuck with versions of Git 2.43 or newer, that is
   older than the release this fix appears in, you can explicitly
   set the attr.tree configuration variable to point at an empty
   tree object, i.e.

$ git config attr.tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904

 * If you like the behaviour we are reverting, you can explicitly
   set the attr.tree configuration variable to HEAD, i.e.

$ git config attr.tree HEAD

The right fix for this is to optimize the code paths that allow
accesses to attributes in tree objects, but that is a much more
involved change and is left as a longer-term project, outside the
scope of this "first step" fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 days agowin32: fix building with NO_UNIX_SOCKETS
Mike Hommey [Fri, 3 May 2024 09:14:27 +0000 (3 18:14 +0900)]
win32: fix building with NO_UNIX_SOCKETS

After 2406bf5f (Win32: detect unix socket support at runtime,
2024-04-03), it fails with:

compat/mingw.c:4160:5: error: no previous prototype for function 'mingw_have_unix_sockets' [-Werror,-Wmissing-prototypes]
   4160 | int mingw_have_unix_sockets(void)
        |     ^

because the prototype is behind `ifndef NO_UNIX_SOCKETS`.

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot/lib-chunk: work around broken "mv" on some vintage of macOS
Junio C Hamano [Thu, 2 May 2024 20:15:57 +0000 (2 13:15 -0700)]
t/lib-chunk: work around broken "mv" on some vintage of macOS

When the destination is read-only, "mv" on some version of macOS
asks whether to replace the destination even though in the test its
stdin is not a terminal (and thus doesn't conform to POSIX[1]).

The helper to corrupt a chunk-file is designed to work on the
files like commit-graph and multi-pack-index files that are
generally read-only, so use "mv -f" to work around this issue.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agocolor: add support for 12-bit RGB colors
Beat Bolli [Thu, 2 May 2024 11:03:31 +0000 (2 13:03 +0200)]
color: add support for 12-bit RGB colors

RGB color parsing currently supports 24-bit values in the form #RRGGBB.

As in Cascading Style Sheets (CSS [1]), also allow to specify an RGB color
using only three digits with #RGB.

In this shortened form, each of the digits is – again, as in CSS –
duplicated to convert the color to 24 bits, e.g. #f1b specifies the same
color as #ff11bb.

In color.h, remove the '0x' prefix in the example to match the actual
syntax.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot/t4026-color: add test coverage for invalid RGB colors
Beat Bolli [Thu, 2 May 2024 11:03:30 +0000 (2 13:03 +0200)]
t/t4026-color: add test coverage for invalid RGB colors

Make sure that the RGB color parser rejects invalid characters and
invalid lengths.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 days agot/t4026-color: remove an extra double quote character
Beat Bolli [Thu, 2 May 2024 11:03:29 +0000 (2 13:03 +0200)]
t/t4026-color: remove an extra double quote character

This is most probably just an editing left-over from cb357221a4 (t4026:
test "normal" color, 2014-11-20) which added this test.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 days agodiff-lib: stop calling diff_setup_done() in do_diff_cache()
René Scharfe [Wed, 1 May 2024 10:26:16 +0000 (1 12:26 +0200)]
diff-lib: stop calling diff_setup_done() in do_diff_cache()

d44e5267ea (diff-lib: plug minor memory leaks in do_diff_cache(),
2020-11-14) added the call to diff_setup_done() to release the memory
of the parseopt member of struct diff_options that repo_init_revisions()
had allocated via repo_diff_setup() and prep_parse_options().

189e97bc4b (diff: remove parseopts member from struct diff_options,
2022-12-01) did away with that allocation; diff_setup_done() doesn't
release any memory anymore.  So stop calling this function on the blank
diffopt member before it is overwritten, as this is no longer necessary.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agocompletion: zsh: stop leaking local cache variable
D. Ben Knoble [Tue, 30 Apr 2024 21:53:15 +0000 (30 21:53 +0000)]
completion: zsh: stop leaking local cache variable

Completing commands like "git rebase" in one repository will leak the
local __git_repo_path into the shell's environment so that completing
commands after changing to a different repository will give the old
repository's references (or none at all).

The bug report on the mailing list [1] suggests one simple way to observe
this yourself:

Enter the following commands from some directory:
  mkdir a b b/c
  for d (a b); git -C $d init && git -C $d commit --allow-empty -m init
  cd a
  git branch foo
  pushd ../b/c
  git branch bar

Now type these:
  git rebase <TAB>… # completion for bar available; C-c to abort
  declare -p __git_repo_path # outputs /path/to/b/.git
  popd
  git branch # outputs foo, main
  git rebase <TAB>… # completion candidates are bar, main!

Ideally, the last typed <TAB> should be yielding foo, main.

Commit beb6ee7163 (completion: extract repository discovery from
__gitdir(), 2017-02-03) anticipated this problem by marking
__git_repo_path as local in __git_main and __gitk_main for Bash
completion but did not give the same mark to _git for Zsh completion.
Thus make __git_repo_path local for Zsh completion, too.

[1]: https://lore.kernel.org/git/CALnO6CBv3+e2WL6n6Mh7ZZHCX2Ni8GpvM4a-bQYxNqjmgZdwdg@mail.gmail.com/

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoStart the 2.46 cycle
Junio C Hamano [Tue, 30 Apr 2024 21:49:22 +0000 (30 14:49 -0700)]
Start the 2.46 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoMerge branch 'js/for-each-repo-keep-going'
Junio C Hamano [Tue, 30 Apr 2024 21:49:45 +0000 (30 14:49 -0700)]
Merge branch 'js/for-each-repo-keep-going'

A scheduled "git maintenance" job is expected to work on all
repositories it knows about, but it stopped at the first one that
errored out.  Now it keeps going.

* js/for-each-repo-keep-going:
  maintenance: running maintenance should not stop on errors
  for-each-repo: optionally keep going on an error

13 days agoMerge branch 'js/build-fuzz-more-often'
Junio C Hamano [Tue, 30 Apr 2024 21:49:44 +0000 (30 14:49 -0700)]
Merge branch 'js/build-fuzz-more-often'

In addition to building the objects needed, try to link the objects
that are used in fuzzer tests, to make sure at least they build
without bitrot, in Linux CI runs.

* js/build-fuzz-more-often:
  fuzz: link fuzz programs with `make all` on Linux

13 days agoMerge branch 'la/doc-use-of-contacts-when-contributing'
Junio C Hamano [Tue, 30 Apr 2024 21:49:43 +0000 (30 14:49 -0700)]
Merge branch 'la/doc-use-of-contacts-when-contributing'

Advertise "git contacts", a tool for newcomers to find people to
ask review for their patches, a bit more in our developer
documentation.

* la/doc-use-of-contacts-when-contributing:
  SubmittingPatches: demonstrate using git-contacts with git-send-email
  SubmittingPatches: add heading for format-patch and send-email
  SubmittingPatches: dedupe discussion of security patches
  SubmittingPatches: discuss reviewers first
  SubmittingPatches: quote commands
  SubmittingPatches: mention GitGitGadget
  SubmittingPatches: clarify 'git-contacts' location
  MyFirstContribution: mention contrib/contacts/git-contacts

13 days agoMerge branch 'aj/stash-staged-fix'
Junio C Hamano [Tue, 30 Apr 2024 21:49:43 +0000 (30 14:49 -0700)]
Merge branch 'aj/stash-staged-fix'

"git stash -S" did not handle binary files correctly, which has
been corrected.

* aj/stash-staged-fix:
  stash: fix "--staged" with binary files

13 days agoMerge branch 'jc/format-patch-rfc-more'
Junio C Hamano [Tue, 30 Apr 2024 21:49:42 +0000 (30 14:49 -0700)]
Merge branch 'jc/format-patch-rfc-more'

The "--rfc" option of "git format-patch" learned to take an
optional string value to be used in place of "RFC" to tweak the
"[PATCH]" on the subject header.

* jc/format-patch-rfc-more:
  format-patch: "--rfc=-(WIP)" appends to produce [PATCH (WIP)]
  format-patch: allow --rfc to optionally take a value, like --rfc=WIP

13 days agoMerge branch 'ds/format-patch-rfc-and-k'
Junio C Hamano [Tue, 30 Apr 2024 21:49:42 +0000 (30 14:49 -0700)]
Merge branch 'ds/format-patch-rfc-and-k'

The "-k" and "--rfc" options of "format-patch" will now error out
when used together, as one tells us not to add anything to the
title of the commit, and the other one tells us to add "RFC" in
addition to "PATCH".

* ds/format-patch-rfc-and-k:
  format-patch: ensure that --rfc and -k are mutually exclusive

13 days agoMerge branch 'xx/disable-replace-when-building-midx'
Junio C Hamano [Tue, 30 Apr 2024 21:49:41 +0000 (30 14:49 -0700)]
Merge branch 'xx/disable-replace-when-building-midx'

The procedure to build multi-pack-index got confused by the
replace-refs mechanism, which has been corrected by disabling the
latter.

* xx/disable-replace-when-building-midx:
  midx: disable replace objects

13 days agoMerge branch 'pw/rebase-m-signoff-fix'
Junio C Hamano [Tue, 30 Apr 2024 21:49:41 +0000 (30 14:49 -0700)]
Merge branch 'pw/rebase-m-signoff-fix'

"git rebase --signoff" used to forget that it needs to add a
sign-off to the resulting commit when told to continue after a
conflict stops its operation.

* pw/rebase-m-signoff-fix:
  rebase -m: fix --signoff with conflicts
  sequencer: store commit message in private context
  sequencer: move current fixups to private context
  sequencer: start removing private fields from public API
  sequencer: always free "struct replay_opts"

13 days agoadd-patch: response to unknown command
Rubén Justo [Mon, 29 Apr 2024 18:37:12 +0000 (29 20:37 +0200)]
add-patch: response to unknown command

When the user gives an unknown command to the "add -p" prompt, the list
of accepted commands with their explanation is given.  This is the same
output they get when they say '?'.

However, the unknown command may be due to a user input error rather
than the user not knowing the valid command.

To reduce the likelihood of user confusion and error repetition, instead
of displaying the list of accepted commands, display a short error
message with the unknown command received, as feedback to the user.

Include a reminder about the current command '?' in the new message, to
guide the user if they want help.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 days agoadd-patch: do not show UI messages on stderr
Rubén Justo [Mon, 29 Apr 2024 18:37:03 +0000 (29 20:37 +0200)]
add-patch: do not show UI messages on stderr

There is no need to show some UI messages on stderr, and yet doing so
may produce some undesirable results, such as messages appearing in an
unexpected order.

Let's use stdout for all UI messages, and adjusts the tests accordingly.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoGit 2.45maintv2.45.0
Junio C Hamano [Mon, 29 Apr 2024 14:30:29 +0000 (29 07:30 -0700)]
Git 2.45

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge tag 'l10n-2.45.0-rnd1' of https://github.com/git-l10n/git-po
Junio C Hamano [Mon, 29 Apr 2024 14:29:35 +0000 (29 07:29 -0700)]
Merge tag 'l10n-2.45.0-rnd1' of https://github.com/git-l10n/git-po

l10n-2.45.0-rnd1

* tag 'l10n-2.45.0-rnd1' of https://github.com/git-l10n/git-po:
  l10n: tr: Update Turkish translations
  l10n: zh_CN: for git 2.45 rounds
  l10n: zh-TW: Git 2.45
  l10n: vi: Updated translation for 2.45
  l10n: TEAMS: retire l10n teams no update in 1 year
  l10n: uk: v2.45 update
  l10n: sv.po: Update Swedish translation
  l10n: Update German translation
  l10n: po-id for 2.45
  l10n: bg.po: Updated Bulgarian translation (5652t)
  l10n: fr: v2.45.0
  l10n: Update Vietnamese team contact

2 weeks agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Mon, 29 Apr 2024 06:50:23 +0000 (29 14:50 +0800)]
Merge branch 'master' of github.com:alshopov/git-po

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

2 weeks agoMerge branch 'fr_v2.45.0' of github.com:jnavila/git
Jiang Xin [Mon, 29 Apr 2024 06:49:44 +0000 (29 14:49 +0800)]
Merge branch 'fr_v2.45.0' of github.com:jnavila/git

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

2 weeks agol10n: tr: Update Turkish translations
Emir SARI [Mon, 15 Apr 2024 22:44:25 +0000 (16 01:44 +0300)]
l10n: tr: Update Turkish translations

Signed-off-by: Emir SARI <emir_sari@icloud.com>
2 weeks agoMerge branch 'l10n/zh-TW/240428' of github.com:l10n-tw/git-po
Jiang Xin [Sun, 28 Apr 2024 12:36:57 +0000 (28 20:36 +0800)]
Merge branch 'l10n/zh-TW/240428' of github.com:l10n-tw/git-po

* 'l10n/zh-TW/240428' of github.com:l10n-tw/git-po:
  l10n: zh-TW: Git 2.45

2 weeks agoMerge branch 'tl/zh_CN_2.45.0_rnd' of github.com:dyrone/git
Jiang Xin [Sun, 28 Apr 2024 12:35:54 +0000 (28 20:35 +0800)]
Merge branch 'tl/zh_CN_2.45.0_rnd' of github.com:dyrone/git

* 'tl/zh_CN_2.45.0_rnd' of github.com:dyrone/git:
  l10n: zh_CN: for git 2.45 rounds

2 weeks agol10n: zh_CN: for git 2.45 rounds
Teng Long [Wed, 24 Apr 2024 13:43:34 +0000 (24 21:43 +0800)]
l10n: zh_CN: for git 2.45 rounds

Signed-off-by: Teng Long <dyroneteng@gmail.com>
2 weeks agol10n: zh-TW: Git 2.45
Yi-Jyun Pan [Sun, 28 Apr 2024 10:46:20 +0000 (28 18:46 +0800)]
l10n: zh-TW: Git 2.45

Co-Authored-By: Lumynous <lumynou5.tw@gmail.com>
Co-Authored-By: Kisaragi Hiu <mail@kisaragi-hiu.com>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2 weeks agoMerge branch 'update-teams' of https://github.com/Nekosha/git-po
Jiang Xin [Sun, 28 Apr 2024 10:28:48 +0000 (28 18:28 +0800)]
Merge branch 'update-teams' of https://github.com/Nekosha/git-po

* 'update-teams' of https://github.com/Nekosha/git-po:
  l10n: Update Vietnamese team contact

2 weeks agol10n: vi: Updated translation for 2.45
Vũ Tiến Hưng [Tue, 16 Apr 2024 09:13:00 +0000 (16 16:13 +0700)]
l10n: vi: Updated translation for 2.45

Signed-off-by: Vũ Tiến Hưng <newcomerminecraft@gmail.com>
2 weeks agol10n: TEAMS: retire l10n teams no update in 1 year
Jiang Xin [Fri, 19 Apr 2024 07:57:47 +0000 (19 15:57 +0800)]
l10n: TEAMS: retire l10n teams no update in 1 year

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2 weeks agoMerge branch 'l10n/uk/2.45-uk-update'
Jiang Xin [Sat, 27 Apr 2024 23:30:08 +0000 (28 07:30 +0800)]
Merge branch 'l10n/uk/2.45-uk-update'

* '2.45-uk-update' of github.com:arkid15r/git-ukrainian-l10n:
  l10n: uk: v2.45 update

2 weeks agoMerge branch 'l10n-de-2.45' of github.com:ralfth/git
Jiang Xin [Sat, 27 Apr 2024 23:25:22 +0000 (28 07:25 +0800)]
Merge branch 'l10n-de-2.45' of github.com:ralfth/git

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

2 weeks agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sat, 27 Apr 2024 23:23:52 +0000 (28 07:23 +0800)]
Merge branch 'po-id' of github.com:bagasme/git-po

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

2 weeks agol10n: uk: v2.45 update
Arkadii Yakovets [Sat, 27 Apr 2024 18:41:08 +0000 (27 11:41 -0700)]
l10n: uk: v2.45 update

Co-authored-by: Kate Golovanova <kate@kgthreads.com>
Signed-off-by: Arkadii Yakovets <ark@cho.red>
Signed-off-by: Kate Golovanova <kate@kgthreads.com>
2 weeks agol10n: sv.po: Update Swedish translation
Peter Krefting [Sat, 27 Apr 2024 14:21:53 +0000 (27 15:21 +0100)]
l10n: sv.po: Update Swedish translation

Also fix some inconsistencies, and fix issue reported by
Anders Jonsson <anders.jonsson@norsjovallen.se>.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2 weeks agovimdiff: make script and tests work with zsh
brian m. carlson [Fri, 26 Apr 2024 22:11:54 +0000 (26 22:11 +0000)]
vimdiff: make script and tests work with zsh

When we process the $LAYOUT variable through sed, the result will end
with the character "#".  We then split it at the shell using IFS so that
we can process it a character at a time.

POSIX specifies that only "IFS white space shall be ignored at the
beginning and end of the input".  The hash mark is not a white space
character, so it is not ignored at the beginning and end of the input.

POSIX then specifies that "[e]ach occurrence in the input of an IFS
character that is not IFS white space, along with any adjacent IFS white
space, shall delimit a field, as described previously."  Thus, the final
hash mark delimits a field, and the final field is the empty string.

zsh implements this behavior strictly in compliance with POSIX (and
differently from most other shells), such that we end up with a trailing
empty field.  We don't want this empty field and processing it in the
normal way causes us to fail to parse properly and fail the tests with
"ERROR" entries, so let's just ignore it instead.  This is the behavior
of bash and dash anyway and what was clearly intended, so this is a
reasonable thing to do.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agot4046: avoid continue in &&-chain for zsh
brian m. carlson [Fri, 26 Apr 2024 22:11:53 +0000 (26 22:11 +0000)]
t4046: avoid continue in &&-chain for zsh

zsh has a bug in which the keyword "continue" within an &&-chain is not
effective and the code following it is executed nonetheless.
Fortunately, this bug has been fixed upstream in 12e5db145 ("51608:
Don't execute commands after "continue &&"", 2023-03-29).  However, zsh
releases very infrequently, so it is not present in a stable release
yet.

That, combined with the fact that almost all zsh users get their shell
from their OS vendor, means that it will likely be a long time before
this problem is fixed for most users.  We have other workarounds in
place for FreeBSD ash and dash, so it shouldn't be too difficult to add
one here, either.

Replace the existing code with a test and if-block, which comes only at
the cost of an additional indentation, and leaves the code a little more
idiomatic anyway.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agol10n: Update German translation
Ralf Thielow [Fri, 26 Apr 2024 14:24:36 +0000 (26 16:24 +0200)]
l10n: Update German translation

Reviewed-by: Matthias Rüster <matthias.ruester@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2 weeks agol10n: po-id for 2.45
Bagas Sanjaya [Wed, 17 Apr 2024 05:41:49 +0000 (17 12:41 +0700)]
l10n: po-id for 2.45

Translate following new components:

  * refs/reftable-backend.c

Update following components:

  * branch.c
  * builtin/column.c
  * builtin/config.c
  * builtin/for-each-ref.c
  * builtin/pack-refs.c
  * revision.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2 weeks agodoc: clarify practices for submitting updated patch versions
Justin Tobler [Thu, 25 Apr 2024 21:34:04 +0000 (25 16:34 -0500)]
doc: clarify practices for submitting updated patch versions

The `SubmittingPatches` documentation briefly mentions that related
patches should be grouped together in their own e-mail thread. Expand on
this to explicitly state that updated versions of a patch series should
also follow this. Also provide add a link to existing documentation from
`MyFirstContribution` that provides detailed instructions on how to do
this via `git-send-email(1)`.

Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'rj/add-i-leak-fix'
Junio C Hamano [Thu, 25 Apr 2024 17:34:24 +0000 (25 10:34 -0700)]
Merge branch 'rj/add-i-leak-fix'

Leakfix.

* rj/add-i-leak-fix:
  add: plug a leak on interactive_add
  add-patch: plug a leak handling the '/' command
  add-interactive: plug a leak in get_untracked_files
  apply: plug a leak in apply_data

2 weeks agoMerge branch 'rs/vsnprintf-failure-is-not-a-bug'
Junio C Hamano [Thu, 25 Apr 2024 17:34:23 +0000 (25 10:34 -0700)]
Merge branch 'rs/vsnprintf-failure-is-not-a-bug'

Demote a BUG() to an die() when the failure from vsnprintf() may
not be due to a programmer error.

* rs/vsnprintf-failure-is-not-a-bug:
  don't report vsnprintf(3) error as bug

2 weeks agocompletion: add docs on how to add subcommand completions
Roland Hieber [Thu, 25 Apr 2024 10:18:44 +0000 (25 12:18 +0200)]
completion: add docs on how to add subcommand completions

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocompletion: improve docs for using __git_complete
Roland Hieber [Thu, 25 Apr 2024 10:18:43 +0000 (25 12:18 +0200)]
completion: improve docs for using __git_complete

It took me more than a few tries and a good lecture of __git_main to
understand that the two paragraphs really only refer to adding
completion functions for executables that are not called through git's
subcommand magic. Improve the docs and be more specific.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agocompletion: add 'symbolic-ref'
Roland Hieber [Thu, 25 Apr 2024 10:18:42 +0000 (25 12:18 +0200)]
completion: add 'symbolic-ref'

Even 'symbolic-ref' is only completed when
GIT_COMPLETION_SHOW_ALL_COMMANDS=1 is set, it currently defaults to
completing file names, which is not very helpful. Add a simple
completion function which completes options and refs.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agofuzz: link fuzz programs with `make all` on Linux
Josh Steadmon [Wed, 24 Apr 2024 18:14:42 +0000 (24 11:14 -0700)]
fuzz: link fuzz programs with `make all` on Linux

Since 5e47215080 (fuzz: add basic fuzz testing target., 2018-10-12), we
have compiled object files for the fuzz tests as part of the default
'make all' target. This helps prevent bit-rot in lesser-used parts of
the codebase, by making sure that incompatible changes are caught at
build time.

However, since we never linked the fuzzer executables, this did not
protect us from link-time errors. As of 8b9a42bf48 (fuzz: fix fuzz test
build rules, 2024-01-19), it's now possible to link the fuzzer
executables without using a fuzzing engine and a variety of
compiler-specific (and compiler-version-specific) flags, at least on
Linux. So let's add a platform-specific option in config.mak.uname to
link the executables as part of the default `make all` target.

Since linking the fuzzer executables without a fuzzing engine does not
require a C++ compiler, we can change the FUZZ_PROGRAMS build rule to
use $(CC) by default. This avoids compiler mis-match issues when
overriding $(CC) but not $(CXX). When we *do* want to actually link with
a fuzzing engine, we can set $(FUZZ_CXX). The build instructions in the
CI fuzz-smoke-test job and in the Makefile comment have been updated
accordingly.

While we're at it, we can consolidate some of the fuzzer build
instructions into one location in the Makefile.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agomaintenance: running maintenance should not stop on errors
Johannes Schindelin [Wed, 24 Apr 2024 16:14:59 +0000 (24 16:14 +0000)]
maintenance: running maintenance should not stop on errors

In https://github.com/microsoft/git/issues/623, it was reported that
maintenance stops on a missing repository, omitting the remaining
repositories that were scheduled for maintenance.

This is undesirable, as it should be a best effort type of operation.

It should still fail due to the missing repository, of course, but not
leave the non-missing repositories in unmaintained shapes.

Let's use `for-each-repo`'s shiny new `--keep-going` option that we just
introduced for that very purpose.

This change will be picked up when running `git maintenance start`,
which is run implicitly by `scalar reconfigure`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agofor-each-repo: optionally keep going on an error
Johannes Schindelin [Wed, 24 Apr 2024 16:14:58 +0000 (24 16:14 +0000)]
for-each-repo: optionally keep going on an error

In https://github.com/microsoft/git/issues/623, it was reported that
the regularly scheduled maintenance stops if one repo in the middle of
the list was found to be missing.

This is undesirable, and points out a gap in the design of `git
for-each-repo`: We need a mode where that command does not stop on an
error, but continues to try running the specified command with the other
repositories.

Imitating the `--keep-going` option of GNU make, this commit teaches
`for-each-repo` the same trick: to continue with the operation on all
the remaining repositories in case there was a problem with one
repository, still setting the exit code to indicate an error occurred.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoDocumentation/RelNotes/2.45.0.txt: fix typo
Taylor Blau [Wed, 24 Apr 2024 16:27:05 +0000 (24 12:27 -0400)]
Documentation/RelNotes/2.45.0.txt: fix typo

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoGit 2.45-rc1v2.45.0-rc1
Junio C Hamano [Tue, 23 Apr 2024 22:05:07 +0000 (23 15:05 -0700)]
Git 2.45-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'ps/run-auto-maintenance-in-receive-pack'
Junio C Hamano [Tue, 23 Apr 2024 22:05:56 +0000 (23 15:05 -0700)]
Merge branch 'ps/run-auto-maintenance-in-receive-pack'

The "receive-pack" program (which responds to "git push") was not
converted to run "git maintenance --auto" when other codepaths that
used to run "git gc --auto" were updated, which has been corrected.

* ps/run-auto-maintenance-in-receive-pack:
  builtin/receive-pack: convert to use git-maintenance(1)
  run-command: introduce function to prepare auto-maintenance process

2 weeks agoMerge branch 'pk/bisect-use-show'
Junio C Hamano [Tue, 23 Apr 2024 22:05:56 +0000 (23 15:05 -0700)]
Merge branch 'pk/bisect-use-show'

When "git bisect" reports the commit it determined to be the
culprit, we used to show it in a format that does not honor common
UI tweaks, like log.date and log.decorate.  The code has been
taught to use "git show" to follow more customizations.

* pk/bisect-use-show:
  bisect: report the found commit with "show"

2 weeks agoA bit more topics before -rc1
Junio C Hamano [Tue, 23 Apr 2024 18:52:19 +0000 (23 11:52 -0700)]
A bit more topics before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2 weeks agoMerge branch 'rs/apply-reject-long-name'
Junio C Hamano [Tue, 23 Apr 2024 18:52:41 +0000 (23 11:52 -0700)]
Merge branch 'rs/apply-reject-long-name'

The filename used for rejected hunks "git apply --reject" creates
was limited to PATH_MAX, which has been lifted.

* rs/apply-reject-long-name:
  apply: avoid using fixed-size buffer in write_out_one_reject()

2 weeks agoMerge branch 'mr/rerere-crash-fix'
Junio C Hamano [Tue, 23 Apr 2024 18:52:41 +0000 (23 11:52 -0700)]
Merge branch 'mr/rerere-crash-fix'

When .git/rr-cache/ rerere database gets corrupted or rerere is fed to
work on a file with conflicted hunks resolved incompletely, the rerere
machinery got confused and segfaulted, which has been corrected.

* mr/rerere-crash-fix:
  rerere: fix crashes due to unmatched opening conflict markers

2 weeks agoMerge branch 'rs/imap-send-simplify-cmd-issuing-codepath'
Junio C Hamano [Tue, 23 Apr 2024 18:52:41 +0000 (23 11:52 -0700)]
Merge branch 'rs/imap-send-simplify-cmd-issuing-codepath'

Code simplification.

* rs/imap-send-simplify-cmd-issuing-codepath:
  imap-send: increase command size limit

2 weeks agoMerge branch 'xx/rfc2822-date-format-in-doc'
Junio C Hamano [Tue, 23 Apr 2024 18:52:40 +0000 (23 11:52 -0700)]
Merge branch 'xx/rfc2822-date-format-in-doc'

Docfix.

* xx/rfc2822-date-format-in-doc:
  Documentation: fix typos describing date format

2 weeks agoMerge branch 'ps/missing-btmp-fix'
Junio C Hamano [Tue, 23 Apr 2024 18:52:40 +0000 (23 11:52 -0700)]
Merge branch 'ps/missing-btmp-fix'

GIt 2.44 introduced a regression that makes the updated code to
barf in repositories with multi-pack index written by older
versions of Git, which has been corrected.

* ps/missing-btmp-fix:
  pack-bitmap: gracefully handle missing BTMP chunks

2 weeks agoMerge branch 'la/format-trailer-info'
Junio C Hamano [Tue, 23 Apr 2024 18:52:39 +0000 (23 11:52 -0700)]
Merge branch 'la/format-trailer-info'

The code to format trailers have been cleaned up.

* la/format-trailer-info:
  trailer: finish formatting unification
  trailer: begin formatting unification
  format_trailer_info(): append newline for non-trailer lines
  format_trailer_info(): drop redundant unfold_value()
  format_trailer_info(): use trailer_item objects

2 weeks agoMerge branch 'dd/t9604-use-posix-timezones'
Junio C Hamano [Tue, 23 Apr 2024 18:52:39 +0000 (23 11:52 -0700)]
Merge branch 'dd/t9604-use-posix-timezones'

The cvsimport tests required that the platform understands
traditional timezone notations like CST6CDT, which has been
updated to work on those systems as long as they understand
POSIX notation with explicit tz transition dates.

* dd/t9604-use-posix-timezones:
  t9604: Fix test for musl libc and new Debian

2 weeks agoMerge branch 'rj/launch-editor-error-message'
Junio C Hamano [Tue, 23 Apr 2024 18:52:39 +0000 (23 11:52 -0700)]
Merge branch 'rj/launch-editor-error-message'

Git writes a "waiting for your editor" message on an incomplete
line after launching an editor, and then append another error
message on the same line if the editor errors out.  It now clears
the "waiting for..." line before giving the error message.

* rj/launch-editor-error-message:
  launch_editor: waiting message on error

2 weeks agoMerge branch 'yb/replay-doc-linkfix'
Junio C Hamano [Tue, 23 Apr 2024 18:52:38 +0000 (23 11:52 -0700)]
Merge branch 'yb/replay-doc-linkfix'

Docfix.

* yb/replay-doc-linkfix:
  Documentation: fix linkgit reference

2 weeks agoMerge branch 'rs/no-openssl-compilation-fix-on-macos'
Junio C Hamano [Tue, 23 Apr 2024 18:52:38 +0000 (23 11:52 -0700)]
Merge branch 'rs/no-openssl-compilation-fix-on-macos'

Build fix.

* rs/no-openssl-compilation-fix-on-macos:
  git-compat-util: fix NO_OPENSSL on current macOS

2 weeks agoMerge branch 'ta/fast-import-parse-path-fix'
Junio C Hamano [Tue, 23 Apr 2024 18:52:37 +0000 (23 11:52 -0700)]
Merge branch 'ta/fast-import-parse-path-fix'

The way "git fast-import" handles paths described in its input has
been tightened up and more clearly documented.

* ta/fast-import-parse-path-fix:
  fast-import: make comments more precise
  fast-import: forbid escaped NUL in paths
  fast-import: document C-style escapes for paths
  fast-import: improve documentation for path quoting
  fast-import: remove dead strbuf
  fast-import: allow unquoted empty path for root
  fast-import: directly use strbufs for paths
  fast-import: tighten path unquoting