]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 years agols-tree: split up "fast path" callbacks
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:15 +0000 (17:13 +0800)] 
ls-tree: split up "fast path" callbacks

Make the various if/else in the callbacks for the "fast path" a lot
easier to read by just using common functions for the parts that are
common, and have per-format callbacks for those parts that are
different.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: detect and error on --name-only --name-status
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:14 +0000 (17:13 +0800)] 
ls-tree: detect and error on --name-only --name-status

The --name-only and --name-status options are synonyms, but let's
detect and error if both are provided.

In addition let's add explicit --format tests for the combination of
these various options.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: support --object-only option for "git-ls-tree"
Teng Long [Wed, 23 Mar 2022 09:13:13 +0000 (17:13 +0800)] 
ls-tree: support --object-only option for "git-ls-tree"

'--object-only' is an alias for '--format=%(objectname)'. It cannot
be used together other format-altering options like '--name-only',
'--long' or '--format', they are mutually exclusive.

The "--name-only" option outputs <filepath> only. Likewise, <objectName>
is another high frequency used field, so implement '--object-only' option
will bring intuitive and clear semantics for this scenario. Using
'--format=%(objectname)' we can achieve a similar effect, but the former
is with a lower learning cost(without knowing the format requirement
of '--format' option).

Even so, if a user is prefer to use "--format=%(objectname)", this is entirely
welcome because they are not only equivalent in function, but also have almost
identical performance. The reason is this commit also add the specific of
"--format=%(objectname)" to the current fast-pathes (builtin formats) to
avoid running unnecessary parsing mechanisms.

The following performance benchmarks are based on torvalds/linux.git:

  When hit the fast-path:

      Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --object-only HEAD
        Time (mean ± σ):      83.6 ms ±   2.0 ms    [User: 59.4 ms, System: 24.1 ms]
        Range (min … max):    80.4 ms …  87.2 ms    35 runs

      Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(objectname)' HEAD
        Time (mean ± σ):      84.1 ms ±   1.8 ms    [User: 61.7 ms, System: 22.3 ms]
        Range (min … max):    80.9 ms …  87.5 ms    35 runs

  But for a customized format, it will be slower:

       Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='oid: %(objectname)' HEAD
         Time (mean ± σ):      96.5 ms ±   2.5 ms    [User: 72.9 ms, System: 23.5 ms]
    Range (min … max):    93.1 ms … 104.1 ms    31 runs

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: introduce "--format" option
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:12 +0000 (17:13 +0800)] 
ls-tree: introduce "--format" option

Add a --format option to ls-tree. It has an existing default output,
and then --long and --name-only options to emit the default output
along with the objectsize and, or to only emit object paths.

Rather than add --type-only, --object-only etc. we can just support a
--format using a strbuf_expand() similar to "for-each-ref
--format". We might still add such options in the future for
convenience.

The --format implementation is slower than the existing code, but this
change does not cause any performance regressions. We'll leave the
existing show_tree() unchanged, and only run show_tree_fmt() in if
a --format different than the hardcoded built-in ones corresponding to
the existing modes is provided.

I.e. something like the "--long" output would be much slower with
this, mainly due to how we need to allocate various things to do with
quote.c instead of spewing the output directly to stdout.

The new option of '--format' comes from Ævar Arnfjörð Bjarmasonn's
idea and suggestion, this commit makes modifications in terms of the
original discussion on community [1].

In [1] there was a "GIT_TEST_LS_TREE_FORMAT_BACKEND" variable to
ensure that we had test coverage for passing tests that would
otherwise use show_tree() through show_tree_fmt(), and thus that the
formatting mechanism could handle all the same cases as the
non-formatting options.

Somewhere in subsequent re-rolls of that we seem to have drifted away
from what the goal of these tests should be. We're trying to ensure
correctness of show_tree_fmt(). We can't tell if we "hit [the]
fast-path" here, and instead of having an explicit test for that, we
can just add it to something our "test_ls_tree_format" tests for.

Here is the statistics about performance tests:

1. Default format (hitten the builtin formats):

    "git ls-tree <tree-ish>" vs "--format='%(mode) %(type) %(object)%x09%(file)'"

    $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r HEAD"
    Benchmark 1: /opt/git/master/bin/git ls-tree -r HEAD
    Time (mean ± σ):     105.2 ms ±   3.3 ms    [User: 84.3 ms, System: 20.8 ms]
    Range (min … max):    99.2 ms … 113.2 ms    28 runs

    $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object)%x09%(file)'  HEAD"
    Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object)%x09%(file)'  HEAD
    Time (mean ± σ):     106.4 ms ±   2.7 ms    [User: 86.1 ms, System: 20.2 ms]
    Range (min … max):   100.2 ms … 110.5 ms    29 runs

2. Default format includes object size (hitten the builtin formats):

    "git ls-tree -l <tree-ish>" vs "--format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'"

    $hyperfine --warmup=10 "/opt/git/master/bin/git ls-tree -r -l HEAD"
    Benchmark 1: /opt/git/master/bin/git ls-tree -r -l HEAD
    Time (mean ± σ):     335.1 ms ±   6.5 ms    [User: 304.6 ms, System: 30.4 ms]
    Range (min … max):   327.5 ms … 348.4 ms    10 runs

    $hyperfine --warmup=10 "/opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'  HEAD"
    Benchmark 1: /opt/git/ls-tree-oid-only/bin/git ls-tree -r --format='%(mode) %(type) %(object) %(size:padded)%x09%(file)'  HEAD
    Time (mean ± σ):     337.2 ms ±   8.2 ms    [User: 309.2 ms, System: 27.9 ms]
    Range (min … max):   328.8 ms … 349.4 ms    10 runs

Links:
[1] https://public-inbox.org/git/RFC-patch-6.7-eac299f06ff-20211217T131635Z-avarab@gmail.com/
[2] https://lore.kernel.org/git/cb717d08be87e3239117c6c667cb32caabaad33d.1646390152.git.dyroneteng@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agococci: allow padding with `strbuf_addf()`
Johannes Schindelin [Wed, 23 Mar 2022 09:13:11 +0000 (17:13 +0800)] 
cocci: allow padding with `strbuf_addf()`

A convenient way to pad strings is to use something like
`strbuf_addf(&buf, "%20s", "Hello, world!")`.

However, the Coccinelle rule that forbids a format `"%s"` with a
constant string argument cast too wide a net, and also forbade such
padding.

The original rule was introduced by commit:

    28c23cd4c39 (strbuf.cocci: suggest strbuf_addbuf() to add one strbuf to an other, 2019-01-25)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: introduce struct "show_tree_data"
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:10 +0000 (17:13 +0800)] 
ls-tree: introduce struct "show_tree_data"

"show_tree_data" is a struct that packages the necessary fields for
"show_tree()". This commit is a pre-prepared commit for supporting
"--format" option and it does not affect any existing functionality.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: slightly refactor `show_tree()`
Teng Long [Wed, 23 Mar 2022 09:13:09 +0000 (17:13 +0800)] 
ls-tree: slightly refactor `show_tree()`

This is a non-functional change, we introduce an enum "ls_tree_cmdmode"
then use it to mark which columns to output.

This has the advantage of making the show_tree logic simpler and more
readable, as well as making it easier to extend new options (for example,
if we want to add a "--object-only" option, we just need to add a similar
"short-circuit logic in "show_tree()").

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: fix "--name-only" and "--long" combined use bug
Teng Long [Wed, 23 Mar 2022 09:13:08 +0000 (17:13 +0800)] 
ls-tree: fix "--name-only" and "--long" combined use bug

If we execute "git ls-tree" with combined "--name-only" and "--long"
, only the pathname will be printed, the size is omitted (the original
discoverer was Peff in [1]).

This commit fix this issue by using `OPT_CMDMODE()` instead to make both
of them mutually exclusive.

[1] https://public-inbox.org/git/YZK0MKCYAJmG+pSU@coredump.intra.peff.net/

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: simplify nesting if/else logic in "show_tree()"
Teng Long [Wed, 23 Mar 2022 09:13:07 +0000 (17:13 +0800)] 
ls-tree: simplify nesting if/else logic in "show_tree()"

Use the object_type() function to determine the object type from the
"mode" passed to us by read_tree(), instead of doing so with the S_*()
macros.

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyronetengb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: rename "retval" to "recurse" in "show_tree()"
Teng Long [Wed, 23 Mar 2022 09:13:06 +0000 (17:13 +0800)] 
ls-tree: rename "retval" to "recurse" in "show_tree()"

The variable which "show_tree()" return is named "retval", a name that's
a little hard to understand. The commit rename "retval" to "recurse"
which is a more meaningful name than before in the context. We do not
need to take a look at "read_tree_at()" in "tree.c" to make sure what
does "retval" mean.

Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: use "size_t", not "int" for "struct strbuf"'s "len"
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:05 +0000 (17:13 +0800)] 
ls-tree: use "size_t", not "int" for "struct strbuf"'s "len"

The "struct strbuf"'s "len" member is a "size_t", not an "int", so
let's change our corresponding types accordingly. This also changes
the "len" and "speclen" variables, which are likewise used to store
the return value of strlen(), which returns "size_t", not "int".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: use "enum object_type", not {blob,tree,commit}_type
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:04 +0000 (17:13 +0800)] 
ls-tree: use "enum object_type", not {blob,tree,commit}_type

Change the ls-tree.c code to use type_name() on the enum instead of
using the string constants. This doesn't matter either way for
performance, but makes this a bit easier to read as we'll no longer
need a strcmp() here.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: add missing braces to "else" arms
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:03 +0000 (17:13 +0800)] 
ls-tree: add missing braces to "else" arms

Add missing {} to the "else" arms in show_tree() per the
CodingGuidelines.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree: remove commented-out code
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:02 +0000 (17:13 +0800)] 
ls-tree: remove commented-out code

Remove code added in f35a6d3bce7 (Teach core object handling functions
about gitlinks, 2007-04-09), later patched in 7d0b18a4da1 (Add output
flushing before fork(), 2008-08-04), and then finally ending up in its
current form in d3bee161fef (tree.c: allow read_tree_recursive() to
traverse gitlink entries, 2009-01-25). All while being commented-out!

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agols-tree tests: add tests for --name-status
Ævar Arnfjörð Bjarmason [Wed, 23 Mar 2022 09:13:01 +0000 (17:13 +0800)] 
ls-tree tests: add tests for --name-status

The --name-status synonym for --name-only added in
c639a5548a5 (ls-tree: --name-only, 2005-12-01) had no tests, let's
make sure it works the same way as its sibling.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoGit 2.34 v2.34.0
Junio C Hamano [Mon, 15 Nov 2021 06:50:52 +0000 (22:50 -0800)] 
Git 2.34

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge tag 'l10n-2.34.0-rnd3.1' of git://github.com/git-l10n/git-po
Junio C Hamano [Mon, 15 Nov 2021 05:45:40 +0000 (21:45 -0800)] 
Merge tag 'l10n-2.34.0-rnd3.1' of git://github.com/git-l10n/git-po

l10n-2.34.0-rnd3.1

* tag 'l10n-2.34.0-rnd3.1' of git://github.com/git-l10n/git-po: (38 commits)
  l10n: pl: 2.34.0 round 3
  l10n: it: fix typos found by git-po-helper
  l10n: ko: fix typos found by git-po-helper
  l10n: Update Catalan translation
  l10n: po-id for 2.34 (round 3)
  l10n: bg.po: Updated Bulgarian translation (5211t)
  l10n: de.po: Update German translation for Git v2.34.0
  l10n: sv.po: Update Swedish translation (5211t0f0)
  l10n: vi(5211t): Translation for v2.34.0 rd3
  l10n: zh_TW.po: v2.34.0 round 3 (0 untranslated)
  l10n: fr: v2.34.0 rnd 3
  l10n: tr: v2.34.0 round 3
  l10n: zh_CN: v2.34.0 round 3
  l10n: git.pot: v2.34.0 round 3 (1 new)
  l10n: pl: 2.34.0 round 2
  l10n: vi(5210t): Translation for v2.34.0 rd2
  l10n: es: 2.34.0 round 2
  l10n: Update Catalan translation
  l10n: bg.po: Updated Bulgarian translation (5210t)
  l10n: fr: v2.34.0 round 2
  ...

3 years agol10n: pl: 2.34.0 round 3
Arusekk [Sun, 14 Nov 2021 14:19:13 +0000 (15:19 +0100)] 
l10n: pl: 2.34.0 round 3

Signed-off-by: Arusekk <arek_koz@o2.pl>
3 years agol10n: it: fix typos found by git-po-helper
Jiang Xin [Sun, 14 Nov 2021 11:40:41 +0000 (19:40 +0800)] 
l10n: it: fix typos found by git-po-helper

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agol10n: ko: fix typos found by git-po-helper
Jiang Xin [Thu, 11 Nov 2021 00:54:16 +0000 (08:54 +0800)] 
l10n: ko: fix typos found by git-po-helper

When checking typos in file "po/ko.po", "git-po-helper" reports lots of
false positives because there are no spaces between ASCII and Korean
characters. After applied commit adee197 "(dict: add smudge table for
Korean language, 2021-11-11)" of "git-l10n/git-po-helper" to suppress
these false positives, some easy-to-fix typos are found and fixed.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agol10n: Update Catalan translation
Jordi Mas [Sat, 13 Nov 2021 15:35:53 +0000 (16:35 +0100)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
3 years agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sat, 13 Nov 2021 06:42:30 +0000 (14:42 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.34 (round 3)

3 years agol10n: po-id for 2.34 (round 3)
Bagas Sanjaya [Thu, 11 Nov 2021 07:43:22 +0000 (14:43 +0700)] 
l10n: po-id for 2.34 (round 3)

  - Translate following new components:
    * merge.c
    * rebase-interactive.c
    * rebase.c
    * midx.c
  - Clean up obsolete translations

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agoMerge branch 'master' of github.com:ruester/git-po-de
Jiang Xin [Sat, 13 Nov 2021 01:27:58 +0000 (09:27 +0800)] 
Merge branch 'master' of github.com:ruester/git-po-de

* 'master' of github.com:ruester/git-po-de:
  l10n: de.po: Update German translation for Git v2.34.0

3 years agoMerge branch 'js/trace2-raise-format-version'
Junio C Hamano [Fri, 12 Nov 2021 23:29:25 +0000 (15:29 -0800)] 
Merge branch 'js/trace2-raise-format-version'

When we added a new event type to trace2 event stream, we forgot to
raise the format version number, which has been corrected.

* js/trace2-raise-format-version:
  trace2: increment event format version

3 years agoMerge branch 'ab/fsck-unexpected-type'
Junio C Hamano [Fri, 12 Nov 2021 23:29:25 +0000 (15:29 -0800)] 
Merge branch 'ab/fsck-unexpected-type'

Regression fix.

* ab/fsck-unexpected-type:
  object-file: free(*contents) only in read_loose_object() caller
  object-file: fix SEGV on free() regression in v2.34.0-rc2

3 years agoMerge branch 'ps/connectivity-optim'
Junio C Hamano [Fri, 12 Nov 2021 23:29:24 +0000 (15:29 -0800)] 
Merge branch 'ps/connectivity-optim'

Regression fix.

* ps/connectivity-optim:
  Revert "connected: do not sort input revisions"

3 years agol10n: bg.po: Updated Bulgarian translation (5211t)
Alexander Shopov [Fri, 12 Nov 2021 07:00:54 +0000 (08:00 +0100)] 
l10n: bg.po: Updated Bulgarian translation (5211t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agol10n: de.po: Update German translation for Git v2.34.0
Matthias Rüster [Sun, 7 Nov 2021 17:07:34 +0000 (18:07 +0100)] 
l10n: de.po: Update German translation for Git v2.34.0

Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com>
Reviewed-by: Phillip Szelat <phillip.szelat@gmail.com>
3 years agotrace2: increment event format version
Josh Steadmon [Thu, 11 Nov 2021 22:34:25 +0000 (14:34 -0800)] 
trace2: increment event format version

In 64bc752 (trace2: add trace2_child_ready() to report on background
children, 2021-09-20), we added a new "child_ready" event. In
Documentation/technical/api-trace2.txt, we promise that adding a new
event type will result in incrementing the trace2 event format version
number, but this was not done. Correct this in code & docs.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: sv.po: Update Swedish translation (5211t0f0)
Peter Krefting [Thu, 11 Nov 2021 22:22:48 +0000 (23:22 +0100)] 
l10n: sv.po: Update Swedish translation (5211t0f0)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
3 years agoobject-file: free(*contents) only in read_loose_object() caller
Ævar Arnfjörð Bjarmason [Thu, 11 Nov 2021 05:18:56 +0000 (06:18 +0100)] 
object-file: free(*contents) only in read_loose_object() caller

In the preceding commit a free() of uninitialized memory regression in
96e41f58fe1 (fsck: report invalid object type-path combinations,
2021-10-01) was fixed, but we'd still have an issue with leaking
memory from fsck_loose(). Let's fix that issue too.

That issue was introduced in my 31deb28f5e0 (fsck: don't hard die on
invalid object types, 2021-10-01). It can be reproduced under
SANITIZE=leak with the test I added in 093fffdfbec (fsck tests: add
test for fsck-ing an unknown type, 2021-10-01):

    ./t1450-fsck.sh --run=84 -vixd

In some sense it's not a problem, we lost the same amount of memory in
terms of things malloc'd and not free'd. It just moved from the "still
reachable" to "definitely lost" column in valgrind(1) nomenclature[1],
since we'd have die()'d before.

But now that we don't hard die() anymore in the library let's properly
free() it. Doing so makes this code much easier to follow, since we'll
now have one function owning the freeing of the "contents" variable,
not two.

For context on that memory management pattern the read_loose_object()
function was added in f6371f92104 (sha1_file: add read_loose_object()
function, 2017-01-13) and subsequently used in c68b489e564 (fsck:
parse loose object paths directly, 2017-01-13). The pattern of it
being the task of both sides to free() the memory has been there in
this form since its inception.

1. https://valgrind.org/docs/manual/mc-manual.html#mc-manual.leaks

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoRevert "connected: do not sort input revisions"
Junio C Hamano [Thu, 11 Nov 2021 20:34:41 +0000 (12:34 -0800)] 
Revert "connected: do not sort input revisions"

This reverts commit f45022dc2fd692fd024f2eb41a86a66f19013d43,
as this is like breakage in the traversal more likely.  In a
history with 10 single strand of pearls,

   1-->2-->3--...->7-->8-->9-->10

asking "rev-list --unsorted-input 1 10 --not 9 8 7 6 5 4" fails to
paint the bottom 1 uninteresting as the traversal stops, without
completing the propagation of uninteresting bit starting at 4 down
through 3 and 2 to 1.

3 years agoobject-file: fix SEGV on free() regression in v2.34.0-rc2
Ævar Arnfjörð Bjarmason [Thu, 11 Nov 2021 05:18:55 +0000 (06:18 +0100)] 
object-file: fix SEGV on free() regression in v2.34.0-rc2

Fix a regression introduced in my 96e41f58fe1 (fsck: report invalid
object type-path combinations, 2021-10-01). When fsck-ing blobs larger
than core.bigFileThreshold, we'd free() a pointer to uninitialized
memory.

This issue would have been caught by SANITIZE=address, but since it
involves core.bigFileThreshold, none of the existing tests in our test
suite covered it.

Running them with the "big_file_threshold" in "environment.c" changed
to say "6" would have shown this failure, but let's add a dedicated
test for this scenario based on Han Xin's report[1].

The bug was introduced between v9 and v10[2] of the fsck series merged
in 061a21d36d8 (Merge branch 'ab/fsck-unexpected-type', 2021-10-25).

1. https://lore.kernel.org/git/20211111030302.75694-1-hanxin.hx@alibaba-inc.com/
2. https://lore.kernel.org/git/cover-v10-00.17-00000000000-20211001T091051Z-avarab@gmail.com/

Reported-by: Han Xin <chiyutianyi@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: vi(5211t): Translation for v2.34.0 rd3
Tran Ngoc Quan [Thu, 11 Nov 2021 06:19:34 +0000 (13:19 +0700)] 
l10n: vi(5211t): Translation for v2.34.0 rd3

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
3 years agoMerge branch 'l10n/zh_TW/211111' of github.com:l10n-tw/git-po
Jiang Xin [Thu, 11 Nov 2021 00:28:26 +0000 (08:28 +0800)] 
Merge branch 'l10n/zh_TW/211111' of github.com:l10n-tw/git-po

* 'l10n/zh_TW/211111' of github.com:l10n-tw/git-po:
  l10n: zh_TW.po: v2.34.0 round 3 (0 untranslated)

3 years agoMerge branch 'fr_v2.34.0_rnd3' of github.com:jnavila/git
Jiang Xin [Thu, 11 Nov 2021 00:27:49 +0000 (08:27 +0800)] 
Merge branch 'fr_v2.34.0_rnd3' of github.com:jnavila/git

* 'fr_v2.34.0_rnd3' of github.com:jnavila/git:
  l10n: fr: v2.34.0 rnd 3

3 years agoMerge branch 'tr-2-34-r3' of github.com:bitigchi/git-po
Jiang Xin [Thu, 11 Nov 2021 00:26:54 +0000 (08:26 +0800)] 
Merge branch 'tr-2-34-r3' of github.com:bitigchi/git-po

* 'tr-2-34-r3' of github.com:bitigchi/git-po:
  l10n: tr: v2.34.0 round 3

3 years agoA few hotfixes
Junio C Hamano [Wed, 10 Nov 2021 22:59:51 +0000 (14:59 -0800)] 
A few hotfixes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'jk/ssh-signing-fix'
Junio C Hamano [Wed, 10 Nov 2021 23:01:21 +0000 (15:01 -0800)] 
Merge branch 'jk/ssh-signing-fix'

Reject OpenSSH 8.7 whose "ssh-keygen -Y find-principals" is
unusable from running the ssh signature tests.

* jk/ssh-signing-fix:
  t/lib-gpg: avoid broken versions of ssh-keygen

3 years agoMerge branch 'js/simple-ipc-cygwin-socket-fix'
Junio C Hamano [Wed, 10 Nov 2021 23:01:20 +0000 (15:01 -0800)] 
Merge branch 'js/simple-ipc-cygwin-socket-fix'

The way Cygwin emulates a unix-domain socket, on top of which the
simple-ipc mechanism is implemented, can race with the program on
the other side that wants to use the socket, and briefly make it
appear as a regular file before lstat(2) starts reporting it as a
socket.  We now have a workaround on the side that connects to a
unix domain socket.

* js/simple-ipc-cygwin-socket-fix:
  simple-ipc: work around issues with Cygwin's Unix socket emulation

3 years agoMerge branch 'ds/no-usable-cron-on-macos'
Junio C Hamano [Wed, 10 Nov 2021 23:01:20 +0000 (15:01 -0800)] 
Merge branch 'ds/no-usable-cron-on-macos'

"git maintenance run" learned to use system supplied scheduler
backend, but cron on macOS turns out to be unusable for this
purpose.

* ds/no-usable-cron-on-macos:
  maintenance: disable cron on macOS

3 years agoMerge branch 'jc/fix-pull-ff-only-when-already-up-to-date'
Junio C Hamano [Wed, 10 Nov 2021 23:01:19 +0000 (15:01 -0800)] 
Merge branch 'jc/fix-pull-ff-only-when-already-up-to-date'

"git pull --ff-only" and "git pull --rebase --ff-only" should make
it a no-op to attempt pulling from a remote that is behind us, but
instead the command errored out by saying it was impossible to
fast-forward, which may technically be true, but not a useful thing
to diagnose as an error.  This has been corrected.

* jc/fix-pull-ff-only-when-already-up-to-date:
  pull: --ff-only should make it a noop when already-up-to-date

3 years agol10n: zh_TW.po: v2.34.0 round 3 (0 untranslated)
Yi-Jyun Pan [Wed, 10 Nov 2021 22:43:41 +0000 (06:43 +0800)] 
l10n: zh_TW.po: v2.34.0 round 3 (0 untranslated)

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
3 years agot/lib-gpg: avoid broken versions of ssh-keygen
Jeff King [Wed, 10 Nov 2021 06:00:47 +0000 (01:00 -0500)] 
t/lib-gpg: avoid broken versions of ssh-keygen

The "-Y find-principals" option of ssh-keygen seems to be broken in
Debian's openssh-client 1:8.7p1-1, whereas it works fine in 1:8.4p1-5.
This causes several failures for GPGSSH tests. We fulfill the
prerequisite because generating the keys works fine, but actually
verifying a signature causes results ranging from bogus results to
ssh-keygen segfaulting.

We can find the broken version during the prereq check by feeding it
empty input. This should result in it complaining to stderr, but in the
broken version it triggers the segfault, causing the GPGSSH tests to be
skipped.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: fr: v2.34.0 rnd 3
Jean-Noël Avila [Wed, 10 Nov 2021 21:01:57 +0000 (22:01 +0100)] 
l10n: fr: v2.34.0 rnd 3

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agomaintenance: disable cron on macOS
Derrick Stolee [Wed, 10 Nov 2021 18:35:59 +0000 (18:35 +0000)] 
maintenance: disable cron on macOS

In eba1ba9 (maintenance: `git maintenance run` learned
`--scheduler=<scheduler>`, 2021-09-04), we introduced the ability to
specify a scheduler explicitly. This led to some extra checks around
whether an alternative scheduler was available. This added the
functionality of removing background maintenance from schedulers other
than the one selected.

On macOS, cron is technically available, but running 'crontab' triggers
a UI prompt asking for special permissions. This is the major reason why
launchctl is used as the default scheduler. The is_crontab_available()
method triggers this UI prompt, causing user disruption.

Remove this disruption by using an #ifdef to prevent running crontab
this way on macOS. This has the unfortunate downside that if a user
manually selects cron via the '--scheduler' option, then adjusting the
scheduler later will not remove the schedule from cron. The
'--scheduler' option ignores the is_available checks, which is how we
can get into this situation.

Extract the new check_crontab_process() method to avoid making the
'child' variable unused on macOS. The method is marked MAYBE_UNUSED
because it has no callers on macOS.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: tr: v2.34.0 round 3
Emir Sarı [Wed, 10 Nov 2021 18:21:28 +0000 (21:21 +0300)] 
l10n: tr: v2.34.0 round 3

Signed-off-by: Emir Sarı <bitigchi@me.com>
3 years agosimple-ipc: work around issues with Cygwin's Unix socket emulation
Johannes Schindelin [Wed, 10 Nov 2021 11:09:10 +0000 (11:09 +0000)] 
simple-ipc: work around issues with Cygwin's Unix socket emulation

Cygwin emulates Unix sockets by writing files with custom contents and
then marking them as system files.

The tricky problem is that while the file is written and its `system`
bit is set, it is still identified as a file. This caused test failures
when Git is too fast looking for the Unix sockets and then complains
that there is a plain file in the way.

Let's work around this by adding a delayed retry loop, specifically for
Cygwin.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: zh_CN: v2.34.0 round 3
Fangyi Zhou [Wed, 10 Nov 2021 12:29:09 +0000 (12:29 +0000)] 
l10n: zh_CN: v2.34.0 round 3

Signed-off-by: Fangyi Zhou <me@fangyi.io>
3 years agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Wed, 10 Nov 2021 02:18:44 +0000 (10:18 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

3 years agol10n: git.pot: v2.34.0 round 3 (1 new)
Jiang Xin [Wed, 10 Nov 2021 00:56:22 +0000 (08:56 +0800)] 
l10n: git.pot: v2.34.0 round 3 (1 new)

Generate po/git.pot from v2.34.0-rc2 for git v2.34.0 l10n round 3.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Wed, 10 Nov 2021 00:55:14 +0000 (08:55 +0800)] 
Merge branch 'master' of github.com:git/git

* 'master' of github.com:git/git:
  Git 2.34-rc2
  parse-options.[ch]: revert use of "enum" for parse_options()
  t/lib-git.sh: fix ACL-related permissions failure
  A few fixes before -rc2
  async_die_is_recursing: work around GCC v11.x issue on Fedora
  Document positive variant of commit and merge option "--no-verify"
  pull: honor --no-verify and do not call the commit-msg hook
  http-backend: remove a duplicated code branch

3 years agoGit 2.34-rc2 v2.34.0-rc2
Junio C Hamano [Tue, 9 Nov 2021 21:19:51 +0000 (13:19 -0800)] 
Git 2.34-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'ab/parse-options-cleanup'
Junio C Hamano [Tue, 9 Nov 2021 21:19:06 +0000 (13:19 -0800)] 
Merge branch 'ab/parse-options-cleanup'

Last minute fix to the update already in 'master'.

* ab/parse-options-cleanup:
  parse-options.[ch]: revert use of "enum" for parse_options()

3 years agoMerge branch 'ad/ssh-signing-testfix'
Junio C Hamano [Tue, 9 Nov 2021 21:19:06 +0000 (13:19 -0800)] 
Merge branch 'ad/ssh-signing-testfix'

Fix ssh-signing test to work on a platform where the default ACL is
overly loose to upset OpenSSH (reported on an installation of Cygwin).

* ad/ssh-signing-testfix:
  t/lib-git.sh: fix ACL-related permissions failure

3 years agoparse-options.[ch]: revert use of "enum" for parse_options()
Ævar Arnfjörð Bjarmason [Tue, 9 Nov 2021 11:04:43 +0000 (12:04 +0100)] 
parse-options.[ch]: revert use of "enum" for parse_options()

Revert the parse_options() prototype change in my recent
352e761388b (parse-options.[ch]: consistently use "enum
parse_opt_result", 2021-10-08) was incorrect. The parse_options()
function returns the number of argc elements that haven't been
processed, not "enum parse_opt_result".

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: pl: 2.34.0 round 2
Arusekk [Tue, 9 Nov 2021 13:48:08 +0000 (14:48 +0100)] 
l10n: pl: 2.34.0 round 2

Signed-off-by: Arusekk <arek_koz@o2.pl>
3 years agol10n: vi(5210t): Translation for v2.34.0 rd2
Tran Ngoc Quan [Mon, 8 Nov 2021 01:39:44 +0000 (08:39 +0700)] 
l10n: vi(5210t): Translation for v2.34.0 rd2

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
3 years agol10n: es: 2.34.0 round 2
Christopher Diaz Riveros [Sun, 10 Oct 2021 11:28:14 +0000 (13:28 +0200)] 
l10n: es: 2.34.0 round 2

Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
Signed-off-by: Omar Olivares <omar@olivares.cl>
Signed-off-by: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
3 years agol10n: Update Catalan translation
Jordi Mas [Sat, 6 Nov 2021 12:43:08 +0000 (13:43 +0100)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
3 years agol10n: bg.po: Updated Bulgarian translation (5210t)
Alexander Shopov [Sat, 6 Nov 2021 10:31:37 +0000 (11:31 +0100)] 
l10n: bg.po: Updated Bulgarian translation (5210t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
3 years agoMerge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-po
Jiang Xin [Sat, 6 Nov 2021 04:32:08 +0000 (12:32 +0800)] 
Merge branch 'pt-PT' of github.com:git-l10n-pt-PT/git-po

* 'pt-PT' of github.com:git-l10n-pt-PT/git-po:
  l10n: pt_PT: cleaning duplicate translations (#2)

3 years agoMerge branch 'l10n/zh_TW/211104' of github.com:l10n-tw/git-po
Jiang Xin [Sat, 6 Nov 2021 04:16:02 +0000 (12:16 +0800)] 
Merge branch 'l10n/zh_TW/211104' of github.com:l10n-tw/git-po

* 'l10n/zh_TW/211104' of github.com:l10n-tw/git-po:
  l10n: zh_TW.po: v2.34.0 round 2 (0 untranslated)

3 years agot/lib-git.sh: fix ACL-related permissions failure
Adam Dinwoodie [Fri, 5 Nov 2021 19:31:06 +0000 (19:31 +0000)] 
t/lib-git.sh: fix ACL-related permissions failure

As well as checking that the relevant functionality is available, the
GPGSSH prerequisite check creates the SSH keys that are used by the test
functions it gates.  If these keys are created in a directory that
has a default Access Control List, the key files can inherit those
permissions.

This can result in a scenario where the private keys are created
successfully, so the prerequisite check passes and the tests are run,
but the key files have permissions that are too permissive, meaning
OpenSSH will refuse to load them and the tests will fail.

To avoid this happening, before creating the keys, clear any default ACL
set on the directory that will contain them.  This step allowed to fail;
if setfacl isn't present, that's a very likely indicator that the
filesystem in question simply doesn't support default ACLs.

Helped-by: Fabian Stelzer <fs@gigacodes.de>
Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agol10n: fr: v2.34.0 round 2
Jean-Noël Avila [Fri, 5 Nov 2021 19:41:17 +0000 (20:41 +0100)] 
l10n: fr: v2.34.0 round 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
3 years agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Fri, 5 Nov 2021 11:48:09 +0000 (19:48 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

* 'po-id' of github.com:bagasme/git-po:
  l10n: po-id for 2.34 (round 2)

3 years agol10n: po-id for 2.34 (round 2)
Bagas Sanjaya [Fri, 5 Nov 2021 08:24:29 +0000 (15:24 +0700)] 
l10n: po-id for 2.34 (round 2)

Translate following new components:

  * gpg-interface.c
  * send-pack.c
  * fetch-pack.c
  * upload-pack.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agol10n: zh_TW.po: v2.34.0 round 2 (0 untranslated)
pan93412 [Thu, 4 Nov 2021 12:09:26 +0000 (20:09 +0800)] 
l10n: zh_TW.po: v2.34.0 round 2 (0 untranslated)

Signed-off-by: pan93412 <pan93412@gmail.com>
3 years agoMerge branch 'master' of github.com:nafmo/git-l10n-sv
Jiang Xin [Fri, 5 Nov 2021 00:18:57 +0000 (08:18 +0800)] 
Merge branch 'master' of github.com:nafmo/git-l10n-sv

* 'master' of github.com:nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation (5210t0f0u)

3 years agoMerge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po
Jiang Xin [Fri, 5 Nov 2021 00:17:50 +0000 (08:17 +0800)] 
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: 2.34.0 Round 2

3 years agol10n: sv.po: Update Swedish translation (5210t0f0u)
Peter Krefting [Mon, 1 Nov 2021 16:40:48 +0000 (17:40 +0100)] 
l10n: sv.po: Update Swedish translation (5210t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
3 years agoA few fixes before -rc2
Junio C Hamano [Thu, 4 Nov 2021 19:24:46 +0000 (12:24 -0700)] 
A few fixes before -rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoSync with maint
Junio C Hamano [Thu, 4 Nov 2021 19:24:40 +0000 (12:24 -0700)] 
Sync with maint

3 years agoMerge branch 'vd/pthread-setspecific-g11-fix' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:24:20 +0000 (12:24 -0700)] 
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

3 years agoMerge branch 'ma/doc-git-version' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:22:10 +0000 (12:22 -0700)] 
Merge branch 'ma/doc-git-version' into maint

Typofix.

* ma/doc-git-version:
  git.txt: fix typo

3 years agoMerge branch 'pw/rebase-r-fixes' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:20:14 +0000 (12:20 -0700)] 
Merge branch 'pw/rebase-r-fixes' into maint

Regression fix.

* pw/rebase-r-fixes:
  rebase -i: fix rewording with --committer-date-is-author-date

3 years agoMerge branch 'jk/log-warn-on-bogus-encoding' into maint
Junio C Hamano [Thu, 4 Nov 2021 19:20:13 +0000 (12:20 -0700)] 
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"

3 years agoMerge branch 'vd/pthread-setspecific-g11-fix'
Junio C Hamano [Thu, 4 Nov 2021 19:07:47 +0000 (12:07 -0700)] 
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

3 years agoMerge branch 'rd/http-backend-code-simplification'
Junio C Hamano [Thu, 4 Nov 2021 19:07:46 +0000 (12:07 -0700)] 
Merge branch 'rd/http-backend-code-simplification'

Code simplification.

* rd/http-backend-code-simplification:
  http-backend: remove a duplicated code branch

3 years agoMerge branch 'ar/no-verify-doc'
Junio C Hamano [Thu, 4 Nov 2021 19:07:46 +0000 (12:07 -0700)] 
Merge branch 'ar/no-verify-doc'

Doc update.

* ar/no-verify-doc:
  Document positive variant of commit and merge option "--no-verify"

3 years agoMerge branch 'ar/fix-git-pull-no-verify'
Junio C Hamano [Thu, 4 Nov 2021 19:07:46 +0000 (12:07 -0700)] 
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

3 years agol10n: zh_CN: 2.34.0 Round 2
Fangyi Zhou [Thu, 4 Nov 2021 11:02:05 +0000 (11:02 +0000)] 
l10n: zh_CN: 2.34.0 Round 2

Signed-off-by: Fangyi Zhou <me@fangyi.io>
3 years agol10n: tr: v2.34.0 round 2
Emir Sarı [Thu, 4 Nov 2021 10:19:12 +0000 (13:19 +0300)] 
l10n: tr: v2.34.0 round 2

Signed-off-by: Emir Sarı <bitigchi@me.com>
3 years agoasync_die_is_recursing: work around GCC v11.x issue on Fedora
Victoria Dye [Thu, 4 Nov 2021 04:01:03 +0000 (04:01 +0000)] 
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>
3 years agol10n: git.pot: v2.34.0 round 2 (3 new, 3 removed)
Jiang Xin [Thu, 4 Nov 2021 00:35:51 +0000 (08:35 +0800)] 
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>
3 years agoMerge branch 'master' of github.com:git/git
Jiang Xin [Thu, 4 Nov 2021 00:34:15 +0000 (08:34 +0800)] 
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

3 years agoMerge branch 'fz/po-zh_CN' of github.com:fangyi-zhou/git-po
Jiang Xin [Thu, 4 Nov 2021 00:23:26 +0000 (08:23 +0800)] 
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

3 years agoGit 2.34-rc1 v2.34.0-rc1
Junio C Hamano [Wed, 3 Nov 2021 20:32:40 +0000 (13:32 -0700)] 
Git 2.34-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agoMerge branch 'pw/rebase-r-fixes'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'pw/rebase-r-fixes'

Regression fix.

* pw/rebase-r-fixes:
  rebase -i: fix rewording with --committer-date-is-author-date

3 years agoMerge branch 'ds/add-rm-with-sparse-index'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'ds/add-rm-with-sparse-index'

Regression fix.

* ds/add-rm-with-sparse-index:
  dir: fix directory-matching bug

3 years agoMerge branch 'jx/message-fixes'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
Merge branch 'jx/message-fixes'

Fixes to recently added messages.

* jx/message-fixes:
  i18n: fix typos found during l10n for git 2.34.0

3 years agoMerge branch 'rs/ssh-signing-fix'
Junio C Hamano [Wed, 3 Nov 2021 20:32:28 +0000 (13:32 -0700)] 
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()

3 years agorebase -i: fix rewording with --committer-date-is-author-date
Phillip Wood [Tue, 2 Nov 2021 21:30:51 +0000 (21:30 +0000)] 
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>
3 years agodir: fix directory-matching bug
Derrick Stolee [Tue, 2 Nov 2021 14:40:06 +0000 (10:40 -0400)] 
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>
3 years agol10n: pl: Update translation
Arusekk [Wed, 29 Sep 2021 17:34:21 +0000 (19:34 +0200)] 
l10n: pl: Update translation

Signed-off-by: Arusekk <arek_koz@o2.pl>
3 years agol10n: zh-CN: v2.34.0 round 1
Fangyi Zhou [Tue, 2 Nov 2021 18:04:10 +0000 (18:04 +0000)] 
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>
3 years agogpg-interface: avoid buffer overrun in parse_ssh_output()
René Scharfe [Sat, 30 Oct 2021 17:07:38 +0000 (19:07 +0200)] 
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>
3 years agogpg-interface: handle missing " with " gracefully in parse_ssh_output()
René Scharfe [Sat, 30 Oct 2021 17:04:56 +0000 (19:04 +0200)] 
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>
3 years agoA few more topics before -rc1
Junio C Hamano [Mon, 1 Nov 2021 20:33:18 +0000 (13:33 -0700)] 
A few more topics before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>