Commit graph

65098 commits

Author SHA1 Message Date
Peter Krefting
f776897d4f l10n: sv.po: Update Swedish translation (5210t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2021-11-04 20:44:36 +01:00
Junio C Hamano
88d915a634 A few fixes before -rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-04 12:24:46 -07:00
Junio C Hamano
9cc14a5b5d Sync with maint 2021-11-04 12:24:40 -07:00
Junio C Hamano
5fbd2fc599 Merge branch 'vd/pthread-setspecific-g11-fix' into maint
One CI task based on Fedora image noticed a not-quite-kosher
consturct recently, which has been corrected.

* vd/pthread-setspecific-g11-fix:
  async_die_is_recursing: work around GCC v11.x issue on Fedora
2021-11-04 12:24:20 -07:00
Junio C Hamano
494cb27e57 Merge branch 'ma/doc-git-version' into maint
Typofix.

* ma/doc-git-version:
  git.txt: fix typo
2021-11-04 12:22:10 -07:00
Junio C Hamano
ecb8d9d11e Merge branch 'pw/rebase-r-fixes' into maint
Regression fix.

* pw/rebase-r-fixes:
  rebase -i: fix rewording with --committer-date-is-author-date
2021-11-04 12:20:14 -07:00
Junio C Hamano
99c7db563f Merge branch 'jk/log-warn-on-bogus-encoding' into maint
Squelch over-eager warning message added during this cycle.

* jk/log-warn-on-bogus-encoding:
  log: document --encoding behavior on iconv() failure
  Revert "logmsg_reencode(): warn when iconv() fails"
2021-11-04 12:20:13 -07:00
Junio C Hamano
a73934c320 Merge branch 'vd/pthread-setspecific-g11-fix'
One CI task based on Fedora image noticed a not-quite-kosher
consturct recently, which has been corrected.

* vd/pthread-setspecific-g11-fix:
  async_die_is_recursing: work around GCC v11.x issue on Fedora
2021-11-04 12:07:47 -07:00
Junio C Hamano
ada03fcbeb Merge branch 'rd/http-backend-code-simplification'
Code simplification.

* rd/http-backend-code-simplification:
  http-backend: remove a duplicated code branch
2021-11-04 12:07:46 -07:00
Junio C Hamano
2b647089ba Merge branch 'ar/no-verify-doc'
Doc update.

* ar/no-verify-doc:
  Document positive variant of commit and merge option "--no-verify"
2021-11-04 12:07:46 -07:00
Junio C Hamano
a876f0b95c Merge branch 'ar/fix-git-pull-no-verify'
"git pull --no-verify" did not affect the underlying "git merge".

* ar/fix-git-pull-no-verify:
  pull: honor --no-verify and do not call the commit-msg hook
2021-11-04 12:07:46 -07:00
Fangyi Zhou
84bf71eae7
l10n: zh_CN: 2.34.0 Round 2
Signed-off-by: Fangyi Zhou <me@fangyi.io>
2021-11-04 11:02:05 +00:00
Emir Sarı
e4fa191d02 l10n: tr: v2.34.0 round 2
Signed-off-by: Emir Sarı <bitigchi@me.com>
2021-11-04 13:19:12 +03:00
Victoria Dye
4b540cf913 async_die_is_recursing: work around GCC v11.x issue on Fedora
This fix corrects an issue found in the `dockerized(pedantic, fedora)` CI
build, first appearing after the introduction of a new version of the Fedora
docker image version. This image includes a version of `glibc` with the
attribute `__attr_access_none` added to `pthread_setspecific` [1], the
implementation of which only exists for GCC 11.X - the version included in
the Fedora image. The attribute requires that the pointer provided in the
second argument of `pthread_getspecific` must, if not NULL, be a pointer to
a valid object. In the usage in `async_die_is_recursing`, `(void *)1` is not
valid, causing the error.

This fix imitates a workaround added in SELinux [2] by using the pointer to
the static `async_die_counter` itself as the second argument to
`pthread_setspecific`. This guaranteed non-NULL, valid pointer matches the
intent of the current usage while not triggering the build error.

[1] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=a1561c3bbe8
[2] https://lore.kernel.org/all/20211021140519.6593-1-cgzones@googlemail.com/

Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Victoria Dye <vdye@github.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 23:12:10 -07:00
Jiang Xin
492288c70a l10n: git.pot: v2.34.0 round 2 (3 new, 3 removed)
Generate po/git.pot from v2.34.0-rc1 for git v2.34.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2021-11-04 08:35:51 +08:00
Jiang Xin
bbf1932c30 Merge branch 'master' of github.com:git/git
* 'master' of github.com:git/git:
  Git 2.34-rc1
  rebase -i: fix rewording with --committer-date-is-author-date
  dir: fix directory-matching bug
  gpg-interface: avoid buffer overrun in parse_ssh_output()
  gpg-interface: handle missing " with " gracefully in parse_ssh_output()
  A few more topics before -rc1
  i18n: fix typos found during l10n for git 2.34.0
  t5310: drop lib-bundle.sh include
  format-patch (doc): clarify --base=auto
  gc: perform incremental repack when implictly enabled
  fsck: verify multi-pack-index when implictly enabled
  fsck: verify commit graph when implicitly enabled
  grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data
  commit-graph: don't consider "replace" objects with "verify"
  commit-graph tests: fix another graph_git_two_modes() helper
  commit-graph tests: fix error-hiding graph_git_two_modes() helper
  pretty: colorize pattern matches in commit messages
  grep: refactor next_match() and match_one_pattern() for external use
2021-11-04 08:34:15 +08:00
Jiang Xin
66e6babac6 Merge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po
* 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po:
  l10n: zh-CN: v2.34.0 round 1
2021-11-04 08:23:26 +08:00
Junio C Hamano
876b142331 Git 2.34-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 13:32:40 -07:00
Junio C Hamano
0cb1330bc6 Merge branch 'pw/rebase-r-fixes'
Regression fix.

* pw/rebase-r-fixes:
  rebase -i: fix rewording with --committer-date-is-author-date
2021-11-03 13:32:29 -07:00
Junio C Hamano
36f0a2e20f Merge branch 'ds/add-rm-with-sparse-index'
Regression fix.

* ds/add-rm-with-sparse-index:
  dir: fix directory-matching bug
2021-11-03 13:32:28 -07:00
Junio C Hamano
e2a33ef9e2 Merge branch 'jx/message-fixes'
Fixes to recently added messages.

* jx/message-fixes:
  i18n: fix typos found during l10n for git 2.34.0
2021-11-03 13:32:28 -07:00
Junio C Hamano
e890c845b8 Merge branch 'rs/ssh-signing-fix'
Fixes to recently merged topic.

* rs/ssh-signing-fix:
  gpg-interface: avoid buffer overrun in parse_ssh_output()
  gpg-interface: handle missing " with " gracefully in parse_ssh_output()
2021-11-03 13:32:28 -07:00
Matt Cooper
596b5e77c9 clean/smudge: allow clean filters to process extremely large files
The filter system allows for alterations to file contents when they're
moved between the database and the worktree. We already made sure that
it is possible for smudge filters to produce contents that are larger
than `unsigned long` can represent (which matters on systems where
`unsigned long` is narrower than `size_t`, most notably 64-bit Windows).
Now we make sure that clean filters can _consume_ contents that are
larger than that.

Note that this commit only allows clean filters' _input_ to be larger
than can be represented by `unsigned long`.

This change makes only a very minute dent into the much larger project
to teach Git to use `size_t` instead of `unsigned long` wherever
appropriate.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Matt Cooper <vtbassmatt@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:27 -07:00
Matt Cooper
d6a09e795d odb: guard against data loss checking out a huge file
This introduces an additional guard for platforms where `unsigned long`
and `size_t` are not of the same size. If the size of an object in the
database would overflow `unsigned long`, instead we now exit with an
error.

A complete fix will have to update _many_ other functions throughout the
codebase to use `size_t` instead of `unsigned long`. It will have to be
implemented at some stage.

This commit puts in a stop-gap for the time being.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Matt Cooper <vtbassmatt@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:27 -07:00
Johannes Schindelin
e2ffeae3f6 git-compat-util: introduce more size_t helpers
We will use them in the next commit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:27 -07:00
Matt Cooper
e9aa762cc7 odb: teach read_blob_entry to use size_t
There is mixed use of size_t and unsigned long to deal with sizes in the
codebase. Recall that Windows defines unsigned long as 32 bits even on
64-bit platforms, meaning that converting size_t to unsigned long narrows
the range. This mostly doesn't cause a problem since Git rarely deals
with files larger than 2^32 bytes.

But adjunct systems such as Git LFS, which use smudge/clean filters to
keep huge files out of the repository, may have huge file contents passed
through some of the functions in entry.c and convert.c. On Windows, this
results in a truncated file being written to the workdir. I traced this to
one specific use of unsigned long in write_entry (and a similar instance
in write_pc_item_to_fd for parallel checkout). That appeared to be for
the call to read_blob_entry, which expects a pointer to unsigned long.

By altering the signature of read_blob_entry to expect a size_t,
write_entry can be switched to use size_t internally (which all of its
callers and most of its callees already used). To avoid touching dozens of
additional files, read_blob_entry uses a local unsigned long to call a
chain of functions which aren't prepared to accept size_t.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Matt Cooper <vtbassmatt@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:27 -07:00
Matt Cooper
b79541af7a t1051: introduce a smudge filter test for extremely large files
The filter system allows for alterations to file contents when they're
added to the database or working tree. ("Smudge" when moving to the
working tree; "clean" when moving to the database.) This is used
natively to handle CRLF to LF conversions. It's also employed by Git-LFS
to replace large files from the working tree with small tracking files
in the repo and vice versa.

Git reads the entire smudged file into memory to convert it into a
"clean" form to be used in-core. While this is inefficient, there's a
more insidious problem on some platforms due to inconsistency between
using unsigned long and size_t for the same type of data (size of a file
in bytes). On most 64-bit platforms, unsigned long is 64 bits, and
size_t is typedef'd to unsigned long. On Windows, however, unsigned long
is only 32 bits (and therefore on 64-bit Windows, size_t is typedef'd to
unsigned long long in order to be 64 bits).

Practically speaking, this means 64-bit Windows users of Git-LFS can't
handle files larger than 2^32 bytes. Other 64-bit platforms don't suffer
this limitation.

This commit introduces a test exposing the issue; future commits make it
pass. The test simulates the way Git-LFS works by having a tiny file
checked into the repository and expanding it to a huge file on checkout.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Matt Cooper <vtbassmatt@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:27 -07:00
Carlo Marcelo Arenas Belón
970fa57f76 test-lib: add prerequisite for 64-bit platforms
Allow tests that assume a 64-bit `size_t` to be skipped in 32-bit
platforms and regardless of the size of `long`.

This imitates the `LONG_IS_64BIT` prerequisite.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:26 -07:00
Johannes Schindelin
df7000cd91 test-tool genzeros: generate large amounts of data more efficiently
In this developer's tests, producing one gigabyte worth of NULs in a
busy loop that writes out individual bytes, unbuffered, took ~27sec.
Writing chunked 256kB buffers instead only took ~0.6sec

This matters because we are about to introduce a pair of test cases that
want to be able to produce 5GB of NULs, and we cannot use `/dev/zero`
because of the HP NonStop platform's lack of support for that device.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:26 -07:00
Carlo Marcelo Arenas Belón
cbc985a1f4 test-genzeros: allow more than 2G zeros in Windows
d5cfd142ec (tests: teach the test-tool to generate NUL bytes and
use it, 2019-02-14), add a way to generate zeroes in a portable
way without using /dev/zero (needed by HP NonStop), but uses a
long variable that is limited to 2^31 in Windows.

Use instead a (POSIX/C99) intmax_t that is at least 64bit wide
in 64-bit Windows to use in a future test.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 11:22:26 -07:00
Phillip Wood
9d6b9df128 rebase -i: fix rewording with --committer-date-is-author-date
baf8ec8d3a (rebase -r: don't write .git/MERGE_MSG when
fast-forwarding, 2021-08-20) stopped reading the author script in
run_git_commit() when rewording a commit. This is normally safe
because "git commit --amend" preserves the authorship. However if the
user passes "--committer-date-is-author-date" then we need to read the
author date from the author script when rewording. Fix this regression
by tightening the check for when it is safe to skip reading the author
script.

Reported-by: Jonas Kittner <jonas.kittner@ruhr-uni-bochum.de>
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 10:44:45 -07:00
Derrick Stolee
5ceb663e92 dir: fix directory-matching bug
This reverts the change from ed49584 (dir: fix pattern matching on dirs,
2021-09-24), which claimed to fix a directory-matching problem without a
test case. It turns out to _create_ a bug, but it is a bit subtle.

The bug would have been revealed by the first of two tests being added to
t0008-ignores.sh. The first uses a pattern "/git/" inside the a/.gitignores
file, which matches against 'a/git/foo' but not 'a/git-foo/bar'. This test
would fail before the revert.

The second test shows what happens if the test instead uses a pattern "git/"
and this test passes both before and after the revert.

The difference in these two cases are due to how
last_matching_pattern_from_list() checks patterns both if they have the
PATTERN_FLAG_MUSTBEDIR and PATTERN_FLAG_NODIR flags. In the case of "git/",
the PATTERN_FLAG_NODIR is also provided, making the change in behavior in
match_pathname() not affect the end result of
last_matching_pattern_from_list().

Reported-by: Glen Choo <chooglen@google.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-03 10:10:36 -07:00
Arusekk
6b53a80441 l10n: pl: Update translation
Signed-off-by: Arusekk <arek_koz@o2.pl>
2021-11-03 16:05:00 +01:00
Fangyi Zhou
7e6630a76d
l10n: zh-CN: v2.34.0 round 1
Reviewed-by: 依云 <lilydjwg@gmail.com>
Reviewed-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
2021-11-02 18:04:10 +00:00
René Scharfe
65db97b4fa gpg-interface: avoid buffer overrun in parse_ssh_output()
If the string "key" we found in the output of ssh-keygen happens to be
located at the very end of the line, then going four characters further
leaves us beyond the end of the string.  Explicitly search for the
space after "key" to handle a missing one gracefully.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-01 17:00:41 -07:00
René Scharfe
18b18503e3 gpg-interface: handle missing " with " gracefully in parse_ssh_output()
If the output of ssh-keygen starts with "Good \"git\" signature for ",
but is not followed by " with " for some reason, then parse_ssh_output()
uses -1 as the len parameter of xmemdupz(), which in turn will end the
program.  Reject the signature and carry on instead in that case.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-01 17:00:41 -07:00
Junio C Hamano
0cddd84c9f A few more topics before -rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-11-01 13:48:08 -07:00
Junio C Hamano
cfd86ee3dd Merge branch 'ab/test-lib'
Test (cosmetic) fix.

* ab/test-lib:
  t5310: drop lib-bundle.sh include
2021-11-01 13:48:08 -07:00
Junio C Hamano
7baf6588c5 Merge branch 'jc/doc-format-patch-clarify-auto-base'
Rephrase the description of "format-patch --base=auto".

* jc/doc-format-patch-clarify-auto-base:
  format-patch (doc): clarify --base=auto
2021-11-01 13:48:08 -07:00
Junio C Hamano
7afb458e91 Merge branch 'gc/use-repo-settings'
It is wrong to read some settings directly from the config
subsystem, as things like feature.experimental can affect their
default values.

* gc/use-repo-settings:
  gc: perform incremental repack when implictly enabled
  fsck: verify multi-pack-index when implictly enabled
  fsck: verify commit graph when implicitly enabled
2021-11-01 13:48:08 -07:00
Junio C Hamano
b82299ec6f Merge branch 'ab/ignore-replace-while-working-on-commit-graph'
Teach "git commit-graph" command not to allow using replace objects
at all, as we do not use the commit-graph at runtime when we see
object replacement.

* ab/ignore-replace-while-working-on-commit-graph:
  commit-graph: don't consider "replace" objects with "verify"
  commit-graph tests: fix another graph_git_two_modes() helper
  commit-graph tests: fix error-hiding graph_git_two_modes() helper
2021-11-01 13:48:08 -07:00
Junio C Hamano
b93d720691 Merge branch 'hm/paint-hits-in-log-grep'
"git log --grep=string --author=name" learns to highlight hits just
like "git grep string" does.

* hm/paint-hits-in-log-grep:
  grep/pcre2: fix an edge case concerning ascii patterns and UTF-8 data
  pretty: colorize pattern matches in commit messages
  grep: refactor next_match() and match_one_pattern() for external use
2021-11-01 13:48:08 -07:00
Daniel Santos
42b297fe8c l10n: pt_PT: cleaning duplicate translations (#2)
* cleaning duplicate incorrect translations part 2
 * update translation table
 * unfuzzy all entries
 * typos check in git commands and git flags
 * random line translations
 * updating all phrases #1

Signed-off-by: Daniel Santos <daniel@brilhante.top>
2021-11-01 15:53:00 +00:00
Bagas Sanjaya
c0a8212802 l10n: po-id for 2.34 (round 1)
Update following components:
  * add-interactive.c
  * add-patch.c
  * diff.c
  * gc.c
  * builtin/bisect--helper.c
  * builtin/commit.c
  * builtin/fetch.c
  * builtin/merge.c
  * builtin/rebase.c
  * builtin/pull.c
  * builtin/push.c
  * builtin/submodule--helper.c

Translate following new components:
  * apply.c
  * bundle.c
  * git.c
  * git-send-email.perl
  * rerere.c
  * builtin/am.c
  * builtin/apply.c
  * builtin/archive.c
  * builtin/bundle.c
  * builtin/cat-file.c
  * builtin/commit-tree.c
  * builtin/count-objects.c
  * builtin/difftool.c
  * builtin/fast-export.c
  * builtin/fast-import.c
  * builtin/fetch-pack.c
  * builtin/fsck.c
  * builtin/gc.c
  * builtin/hash-object.c
  * builtin/ls-files.c
  * builtin/ls-remote.c
  * builtin/ls-tree.c
  * builtin/read-tree.c
  * builtin/receive-pack.c
  * builtin/reflog.c
  * builtin/repack.c
  * builtin/rev-list.c
  * builtin/rev-parse.c
  * builtin/send-pack.c
  * builtin/symbolic-ref.c
  * builtin/update-index.c
  * builtin/update-ref.c
  * builtin/upload-pack.c
  * builtin/verify-pack.c
  * builtin/verify-commit.c
  * builtin/verify-tag.c
  * builtin/write-tree.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
2021-11-01 17:58:04 +07:00
Jiang Xin
f733719316 i18n: fix typos found during l10n for git 2.34.0
Emir and Jean-Noël reported typos in some i18n messages when preparing
l10n for git 2.34.0.

* Fix unstable spelling of config variable "gpg.ssh.defaultKeyCommand"
  which was introduced in commit fd9e226776 (ssh signing: retrieve a
  default key from ssh-agent, 2021-09-10).

* Add missing space between "with" and "--python" which was introduced
  in commit bd0708c7eb (ref-filter: add %(raw) atom, 2021-07-26).

* Fix unmatched single quote in 'builtin/index-pack.c' which was
  introduced in commit 8737dab346 (index-pack: refactor renaming in
  final(), 2021-09-09)

[1] https://github.com/git-l10n/git-po/pull/567

Reported-by: Emir Sarı <bitigchi@me.com>
Reported-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-10-31 22:49:49 -07:00
Jiang Xin
235233a394 Merge branch 'fr_2.34.0_rnd1' of github.com:jnavila/git
* 'fr_2.34.0_rnd1' of github.com:jnavila/git:
  l10n: fr v2.34.0 rnd1
2021-11-01 09:49:18 +08:00
Jean-Noël Avila
d01af2568e l10n: fr v2.34.0 rnd1
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2021-10-31 17:48:23 +01:00
Emir Sarı
5650c37365 l10n: tr: v2.34.0 round 1
Signed-off-by: Emir Sarı <bitigchi@me.com>
2021-10-30 21:07:51 +03:00
Jordi Mas
d00296a8bf l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2021-10-30 09:54:25 +02:00
Jiang Xin
1f511a9b56 l10n: git.pot: v2.34.0 round 1 (134 new, 154 removed)
Generate po/git.pot from v2.34.0-rc0 for git v2.34.0 l10n round 1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2021-10-30 09:37:04 +08:00