Commit Graph

75114 Commits

Author SHA1 Message Date
Patrick Steinhardt
dd6003f200 t6006: fix prereq handling with test_format ()
In df383b5842 (t/test-lib: wire up NO_ICONV prerequisite, 2024-10-16) we
have introduced a new NO_ICONV prerequisite that makes us skip tests in
case Git is not compiled with support for iconv. This change subtly
broke t6006: while the test suite still passes, some of its tests won't
execute because they run into an error.

    ./t6006-rev-list-format.sh: line 92: test_expect_%e: command not found

The broken tests use `test_format ()`, and the mentioned commit simply
prepended the new prerequisite to its arguments. But that does not work,
as the function is not aware of prereqs at all and will now treat all of
its arguments incorrectly.

Fix this by making the function aware of prereqs by accepting an
optional fourth argument. Adapt the callsites accordingly.

Reported-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-28 13:44:38 -04:00
Patrick Steinhardt
80ebd91b83 http: fix build error on FreeBSD
The `result` parameter passed to `http_request_reauth()` may either
point to a `struct strbuf` or a `FILE *`, where the `target` parameter
tells us which of either it actually is. To accommodate for both types
the pointer is a `void *`, which we then pass directly to functions
without doing a cast.

This is fine on most platforms, but it breaks on FreeBSD because
`fileno()` is implemented as a macro that tries to directly access the
`FILE *` structure.

Fix this issue by storing the `FILE *` in a local variable before we
pass it on to other functions.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
87ad2a9d56 builtin/credential-cache: fix missing parameter for stub function
When not compiling the credential cache we may use a stub function for
`cmd_credential_cache()`. With commit 9b1cb5070f (builtin: add a
repository parameter for builtin functions, 2024-09-13), we have added a
new parameter to all of those top-level `cmd_*()` functions, and did
indeed adapt the non-stubbed-out `cmd_credential_cache()`. But we didn't
adapt the stubbed-out variant, so the code does not compile.

Fix this by adding the missing parameter.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
bb0d76dbf7 t7300: work around platform-specific behaviour with long paths on MinGW
Windows by default has a restriction in place to only allow paths up to
260 characters. This restriction can nowadays be lifted by setting a
registry key, but is still active by default.

In t7300 we have one test that exercises the behaviour of git-clean(1)
with such long paths. Interestingly enough, this test fails on my system
that uses Windows 10 with mingw-w64 installed via MSYS2: instead of
observing ENAMETOOLONG, we observe ENOENT. This behaviour is consistent
across multiple different environments I have tried.

I cannot say why exactly we observe a different error here, but I would
not be surprised if this was either dependent on the Windows version,
the version of MinGW, the current working directory of Git or any kind
of combination of these.

Work around the issue by handling both errors.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
5f8af25ff9 t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin
Parsing repositories which contain '[::1]' is broken on Cygwin. It seems
as if Cygwin is confusing those as drive letter prefixes or something
like this, but I couldn't deduce the actual root cause.

Mark those tests as broken for now.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
f74949fa3d t3404: work around platform-specific behaviour on macOS 10.15
Two of our tests in t3404 use indented HERE docs where leading tabs on
some of the lines are actually relevant. The tabs do get removed though,
and we try to fix this up by using sed(1) to replace leading tabs in the
actual output, as well. But macOS 10.15 uses an oldish version of sed(1)
that has BSD lineage, which does not understand "\t", and thus we fail
to strip those leading tabs and fail the test.

Address this issue by using `q_to_tab` such that we do not have to strip
leading tabs from the actual output.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
3acb1f7199 t1401: make invocation of tar(1) work with Win32-provided one
Windows nowadays provides a tar(1) binary in "C:\Windows\system32". This
version of tar(1) doesn't seem to handle the case where directory paths
end with a trailing forward slash. And as we do that in t1401 the result
is that the test fails.

Drop the trailing slash. Other tests that use tar(1) work alright, this
is the only instance where it has been failing.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
b4b77ea280 t/lib-gpg: fix setup of GNUPGHOME in MinGW
In "t/lib-gpg.sh" we set up the "GNUPGHOME" environment variable to
point to a test-specific directory. This is done by using "$PWD/gpghome"
as value, where "$PWD" is the current test's trash directory.

This is broken for MinGW though because "$PWD" will use Windows-style
paths that contain drive letters. What we really want in this context is
a Unix-style path, which we can get by using `$(pwd)` instead. It is
somewhat puzzling that nobody ever hit this issue, but it may easily be
that nobody ever tests on Windows with GnuPG installed, which would make
us skip those tests.

Adapt the code accordingly to fix tests using this library.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
6b1f9e9c8c t/lib-gitweb: test against the build version of gitweb
When testing gitweb we set up the CGI script as "gitweb.perl", which is
the source file of the build target "gitweb.cgi". This file doesn't have
a patched shebang and still contains `++REPLACEMENT++` markers, but
things generally work because we replace the configuration with our own
test configuration.

But this only works as long as "$GIT_BUILD_DIR" actually points to the
source tree, because "gitweb.cgi" and "gitweb.perl" happen to sit next
to each other. This is not the case though once you have out-of-tree
builds like with CMake, where the source and built versions live in
different directories. Consequently, "$GIT_BUILD_DIR/gitweb/gitweb.perl"
won't exist there.

While we could ask build systems with out-of-tree builds to instead set
up GITWEB_TEST_INSTALLED, which allows us to override the location of
the script, it goes against the spirit of this environment variable. We
_don't_ want to test against an installed version, we want to use the
version we have just built.

Fix this by using "gitweb.cgi" instead. This means that you cannot run
test scripts without building that file, but in general we do expect
developers to build stuff before they test it anyway.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
df383b5842 t/test-lib: wire up NO_ICONV prerequisite
The iconv library is used by Git to reencode files, commit messages and
other things. As such it is a rather integral part, but given that many
platforms nowadays use UTF-8 everywhere you can live without support for
reencoding in many situations. It is thus optional to build Git with
iconv, and some of our platforms wired up in "config.mak.uname" disable
it. But while we support building without it, running our test suite
with "NO_ICONV=Yes" causes many test failures.

Wire up a new test prerequisite ICONV that gets populated via our
GIT-BUILD-OPTIONS. Annotate failing tests accordingly.

Note that this commit does not do a deep dive into every single test to
assess whether the failure is expected or not. Most of the tests do
smell like the expected kind of failure though.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Patrick Steinhardt
ed7634ebcc t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE
When assembling our LSAN_OPTIONS that configure the leak sanitizer we
end up prepending the string with various different colon-separated
options via calls to `prepend_var`. One of the settings we add is the
path where the sanitizer should store logs, which can be an arbitrary
filesystem path.

Naturally, filesystem paths may contain whitespace characters. And while
it does seem as if we were quoting the value, we use escaped quotes and
consequently split up the value if it does contain spaces. This leads to
the following error in t0000 when having a value with whitespaces:

    .../t/test-lib.sh: eval: line 64: unexpected EOF while looking for matching `"'
    ++ return 1
    error: last command exited with $?=1
    not ok 5 - subtest: 3 passing tests

The error itself is a bit puzzling at first. The basic problem is that
the code sees the leading escaped quote during eval, but because we
truncate everything after the space character it doesn't see the
trailing escaped quote and thus fails to parse the string.

Properly quote the value to fix the issue while using single-quotes to
quote the inner value passed to eval. The issue can be reproduced by
t0000 with such a path that contains spaces.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
2024-10-16 17:00:49 -04:00
Junio C Hamano
ef8ce8f3d4 Start the 2.48 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-10-10 14:22:30 -07:00
Junio C Hamano
3eb4cc451e Merge branch 'jk/output-prefix-cleanup'
Code clean-up.

* jk/output-prefix-cleanup:
  diff: store graph prefix buf in git_graph struct
  diff: return line_prefix directly when possible
  diff: return const char from output_prefix callback
  diff: drop line_prefix_length field
  line-log: use diff_line_prefix() instead of custom helper
2024-10-10 14:22:30 -07:00
Junio C Hamano
31bc4454de Merge branch 'ps/leakfixes-part-8'
More leakfixes.

* ps/leakfixes-part-8: (23 commits)
  builtin/send-pack: fix leaking list of push options
  remote: fix leaking push reports
  t/helper: fix leaks in proc-receive helper
  pack-write: fix return parameter of `write_rev_file_order()`
  revision: fix leaking saved parents
  revision: fix memory leaks when rewriting parents
  midx-write: fix leaking buffer
  pack-bitmap-write: fix leaking OID array
  pseudo-merge: fix leaking strmap keys
  pseudo-merge: fix various memory leaks
  line-log: fix several memory leaks
  diff: improve lifecycle management of diff queues
  builtin/revert: fix leaking `gpg_sign` and `strategy` config
  t/helper: fix leaking repository in partial-clone helper
  builtin/clone: fix leaking repo state when cloning with bundle URIs
  builtin/pack-redundant: fix various memory leaks
  builtin/stash: fix leaking `pathspec_from_file`
  submodule: fix leaking submodule entry list
  wt-status: fix leaking buffer with sparse directories
  shell: fix leaking strings
  ...
2024-10-10 14:22:29 -07:00
Junio C Hamano
d29d644d18 Merge branch 'ds/line-log-asan-fix'
Use after free and double freeing at the end in "git log -L... -p"
had been identified and fixed.

* ds/line-log-asan-fix:
  line-log: protect inner strbuf from free
2024-10-10 14:22:27 -07:00
Junio C Hamano
e29296745d Merge branch 'sk/doc-maintenance-schedule'
Doc update to clarify how periodical maintenance are scheduled,
spread across time to avoid thundering hurds.

* sk/doc-maintenance-schedule:
  doc: add a note about staggering of maintenance
2024-10-10 14:22:26 -07:00
Junio C Hamano
325772f0d5 Merge branch 'tb/notes-amlog-doc'
Document "amlog" notes.

* tb/notes-amlog-doc:
  Documentation: mention the amlog in howto/maintain-git.txt
2024-10-10 14:22:25 -07:00
Junio C Hamano
5575c713c2 Merge branch 'ps/reftable-alloc-failures'
The reftable library is now prepared to expect that the memory
allocation function given to it may fail to allocate and to deal
with such an error.

* ps/reftable-alloc-failures: (26 commits)
  reftable/basics: fix segfault when growing `names` array fails
  reftable/basics: ban standard allocator functions
  reftable: introduce `REFTABLE_FREE_AND_NULL()`
  reftable: fix calls to free(3P)
  reftable: handle trivial allocation failures
  reftable/tree: handle allocation failures
  reftable/pq: handle allocation failures when adding entries
  reftable/block: handle allocation failures
  reftable/blocksource: handle allocation failures
  reftable/iter: handle allocation failures when creating indexed table iter
  reftable/stack: handle allocation failures in auto compaction
  reftable/stack: handle allocation failures in `stack_compact_range()`
  reftable/stack: handle allocation failures in `reftable_new_stack()`
  reftable/stack: handle allocation failures on reload
  reftable/reader: handle allocation failures in `reader_init_iter()`
  reftable/reader: handle allocation failures for unindexed reader
  reftable/merged: handle allocation failures in `merged_table_init_iter()`
  reftable/writer: handle allocation failures in `reftable_new_writer()`
  reftable/writer: handle allocation failures in `writer_index_hash()`
  reftable/record: handle allocation failures when decoding records
  ...
2024-10-10 14:22:25 -07:00
Junio C Hamano
799450316b Merge branch 'ja/doc-synopsis-markup'
The way AsciiDoc is used for SYNOPSIS part of the manual pages has
been revamped.  The sources, at least for the simple cases, got
vastly pleasant to work with.

* ja/doc-synopsis-markup:
  doc: apply synopsis simplification on git-clone and git-init
  doc: update the guidelines to reflect the current formatting rules
  doc: introduce a synopsis typesetting
2024-10-10 14:22:24 -07:00
Junio C Hamano
777489f9e0 Git 2.47
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-10-06 15:56:06 -07:00
Junio C Hamano
5c97f7ba5c l10n-2.47.0-rnd2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE37vMEzKDqYvVxs51k24VDd1FMtUFAmcCD90ACgkQk24VDd1F
 MtVEzw//Q5cfCdENqI3+sgkY6vYmpaO4xhGsjDPXz9BB7w/gAhQ63s4ZcppL38bG
 MOsHfRRpyh2wNoMN+apwAqv6huYIhQdrfaI7HjSRiA6RiQXxEFhNdIr4dqF+RlV5
 wwfQ3ePFtHmQg+Ys6KkZOBVDgWjoX8IbRmsZJGIdA/30z9jeQtgwm76vlIA/M0ll
 UbJz+L2TRjngei6IiHKb8k+3N6ERrsh9yELsVVDeBks6XjCZ4acLqEgcCzIWMXDS
 dLse7is2J4momeBpCr4maHVZyoFBFbNHfqoxqEgwIq80TZSltPo/KUW/jX3Vfq+0
 2pBH8CWsetwA0dT7wfLFDY01IAgs6nvFsI/Ahe1vk0H4Nne0/PM9OTOj8+EiTKtr
 biWx968Xy/7szZT8v1iZuhA9Ku1DdUiIpH1ybqNMVzzMCBG8UzZaGS90bCuZEg4A
 GOGPH5KtutAyK/FdRGqVVkLBT2KBQvmDXbdWCDR9Ct82mXRaDQJ7QW+6ucbH7OJB
 X9YgiakCmNaoWMaLl4BhOHoX2UESk+FzLudbltU4QmFwHPr7tV9jKEz3H8QWaMLQ
 lB3mACJ1ks0CZmq/kTwrV3s0rOT22YiNLktpYjVN0Id7vEFLWc0nBq4DjqX4VI67
 l6s25Ugj893/9K93XRFtYLlow4jdRCof6UE+lqtXXAwSR6YpBUQ=
 =LYel
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.47.0-rnd2' of https://github.com/git-l10n/git-po

l10n-2.47.0-rnd2

* tag 'l10n-2.47.0-rnd2' of https://github.com/git-l10n/git-po:
  l10n: Update German translation
  l10n: bg.po: Updated Bulgarian translation (5772t)
  l10n: vi: Updated translation for 2.47
  l10n: zh_TW: Git 2.47
  l10n: new lead for Catalan translation
  l10n: Update Catalan translation
  l10n: fr.po: 2.47.0
  l10n: zh_CN: updated translation for 2.47
  l10n: po-id for 2.47
  l10n: tr: Update Turkish translations for 2.47.0
  l10n: sv.po: Update Swedish translation
2024-10-06 11:14:12 -07:00
Jiang Xin
81e7bd6151 Merge branch 'l10n-de-2.47' of github.com:ralfth/git
* 'l10n-de-2.47' of github.com:ralfth/git:
  l10n: Update German translation
2024-10-06 12:06:21 +08:00
Jiang Xin
dde6096b16 Merge branch 'master' of github.com:alshopov/git-po
* 'master' of github.com:alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (5772t)
2024-10-06 12:04:11 +08:00
Jiang Xin
93d2fa651f Merge branch 'catalan-247' of github.com:Softcatala/git-po
* 'catalan-247' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation
2024-10-06 12:03:46 +08:00
Jiang Xin
be0bd9669d Merge branch 'new-catalan-maintainer' of github.com:Softcatala/git-po
* 'new-catalan-maintainer' of github.com:Softcatala/git-po:
  l10n: new lead for Catalan translation
2024-10-06 12:03:08 +08:00
Jiang Xin
498f8cb54c Merge branch 'l10n/zh-TW/2024-10-05' of github.com:l10n-tw/git-po
* 'l10n/zh-TW/2024-10-05' of github.com:l10n-tw/git-po:
  l10n: zh_TW: Git 2.47
2024-10-06 11:39:29 +08:00
Jiang Xin
c1b5fb0f01 Merge branch 'tl/zh_CN_2.47.0_rnd' of github.com:dyrone/git
* 'tl/zh_CN_2.47.0_rnd' of github.com:dyrone/git:
  l10n: zh_CN: updated translation for 2.47
2024-10-06 11:39:03 +08:00
Jiang Xin
1ff21bff12 Merge branch 'master' of github.com:nafmo/git-l10n-sv
* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation
2024-10-06 11:38:15 +08:00
Jiang Xin
fc49119c03 Merge branch 'fr_2.47.0_rnd1' of github.com:jnavila/git
* 'fr_2.47.0_rnd1' of github.com:jnavila/git:
  l10n: fr.po: 2.47.0
2024-10-06 11:37:56 +08:00
Jiang Xin
3a19f2d4fc Merge branch 'vi-2.47' of github.com:Nekosha/git-po
* 'vi-2.47' of github.com:Nekosha/git-po:
  l10n: vi: Updated translation for 2.47
2024-10-06 11:35:59 +08:00
Jiang Xin
770ea7bee7 Merge branch 'po-id' of github.com:bagasme/git-po
* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.47
2024-10-06 11:35:06 +08:00
Ralf Thielow
f4110efbc3 l10n: Update German translation
Reviewed-by: Matthias Rüster <matthias.ruester@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2024-10-05 19:28:19 +02:00
Alexander Shopov
d6aa1da141 l10n: bg.po: Updated Bulgarian translation (5772t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2024-10-05 13:21:30 +02:00
Vũ Tiến Hưng
365a7ed9bd l10n: vi: Updated translation for 2.47
Signed-off-by: Vũ Tiến Hưng <newcomerminecraft@gmail.com>
2024-10-05 17:23:48 +07:00
Yi-Jyun Pan
507b364f44
l10n: zh_TW: Git 2.47
Co-authored-by: Lumynous <lumynou5.tw@gmail.com>
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2024-10-05 15:47:12 +08:00
Jordi Mas
52d4a65070 l10n: new lead for Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2024-10-05 09:26:43 +02:00
Jordi Mas
cd0ef8b6e3 l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2024-10-05 09:19:18 +02:00
Junio C Hamano
90fe3800b9 Mostly there for 2.47 final
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-10-04 14:21:44 -07:00
Junio C Hamano
2ab53b59ef Merge branch 'kn/osx-fsmonitor-with-submodules-fix'
macOS with fsmonitor daemon can hang forever when a submodule is
involved, which has been corrected.

* kn/osx-fsmonitor-with-submodules-fix:
  fsmonitor OSX: fix hangs for submodules
2024-10-04 14:21:43 -07:00
Junio C Hamano
bffc417e7c Merge branch 'ak/doc-typofix'
Typofixes.

* ak/doc-typofix:
  Documentation: fix typos
  Documentation/config: fix typos
2024-10-04 14:21:43 -07:00
Junio C Hamano
68ac04ad85 Merge branch 'tb/weak-sha1-for-tail-sum'
Build fix.

* tb/weak-sha1-for-tail-sum:
  hash.h: set NEEDS_CLONE_HELPER_UNSAFE in fallback mode
2024-10-04 14:21:42 -07:00
Junio C Hamano
b1c6ed40cd Merge branch 'ps/reftable-concurrent-writes'
Test fix.

* ps/reftable-concurrent-writes:
  t0610: work around flaky test with concurrent writers
2024-10-04 14:21:42 -07:00
Junio C Hamano
d30c2c4c53 Merge branch 'mh/w-unused-fix'
Buildfix.

* mh/w-unused-fix:
  utf8.h: squelch unused-parameter warnings with NO_ICONV
2024-10-04 14:21:41 -07:00
Junio C Hamano
12841c449c Merge branch 'rs/archive-with-attr-pathspec-fix'
Message update.

* rs/archive-with-attr-pathspec-fix:
  archive: fix misleading error message
2024-10-04 14:21:40 -07:00
Junio C Hamano
4861bbf85a Merge branch 'ak/typofix-2.46-maint'
Typofixes.

* ak/typofix-2.46-maint:
  perl: fix a typo
  mergetool: fix a typo
  reftable: fix a typo
  trace2: fix typos
2024-10-04 14:21:40 -07:00
Jean-Noël Avila
5187f2b738 l10n: fr.po: 2.47.0
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2024-10-04 23:04:55 +02:00
Teng Long
5d5cd454e9 l10n: zh_CN: updated translation for 2.47
Signed-off-by: Teng Long <dyroneteng@gmail.com>
2024-10-05 03:32:47 +08:00
Junio C Hamano
8895aca996 A bit more after 2.47-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-10-04 10:14:07 -07:00
Junio C Hamano
b4efdfe165 Merge branch 'ds/read-cache-mempool-leakfix'
Leakfix.

* ds/read-cache-mempool-leakfix:
  read-cache: free threaded memory pool
2024-10-04 10:14:07 -07:00
Junio C Hamano
b9b995e371 Merge branch 'jc/doc-discarding-stalled-topics'
Document that inactive topics are subject to be discarded.

* jc/doc-discarding-stalled-topics:
  howto-maintain-git: discarding inactive topics
2024-10-04 10:14:07 -07:00