]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
10 months agot-strvec: use if_test
René Scharfe [Tue, 30 Jul 2024 14:12:36 +0000 (16:12 +0200)] 
t-strvec: use if_test

The macro TEST takes a single expression.  If a test requires multiple
statements then they need to be placed in a function that's called in
the TEST expression.

Remove the cognitive overhead of defining and calling single-use
functions by using if_test instead.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot-reftable-basics: use if_test
René Scharfe [Tue, 30 Jul 2024 14:10:59 +0000 (16:10 +0200)] 
t-reftable-basics: use if_test

The macro TEST takes a single expression.  If a test requires multiple
statements then they need to be placed in a function that's called in
the TEST expression.

Remove the overhead of defining and calling single-use functions by
using if_test instead.

Run the tests in the order of definition.  We can reorder them like that
because they are independent.  Technically this changes the output, but
retains the meaning of a full run and allows for easier review e.g. with
diff option --ignore-all-space.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot-ctype: use if_test
René Scharfe [Tue, 30 Jul 2024 14:10:09 +0000 (16:10 +0200)] 
t-ctype: use if_test

Use the documented macro if_test instead of the internal functions
test__run_begin() and test__run_end(), which are supposed to be private
to the unit test framework.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agounit-tests: add if_test
René Scharfe [Tue, 30 Jul 2024 14:08:19 +0000 (16:08 +0200)] 
unit-tests: add if_test

The macro TEST only allows defining a test that consists of a single
expression.  Add a new macro, if_test, which provides a way to define
unit tests that are made up of one or more statements.

if_test allows defining self-contained tests en bloc, a bit like
test_expect_success does for regular tests.  It acts like a conditional;
the test body is executed if test_skip_all() had not been called before.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agounit-tests: show location of checks outside of tests
René Scharfe [Tue, 30 Jul 2024 14:07:00 +0000 (16:07 +0200)] 
unit-tests: show location of checks outside of tests

Checks outside of tests are caught at runtime and reported like this:

 Assertion failed: (ctx.running), function test_assert, file test-lib.c, line 267.

The assert() call aborts the unit test and doesn't reveal the location
or even the type of the offending check, as test_assert() is called by
all of them.

Handle it like the opposite case, a test without any checks: Don't
abort, but report the location of the actual check, along with a message
explaining the situation.  The output for example above becomes:

 # BUG: check outside of test at t/helper/test-example-tap.c:75

... and the unit test program continues and indicates the error in its
exit code at the end.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 months agot0080: use here-doc test body
René Scharfe [Tue, 30 Jul 2024 14:05:58 +0000 (16:05 +0200)] 
t0080: use here-doc test body

Improve the readability of the expected output by using a here-doc for
the test body and replacing the unwieldy ${SQ} references with literal
single quotes.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoGit 2.46-rc1 v2.46.0-rc1
Junio C Hamano [Thu, 18 Jul 2024 15:23:53 +0000 (08:23 -0700)] 
Git 2.46-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'jk/am-retry'
Junio C Hamano [Thu, 18 Jul 2024 15:30:27 +0000 (08:30 -0700)] 
Merge branch 'jk/am-retry'

Test fix as a follow-up to an already graduated topic.

* jk/am-retry:
  t4153: stop redirecting input from /dev/zero

11 months agoMerge branch 'tb/pseudo-merge-reachability-bitmap'
Junio C Hamano [Thu, 18 Jul 2024 15:30:27 +0000 (08:30 -0700)] 
Merge branch 'tb/pseudo-merge-reachability-bitmap'

Doc update.

* tb/pseudo-merge-reachability-bitmap:
  Documentation/gitpacking: make sample configs listing blocks

11 months agoMerge branch 'ps/pseudo-ref-terminology'
Junio C Hamano [Thu, 18 Jul 2024 15:30:26 +0000 (08:30 -0700)] 
Merge branch 'ps/pseudo-ref-terminology'

Doc update.

* ps/pseudo-ref-terminology:
  Documentation/glossary: fix double word

11 months agoMerge branch 'tb/doc-max-tree-depth-fix'
Junio C Hamano [Thu, 18 Jul 2024 15:30:26 +0000 (08:30 -0700)] 
Merge branch 'tb/doc-max-tree-depth-fix'

Doc update.

* tb/doc-max-tree-depth-fix:
  Documentation: fix default value for core.maxTreeDepth

11 months agoMerge branch 'ch/refs-without-the-repository-fix'
Junio C Hamano [Thu, 18 Jul 2024 15:30:25 +0000 (08:30 -0700)] 
Merge branch 'ch/refs-without-the-repository-fix'

Comment fix.

* ch/refs-without-the-repository-fix:
  refs: correct the version numbers in a comment

11 months agoPost 2.46-rc0 batch #3
Junio C Hamano [Wed, 17 Jul 2024 17:47:05 +0000 (10:47 -0700)] 
Post 2.46-rc0 batch #3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'js/unit-test-oidtree-cmake-fix'
Junio C Hamano [Wed, 17 Jul 2024 17:47:27 +0000 (10:47 -0700)] 
Merge branch 'js/unit-test-oidtree-cmake-fix'

Build fix.

* js/unit-test-oidtree-cmake-fix:
  cmake: fix build of `t-oidtree`

11 months agoMerge branch 'js/var-git-shell-path'
Junio C Hamano [Wed, 17 Jul 2024 17:47:27 +0000 (10:47 -0700)] 
Merge branch 'js/var-git-shell-path'

"git var GIT_SHELL_PATH" should report the path to the shell used
to spawn external commands, but it didn't do so on Windows, which
has been corrected.

* js/var-git-shell-path:
  var(win32): do report the GIT_SHELL_PATH that is actually used
  run-command: declare the `git_shell_path()` function globally
  run-command(win32): resolve the path to the Unix shell early
  mingw(is_msys2_sh): handle forward slashes in the `sh.exe` path, too
  win32: override `fspathcmp()` with a directory separator-aware version
  strvec: declare the `strvec_push_nodup()` function globally
  run-command: refactor getting the Unix shell path into its own function

11 months agoMerge branch 'ps/doc-http-empty-cookiefile'
Junio C Hamano [Wed, 17 Jul 2024 17:47:26 +0000 (10:47 -0700)] 
Merge branch 'ps/doc-http-empty-cookiefile'

What happens when http.cookieFile gets the special value "" has
been clarified in the documentation.

* ps/doc-http-empty-cookiefile:
  doc: update http.cookieFile with in-memory cookie processing

11 months agoMerge branch 'kn/push-empty-fix'
Junio C Hamano [Wed, 17 Jul 2024 17:47:26 +0000 (10:47 -0700)] 
Merge branch 'kn/push-empty-fix'

"git push '' HEAD:there" used to hit a BUG(); it has been corrected
to die with "fatal: bad repository ''".

* kn/push-empty-fix:
  builtin/push: call set_refspecs after validating remote

11 months agoMerge branch 'jc/http-cookiefile'
Junio C Hamano [Wed, 17 Jul 2024 17:47:25 +0000 (10:47 -0700)] 
Merge branch 'jc/http-cookiefile'

The http.cookieFile and http.saveCookies configuration variables
have a few values that need to be avoided, which are now ignored
with warning messages.

* jc/http-cookiefile:
  http.c: cookie file tightening

11 months agoMerge branch 'jk/test-body-in-here-doc'
Junio C Hamano [Wed, 17 Jul 2024 17:47:24 +0000 (10:47 -0700)] 
Merge branch 'jk/test-body-in-here-doc'

The test framework learned to take the test body not as a single
string but as a here-document.

* jk/test-body-in-here-doc:
  t/.gitattributes: ignore whitespace in chainlint expect files
  t: convert some here-doc test bodies
  test-lib: allow test snippets as here-docs
  chainlint.pl: add tests for test body in heredoc
  chainlint.pl: recognize test bodies defined via heredoc
  chainlint.pl: check line numbers in expected output
  chainlint.pl: force CRLF conversion when opening input files
  chainlint.pl: do not spawn more threads than we have scripts
  chainlint.pl: only start threads if jobs > 1
  chainlint.pl: add test_expect_success call to test snippets

11 months agoMerge branch 'rj/test-sanitize-leak-log-fix'
Junio C Hamano [Wed, 17 Jul 2024 17:47:24 +0000 (10:47 -0700)] 
Merge branch 'rj/test-sanitize-leak-log-fix'

Tests that use GIT_TEST_SANITIZE_LEAK_LOG feature got their exit
status inverted, which has been corrected.

* rj/test-sanitize-leak-log-fix:
  test-lib: GIT_TEST_SANITIZE_LEAK_LOG enabled by default
  test-lib: fix GIT_TEST_SANITIZE_LEAK_LOG

11 months agoDocumentation: fix default value for core.maxTreeDepth
Taylor Blau [Wed, 17 Jul 2024 13:17:31 +0000 (09:17 -0400)] 
Documentation: fix default value for core.maxTreeDepth

When `core.maxTreeDepth` was originally introduced via be20128bfa (add
core.maxTreeDepth config, 2023-08-31), its default value was 4096.

There have since been a couple of updates to its default value that were
not reflected in the documentation for `core.maxTreeDepth`:

  - 4d5693ba05 (lower core.maxTreeDepth default to 2048, 2023-08-31)
  - b64d78ad02 (max_tree_depth: lower it for MSVC to avoid stack
    overflows, 2023-11-01)

Commit 4d5693ba05 lowers the default to 2048 for platforms with smaller
stack sizes, and commit b64d78ad02 lowers the default even further when
Git is compiled with MSVC.

Neither of these changes were reflected in the documentation, which I
noticed while merging newer releases back into GitHub's private fork
(which contained the original implementation of `core.maxTreeDepth`).

Update the documentation to reflect what the platform-specific default
values are.

Noticed-by: Keith W. Campbell <keithc@ca.ibm.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoDocumentation/glossary: fix double word
Martin Ågren [Wed, 17 Jul 2024 10:54:29 +0000 (12:54 +0200)] 
Documentation/glossary: fix double word

Remove a spurious "that".

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoDocumentation/gitpacking: make sample configs listing blocks
Martin Ågren [Wed, 17 Jul 2024 10:54:28 +0000 (12:54 +0200)] 
Documentation/gitpacking: make sample configs listing blocks

This document contains a few sample config snippets. At least with
Asciidoctor, the section headers are rendered *more* indented than the
variables that follow:

       [bitmapPseudoMerge "all"]
    pattern = "refs/"
    ...

To address this, wrap these listings in AsciiDoc listing blocks. Remove
the indentation from the section headings. This is similar to how we
handle such sample config elsewhere, e.g., in config.txt.

While we're here, fix the nearby "wiht" typo.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agot4153: stop redirecting input from /dev/zero
Jeff King [Wed, 17 Jul 2024 07:00:50 +0000 (03:00 -0400)] 
t4153: stop redirecting input from /dev/zero

Commit 852a171018 (am: let command-line options override saved options,
2015-08-04) redirected a few "git am" invocations from /dev/zero, even
though it did not expect "am" to read the input. This was necessary at
the time because those tests used test_terminal, and as described in
18d8c26930 (test_terminal: redirect child process' stdin to a pty,
2015-08-04):

  Note that due to the way the code is structured, the child's stdin
  pseudo-tty will be closed when we finish reading from our stdin. This
  means that in the common case, where our stdin is attached to /dev/null,
  the child's stdin pseudo-tty will be closed immediately. Some operations
  like isatty(), which git-am uses, require the file descriptor to be
  open, and hence if the success of the command depends on such functions,
  test_terminal's stdin should be redirected to a source with large amount
  of data to ensure that the child's stdin is not closed, e.g.

              test_terminal git am --3way </dev/zero

But we later dropped the use of test_terminal in 53ce2e3f0a (am: add
explicit "--retry" option, 2024-06-06). That commit dropped one of the
redirections from /dev/zero but not the other.

In theory the remaining one should not cause any problems, but it turns
out that at least one platform (NonStop) does not have /dev/zero at all.
We never noticed before because it also did not pass the TTY prereq,
meaning these tests were not run at all there until 53ce2e3f0a.

So let's drop the useless /dev/zero mention. There are others in the
test suite, but they are run only for tests marked with EXPENSIVE (so
not typically by default).

Reported-by: Randall S. Becker <rsbecker@nexbridge.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoPost 2.46-rc0 batch #2
Junio C Hamano [Tue, 16 Jul 2024 18:18:39 +0000 (11:18 -0700)] 
Post 2.46-rc0 batch #2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'bc/gitfaq-more'
Junio C Hamano [Tue, 16 Jul 2024 18:18:58 +0000 (11:18 -0700)] 
Merge branch 'bc/gitfaq-more'

A handful of entries are added to the GitFAQ document.

* bc/gitfaq-more:
  doc: mention that proxies must be completely transparent
  gitfaq: add entry about syncing working trees
  gitfaq: give advice on using eol attribute in gitattributes
  gitfaq: add documentation on proxies

11 months agoMerge branch 'bc/http-proactive-auth'
Junio C Hamano [Tue, 16 Jul 2024 18:18:57 +0000 (11:18 -0700)] 
Merge branch 'bc/http-proactive-auth'

The http transport can now be told to send request with
authentication material without first getting a 401 response.

* bc/http-proactive-auth:
  http: allow authenticating proactively

11 months agoMerge branch 'jc/where-is-bash-for-ci'
Junio C Hamano [Tue, 16 Jul 2024 18:18:57 +0000 (11:18 -0700)] 
Merge branch 'jc/where-is-bash-for-ci'

Shell script clean-up.

* jc/where-is-bash-for-ci:
  ci: unify bash calling convention

11 months agoMerge branch 'ds/advice-sparse-index-expansion'
Junio C Hamano [Tue, 16 Jul 2024 18:18:56 +0000 (11:18 -0700)] 
Merge branch 'ds/advice-sparse-index-expansion'

A new warning message is issued when a command has to expand a
sparse index to handle working tree cruft that are outside of the
sparse checkout.

* ds/advice-sparse-index-expansion:
  advice: warn when sparse index expands

11 months agoMerge branch 'cb/send-email-sanitize-trailer-addresses'
Junio C Hamano [Tue, 16 Jul 2024 18:18:56 +0000 (11:18 -0700)] 
Merge branch 'cb/send-email-sanitize-trailer-addresses'

Address-looking strings found on the trailer are now placed on the
Cc: list after running through sanitize_address by "git send-email".
* cb/send-email-sanitize-trailer-addresses:
  git-send-email: use sanitized address when reading mbox body

11 months agoMerge branch 'en/ort-inner-merge-error-fix'
Junio C Hamano [Tue, 16 Jul 2024 18:18:55 +0000 (11:18 -0700)] 
Merge branch 'en/ort-inner-merge-error-fix'

The "ort" merge backend saw one bugfix for a crash that happens
when inner merge gets killed, and assorted code clean-ups.

* en/ort-inner-merge-error-fix:
  merge-ort: fix missing early return
  merge-ort: convert more error() cases to path_msg()
  merge-ort: upon merge abort, only show messages causing the abort
  merge-ort: loosen commented requirements
  merge-ort: clearer propagation of failure-to-function from merge_submodule
  merge-ort: fix type of local 'clean' var in handle_content_merge ()
  merge-ort: maintain expected invariant for priv member
  merge-ort: extract handling of priv member into reusable function

11 months agorefs: correct the version numbers in a comment
Christian Hesse [Tue, 16 Jul 2024 09:55:44 +0000 (11:55 +0200)] 
refs: correct the version numbers in a comment

The paragraph talks about a change made in c8f815c2 (refs: remove
functions without ref store, 2024-05-07), which is v2.46.0-rc0~119^2
and will be published as part of v2.46, not v2.45.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoPost 2.46-rc0 batch #1
Junio C Hamano [Mon, 15 Jul 2024 17:11:12 +0000 (10:11 -0700)] 
Post 2.46-rc0 batch #1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'cp/unit-test-reftable-record'
Junio C Hamano [Mon, 15 Jul 2024 17:11:43 +0000 (10:11 -0700)] 
Merge branch 'cp/unit-test-reftable-record'

A test in reftable library has been rewritten using the unit test
framework.

* cp/unit-test-reftable-record:
  t-reftable-record: add tests for reftable_log_record_compare_key()
  t-reftable-record: add tests for reftable_ref_record_compare_name()
  t-reftable-record: add index tests for reftable_record_is_deletion()
  t-reftable-record: add obj tests for reftable_record_is_deletion()
  t-reftable-record: add log tests for reftable_record_is_deletion()
  t-reftable-record: add ref tests for reftable_record_is_deletion()
  t-reftable-record: add comparison tests for obj records
  t-reftable-record: add comparison tests for index records
  t-reftable-record: add comparison tests for ref records
  t-reftable-record: add reftable_record_cmp() tests for log records
  t: move reftable/record_test.c to the unit testing framework

11 months agoMerge branch 'jc/disable-push-nego-for-deletion'
Junio C Hamano [Mon, 15 Jul 2024 17:11:43 +0000 (10:11 -0700)] 
Merge branch 'jc/disable-push-nego-for-deletion'

"git push" that pushes only deletion gave an unnecessary and
harmless error message when push negotiation is configured, which
has been corrected.

* jc/disable-push-nego-for-deletion:
  push: avoid showing false negotiation errors

11 months agoMerge branch 'ri/doc-show-branch-fix'
Junio C Hamano [Mon, 15 Jul 2024 17:11:43 +0000 (10:11 -0700)] 
Merge branch 'ri/doc-show-branch-fix'

Docfix.

* ri/doc-show-branch-fix:
  doc: fix the max number of branches shown by "show-branch"

11 months agoMerge branch 'tb/dev-build-pedantic-fix'
Junio C Hamano [Mon, 15 Jul 2024 17:11:42 +0000 (10:11 -0700)] 
Merge branch 'tb/dev-build-pedantic-fix'

Developer build procedure fix.

* tb/dev-build-pedantic-fix:
  config.mak.dev: fix typo when enabling -Wpedantic

11 months agoMerge branch 'rs/clang-format-updates'
Junio C Hamano [Mon, 15 Jul 2024 17:11:42 +0000 (10:11 -0700)] 
Merge branch 'rs/clang-format-updates'

Custom control structures we invented more recently have been
taught to the clang-format file.

* rs/clang-format-updates:
  clang-format: include kh_foreach* macros in ForEachMacros

11 months agoMerge branch 'am/gitweb-feed-use-committer-date'
Junio C Hamano [Mon, 15 Jul 2024 17:11:41 +0000 (10:11 -0700)] 
Merge branch 'am/gitweb-feed-use-committer-date'

GitWeb update to use committer date consistently in rss/atom feeds.

* am/gitweb-feed-use-committer-date:
  gitweb: rss/atom change published/updated date to committer date

11 months agoMerge branch 'jk/tests-without-dns'
Junio C Hamano [Mon, 15 Jul 2024 17:11:41 +0000 (10:11 -0700)] 
Merge branch 'jk/tests-without-dns'

Test suite has been taught not to unnecessarily rely on DNS failing
a bogus external name.

* jk/tests-without-dns:
  t/lib-bundle-uri: use local fake bundle URLs
  t5551: do not confirm that bogus url cannot be used
  t5553: use local url for invalid fetch

11 months agoMerge branch 'gt/unit-test-oidmap'
Junio C Hamano [Mon, 15 Jul 2024 17:11:40 +0000 (10:11 -0700)] 
Merge branch 'gt/unit-test-oidmap'

An existing test of oidmap API has been rewritten with the
unit-test framework.

* gt/unit-test-oidmap:
  t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c

11 months agoMerge branch 'as/describe-broken-refresh-index-fix'
Junio C Hamano [Mon, 15 Jul 2024 17:11:40 +0000 (10:11 -0700)] 
Merge branch 'as/describe-broken-refresh-index-fix'

"git describe --dirty --broken" forgot to refresh the index before
seeing if there is any chang, ("git describe --dirty" correctly did
so), which has been corrected.

* as/describe-broken-refresh-index-fix:
  describe: refresh the index when 'broken' flag is used

11 months agoMerge branch 'rj/t0613-no-longer-leaks'
Junio C Hamano [Mon, 15 Jul 2024 17:11:39 +0000 (10:11 -0700)] 
Merge branch 'rj/t0613-no-longer-leaks'

A test that no longer leaks has been marked as such.

* rj/t0613-no-longer-leaks:
  t0613: mark as leak-free

11 months agoMerge branch 'rj/t0612-no-longer-leaks'
Junio C Hamano [Mon, 15 Jul 2024 17:11:39 +0000 (10:11 -0700)] 
Merge branch 'rj/t0612-no-longer-leaks'

A test that no longer leaks has been marked as such.

* rj/t0612-no-longer-leaks:
  t0612: mark as leak-free

11 months agovar(win32): do report the GIT_SHELL_PATH that is actually used
Johannes Schindelin [Sat, 13 Jul 2024 21:08:24 +0000 (21:08 +0000)] 
var(win32): do report the GIT_SHELL_PATH that is actually used

On Windows, Unix-like paths like `/bin/sh` make very little sense. In
the best case, they simply don't work, in the worst case they are
misinterpreted as absolute paths that are relative to the drive
associated with the current directory.

To that end, Git does not actually use the path `/bin/sh` that is
recorded e.g. when `run_command()` is called with a Unix shell
command-line. Instead, as of 776297548e (Do not use SHELL_PATH from
build system in prepare_shell_cmd on Windows, 2012-04-17), it
re-interprets `/bin/sh` as "look up `sh` on the `PATH` and use the
result instead".

This is the logic users expect to be followed when running `git var
GIT_SHELL_PATH`.

However, when 1e65721227 (var: add support for listing the shell,
2023-06-27) introduced support for `git var GIT_SHELL_PATH`, Windows was
not special-cased as above, which is why it outputs `/bin/sh` even
though that disagrees with what Git actually uses.

Let's fix this by using the exact same logic as `prepare_shell_cmd()`,
adjusting the Windows-specific `git var GIT_SHELL_PATH` test case to
verify that it actually finds a working executable.

Reported-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agorun-command: declare the `git_shell_path()` function globally
Johannes Schindelin [Sat, 13 Jul 2024 21:08:23 +0000 (21:08 +0000)] 
run-command: declare the `git_shell_path()` function globally

The intention is to use it in `git var GIT_SHELL_PATH`, therefore we
need this function to stop being file-local only.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agorun-command(win32): resolve the path to the Unix shell early
Johannes Schindelin [Sat, 13 Jul 2024 21:08:22 +0000 (21:08 +0000)] 
run-command(win32): resolve the path to the Unix shell early

In 776297548e (Do not use SHELL_PATH from build system in
prepare_shell_cmd on Windows, 2012-04-17), the hard-coded path to the
Unix shell was replaced by passing `sh` instead when executing Unix
shell scripts in Git.

This was done because the hard-coded path to the Unix shell is incorrect
on Windows because it not only is a Unix-style absolute path instead of
a Windows one, but Git uses the runtime prefix feature on Windows, i.e.
the correct path cannot be hard-coded.

Naturally, the `sh` argument will be resolved to the full path of said
executable eventually.

To help fixing the bug where `git var GIT_SHELL_PATH` currently does not
reflect that logic, but shows that incorrect hard-coded Unix-style
absolute path, let's resolve the full path to the `sh` executable early
in the `git_shell_path()` function so that we can use it in `git var`,
too, and be sure that the output is equivalent to what `run_command()`
does when it is asked to execute a command-line using a Unix shell.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agomingw(is_msys2_sh): handle forward slashes in the `sh.exe` path, too
Johannes Schindelin [Sat, 13 Jul 2024 21:08:21 +0000 (21:08 +0000)] 
mingw(is_msys2_sh): handle forward slashes in the `sh.exe` path, too

Whether the full path to the MSYS2 Bash is specified using backslashes
or forward slashes, in either case the command-line arguments need to be
quoted in the MSYS2-specific manner instead of using regular Win32
command-line quoting rules.

In preparation for `prepare_shell_cmd()` to use the full path to
`sh.exe` (with forward slashes for consistency), let's teach the
`is_msys2_sh()` function about this; Otherwise 5580.4 'clone with
backslashed path' would fail once `prepare_shell_cmd()` uses the full
path instead of merely `sh`.

This patch relies on the just-introduced fix where `fspathcmp()` handles
backslashes and forward slashes as equivalent on Windows.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agowin32: override `fspathcmp()` with a directory separator-aware version
Johannes Schindelin [Sat, 13 Jul 2024 21:08:20 +0000 (21:08 +0000)] 
win32: override `fspathcmp()` with a directory separator-aware version

On Windows, the backslash is the directory separator, even if the
forward slash can be used, too, at least since Windows NT.

This means that the paths `a/b` and `a\b` are equivalent, and
`fspathcmp()` needs to be made aware of that fact.

Note that we have to override both `fspathcmp()` and `fspathncmp()`, and
the former cannot be a mere pre-processor constant that transforms calls
to `fspathcmp(a, b)` into `fspathncmp(a, b, (size_t)-1)` because the
function `report_collided_checkout()` in `unpack-trees.c` wants to
assign `list.cmp = fspathcmp`.

Also note that `fspatheq()` does _not_ need to be overridden because it
calls `fspathcmp()` internally.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agostrvec: declare the `strvec_push_nodup()` function globally
Johannes Schindelin [Sat, 13 Jul 2024 21:08:19 +0000 (21:08 +0000)] 
strvec: declare the `strvec_push_nodup()` function globally

This function differs from `strvec_push()` in that it takes ownership of
the allocated string that is passed as second argument.

This is useful when appending elements to the string array that have
been freshly allocated and serve no further other purpose after that.

Without declaring this function globally, call sites would allocate the
memory, only to have `strvec_push()` duplicate the string, and then the
first copy would need to be released. Having this function globally
avoids that kind of unnecessary work.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agorun-command: refactor getting the Unix shell path into its own function
Johannes Schindelin [Sat, 13 Jul 2024 21:08:18 +0000 (21:08 +0000)] 
run-command: refactor getting the Unix shell path into its own function

This encapsulates the platform-specific logic better.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agocmake: fix build of `t-oidtree`
Johannes Schindelin [Fri, 12 Jul 2024 20:34:10 +0000 (20:34 +0000)] 
cmake: fix build of `t-oidtree`

When the `oidtree` test helper was turned into a unit test, a new
`lib-oid` source file was added as dependency. This was only done in the
Makefile so far, but also needs to be done in the CMake definition.

This is a companion of ed548408723d (t/: migrate helper/test-oidtree.c
to unit-tests/t-oidtree.c, 2024-06-08).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agobuiltin/push: call set_refspecs after validating remote
Karthik Nayak [Thu, 11 Jul 2024 09:39:54 +0000 (11:39 +0200)] 
builtin/push: call set_refspecs after validating remote

When an end-user runs "git push" with an empty string for the remote
repository name, e.g.

    $ git push '' main

"git push" fails with a BUG(). Even though this is a nonsense request
that we want to fail, we shouldn't hit a BUG().  Instead we want to give
a sensible error message, e.g., 'bad repository'".

This is because since 9badf97c42 (remote: allow resetting url list,
2024-06-14), we reset the remote URL if the provided URL is empty. When
a user of 'remotes_remote_get' tries to fetch a remote with an empty
repo name, the function initializes the remote via 'make_remote'. But
the remote is still not a valid remote, since the URL is empty, so it
tries to add the URL alias using 'add_url_alias'. This in-turn will call
'add_url', but since the URL is empty we call 'strvec_clear' on the
`remote->url`. Back in 'remotes_remote_get', we again check if the
remote is valid, which fails, so we return 'NULL' for the 'struct
remote *' value.

The 'builtin/push.c' code, calls 'set_refspecs' before validating the
remote. This worked with empty repo names earlier since we would get a
remote, albeit with an empty URL. With the new changes, we get a 'NULL'
remote value, this causes the check for remote to fail and raises the
BUG in 'set_refspecs'.

Do a simple fix by doing remote validation first. Also add a test to
validate the bug fix. With this, we can also now directly pass remote to
'set_refspecs' instead of it trying to lazily obtain it.

Helped-by: Jeff King <peff@peff.net>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoGit 2.46-rc0 v2.46.0-rc0
Junio C Hamano [Fri, 12 Jul 2024 15:40:36 +0000 (08:40 -0700)] 
Git 2.46-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'rs/simplify-submodule-helper-super-prefix-invocation'
Junio C Hamano [Fri, 12 Jul 2024 15:41:57 +0000 (08:41 -0700)] 
Merge branch 'rs/simplify-submodule-helper-super-prefix-invocation'

Code clean-up.

* rs/simplify-submodule-helper-super-prefix-invocation:
  submodule--helper: use strvec_pushf() for --super-prefix

11 months agoMerge branch 'as/pathspec-h-typofix'
Junio C Hamano [Fri, 12 Jul 2024 15:41:57 +0000 (08:41 -0700)] 
Merge branch 'as/pathspec-h-typofix'

Typofix.

* as/pathspec-h-typofix:
  pathspec: fix typo "glossary-context.txt" -> "glossary-content.txt"

11 months agodoc: update http.cookieFile with in-memory cookie processing
Piotr Szlazak [Thu, 11 Jul 2024 08:36:48 +0000 (08:36 +0000)] 
doc: update http.cookieFile with in-memory cookie processing

Documentation only mentions how to read cookies from the given file
and how to save them to the file using http.saveCookies.

But underlying libcURL allows the HTTP cookies used only in memory;
cookies from the server will be accepted and sent back in successive
requests within same connection, by using an empty string as the
filename.  Document this.

Signed-off-by: Piotr Szlazak <piotr.szlazak@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agotest-lib: GIT_TEST_SANITIZE_LEAK_LOG enabled by default
Rubén Justo [Thu, 11 Jul 2024 14:10:51 +0000 (23:10 +0900)] 
test-lib: GIT_TEST_SANITIZE_LEAK_LOG enabled by default

As we currently describe in t/README, it can happen that:

    Some tests run "git" (or "test-tool" etc.) without properly checking
    the exit code, or git will invoke itself and fail to ferry the
    abort() exit code to the original caller.

Therefore, GIT_TEST_SANITIZE_LEAK_LOG=true is needed to be set to
capture all memory leaks triggered by our tests.

It seems unnecessary to force users to remember this option, as
forgetting it could lead to missed memory leaks.

We could solve the problem by making it "true" by default, but that
might suggest we think "false" makes sense, which isn't the case.

Therefore, the best approach is to remove the option entirely while
maintaining the capability to detect memory leaks in blind spots of our
tests.

Signed-off-by: Rubén Justo <rjusto@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agot/.gitattributes: ignore whitespace in chainlint expect files
Jeff King [Wed, 10 Jul 2024 08:47:04 +0000 (04:47 -0400)] 
t/.gitattributes: ignore whitespace in chainlint expect files

The ".expect" files in t/chainlint/ are snippets of expected output from
the chainlint script, and do not necessarily conform to our usual code
style. Especially with the recent change to retain line numbers, blank
lines in the input script end up with trailing whitespace as we print
"3 " for line 3, for example. The point of these files is to match the
output verbatim, so let's not complain about the trailing spaces.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agot: convert some here-doc test bodies
Jeff King [Wed, 10 Jul 2024 08:39:31 +0000 (04:39 -0400)] 
t: convert some here-doc test bodies

The t1404 script checks a lot of output from Git which contains single
quotes. Because the test snippets are themselves wrapped in the same
single-quotes, we have to resort to using $SQ to match them.  This is
error-prone and makes the tests harder to read.

Instead, let's use the new here-doc feature added in the previous
commit, which lets us write anything in the test body we want (except
the here-doc end marker on a line by itself, of course).

Note that we do use "\" in our marker to avoid interpolation (which is
the whole point). But we don't use "<<-", as we want to preserve
whitespace in the snippet (and running with "-v" before and after shows
that we produce the exact same output, except with the ugly $SQ
references fixed).

I just converted every test here, even though only some of them use
$SQ. But it would be equally correct to mix-and-match styles if we don't
mind the inconsistency.

I've also converted a few tests in t0600 which were moved from t1404 (I
had written this patch before they were moved, but it seemed worth
porting over the changes rather than losing them).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agotest-lib: allow test snippets as here-docs
Jeff King [Wed, 10 Jul 2024 08:39:29 +0000 (04:39 -0400)] 
test-lib: allow test snippets as here-docs

Most test snippets are wrapped in single quotes, like:

  test_expect_success 'some description' '
          do_something
  '

This sometimes makes the snippets awkward to write, because you can't
easily use single quotes within them. We sometimes work around this with
$SQ, or by loosening regexes to use "." instead of a literal quote, or
by using double quotes when we'd prefer to use single-quotes (and just
adding extra backslash-escapes to avoid interpolation).

This commit adds another option: feeding the snippet via the function's
stdin. This doesn't conflict with anything the snippet would want to do,
because we always redirect its stdin from /dev/null anyway (which we'll
continue to do).

A few notes on the implementation:

  - it would be nice to push this down into test_run_, but we can't, as
    test_expect_success and test_expect_failure want to see the actual
    script content to report it for verbose-mode. A helper function
    limits the amount of duplication in those callers here.

  - The helper function is a little awkward to call, as you feed it the
    name of the variable you want to set. The more natural thing in
    shell would be command substitution like:

      body=$(body_or_stdin "$2")

    but that loses trailing whitespace. There are tricks around this,
    like:

      body=$(body_or_stdin "$2"; printf .)
      body=${body%.}

    but we'd prefer to keep such tricks in the helper, not in each
    caller.

  - I implemented the helper using a sequence of "read" calls. Together
    with "-r" and unsetting the IFS, this preserves incoming whitespace.
    An alternative is to use "cat" (which then requires the gross "."
    trick above). But this saves us a process, which is probably a good
    thing. The "read" builtin does use more read() syscalls than
    necessary (one per byte), but that is almost certainly a win over a
    separate process.

    Both are probably slower than passing a single-quoted string, but
    the difference is lost in the noise for a script that I converted as
    an experiment.

  - I handle test_expect_success and test_expect_failure here. If we
    like this style, we could easily extend it to other spots (e.g.,
    lazy_prereq bodies) on top of this patch.

  - even though we are using "local", we have to be careful about our
    variable names. Within test_expect_success, any variable we declare
    with local will be seen as local by the test snippets themselves (so
    it wouldn't persist between tests like normal variables would).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: add tests for test body in heredoc
Jeff King [Wed, 10 Jul 2024 08:39:16 +0000 (04:39 -0400)] 
chainlint.pl: add tests for test body in heredoc

The chainlint.pl script recently learned about the upcoming:

  test_expect_success 'some test' - <<\EOT
TEST_BODY
  EOT

syntax, where TEST_BODY should be checked in the usual way. Let's make
sure this works by adding a few tests. The "here-doc-body" file tests
the basic syntax, including an embedded here-doc which we should still
be able to recognize.

Likewise the "here-doc-body-indent" checks the same thing, but using the
"<<-" operator. We wouldn't expect this to be used normally, but we
would not want to accidentally miss a body that uses it. The
"pathological" variant checks the opposite: we don't get confused by an
indented tag within the here-doc body.

The "here-doc-double" tests the handling of two here-doc tags on the
same line. This is not something we'd expect anybody to do in practice,
but the code was written defensively to handle this, so let's make sure
it works.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: recognize test bodies defined via heredoc
Eric Sunshine [Wed, 10 Jul 2024 08:38:31 +0000 (04:38 -0400)] 
chainlint.pl: recognize test bodies defined via heredoc

In order to check tests for semantic problems, chainlint.pl scans test
scripts, looking for tests defined as:

    test_expect_success [prereq] title '
        body
    '

where `body` is a single string which is then treated as a standalone
chunk of code and "linted" to detect semantic issues. (The same happens
for `test_expect_failure` definitions.)

The introduction of test definitions in which the test body is instead
presented via a heredoc rather than as a single string creates a blind
spot in the linting process since such invocations are not recognized by
chainlint.pl.

Prepare for this new style by also recognizing tests defined as:

    test_expect_success [prereq] title - <<\EOT
        body
    EOT

A minor complication is that chainlint.pl has never considered heredoc
bodies significant since it doesn't scan them for semantic problems,
thus it has always simply thrown them away. However, with the new
`test_expect_success` calling sequence, heredoc bodies become
meaningful, thus need to be captured.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: check line numbers in expected output
Jeff King [Wed, 10 Jul 2024 08:37:55 +0000 (04:37 -0400)] 
chainlint.pl: check line numbers in expected output

While working on chainlint.pl recently, we introduced some bugs that
showed incorrect line numbers in the output. But it was hard to notice,
since we sanitize the output by removing all of the line numbers! It
would be nice to retain these so we can catch any regressions.

The main reason we sanitize is for maintainability: we concatenate all
of the test snippets into a single file, so it's hard for each ".expect"
file to know at which offset its test input will be found. We can handle
that by storing the per-test line numbers in the ".expect" files, and
then dynamically offsetting them as we build the concatenated test and
expect files together.

The changes to the ".expect" files look like tedious boilerplate, but it
actually makes adding new tests easier. You can now just run:

  perl chainlint.pl chainlint/foo.test |
  tail -n +2 >chainlint/foo.expect

to save the output of the script minus the comment headers (after
checking that it is correct, of course). Whereas before you had to strip
the line numbers. The conversions here were done mechanically using
something like the script above, and then spot-checked manually.

It would be possible to do all of this in shell via the Makefile, but it
gets a bit complicated (and requires a lot of extra processes). Instead,
I've written a short perl script that generates the concatenated files
(we already depend on perl, since chainlint.pl uses it). Incidentally,
this improves a few other things:

  - we incorrectly used $(CHAINLINTTMP_SQ) inside a double-quoted
    string. So if your test directory required quoting, like:

       make "TEST_OUTPUT_DIRECTORY=/tmp/h'orrible"

    we'd fail the chainlint tests.

  - the shell in the Makefile didn't handle &&-chaining correctly in its
    loops (though in practice the "sed" and "cat" invocations are not
    likely to fail).

  - likewise, the sed invocation to strip numbers was hiding the exit
    code of chainlint.pl itself. In practice this isn't a big deal;
    since there are linter violations in the test files, we expect it to
    exit non-zero. But we could later use exit codes to distinguish
    serious errors from expected ones.

  - we now use a constant number of processes, instead of scaling with
    the number of test scripts. So it should be a little faster (on my
    machine, "make check-chainlint" goes from 133ms to 73ms).

There are some alternatives to this approach, but I think this is still
a good intermediate step:

  1. We could invoke chainlint.pl individually on each test file, and
     compare it to the expected output (and possibly using "make" to
     avoid repeating already-done checks). This is a much bigger change
     (and we'd have to figure out what to do with the "# LINT" lines in
     the inputs). But in this case we'd still want the "expect" files to
     be annotated with line numbers. So most of what's in this patch
     would be needed anyway.

  2. Likewise, we could run a single chainlint.pl and feed it all of the
     scripts (with "--jobs=1" to get deterministic output). But we'd
     still need to annotate the scripts as we did here, and we'd still
     need to either assemble the "expect" file, or break apart the
     script output to compare to each individual ".expect" file.

So we may pursue those in the long run, but this patch gives us more
robust tests without too much extra work or moving in a useless
direction.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: force CRLF conversion when opening input files
Jeff King [Wed, 10 Jul 2024 08:37:30 +0000 (04:37 -0400)] 
chainlint.pl: force CRLF conversion when opening input files

The lexer in chainlint.pl can't handle CRLF line endings; it complains
about an internal error in scan_token() if we see one. For example, in
our Windows CI environment:

  $ perl chainlint.pl chainlint/for-loop.test | cat -v
  Thread 2 terminated abnormally: internal error scanning character '^M'

This doesn't break "make check-chainlint" (yet), because we assemble a
concatenated input by passing the contents of each file through "sed".
And the "sed" we use will strip out the CRLFs. But the next patch is
going to rework this a bit, which does break check-chainlint on Windows.
Plus it's probably nicer to folks on Windows who might work on chainlint
itself and write new tests.

In theory we could fix the parser to handle this, but it's not really
worth the trouble. We should be able to ask the input layer to translate
the line endings for us. In fact, I'd expect this to happen by default,
as perl's documentation claims Win32 uses the ":unix:crlf" PERLIO layer
by default ("unix" here just refers to using read/write syscalls, and
then "crlf" layers the translation on top). However, this doesn't seem
to be the case in our Windows CI environment. I didn't dig into the
exact reason, but it is perhaps because we are using an msys build of
perl rather than a "true" Win32 build.

At any rate, it is easy-ish to just ask explicitly for the conversion.
In the above example, setting PERLIO=crlf in the environment is enough
to make it work. Curiously, though, this doesn't work when invoking
chainlint via "make". Again, I didn't dig into it, but it may have to do
with msys programs calling Windows programs or vice versa.

We can make it work consistently by just explicitly asking for CRLF
translation when we open the files. This will even work on non-Windows
platforms, though we wouldn't really expect to find CRLF files there.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: do not spawn more threads than we have scripts
Jeff King [Wed, 10 Jul 2024 08:35:57 +0000 (04:35 -0400)] 
chainlint.pl: do not spawn more threads than we have scripts

The chainlint.pl script spawns worker threads to check many scripts in
parallel. This is good if you feed it a lot of scripts. But if you give
it few (or one), then the overhead of spawning the threads dominates. We
can easily notice that we have fewer scripts than threads and scale back
as appropriate.

This patch reduces the time to run:

  time for i in chainlint/*.test; do
perl chainlint.pl $i
  done >/dev/null

on my system from ~4.1s to ~1.1s, where I have 8+8 cores.

As with the previous patch, this isn't the usual way we run chainlint
(we feed many scripts at once, which is why it supports threading in the
first place). So this won't make a big difference in the real world, but
it may help us out in the future, and it makes experimenting with and
debugging the chainlint tests a bit more pleasant.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: only start threads if jobs > 1
Jeff King [Wed, 10 Jul 2024 08:35:13 +0000 (04:35 -0400)] 
chainlint.pl: only start threads if jobs > 1

If the system supports threads, chainlint.pl will always spawn worker
threads to do the real work. But when --jobs=1, this is pointless, since
we could just do the work in the main thread. And spawning even a single
thread has a high overhead. For example, on my Linux system, running:

  for i in chainlint/*.test; do
perl chainlint.pl --jobs=1 $i
  done >/dev/null

takes ~1.7s without this patch, and ~1.1s after. We don't usually spawn
a bunch of individual chainlint.pl processes (instead we feed several
scripts at once, and the parallelism outweighs the setup cost). But it's
something we've considered doing, and since we already have fallback
code for systems without thread support, it's pretty easy to make this
work.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agochainlint.pl: add test_expect_success call to test snippets
Jeff King [Wed, 10 Jul 2024 08:34:48 +0000 (04:34 -0400)] 
chainlint.pl: add test_expect_success call to test snippets

The chainlint tests are a series of individual files, each holding a
test body. The "make check-chainlint" target assembles them into a
single file, adding a "test_expect_success" function call around each.
Let's instead include that function call in the files themselves. This
is a little more boilerplate, but has several advantages:

  1. You can now run chainlint manually on snippets with just "perl
     chainlint.perl chainlint/foo.test". This can make developing and
     debugging a little easier.

  2. Many of the tests implicitly relied on the syntax of the lines
     added by the Makefile (in particular the use of single-quotes).
     This assumption is much easier to see when the single-quotes are
     alongside the test body.

  3. We had no way to test how the chainlint program handled
     various test_expect_success lines themselves. Now we'll be able to
     check variations.

The change to the .test files was done mechanically, using the same
test names they would have been assigned by the Makefile (this is
important to match the expected output). The Makefile has the minimal
change to drop the extra lines; there are more cleanups possible but a
future patch in this series will rewrite this substantially anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agohttp.c: cookie file tightening
Junio C Hamano [Tue, 9 Jul 2024 23:03:48 +0000 (16:03 -0700)] 
http.c: cookie file tightening

The http.cookiefile configuration variable is used to call
curl_easy_setopt() to set CURLOPT_COOKIEFILE and if http.savecookies
is set, the same value is used for CURLOPT_COOKIEJAR.  The former is
used only to read cookies at startup, the latter is used to write
cookies at the end.

The manual pages https://curl.se/libcurl/c/CURLOPT_COOKIEFILE.html
and https://curl.se/libcurl/c/CURLOPT_COOKIEJAR.html talk about two
interesting special values.

 * "" (an empty string) given to CURLOPT_COOKIEFILE means not to
   read cookies from any file upon startup.

 * It is not specified what "" (an empty string) given to
   CURLOPT_COOKIEJAR does; presumably open a file whose name is an
   empty string and write cookies to it?  In any case, that is not
   what we want to see happen, ever.

 * "-" (a dash) given to CURLOPT_COOKIEFILE makes cURL read cookies
   from the standard input, and given to CURLOPT_COOKIEJAR makes
   cURL write cookies to the standard output.  Neither of which we
   want ever to happen.

So, let's make sure we avoid these nonsense cases.  Specifically,
when http.cookies is set to "-", ignore it with a warning, and when
it is set to "" and http.savecookies is set, ignore http.savecookies
with a warning.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agohttp: allow authenticating proactively
brian m. carlson [Wed, 10 Jul 2024 00:01:55 +0000 (00:01 +0000)] 
http: allow authenticating proactively

When making a request over HTTP(S), Git only sends authentication if it
receives a 401 response.  Thus, if a repository is open to the public
for reading, Git will typically never ask for authentication for fetches
and clones.

However, there may be times when a user would like to authenticate
nevertheless.  For example, a forge may give higher rate limits to users
who authenticate because they are easier to contact in case of excessive
use.  Or it may be useful for a known heavy user, such as an internal
service, to proactively authenticate so its use can be monitored and, if
necessary, throttled.

Let's make this possible with a new option, "http.proactiveAuth".  This
option specifies a type of authentication which can be used to
authenticate against the host in question.  This is necessary because we
lack the WWW-Authenticate header to provide us details; similarly, we
cannot accept certain types of authentication because we require
information from the server, such as a nonce or challenge, to
successfully authenticate.

If we're in auto mode and we got a username and password, set the
authentication scheme to Basic.  libcurl will not send authentication
proactively unless there's a single choice of allowed authentication,
and we know in this case we didn't get an authtype entry telling us what
scheme to use, or we would have taken a different codepath and written
the header ourselves.  In any event, of the other schemes that libcurl
supports, Digest and NTLM require a nonce or challenge, which means that
they cannot work with proactive auth, and GSSAPI does not use a username
and password at all, so Basic is the only logical choice among the
built-in options.

Note that the existing http_proactive_auth variable signifies proactive
auth if there are already credentials, which is different from the
functionality we're adding, which always seeks credentials even if none
are provided.  Nonetheless, t5540 tests the existing behavior for
WebDAV-based pushes to an open repository without credentials, so we
preserve it.  While at first this may seem an insecure and bizarre
decision, it may be that authentication is done with TLS certificates,
in which case it might actually provide a quite high level of security.
Expand the variable to use an enum to handle the additional cases and a
helper function to distinguish our new cases from the old ones.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agodoc: mention that proxies must be completely transparent
brian m. carlson [Tue, 9 Jul 2024 23:37:46 +0000 (23:37 +0000)] 
doc: mention that proxies must be completely transparent

We already document in the FAQ that proxies must be completely
transparent and not modify the request or response in any way, but add
similar documentation to the http.proxy entry.  We know that while the
FAQ is very useful, users sometimes are less likely to read in favor of
the documentation specific to an option or command, so adding it in both
places will help users be adequately informed.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agogitfaq: add entry about syncing working trees
brian m. carlson [Tue, 9 Jul 2024 23:37:45 +0000 (23:37 +0000)] 
gitfaq: add entry about syncing working trees

Users very commonly want to sync their working tree with uncommitted
changes across machines, often to carry across in-progress work or
stashes.  Despite this not being a recommended approach, users want to
do it and are not dissuaded by suggestions not to, so let's recommend a
sensible technique.

The technique that many users are using is their preferred cloud syncing
service, which is a bad idea.  Users have reported problems where they
end up with duplicate files that won't go away (with names like "file.c
2"), broken references, oddly named references that have date stamps
appended to them, missing objects, and general corruption and data loss.
That's because almost all of these tools sync file by file, which is a
great technique if your project is a single word processing document or
spreadsheet, but is utterly abysmal for Git repositories because they
don't necessarily snapshot the entire repository correctly.  They also
tend to sync the files immediately instead of when the repository is
quiescent, so writing multiple files, as occurs during a commit or a gc,
can confuse the tools and lead to corruption.

We know that the old standby, rsync, is up to the task, provided that
the repository is quiescent, so let's suggest that and dissuade people
from using cloud syncing tools.  Let's tell people about common things
they should be aware of before doing this and that this is still
potentially risky.  Additionally, let's tell people that Git's security
model does not permit sharing working trees across users in case they
planned to do that.  While we'd still prefer users didn't try to do
this, hopefully this will lead them in a safer direction.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agogitfaq: give advice on using eol attribute in gitattributes
brian m. carlson [Tue, 9 Jul 2024 23:37:44 +0000 (23:37 +0000)] 
gitfaq: give advice on using eol attribute in gitattributes

In the FAQ, we tell people how to use the text attribute, but we fail to
explain what to do with the eol attribute.  As we ourselves have
noticed, most shell implementations do not care for carriage returns,
and as such, people will practically always want them to use LF endings.
Similar things can be said for batch files on Windows, except with CRLF
endings.

Since these are common things to have in a repository, let's help users
make a good decision by recommending that they use the gitattributes
file to correctly check out the endings.

In addition, let's correct the cross-reference to this question, which
originally referred to "the following entry", even though a new entry
has been inserted in between.  The cross-reference notation should
prevent this from occurring and provide a link in formats, such as HTML,
which support that.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agogitfaq: add documentation on proxies
brian m. carlson [Tue, 9 Jul 2024 23:37:43 +0000 (23:37 +0000)] 
gitfaq: add documentation on proxies

Many corporate environments and local systems have proxies in use.  Note
the situations in which proxies can be used and how to configure them.
At the same time, note what standards a proxy must follow to work with
Git.  Explicitly call out certain classes that are known to routinely
have problems reported various places online, including in the Git for
Windows issue tracker and on Stack Overflow, and recommend against the
use of such software, noting that they are associated with myriad
security problems (including, for example, breaking sandboxing and image
integrity[0], and, for TLS middleboxes, the use of insecure protocols
and ciphers and lack of certificate verification[1]). Don't mention the
specific nature of these security problems in the FAQ entry because they
are extremely numerous and varied and we wish to keep the FAQ entry
relatively brief.

[0] https://issues.chromium.org/issues/40285192
[1] https://faculty.cc.gatech.edu/~mbailey/publications/ndss17_interception.pdf

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoci: unify bash calling convention
Junio C Hamano [Mon, 8 Jul 2024 22:52:11 +0000 (15:52 -0700)] 
ci: unify bash calling convention

Under ci/ hierarchy, we run scripts under either "sh" (any Bourne
compatible POSIX shell would work) or specifically "bash" (as they
require features from bash, e.g., ${parameter/pattern/string}
expansion).  As we have the CI environment under our control, we can
expect that /bin/sh will always be fine to run the scripts that only
require a Bourne shell, but we may not know where "bash" is
installed depending on the distro used.

So let's make sure we start these scripts with either one of these:

#!/bin/sh
#!/usr/bin/env bash

Yes, the latter has to assume that everybody installs "env" at that
path and not as /bin/env or /usr/local/bin/env, but this currently
is the best we could do.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoThe ninteenth batch
Junio C Hamano [Mon, 8 Jul 2024 21:25:44 +0000 (14:25 -0700)] 
The ninteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'ds/sparse-lstat-caching'
Junio C Hamano [Mon, 8 Jul 2024 21:53:11 +0000 (14:53 -0700)] 
Merge branch 'ds/sparse-lstat-caching'

The code to deal with modified paths that are out-of-cone in a
sparsely checked out working tree has been optimized.

* ds/sparse-lstat-caching:
  sparse-index: improve lstat caching of sparse paths
  sparse-index: count lstat() calls
  sparse-index: use strbuf in path_found()
  sparse-index: refactor path_found()
  sparse-checkout: refactor skip worktree retry logic

11 months agoMerge branch 'xx/bundie-uri-fixes'
Junio C Hamano [Mon, 8 Jul 2024 21:53:11 +0000 (14:53 -0700)] 
Merge branch 'xx/bundie-uri-fixes'

When bundleURI interface fetches multiple bundles, Git failed to
take full advantage of all bundles and ended up slurping duplicated
objects.

* xx/bundie-uri-fixes:
  unbundle: extend object verification for fetches
  fetch-pack: expose fsckObjects configuration logic
  bundle-uri: verify oid before writing refs

11 months agoMerge branch 'ps/leakfixes-more'
Junio C Hamano [Mon, 8 Jul 2024 21:53:10 +0000 (14:53 -0700)] 
Merge branch 'ps/leakfixes-more'

More memory leaks have been plugged.

* ps/leakfixes-more: (29 commits)
  builtin/blame: fix leaking ignore revs files
  builtin/blame: fix leaking prefixed paths
  blame: fix leaking data for blame scoreboards
  line-range: plug leaking find functions
  merge: fix leaking merge bases
  builtin/merge: fix leaking `struct cmdnames` in `get_strategy()`
  sequencer: fix memory leaks in `make_script_with_merges()`
  builtin/clone: plug leaking HEAD ref in `wanted_peer_refs()`
  apply: fix leaking string in `match_fragment()`
  sequencer: fix leaking string buffer in `commit_staged_changes()`
  commit: fix leaking parents when calling `commit_tree_extended()`
  config: fix leaking "core.notesref" variable
  rerere: fix various trivial leaks
  builtin/stash: fix leak in `show_stash()`
  revision: free diff options
  builtin/log: fix leaking commit list in git-cherry(1)
  merge-recursive: fix memory leak when finalizing merge
  builtin/merge-recursive: fix leaking object ID bases
  builtin/difftool: plug memory leaks in `run_dir_diff()`
  object-name: free leaking object contexts
  ...

11 months agoMerge branch 'tb/path-filter-fix'
Junio C Hamano [Mon, 8 Jul 2024 21:53:09 +0000 (14:53 -0700)] 
Merge branch 'tb/path-filter-fix'

The Bloom filter used for path limited history traversal was broken
on systems whose "char" is unsigned; update the implementation and
bump the format version to 2.

* tb/path-filter-fix:
  bloom: introduce `deinit_bloom_filters()`
  commit-graph: reuse existing Bloom filters where possible
  object.h: fix mis-aligned flag bits table
  commit-graph: new Bloom filter version that fixes murmur3
  commit-graph: unconditionally load Bloom filters
  bloom: prepare to discard incompatible Bloom filters
  bloom: annotate filters with hash version
  repo-settings: introduce commitgraph.changedPathsVersion
  t4216: test changed path filters with high bit paths
  t/helper/test-read-graph: implement `bloom-filters` mode
  bloom.h: make `load_bloom_filter_from_graph()` public
  t/helper/test-read-graph.c: extract `dump_graph_info()`
  gitformat-commit-graph: describe version 2 of BDAT
  commit-graph: ensure Bloom filters are read with consistent settings
  revision.c: consult Bloom filters for root commits
  t/t4216-log-bloom.sh: harden `test_bloom_filters_not_used()`

11 months agoMerge branch 'db/date-underflow-fix'
Junio C Hamano [Mon, 8 Jul 2024 21:53:09 +0000 (14:53 -0700)] 
Merge branch 'db/date-underflow-fix'

date parser updates to be more careful about underflowing epoch
based timestamp.

* db/date-underflow-fix:
  date: detect underflow/overflow when parsing dates with timezone offset
  t0006: simplify prerequisites

11 months agoMerge branch 'rj/pager-die-upon-exec-failure'
Junio C Hamano [Mon, 8 Jul 2024 21:53:08 +0000 (14:53 -0700)] 
Merge branch 'rj/pager-die-upon-exec-failure'

When GIT_PAGER failed to spawn, depending on the code path taken,
we failed immediately (correct) or just spew the payload to the
standard output (incorrect).  The code now always fail immediately
when GIT_PAGER fails.

* rj/pager-die-upon-exec-failure:
  pager: die when paging to non-existing command

11 months agoMerge branch 'ss/doc-eol-attr-fix'
Junio C Hamano [Mon, 8 Jul 2024 21:53:08 +0000 (14:53 -0700)] 
Merge branch 'ss/doc-eol-attr-fix'

Doc update.

* ss/doc-eol-attr-fix:
  doc: fix case error of eol attribute in example

11 months agoMerge branch 'jc/archive-prefix-with-add-virtual-file'
Junio C Hamano [Mon, 8 Jul 2024 21:53:07 +0000 (14:53 -0700)] 
Merge branch 'jc/archive-prefix-with-add-virtual-file'

"git archive --add-virtual-file=<path>:<contents>" never paid
attention to the --prefix=<prefix> option but the documentation
said it would. The documentation has been corrected.

* jc/archive-prefix-with-add-virtual-file:
  archive: document that --add-virtual-file takes full path

11 months agoadvice: warn when sparse index expands
Derrick Stolee [Mon, 8 Jul 2024 14:13:58 +0000 (14:13 +0000)] 
advice: warn when sparse index expands

Typically, forcing a sparse index to expand to a full index means that
Git could not determine the status of a file outside of the
sparse-checkout and needed to expand sparse trees into the full list of
sparse blobs. This operation can be very slow when the sparse-checkout
is much smaller than the full tree at HEAD.

When users are in this state, there is usually a modified or untracked
file outside of the sparse-checkout mentioned by the output of 'git
status'. There are a number of reasons why this is insufficient:

 1. Users may not have a full understanding of which files are inside or
    outside of their sparse-checkout. This is more common in monorepos
    that manage the sparse-checkout using custom tools that map build
    dependencies into sparse-checkout definitions.

 2. In some cases, an empty directory could exist outside the
    sparse-checkout and these empty directories are not reported by 'git
    status' and friends.

 3. If the user has '.gitignore' or 'exclude' files, then 'git status'
    will squelch the warnings and not demonstrate any problems.

In order to help users who are in this state, add a new advice message
to indicate that a sparse index is expanded to a full index. This
message should be written at most once per process, so add a static
global 'give_advice_on_expansion' to sparse-index.c. Further, there is a
case in 'git sparse-checkout set' that uses the sparse index as an
in-memory data structure (even when writing a full index) so we need to
disable the message in that kind of case.

The t1092-sparse-checkout-compatibility.sh test script compares the
behavior of several Git commands across full and sparse repositories,
including sparse repositories with and without a sparse index. We need
to disable the advice in the sparse-index repo to avoid differences in
stderr. By leaving the advice on in the sparse-checkout repo (without
the sparse index), we can test the behavior of disabling the advice in
convert_to_sparse(). (Indeed, these tests are how that necessity was
discovered.) Add a test that reenables the advice and demonstrates that
the message is output.

The advice message is defined outside of expand_index() to avoid super-
wide lines. It is also defined as a macro to avoid compile issues with
-Werror=format-security.

Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agodoc: fix the max number of branches shown by "show-branch"
Rikita Ishikawa [Mon, 8 Jul 2024 13:07:59 +0000 (13:07 +0000)] 
doc: fix the max number of branches shown by "show-branch"

The number to be displayed is calculated by the following defined in
object.h:

    #define REV_SHIFT        2
    #define MAX_REVS        (FLAG_BITS - REV_SHIFT)

FLAG_BITS is currently 28, so 26 is the correct number.

Signed-off-by: Rikita Ishikawa <lagrange.resolvent@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agogitweb: rss/atom change published/updated date to committer date
Jesús Ariel Cabello Mateos [Sun, 7 Jul 2024 18:48:13 +0000 (18:48 +0000)] 
gitweb: rss/atom change published/updated date to committer date

The author date is used for published/updated date in the rss/atom
feed stream.  Change it to the committer date that reflects the
"published/updated" definition better and makes rss/atom feeds more
linear.  Gitlab/Github rss/atom feeds use the committer date.

Additionally, to be consistent, also use the committer date to
determine the date of the last commit to send in the feed
instead of the author date.

Signed-off-by: Jesús Ariel Cabello Mateos <080ariel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge https://github.com/j6t/git-gui
Junio C Hamano [Mon, 8 Jul 2024 05:50:37 +0000 (22:50 -0700)] 
Merge https://github.com/j6t/git-gui

* https://github.com/j6t/git-gui:
  git-gui: fix inability to quit after closing another instance
  git-gui: sv.po: Update Swedish translation (576t0f0u)
  git-gui: note the new maintainer
  Makefile(s): do not enforce "all indents must be done with tab"
  Makefile(s): avoid recipe prefix in conditional statements
  doc: switch links to https
  doc: update links to current pages
  git-gui: po: fix typo in French "aperçu"

11 months agoMerge branch 'os/catch-rename'
Johannes Sixt [Sun, 7 Jul 2024 12:00:23 +0000 (14:00 +0200)] 
Merge branch 'os/catch-rename'

The problem can be reproduced on Linux with this sequence:

1. Run git gui from a terminal.
2. Edit the commit message and wait for at least 2 seconds.
3. Terminate the instance from the terminal, for example with Ctrl-C,
   to simulate crash. This leaves the file .git/GITGUI_BCK behind.
4. Start two instances of git gui &.

At this point the first instance can be closed (it renames
.git/GITGUI_BCK to .git/GITGUI_MSG), but the seconds brings an error
message about the absent file and cannot be closed thereafter and must
be killed from the command line.

The renaming that happens by the first instance is the correct action
and need not be repeated by the second instance. It is the correct
action to ignore the failed renaming.

On the other hand, the second instance could just edit the commit
message again, wait 2 seconds to write GITGUI_BCK, and then can be
closed without failing. At this point, since the user has edited the
message, it is again correct to preserve the edited version in
GITGUI_MSG.

* os/catch-rename:
  git-gui: fix inability to quit after closing another instance

11 months agoclang-format: include kh_foreach* macros in ForEachMacros
René Scharfe [Fri, 5 Jul 2024 19:25:43 +0000 (21:25 +0200)] 
clang-format: include kh_foreach* macros in ForEachMacros

The command for generating the list of ForEachMacros searches for
macros whose name contains the string "for_each".  Include those whose
name contains "foreach" as well.  That brings in kh_foreach and
kh_foreach_value from khash.h.

Regenerating the list also brings in hashmap-based macros added by
87571c3f71 (hashmap: use *_entry APIs for iteration, 2019-10-06),
f0e63c4113 (hashmap: use *_entry APIs to wrap container_of, 2019-10-06),
4fa1d501f7 (strmap: add functions facilitating use as a string->int map,
2020-11-05), b70c82e6ed (strmap: add more utility functions,
2020-11-05), and 1201eb628a (strmap: add a strset sub-type, 2020-11-06).

for_each_abbrev is no longer found because its definition was removed by
d850b7a545 (cocci: apply the "cache.h" part of "the_repository.pending",
2023-03-28).  Note that it had been a false positive, though, as it had
been a function wrapper, not a for-like macro.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoconfig.mak.dev: fix typo when enabling -Wpedantic
Taylor Blau [Fri, 5 Jul 2024 18:51:09 +0000 (14:51 -0400)] 
config.mak.dev: fix typo when enabling -Wpedantic

In ebd2e4a13a (Makefile: restrict -Wpedantic and -Wno-pedantic-ms-format
better, 2021-09-28), we tightened our Makefile's behavior to only enable
-Wpedantic when compiling with either gcc5/clang4 or greater as older
compiler versions did not have support for -Wpedantic.

Commit ebd2e4a13a was looking for either "gcc5" or "clang4" to appear in
the COMPILER_FEATURES variable, combining the two "$(filter ...)"
searches with an "$(or ...)".

But ebd2e4a13a has a typo where instead of writing:

    ifneq ($(or ($filter ...),$(filter ...)),)

we wrote:

    ifneq (($or ($filter ...),$(filter ...)),)

Causing our Makefile (when invoked with DEVELOPER=1, and a sufficiently
recent compiler version) to barf:

    $ make DEVELOPER=1
    config.mak.dev:13: extraneous text after 'ifneq' directive
    [...]

Correctly combine the results of the two "$(filter ...)" operations by
using "$(or ...)", not "$or".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agomerge-ort: fix missing early return
Elijah Newren [Thu, 4 Jul 2024 20:02:21 +0000 (20:02 +0000)] 
merge-ort: fix missing early return

One of the conversions in f19b9165 (merge-ort: convert more error()
cases to path_msg(), 2024-06-19) accidentally lost the early return.

Restore it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agot: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c
Ghanshyam Thakkar [Wed, 3 Jul 2024 06:29:53 +0000 (11:59 +0530)] 
t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c

helper/test-oidmap.c along with t0016-oidmap.sh test the oidmap.h
library which is built on top of hashmap.h.

Migrate them to the unit testing framework for better performance,
concise code and better debugging. Along with the migration also plug
memory leaks and make the test logic independent for all the tests.
The migration removes 'put' tests from t0016, because it is used as
setup to all the other tests, so testing it separately does not yield
any benefit.

Mentored-by: Christian Couder <chriscool@tuxfamily.org>
Mentored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Reviewed-by: Josh Steadmon <steadmon@google.com>
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agopush: avoid showing false negotiation errors
Junio C Hamano [Tue, 2 Jul 2024 19:57:47 +0000 (12:57 -0700)] 
push: avoid showing false negotiation errors

When "git push" is configured to use the push negotiation, a push of
deletion of a branch (without pushing anything else) may end up not
having anything to negotiate for the common ancestor discovery.

In such a case, we end up making an internal invocation of "git
fetch --negotiate-only" without any "--negotiate-tip" parameters
that stops the negotiate-only fetch from being run, which by itself
is not a bad thing (one fewer round-trip), but the end-user sees a
"fatal: --negotiate-only needs one or more --negotiation-tip=*"
message that the user cannot act upon.

Teach "git push" to notice the situation and omit performing the
negotiate-only fetch to begin with.  One fewer process spawned, one
fewer "alarming" message given the user.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoSync with 'maint'
Junio C Hamano [Tue, 2 Jul 2024 16:59:24 +0000 (09:59 -0700)] 
Sync with 'maint'

11 months agoThe eighteenth batch
Junio C Hamano [Tue, 2 Jul 2024 16:34:47 +0000 (09:34 -0700)] 
The eighteenth batch

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 months agoMerge branch 'rs/diff-color-moved-w-no-ext-diff-fix'
Junio C Hamano [Tue, 2 Jul 2024 16:59:02 +0000 (09:59 -0700)] 
Merge branch 'rs/diff-color-moved-w-no-ext-diff-fix'

"git diff --no-ext-diff" when diff.external is configured ignored
the "--color-moved" option.

* rs/diff-color-moved-w-no-ext-diff-fix:
  diff: allow --color-moved with --no-ext-diff

11 months agoMerge branch 'ew/object-convert-leakfix'
Junio C Hamano [Tue, 2 Jul 2024 16:59:01 +0000 (09:59 -0700)] 
Merge branch 'ew/object-convert-leakfix'

Leakfix.

* ew/object-convert-leakfix:
  object-file: fix leak on conversion failure

11 months agoMerge branch 'jk/remote-wo-url'
Junio C Hamano [Tue, 2 Jul 2024 16:59:01 +0000 (09:59 -0700)] 
Merge branch 'jk/remote-wo-url'

Memory ownership rules for the in-core representation of
remote.*.url configuration values have been straightened out, which
resulted in a few leak fixes and code clarification.

* jk/remote-wo-url:
  remote: drop checks for zero-url case
  remote: always require at least one url in a remote
  t5801: test remote.*.vcs config
  t5801: make remote-testgit GIT_DIR setup more robust
  remote: allow resetting url list
  config: document remote.*.url/pushurl interaction
  remote: simplify url/pushurl selection
  remote: use strvecs to store remote url/pushurl
  remote: transfer ownership of memory in add_url(), etc
  remote: refactor alias_url() memory ownership
  archive: fix check for missing url

11 months agoMerge branch 'jc/fuzz-sans-curl'
Junio C Hamano [Tue, 2 Jul 2024 16:59:01 +0000 (09:59 -0700)] 
Merge branch 'jc/fuzz-sans-curl'

CI job to build minimum fuzzers learned to pass NO_CURL=NoThanks to
the build procedure, as its build environment does not offer, or
the rest of the build needs, anything cURL.

* jc/fuzz-sans-curl:
  fuzz: minimum fuzzers environment lacks libcURL