https://github.com/git/git

sort by:
Revision Author Date Message Commit Date
89bece5 Git 2.35 Signed-off-by: Junio C Hamano <gitster@pobox.com> 24 January 2022, 17:25:25 UTC
c6e19e4 Merge branch 'ab/checkout-branch-info-leakfix' We added an unrelated sanity checking that leads to a BUG() while plugging a leak, which triggered in a repository with symrefs in the local branch namespace that point at a ref outside. Partially revert the change to avoid triggering the BUG(). * ab/checkout-branch-info-leakfix: checkout: avoid BUG() when hitting a broken repository 24 January 2022, 17:14:46 UTC
7ea759c Merge tag 'l10n-2.35.0-rnd2' of git://github.com/git-l10n/git-po l10n-2.35.0-rnd2 * tag 'l10n-2.35.0-rnd2' of git://github.com/git-l10n/git-po: l10n: Update Catalan translation l10n: zh_TW: v2.35.0 round 2 (0 untranslated) l10n: Update Catalan translation l10n: de.po: Update German translation l10n: de.po: Fix translation for "'%s' is aliased to '%s'" l10n: po-id for 2.35 (round 2) l10n: Update Catalan translation l10n: vi(5195t): Update for v2.35.0 round 2 l10n: batch update to fix typo in branch.c l10n: git.pot: v2.35.0 round 2 (1 new, 1 removed) l10n: bg.po: Updated Bulgarian translation (5195t) l10n: zh_CN: v2.35.0 round 1 l10n: fr: v2.35.0 round 1 l10n: zh_TW: v2.35.0 round 1 (1 fuzzy) l10n: po-id for 2.35 (round 1) l10n: sv.po: Update Swedish translation (5196t0f0u) l10n: sv.po: Fix typo l10n: tr: v2.35.0 round 1 l10n: git.pot: v2.35.0 round 1 (126 new, 142 removed) 24 January 2022, 17:09:34 UTC
9e2b35d l10n: Update Catalan translation Signed-off-by: Jordi Mas <jmas@softcatala.org> 23 January 2022, 08:40:52 UTC
0fff4ea Merge branch 'l10n/zh_TW/220113' of github.com:l10n-tw/git-po * 'l10n/zh_TW/220113' of github.com:l10n-tw/git-po: l10n: zh_TW: v2.35.0 round 2 (0 untranslated) l10n: zh_TW: v2.35.0 round 1 (1 fuzzy) 22 January 2022, 08:27:41 UTC
519947b checkout: avoid BUG() when hitting a broken repository When 9081a421 (checkout: fix "branch info" memory leaks, 2021-11-16) cleaned up existing memory leaks, we added an unrelated sanity check to ensure that a local branch is truly local and not a symref to elsewhere that dies with BUG() otherwise. This was misguided in two ways. First of all, such a tightening did not belong to a leak-fix patch. And the condition it detected was *not* a bug in our program but a problem in user data, where warning() or die() would have been more appropriate. As the condition is not fatal (the result of computing the local branch name in the code that is involved in the faulty check is only used as a textual label for the commit), let's revert the code to the original state, i.e. strip "refs/heads/" to compute the local branch name if possible, and otherwise leave it NULL. The consumer of the information in merge_working_tree() is prepared to see NULL in there and act accordingly. cf. https://bugzilla.redhat.com/show_bug.cgi?id=2042920 Reported-by: Petr Šplíchal <psplicha@redhat.com> Reported-by: Todd Zullinger <tmz@pobox.com> Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 22 January 2022, 01:04:50 UTC
8795330 l10n: zh_TW: v2.35.0 round 2 (0 untranslated) Used 1 translation from zh_CN. Thanks to zh_CN translation team! Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com> 21 January 2022, 23:10:43 UTC
b3d4896 l10n: Update Catalan translation Signed-off-by: Jordi Mas <jmas@softcatala.org> 21 January 2022, 06:56:02 UTC
297ca89 Merge branch 'js/branch-track-inherit' "git branch -h" incorrectly said "--track[=direct|inherit]", implying that "--trackinherit" is a valid option, which has been corrected. source: <3de40324bea6a1dd9bca2654721471e3809e87d8.1642538935.git.steadmon@google.com> source: <c3c26192-aee9-185a-e559-b8735139e49c@web.de> * js/branch-track-inherit: branch,checkout: fix --track documentation 20 January 2022, 23:25:38 UTC
6327f0e branch,checkout: fix --track documentation Document that the accepted variants of the --track option are --track, --track=direct, and --track=inherit. The equal sign in the latter two cannot be replaced with whitespace; in general optional arguments need to be attached firmly to their option. Put "direct" consistently before "inherit", if only for the reasons that the former is the default, explained first in the documentation, and comes before the latter alphabetically. Mention both modes in the short help so that readers don't have to look them up in the full documentation. They are literal strings and thus untranslatable. PARSE_OPT_LITERAL_ARGHELP is inferred due to the pipe and parenthesis characters, so we don't have to provide that flag explicitly. Mention that -t has the same effect as --track and --track=direct. There is no way to specify inherit mode using the short option, because short options generally don't accept optional arguments. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> 20 January 2022, 19:07:51 UTC
159af2a l10n: de.po: Update German translation Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com> Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com> 20 January 2022, 17:23:36 UTC
ea0fca8 l10n: de.po: Fix translation for "'%s' is aliased to '%s'" The German translation for "'%s' is aliased to '%s'" is incorrect. It switches the order of alias name and alias definition. A better translation would be "'%s' ist ein Alias für '%s'". (Full stop removed intentionally, because the original does not use one either.) Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com> 20 January 2022, 17:11:37 UTC
7ff31e1 Merge branch 'po-id' of github.com:bagasme/git-po * 'po-id' of github.com:bagasme/git-po: l10n: po-id for 2.35 (round 2) 20 January 2022, 02:40:08 UTC
50b2d72 Git 2.35-rc2 Signed-off-by: Junio C Hamano <gitster@pobox.com> 19 January 2022, 20:48:46 UTC
e2724c1 getcwd(mingw): handle the case when there is no cwd A recent upstream topic introduced checks for certain Git commands that prevent them from deleting the current working directory, introducing also a regression test that ensures that commands such as `git version` _can_ run without a current working directory. While technically not possible on Windows via the regular Win32 API, we do run the regression tests in an MSYS2 Bash which uses a POSIX emulation layer (the MSYS2/Cygwin runtime) where a really evil hack _does_ allow to delete a directory even if it is the current working directory. Therefore, Git needs to be prepared for a missing working directory, even on Windows. This issue was not noticed in upstream Git because there was no caller that tried to discover a Git directory with a deleted current working directory in the test suite. But in the microsoft/git fork, we do want to run `pre-command`/`post-command` hooks for every command, even for `git version`, which means that we make precisely such a call. The bug is not in that `pre-command`/`post-command` feature, though, but in `mingw_getcwd()` and needs to be addressed there. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> 19 January 2022, 19:27:31 UTC
80dabf9 l10n: po-id for 2.35 (round 2) Translate following new components: * advice.c * alias.c * sequencer.c * sparse-index.c * builtin/sparse-checkout.c Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> 19 January 2022, 10:59:41 UTC
0f8f20f l10n: Update Catalan translation Signed-off-by: Jordi Mas <jmas@softcatala.org> 19 January 2022, 06:56:01 UTC
af4e5f5 Merge branch 'js/branch-track-inherit' "git branch -h" incorrectly said "--track[=direct|inherit]", implying that "--trackinherit" is a valid option, which has been corrected. * js/branch-track-inherit: branch,checkout: fix --track usage strings 19 January 2022, 00:02:23 UTC
0330edb Merge branch 'jc/freebsd-without-c99-only-build' FreeBSD 13.0 headers have unconditional dependency on C11 language features, and adding -std=gnu99 to DEVELOPER_CFLAGS would just break the developer build. * jc/freebsd-without-c99-only-build: Makefile: FreeBSD cannot do C99-or-below build 19 January 2022, 00:02:23 UTC
15f0028 branch,checkout: fix --track usage strings As Ævar pointed out in [1], the use of PARSE_OPT_LITERAL_ARGHELP with a list of allowed parameters is not recommended. Both git-branch and git-checkout were changed in d311566 (branch: add flags and config to inherit tracking, 2021-12-20) to use this discouraged combination for their --track flags. Fix this by removing PARSE_OPT_LITERAL_ARGHELP, and changing the arghelp to simply be "mode". Users may discover allowed values in the manual pages. [1]: https://lore.kernel.org/git/220111.86a6g3yqf9.gmgdl@evledraar.gmail.com/ Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 18 January 2022, 22:08:15 UTC
2b95d94 Makefile: FreeBSD cannot do C99-or-below build In "make DEVELOPER=YesPlease" builds, we try to help developers to catch as many potential issues as they can by using -Wall and turning compilation warnings into errors. In the same spirit, we recently started adding -std=gnu99 to their CFLAGS, so that they can notice when they accidentally used language features beyond C99. It however turns out that FreeBSD 13.0 mistakenly uses C11 extension in its system header files regardless of what __STDC_VERSION__ says, which means that the platform (unless we tweak their system headers) cannot be used for this purpose. It seems that -std=gnu99 is only added conditionally even in today's config.mak.dev, so it is fine if we dropped -std=gnu99 from there. Which means that developers on FreeBSD cannot participate in vetting use of features beyond C99, but there are developers on other platforms who will, so it's not too bad. We might want a more "fundamental" fix to make the platform capable of taking -std=gnu99, like working around the use of unconditional C11 extension in its system header files by supplying a set of "replacement" definitions in our header files. We chose not to pursue such an approach for two reasons at this point: (1) The fix belongs to the FreeBSD project, not this project, and such an upstream fix may happen hopefully in a not-too-distant future. (2) Fixing such a bug in system header files and working it around can lead to unexpected breakages (other parts of their system header files may not be expecting to see and do not work well with our "replacement" definitions). This close to the final release of this cycle, we have no time for that. Signed-off-by: Junio C Hamano <gitster@pobox.com> 18 January 2022, 20:16:23 UTC
b56bd95 Merge branch 'da/rhel7-lacks-uncompress2-and-c99' Adjust build on RHEL 7 to explicitly ask C99 support and use the fallback implementation of uncompress2 we ship. * da/rhel7-lacks-uncompress2-and-c99: build: centos/RHEL 7 ships with an older gcc and zlib 17 January 2022, 23:15:59 UTC
6bcc4e2 l10n: vi(5195t): Update for v2.35.0 round 2 Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com> 17 January 2022, 07:15:31 UTC
ee27abd l10n: batch update to fix typo in branch.c In git 2.35 l10n round 1, a space between two words was missing in the message from "branch.c", and it was fixed by commit 68d924e1de (branch: missing space fix at line 313, 2022-01-11). Do a batch update for teams (bg, fr, id, sv, tr and zh_CN) that have already completed their works on l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> 17 January 2022, 00:58:49 UTC
fe7f7ad l10n: git.pot: v2.35.0 round 2 (1 new, 1 removed) Generate po/git.pot from v2.35.0-rc1 for git v2.35.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> 17 January 2022, 00:32:09 UTC
90999dd Merge tag 'v2.35.0-rc1' Git 2.35-rc1 * tag 'v2.35.0-rc1': Git 2.35-rc1 reftable tests: avoid "int" overflow, use "uint64_t" reftable: avoid initializing structs from structs t1450-fsck: exec-bit is not needed to make loose object writable refs API: use "failure_errno", not "errno" Last minute fixes before -rc1 build: NonStop ships with an older zlib packfile: fix off-by-one error in decoding logic t/gpg: simplify test for unknown key branch: missing space fix at line 313 fmt-merge-msg: prevent use-after-free with signed tags cache.h: drop duplicate `ensure_full_index()` declaration lazyload: use correct calling conventions fetch: fix deadlock when cleaning up lockfiles in async signals 17 January 2022, 00:30:45 UTC
ffb9f29 build: centos/RHEL 7 ships with an older gcc and zlib GCC 4.8.5 is the default system compiler on centos7/RHEL7. This version requires -std=c99 to enable c99 support. zlib 1.2.7 on centos7/rhel7 lacks uncompress2(). Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 16 January 2022, 22:18:17 UTC
c8464a3 l10n: bg.po: Updated Bulgarian translation (5195t) Signed-off-by: Alexander Shopov <ash@kambanaria.org> 16 January 2022, 09:51:37 UTC
df3c41a Git 2.35-rc1 Signed-off-by: Junio C Hamano <gitster@pobox.com> 14 January 2022, 23:26:53 UTC
36b6571 Merge branch 'js/t1450-making-it-writable-does-not-need-full-posixperm' Test fix. * js/t1450-making-it-writable-does-not-need-full-posixperm: t1450-fsck: exec-bit is not needed to make loose object writable 14 January 2022, 23:25:15 UTC
9a329bd Merge branch 'ab/reftable-build-fixes' A few portability tweaks. * ab/reftable-build-fixes: reftable tests: avoid "int" overflow, use "uint64_t" reftable: avoid initializing structs from structs 14 January 2022, 23:25:15 UTC
31e3912 Merge branch 'ab/refs-errno-cleanup' A brown-paper-bag fix on top of a topic that was merged during this cycle. * ab/refs-errno-cleanup: refs API: use "failure_errno", not "errno" 14 January 2022, 23:25:15 UTC
22d2f70 reftable tests: avoid "int" overflow, use "uint64_t" Change code added in 1ae2b8cda84 (reftable: add merged table view, 2021-10-07) to consistently use the "uint64_t" type. These "min" and "max" variables get passed in the body of this function to a function whose prototype is: [...] reftable_writer_set_limits([...], uint64_t min, uint64_t max This avoids the following warning on SunCC 12.5 on gcc211.fsffrance.org: "reftable/merged_test.c", line 27: warning: initializer does not fit or is out of range: 0xffffffff Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 13 January 2022, 21:39:09 UTC
f2b2551 reftable: avoid initializing structs from structs Apparently, the IBM xlc compiler doesn't like this. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 13 January 2022, 21:36:34 UTC
5906910 t1450-fsck: exec-bit is not needed to make loose object writable A test case wants to append stuff to a loose object file to ensure that this kind of corruption is detected. To make a read-only loose object file writable with chmod, it is not necessary to also make it executable. Replace the bitmask 755 with the instruction +w to request only the write bit and to also heed the umask. And get rid of a POSIXPERM prerequisite, which is unnecessary for the test. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> 13 January 2022, 20:36:12 UTC
cac15b3 refs API: use "failure_errno", not "errno" Fix a logic error in refs_resolve_ref_unsafe() introduced in a recent series of mine to abstract the refs API away from errno. See 96f6623ada0 (Merge branch 'ab/refs-errno-cleanup', 2021-11-29)for that series. In that series introduction of "failure_errno" to refs_resolve_ref_unsafe came in ef18119dec8 (refs API: add a version of refs_resolve_ref_unsafe() with "errno", 2021-10-16). There we'd set "errno = 0" immediately before refs_read_raw_ref(), and then set "failure_errno" to "errno" if errno was non-zero afterwards. Then in the next commit 8b72fea7e91 (refs API: make refs_read_raw_ref() not set errno, 2021-10-16) we started expecting "refs_read_raw_ref()" to set "failure_errno". It would do that if refs_read_raw_ref() failed, but it wouldn't be the same errno. So we might set the "errno" here to any arbitrary bad value, and end up e.g. returning NULL when we meant to return the refname from refs_resolve_ref_unsafe(), or the other way around. Instrumenting this code will reveal cases where refs_read_raw_ref() will fail, and "errno" and "failure_errno" will be set to different values. In practice I haven't found a case where this scary bug changed anything in practice. The reason for that is that we'll not care about the actual value of "errno" here per-se, but only whether: 1. We have an errno 2. If it's one of ENOENT, EISDIR or ENOTDIR. See the adjacent code added in a1c1d8170db (refs_resolve_ref_unsafe: handle d/f conflicts for writes, 2017-10-06) I.e. if we clobber "failure_errno" with "errno", but it happened to be one of those three, and we'll clobber it with another one of the three we were OK. Perhaps there are cases where the difference ended up mattering, but I haven't found them. Instrumenting the test suite to fail if "errno" and "failure_errno" are different shows a lot of failures, checking if they're different *and* one is but not the other is outside that list of three "errno" values yields no failures. But let's fix the obvious bug. We should just stop paying attention to "errno" in refs_resolve_ref_unsafe(). In addition let's change the partial resetting of "errno" in files_read_raw_ref() to happen just before the "return", to ensure that any such bug will be more easily spotted in the future. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 13 January 2022, 18:53:54 UTC
65387fd l10n: zh_CN: v2.35.0 round 1 - Translate new messages - Translate the word 'cone' instead of leaving it verbatim (in the context of sparse checkout) - Make translations of 'failed to' consistent Signed-off-by: Fangyi Zhou <me@fangyi.io> Reviewed-by: Teng Long <dyroneteng@gmail.com> Reviewed-by: 依云 <lilydjwg@gmail.com> Reviewed-by: Jiang Xin <worldhello.net@gmail.com> 13 January 2022, 13:15:04 UTC
14a38ad Merge branch 'fr_2.35.0_rnd1' of github.com:jnavila/git * 'fr_2.35.0_rnd1' of github.com:jnavila/git: l10n: fr: v2.35.0 round 1 13 January 2022, 01:11:17 UTC
1ffcbaa Last minute fixes before -rc1 Signed-off-by: Junio C Hamano <gitster@pobox.com> 13 January 2022, 00:27:08 UTC
12f82b0 Merge branch 'ps/lockfile-cleanup-fix' Some lockfile code called free() in signal-death code path, which has been corrected. * ps/lockfile-cleanup-fix: fetch: fix deadlock when cleaning up lockfiles in async signals 12 January 2022, 23:11:43 UTC
453cef7 Merge branch 'ma/header-dup-cleanup' Code clean-up. * ma/header-dup-cleanup: cache.h: drop duplicate `ensure_full_index()` declaration 12 January 2022, 23:11:43 UTC
83ca082 Merge branch 'fs/gpg-unknown-key-test-fix' Test simplification. * fs/gpg-unknown-key-test-fix: t/gpg: simplify test for unknown key 12 January 2022, 23:11:42 UTC
2a72807 Merge branch 'ak/protect-any-current-branch' * ak/protect-any-current-branch: branch: missing space fix at line 313 12 January 2022, 23:11:41 UTC
c9c0828 Merge branch 'jt/pack-header-lshift-overflow' * jt/pack-header-lshift-overflow: packfile: fix off-by-one error in decoding logic 12 January 2022, 23:11:41 UTC
4e2e2a4 Merge branch 'rb/nonstop-lacks-uncompress2' * rb/nonstop-lacks-uncompress2: build: NonStop ships with an older zlib 12 January 2022, 23:11:41 UTC
a4510f8 Merge branch 'ma/windows-dynload-fix' Fix calling dynamically loaded functions on Windows. * ma/windows-dynload-fix: lazyload: use correct calling conventions 12 January 2022, 23:11:41 UTC
cde28af Merge branch 'fs/ssh-signing-key-lifetime' "git merge $signed_tag" started to drop the tag message from the default merge message it uses by accident, which has been corrected. * fs/ssh-signing-key-lifetime: fmt-merge-msg: prevent use-after-free with signed tags 12 January 2022, 23:11:41 UTC
68d1da4 build: NonStop ships with an older zlib Notably, it lacks uncompress2(); use the fallback we ship in our tree instead. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 12 January 2022, 20:17:29 UTC
a5c97b0 packfile: fix off-by-one error in decoding logic shift count being exactly at 7-bit smaller than the long is OK; on 32-bit architecture, shift count starts at 4 and goes through 11, 18 and 25, at which point the guard triggers one iteration too early. Reported-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 12 January 2022, 20:14:49 UTC
e1e1de0 l10n: fr: v2.35.0 round 1 Signed-off-by: Jean-Noël Avila <jn.avila@free.fr> 12 January 2022, 20:14:45 UTC
0517f59 t/gpg: simplify test for unknown key To test for a key that is completely unknown to the keyring we need one to sign the commit with. This was done by generating a new key and not add it into the keyring. To avoid the key generation overhead and problems where GPG did hang in CI during it, switch GNUPGHOME to the empty $GNUPGHOME_NOT_USED instead, therefore making all used keys unknown for this single `verify-commit` call. Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Reviewed-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 12 January 2022, 19:21:22 UTC
68d924e branch: missing space fix at line 313 The message introduced by commit 593a2a5d06 (branch: protect branches checked out in all worktrees, 2021-12-01) is missing a space in the first line, add it. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 12 January 2022, 18:52:52 UTC
cb57f25 l10n: zh_TW: v2.35.0 round 1 (1 fuzzy) Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com> 12 January 2022, 17:10:46 UTC
4b1fd48 l10n: po-id for 2.35 (round 1) Update following components: * apply.c * branch.c * builtin/add.c * builtin/am.c * builtin/fetch.c * builtin/ls-files.c * builtin/stash.c Translate following new components: * archive-tar.c * archive-zip.c Also clean up obsolete translations. Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com> 12 January 2022, 11:16:47 UTC
38ad274 Merge branch 'master' of github.com:nafmo/git-l10n-sv * 'master' of github.com:nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (5196t0f0u) l10n: sv.po: Fix typo 12 January 2022, 05:46:21 UTC
05b345a l10n: sv.po: Update Swedish translation (5196t0f0u) Includes extra translation for branch.c:313 which has an upstream whitespace error that is expected to be fixed. Signed-off-by: Peter Krefting <peter@softwolves.pp.se> 11 January 2022, 15:36:26 UTC
f91e43e l10n: sv.po: Fix typo Suggested-by: Anders Jonsson <anders.jonsson@norsjovallen.se> Signed-off-by: Peter Krefting <peter@softwolves.pp.se> 11 January 2022, 14:52:57 UTC
59b1ff1 l10n: tr: v2.35.0 round 1 Signed-off-by: Emir SARI <emir_sari@icloud.com> 11 January 2022, 10:08:26 UTC
79aed79 l10n: git.pot: v2.35.0 round 1 (126 new, 142 removed) Generate po/git.pot from v2.35.0-rc0 for git v2.35.0 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> 11 January 2022, 01:52:27 UTC
c39fc06 fmt-merge-msg: prevent use-after-free with signed tags When merging a signed tag, fmt_merge_msg_sigs() is responsible for populating the body of the merge message with the names of the signed tags, their signatures, and the validity of those signatures. In 02769437e1 (ssh signing: use sigc struct to pass payload, 2021-12-09), check_signature() was taught to pass the object payload via the sigc struct instead of passing the payload buffer separately. In effect, 02769437e1 causes buf, and sigc.payload to point at the same region in memory. This causes a problem for fmt_tag_signature(), which wants to read from this location, since it is freed beforehand by signature_check_clear() (which frees it via sigc's `payload` member). That makes the subsequent use in fmt_tag_signature() a use-after-free. As a result, merge messages did not contain the body of any signed tags. Luckily, they tend not to contain garbage, either, since the result of strstr()-ing the object buffer in fmt_tag_signature() is guarded: const char *tag_body = strstr(buf, "\n\n"); if (tag_body) { tag_body += 2; strbuf_add(tagbuf, tag_body, buf + len - tag_body); } Unfortunately, the tests in t6200 did not catch this at the time because they do not search for the body of signed tags in fmt-merge-msg's output. Resolve this by waiting to call signature_check_clear() until after its contents can be safely discarded. Harden ourselves against any future regressions in this area by making sure we can find signed tag messages in the output of fmt-merge-msg, too. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 10 January 2022, 21:57:40 UTC
90d242d Git 2.35-rc0 Signed-off-by: Junio C Hamano <gitster@pobox.com> 10 January 2022, 19:52:57 UTC
6e22345 Merge branch 'en/stash-df-fix' "git stash apply" forgot to attempt restoring untracked files when it failed to restore changes to tracked ones. * en/stash-df-fix: stash: do not return before restoring untracked files 10 January 2022, 19:52:57 UTC
27a70fa Merge branch 'ms/t-readme-typofix' Typofix. * ms/t-readme-typofix: t/README: fix typo 10 January 2022, 19:52:56 UTC
c17de5a Merge branch 'ja/i18n-similar-messages' Similar message templates have been consolidated so that translators need to work on fewer number of messages. * ja/i18n-similar-messages: i18n: turn even more messages into "cannot be used together" ones i18n: ref-filter: factorize "%(foo) atom used without %(bar) atom" i18n: factorize "--foo outside a repository" i18n: refactor "unrecognized %(foo) argument" strings i18n: factorize "no directory given for --foo" i18n: factorize "--foo requires --bar" and the like i18n: tag.c factorize i18n strings i18n: standardize "cannot open" and "cannot read" i18n: turn "options are incompatible" into "cannot be used together" i18n: refactor "%s, %s and %s are mutually exclusive" i18n: refactor "foo and bar are mutually exclusive" 10 January 2022, 19:52:56 UTC
2c54104 Merge branch 'en/merge-ort-renorm-with-rename-delete-conflict-fix' A corner case bug in the ort merge strategy has been corrected. * en/merge-ort-renorm-with-rename-delete-conflict-fix: merge-ort: fix bug with renormalization and rename/delete conflicts 10 January 2022, 19:52:55 UTC
def8c6a Merge branch 'jc/doc-submitting-patches-choice-of-base' Extend the guidance to choose the base commit to build your work on, and hint/nudge contributors to read others' changes. * jc/doc-submitting-patches-choice-of-base: SubmittingPatchs: clarify choice of base and testing 10 January 2022, 19:52:55 UTC
9b6eda0 Merge branch 'jl/subtree-check-parents-argument-passing-fix' Fix performance-releated bug in "git subtree" (in contrib/). * jl/subtree-check-parents-argument-passing-fix: subtree: fix argument handling in check_parents 10 January 2022, 19:52:54 UTC
c0450ca Merge branch 'lh/use-gnu-color-in-grep' The color palette used by "git grep" has been updated to match that of GNU grep. * lh/use-gnu-color-in-grep: grep: align default colors with GNU grep ones 10 January 2022, 19:52:54 UTC
0669bdf Merge branch 'js/branch-track-inherit' "git -c branch.autosetupmerge=inherit branch new old" makes "new" to have the same upstream as the "old" branch, instead of marking "old" itself as its upstream. * js/branch-track-inherit: config: require lowercase for branch.*.autosetupmerge branch: add flags and config to inherit tracking branch: accept multiple upstream branches for tracking 10 January 2022, 19:52:54 UTC
4b51386 Merge branch 'ab/usage-die-message' Code clean-up to hide vreportf() from public API. * ab/usage-die-message: config API: use get_error_routine(), not vreportf() usage.c + gc: add and use a die_message_errno() gc: return from cmd_gc(), don't call exit() usage.c API users: use die_message() for error() + exit 128 usage.c API users: use die_message() for "fatal :" + exit 128 usage.c: add a die_message() routine 10 January 2022, 19:52:53 UTC
bc61dba Merge branch 'jz/apply-3-corner-cases' "git apply --3way" bypasses the attempt to do a three-way application in more cases to address the regression caused by the recent change to use direct application as a fallback. * jz/apply-3-corner-cases: git-apply: skip threeway in add / rename cases 10 January 2022, 19:52:53 UTC
78e696c Merge branch 'hn/reftable-fixes' Assorted fixlets in reftable code. * hn/reftable-fixes: reftable: support preset file mode for writing reftable: signal overflow reftable: fix typo in header 10 January 2022, 19:52:52 UTC
626f2ca Merge branch 'ab/reflog-prep' Code refactoring in the reflog part of refs API. * ab/reflog-prep: reflog + refs-backend: move "verbose" out of the backend refs files-backend: assume cb->newlog if !EXPIRE_REFLOGS_DRY_RUN reflog: reduce scope of "struct rev_info" reflog expire: don't use lookup_commit_reference_gently() reflog expire: refactor & use "tip_commit" only for UE_NORMAL reflog expire: use "switch" over enum values reflog: change one->many worktree->refnames to use a string_list reflog expire: narrow scope of "cb" in cmd_reflog_expire() reflog delete: narrow scope of "cmd" passed to count_reflog_ent() 10 January 2022, 19:52:52 UTC
8ab404e Merge branch 'ab/do-not-limit-stash-help-to-push' "git stash" by default triggers its "push" action, but its implementation also made "git stash -h" to show short help only for "git stash push", which has been corrected. * ab/do-not-limit-stash-help-to-push: stash: don't show "git stash push" usage on bad "git stash" usage 10 January 2022, 19:52:52 UTC
077e120 Merge branch 'ab/makefile-hook-list-dependency-fix' Fix dependency rules to generate hook-list.h header file. * ab/makefile-hook-list-dependency-fix: Makefile: correct the dependency graph of hook-list.h 10 January 2022, 19:52:52 UTC
114d64b Merge branch 'ab/makefile-pager-env-is-used-only-by-pager.c' * ab/makefile-pager-env-is-used-only-by-pager.c: Makefile: move -DPAGER_ENV from BASIC_CFLAGS to EXTRA_CPPFLAGS 10 January 2022, 19:52:51 UTC
43f196c Merge branch 'ab/makefile-msgfmt-wo-stats' Make the recipe that runs msgfmt less noisy. * ab/makefile-msgfmt-wo-stats: Makefile: don't invoke msgfmt with --statistics 10 January 2022, 19:52:51 UTC
01ea04f Merge branch 'hn/refs-debug-update' Debugging support for refs API. * hn/refs-debug-update: refs: centralize initialization of the base ref_store. refs: print error message in debug output refs: pass gitdir to packed_ref_store_create 10 January 2022, 19:52:51 UTC
3c0e417 Merge branch 'ds/fetch-pull-with-sparse-index' "git fetch" and "git pull" are now declared sparse-index clean. Also "git ls-files" learns the "--sparse" option to help debugging. * ds/fetch-pull-with-sparse-index: test-read-cache: remove --table, --expand options t1091/t3705: remove 'test-tool read-cache --table' t1092: replace 'read-cache --table' with 'ls-files --sparse' ls-files: add --sparse option fetch/pull: use the sparse index 10 January 2022, 19:52:50 UTC
b48c69c Merge branch 'hn/ref-api-tests-update' Test updates. * hn/ref-api-tests-update: t7004: use "test-tool ref-store" for reflog inspection t7004: create separate tags for different tests t5550: require REFFILES t5540: require REFFILES 10 January 2022, 19:52:50 UTC
9dbb375 Merge branch 'jh/p4-remove-unused' Remove a few commands from "git p4" that aren't very useful. * jh/p4-remove-unused: git-p4: remove "rollback" verb git-p4: remove "debug" verb 10 January 2022, 19:52:50 UTC
be69d35 Merge branch 'ja/perf-use-specified-shell' Perf tests were run with end-user's shell, but it has been corrected to use the shell specified by $TEST_SHELL_PATH. * ja/perf-use-specified-shell: t/perf: do not run tests in user's $SHELL 10 January 2022, 19:52:50 UTC
321f7f4 Merge branch 'hn/test-ref-store-show-hash-algo' Debugging support for refs API. * hn/test-ref-store-show-hash-algo: test-ref-store: print hash algorithm 10 January 2022, 19:52:50 UTC
98ab07a Merge branch 'ws/fast-export-with-revision-options' Use of certain "git rev-list" options with "git fast-export" created nonsense results (the worst two of which being "--reverse" and "--invert-grep --grep=<foo>"). The use of "--first-parent" is made to behave a bit more sensible than before. * ws/fast-export-with-revision-options: fast-export: fix surprising behavior with --first-parent 10 January 2022, 19:52:50 UTC
b6f538f Merge branch 'js/l10n-mention-ngettext-early-in-readme' Localization doc update. * js/l10n-mention-ngettext-early-in-readme: l10n: README: call more attention to plural strings 10 January 2022, 19:52:49 UTC
66f6c18 Merge branch 'jh/p4-human-unit-numbers' The way "git p4" shows file sizes in its output has been updated to use human-readable units. * jh/p4-human-unit-numbers: git-p4: show progress as an integer git-p4: print size values in appropriate units 10 January 2022, 19:52:49 UTC
09481fe Merge branch 'ds/sparse-checkout-malformed-pattern-fix' Certain sparse-checkout patterns that are valid in non-cone mode led to segfault in cone mode, which has been corrected. * ds/sparse-checkout-malformed-pattern-fix: sparse-checkout: refuse to add to bad patterns sparse-checkout: fix OOM error with mixed patterns sparse-checkout: fix segfault on malformed patterns 10 January 2022, 19:52:49 UTC
97d6fb5 cache.h: drop duplicate `ensure_full_index()` declaration There are two identical declarations of `ensure_full_index()` in cache.h. Commit 3964fc2aae ("sparse-index: add guard to ensure full index", 2021-03-30) provided an empty implementation of `ensure_full_index()`, declaring it in a new file sparse-index.h. When commit 4300f8442a ("sparse-index: implement ensure_full_index()", 2021-03-30) fleshed out the implementation, it added an identical declaration to cache.h. Then 118a2e8bde ("cache: move ensure_full_index() to cache.h", 2021-04-01) favored having the declaration in cache.h. Because of the double declaration, at that point we could have just dropped the one in sparse-index.h, but instead it got moved to cache.h. As a result, cache.h contains the exact same function declaration twice. Drop the one under "/* Name hashing */", in favor of the one under "/* Initialize and use the cache information */". Signed-off-by: Martin Ågren <martin.agren@gmail.com> Acked-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> 10 January 2022, 19:30:33 UTC
4a9b204 lazyload: use correct calling conventions Christoph Reiter reported on the Git for Windows issue tracker[1], that mingw_strftime() imports strftime() from ucrtbase.dll with the wrong calling convention. It should be __cdecl instead of WINAPI, which we always use in DECLARE_PROC_ADDR(). The MSYS2 project encountered cmake sefaults on x86 Windows caused by the same issue in the cmake source. [2] There are no known git crashes that where caused by this, yet, but we should try to prevent them. We import two other non-WINAPI functions via DECLARE_PROC_ADDR(), too. * NtSetSystemInformation() (NTAPI) * GetUserNameExW() (SEC_ENTRY) NTAPI, SEC_ENTRY and WINAPI are all ususally defined as __stdcall, but there are circumstances where they're defined differently. Teach DECLARE_PROC_ADDR() about calling conventions and be explicit about when we want to use which calling convention. Import winnt.h for the definition of NTAPI and sspi.h for SEC_ENTRY near their respective only users. [1] https://github.com/git-for-windows/git/issues/3560 [2] https://github.com/msys2/MINGW-packages/issues/10152 Reported-By: Christoph Reiter <reiter.christoph@gmail.com> Signed-off-by: Matthias Aßhauer <mha1993@live.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> 09 January 2022, 18:34:53 UTC
58d4d7f fetch: fix deadlock when cleaning up lockfiles in async signals When fetching packfiles, we write a bunch of lockfiles for the packfiles we're writing into the repository. In order to not leave behind any cruft in case we exit or receive a signal, we register both an exit handler as well as signal handlers for common signals like SIGINT. These handlers will then unlink the locks and free the data structure tracking them. We have observed a deadlock in this logic though: (gdb) bt #0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 #1 0x00007f4932bea2cd in _int_free (av=0x7f4932f2eb20 <main_arena>, p=0x3e3e4200, have_lock=0) at malloc.c:3969 #2 0x00007f4932bee58c in __GI___libc_free (mem=<optimized out>) at malloc.c:2975 #3 0x0000000000662ab1 in string_list_clear () #4 0x000000000044f5bc in unlock_pack_on_signal () #5 <signal handler called> #6 _int_free (av=0x7f4932f2eb20 <main_arena>, p=<optimized out>, have_lock=0) at malloc.c:4024 #7 0x00007f4932bee58c in __GI___libc_free (mem=<optimized out>) at malloc.c:2975 #8 0x000000000065afd5 in strbuf_release () #9 0x000000000066ddb9 in delete_tempfile () #10 0x0000000000610d0b in files_transaction_cleanup.isra () #11 0x0000000000611718 in files_transaction_abort () #12 0x000000000060d2ef in ref_transaction_abort () #13 0x000000000060d441 in ref_transaction_prepare () #14 0x000000000060e0b5 in ref_transaction_commit () #15 0x00000000004511c2 in fetch_and_consume_refs () #16 0x000000000045279a in cmd_fetch () #17 0x0000000000407c48 in handle_builtin () #18 0x0000000000408df2 in cmd_main () #19 0x00000000004078b5 in main () The process was killed with a signal, which caused the signal handler to kick in and try free the data structures after we have unlinked the locks. It then deadlocks while calling free(3P). The root cause of this is that it is not allowed to call certain functions in async-signal handlers, as specified by signal-safety(7). Next to most I/O functions, this list of disallowed functions also includes memory-handling functions like malloc(3P) and free(3P) because they may not be reentrant. As a result, if we execute such functions in the signal handler, then they may operate on inconistent state and fail in unexpected ways. Fix this bug by not calling non-async-signal-safe functions when running in the signal handler. We're about to re-raise the signal anyway and will thus exit, so it's not much of a problem to keep the string list of lockfiles untouched. Note that it's fine though to call unlink(2), so we'll still clean up the lockfiles correctly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> 07 January 2022, 21:49:19 UTC
e83ba64 The seventh batch Signed-off-by: Junio C Hamano <gitster@pobox.com> 05 January 2022, 22:01:31 UTC
9afe4d9 Merge branch 'rs/daemon-plug-leak' Plug a memory leak. * rs/daemon-plug-leak: daemon: plug memory leak on overlong path 05 January 2022, 22:01:31 UTC
c91b0b7 Merge branch 'rs/pcre2-utf' "git grep --perl-regexp" failed to match UTF-8 characters with wildcard when the pattern consists only of ASCII letters, which has been corrected. * rs/pcre2-utf: grep/pcre2: factor out literal variable grep/pcre2: use PCRE2_UTF even with ASCII patterns 05 January 2022, 22:01:31 UTC
5d522cd Merge branch 'jc/t4204-do-not-write-git-on-upstream-of-pipe' Test fixes. * jc/t4204-do-not-write-git-on-upstream-of-pipe: t4204 is not sanitizer clean at all 05 January 2022, 22:01:31 UTC
2043ce8 Merge branch 'rs/log-invert-grep-with-headers' "git log --invert-grep --author=<name>" used to exclude commits written by the given author, but now "--invert-grep" only affects the matches made by the "--grep=<pattern>" option. * rs/log-invert-grep-with-headers: log: let --invert-grep only invert --grep 05 January 2022, 22:01:30 UTC
2a6c7f9 Merge branch 'gh/gpg-doc-markup-fix' Doc markup fix. * gh/gpg-doc-markup-fix: docs: add missing colon to Documentation/config/gpg.txt 05 January 2022, 22:01:30 UTC
8292c14 Merge branch 'rs/t4202-invert-grep-test-fix' Test fix. * rs/t4202-invert-grep-test-fix: t4202: fix patternType setting in --invert-grep test 05 January 2022, 22:01:30 UTC
88a516a Merge branch 'ds/repack-fixlets' Two fixes around "git repack". * ds/repack-fixlets: repack: make '--quiet' disable progress repack: respect kept objects with '--write-midx -b' 05 January 2022, 22:01:30 UTC
bb14cfd Merge branch 'jc/merge-detached-head-name' The default merge message prepared by "git merge" records the name of the current branch; the name can be overridden with a new option to allow users to pretend a merge is made on a different branch. * jc/merge-detached-head-name: merge: allow to pretend a merge is made into a different branch 05 January 2022, 22:01:30 UTC
a165484 Merge branch 'km/help-prompt-fix' Among some code paths that ask an yes/no question, only one place gave a prompt that looked different from the others, which has been updated to match what the others create. * km/help-prompt-fix: help: make auto-correction prompt more consistent 05 January 2022, 22:01:29 UTC
back to top