]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
18 months agoMerge branch 'ja/rebase-i-avoid-amending-self' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:34 +0000 (17:11 -0700)] 
Merge branch 'ja/rebase-i-avoid-amending-self' into maint-2.38

"git rebase -i" can mistakenly attempt to apply a fixup to a commit
itself, which has been corrected.

* ja/rebase-i-avoid-amending-self:
  sequencer: avoid dropping fixup commit that targets self via commit-ish

18 months agoMerge branch 'jk/fsck-on-diet' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:33 +0000 (17:11 -0700)] 
Merge branch 'jk/fsck-on-diet' into maint-2.38

"git fsck" failed to release contents of tree objects already used
from the memory, which has been fixed.

* jk/fsck-on-diet:
  parse_object_buffer(): respect save_commit_buffer
  fsck: turn off save_commit_buffer
  fsck: free tree buffers after walking unreachable objects

18 months agoMerge branch 'ah/fsmonitor-daemon-usage-non-l10n' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:33 +0000 (17:11 -0700)] 
Merge branch 'ah/fsmonitor-daemon-usage-non-l10n' into maint-2.38

Fix messages incorrectly marked for translation.

* ah/fsmonitor-daemon-usage-non-l10n:
  fsmonitor--daemon: don't translate literal commands

18 months agoMerge branch 'jk/clone-allow-bare-and-o-together' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:33 +0000 (17:11 -0700)] 
Merge branch 'jk/clone-allow-bare-and-o-together' into maint-2.38

"git clone" did not like to see the "--bare" and the "--origin"
options used together without a good reason.

* jk/clone-allow-bare-and-o-together:
  clone: allow "--bare" with "-o"

18 months agoMerge branch 'jk/remote-rename-without-fetch-refspec' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:32 +0000 (17:11 -0700)] 
Merge branch 'jk/remote-rename-without-fetch-refspec' into maint-2.38

"git remote rename" failed to rename a remote without fetch
refspec, which has been corrected.

* jk/remote-rename-without-fetch-refspec:
  remote: handle rename of remote without fetch refspec

18 months agoMerge branch 'vd/fix-unaligned-read-index-v4' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:32 +0000 (17:11 -0700)] 
Merge branch 'vd/fix-unaligned-read-index-v4' into maint-2.38

The codepath that reads from the index v4 had unaligned memory
accesses, which has been corrected.

* vd/fix-unaligned-read-index-v4:
  read-cache: avoid misaligned reads in index v4

18 months agoMerge branch 'ab/coding-guidelines-c99' into maint-2.38
Junio C Hamano [Wed, 26 Oct 2022 00:11:32 +0000 (17:11 -0700)] 
Merge branch 'ab/coding-guidelines-c99' into maint-2.38

Update CodingGuidelines to clarify what features to use and avoid
in C99.

* ab/coding-guidelines-c99:
  CodingGuidelines: recommend against unportable C99 struct syntax
  CodingGuidelines: mention C99 features we can't use
  CodingGuidelines: allow declaring variables in for loops
  CodingGuidelines: mention dynamic C99 initializer elements
  CodingGuidelines: update for C99

19 months agoCodingGuidelines: recommend against unportable C99 struct syntax
Ævar Arnfjörð Bjarmason [Mon, 10 Oct 2022 20:38:00 +0000 (13:38 -0700)] 
CodingGuidelines: recommend against unportable C99 struct syntax

Per 33665d98e6b (reftable: make assignments portable to AIX xlc
v12.01, 2022-03-28) forms like ".a.b = *c" can be replaced by using
".a = { .b = *c }" instead.

We'll probably allow these sooner than later, but since the workaround
is trivial let's note it among the C99 features we'd like to hold off
on for now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoCodingGuidelines: mention C99 features we can't use
Ævar Arnfjörð Bjarmason [Mon, 10 Oct 2022 20:37:59 +0000 (13:37 -0700)] 
CodingGuidelines: mention C99 features we can't use

The C99 section of the CodingGuidelines is a good overview of what we
can use, but is sorely lacking in what we can't use. Something that
comes up occasionally is the portability of %z.

Per [1] we couldn't use it for the longest time due to MSVC not
supporting it, but nowadays by requiring C99 we rely on the MSVC
version that does, but we can't use it yet because a C library that
MinGW uses doesn't support it.

1. https://lore.kernel.org/git/a67e0fd8-4a14-16c9-9b57-3430440ef93c@gmail.com/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoCodingGuidelines: allow declaring variables in for loops
Ævar Arnfjörð Bjarmason [Mon, 10 Oct 2022 20:37:58 +0000 (13:37 -0700)] 
CodingGuidelines: allow declaring variables in for loops

Since 44ba10d6712 (revision: use C99 declaration of variable in for()
loop, 2021-11-14) released with v2.35.0 we've had a variable declared
with in a for loop.

Since then we've had inadvertent follow-ups to that with at least
cb2607759e2 (merge-ort: store more specific conflict information,
2022-06-18) released with v2.38.0.

As November 2022 is within the window of this upcoming release,
let's update the guideline to allow this.  We can have the promised
"revisit" discussion while this patch cooks, and drop it if it turns
out that it is still premature, which is not expected to happen at
this moment.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoCodingGuidelines: mention dynamic C99 initializer elements
Ævar Arnfjörð Bjarmason [Mon, 10 Oct 2022 20:37:57 +0000 (13:37 -0700)] 
CodingGuidelines: mention dynamic C99 initializer elements

The first use of variables in initializer elements appears to have
been 2b6854c863a (Cleanup variables in cat-file, 2007-04-21) released
with v1.5.2.

Some of those caused portability issues, and e.g. that "cat-file" use
was changed in 66dbfd55e38 (Rewrite dynamic structure initializations
to runtime assignment, 2010-05-14) which went out with v1.7.2.

But curiously 66dbfd55e38 missed some of them, e.g. an archive.c use
added in d5f53d6d6f2 (archive: complain about path specs that don't
match anything, 2009-12-12), and another one in merge-index.c (later
builtin/merge-index.c) in 0077138cd9d (Simplify some instances of
run_command() by using run_command_v_opt()., 2009-06-08).

As far as I can tell there's been no point since 2b6854c863a in 2007
where a compiler that didn't support this has been able to compile
git. Presumably 66dbfd55e38 was an attempt to make headway with wider
portability that ultimately wasn't completed.

In any case, we are thoroughly reliant on this syntax at this point,
so let's update the guidelines, see
https://lore.kernel.org/git/xmqqy1tunjgp.fsf@gitster.g/ for the
initial discussion.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoCodingGuidelines: update for C99
Ævar Arnfjörð Bjarmason [Mon, 10 Oct 2022 20:37:56 +0000 (13:37 -0700)] 
CodingGuidelines: update for C99

Since 7bc341e21b5 (git-compat-util: add a test balloon for C99
support, 2021-12-01) we've had a hard dependency on C99, but the prose
in CodingGuidelines was written under the assumption that we were
using C89 with a few C99 features.

As the updated prose notes we'd still like to hold off on novel C99
features, but let's make it clear that we target that C version, and
then enumerate new C99 features that are safe to use.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoGit 2.38.1 v2.38.1
Taylor Blau [Thu, 6 Oct 2022 00:24:38 +0000 (20:24 -0400)] 
Git 2.38.1

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.37.4
Taylor Blau [Fri, 7 Oct 2022 00:00:04 +0000 (20:00 -0400)] 
Sync with 2.37.4

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.37.4 v2.37.4
Taylor Blau [Thu, 6 Oct 2022 00:12:39 +0000 (20:12 -0400)] 
Git 2.37.4

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.36.3
Taylor Blau [Thu, 6 Oct 2022 21:48:57 +0000 (17:48 -0400)] 
Sync with 2.36.3

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot7527: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t7527: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t7527 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.36.3 v2.36.3
Taylor Blau [Fri, 30 Sep 2022 21:37:57 +0000 (17:37 -0400)] 
Git 2.36.3

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.35.5
Taylor Blau [Thu, 6 Oct 2022 21:44:44 +0000 (17:44 -0400)] 
Sync with 2.35.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.35.5 v2.35.5
Taylor Blau [Fri, 30 Sep 2022 21:25:26 +0000 (17:25 -0400)] 
Git 2.35.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.34.5
Taylor Blau [Thu, 6 Oct 2022 21:43:37 +0000 (17:43 -0400)] 
Sync with 2.34.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.34.5 v2.34.5
Taylor Blau [Fri, 30 Sep 2022 21:22:02 +0000 (17:22 -0400)] 
Git 2.34.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.33.5
Taylor Blau [Thu, 6 Oct 2022 21:42:55 +0000 (17:42 -0400)] 
Sync with 2.33.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.33.5 v2.33.5
Taylor Blau [Fri, 30 Sep 2022 21:04:26 +0000 (17:04 -0400)] 
Git 2.33.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.32.4
Taylor Blau [Thu, 6 Oct 2022 21:42:02 +0000 (17:42 -0400)] 
Sync with 2.32.4

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.32.4 v2.32.4
Taylor Blau [Fri, 30 Sep 2022 21:00:58 +0000 (17:00 -0400)] 
Git 2.32.4

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.31.5
Taylor Blau [Thu, 6 Oct 2022 21:40:44 +0000 (17:40 -0400)] 
Sync with 2.31.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.31.5 v2.31.5
Taylor Blau [Fri, 30 Sep 2022 20:56:02 +0000 (16:56 -0400)] 
Git 2.31.5

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoSync with 2.30.6
Taylor Blau [Thu, 6 Oct 2022 21:39:15 +0000 (17:39 -0400)] 
Sync with 2.30.6

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.30.6 v2.30.6
Taylor Blau [Fri, 30 Sep 2022 20:32:10 +0000 (16:32 -0400)] 
Git 2.30.6

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot5537: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t5537: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t5537 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot3206: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t3206: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t3206 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoGit 2.38 v2.38.0
Junio C Hamano [Sun, 2 Oct 2022 15:43:56 +0000 (08:43 -0700)] 
Git 2.38

Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoMerge tag 'l10n-2.38.0-rnd3' of https://github.com/git-l10n/git-po
Junio C Hamano [Sun, 2 Oct 2022 15:24:32 +0000 (08:24 -0700)] 
Merge tag 'l10n-2.38.0-rnd3' of https://github.com/git-l10n/git-po

l10n-2.38.0-rnd3

* tag 'l10n-2.38.0-rnd3' of https://github.com/git-l10n/git-po: (25 commits)
  l10n: zh_TW.po: Git 2.38.0, round 3
  l10n: fr: v2.38.0 round 3
  l10n: Update Catalan translation
  l10n: de.po: update German translation
  l10n: zh_CN: 2.38.0 round 3
  l10n: tr: v2.38.0 3rd round
  l10n: bg.po: Updated Bulgarian translation (5484t)
  l10n: po-id for 2.38 (round 3)
  l10n: es: update translation
  l10n: sv.po: Update Swedish translation (5484t0f0u)
  l10n: Update Catalan translation
  l10n: fr: don't say that merge is "the default strategy"
  l10n: zh_CN v2.38.0 rounds 1 & 2
  l10n: po-id for 2.38 (round 2)
  l10n: tr: v2.38.0 round 2
  l10n: bg.po: Updated Bulgarian translation (5484t)
  l10n: fr: v2.38.0 round 2
  l10n: fr: v2.38 round 1
  l10n: fr: The word 'branche' is only feminine
  l10n: Update Catalan translation
  ...

19 months agol10n: zh_TW.po: Git 2.38.0, round 3
Yi-Jyun Pan [Sat, 1 Oct 2022 11:04:42 +0000 (19:04 +0800)] 
l10n: zh_TW.po: Git 2.38.0, round 3

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
19 months agot7814: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t7814: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t7814 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot5537: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t5537: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t5537 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot5516: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t5516: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t5516 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot3207: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t3207: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t3207 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot2080: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:48:56 +0000 (16:48 -0400)] 
t2080: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t1092 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot1092: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t1092: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t1092 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot2080: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:48:56 +0000 (16:48 -0400)] 
t2080: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t1092 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot1092: prepare for changing protocol.file.allow
Taylor Blau [Fri, 30 Sep 2022 20:47:00 +0000 (16:47 -0400)] 
t1092: prepare for changing protocol.file.allow

Explicitly cloning over the "file://" protocol in t1092 in preparation
for merging a security release which will change the default value of
this configuration to be "user".

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoalias.c: reject too-long cmdline strings in split_cmdline()
Kevin Backhouse [Wed, 28 Sep 2022 22:53:32 +0000 (18:53 -0400)] 
alias.c: reject too-long cmdline strings in split_cmdline()

This function improperly uses an int to represent the number of entries
in the resulting argument array. This allows a malicious actor to
intentionally overflow the return value, leading to arbitrary heap
writes.

Because the resulting argv array is typically passed to execv(), it may
be possible to leverage this attack to gain remote code execution on a
victim machine. This was almost certainly the case for certain
configurations of git-shell until the previous commit limited the size
of input it would accept. Other calls to split_cmdline() are typically
limited by the size of argv the OS is willing to hand us, so are
similarly protected.

So this is not strictly fixing a known vulnerability, but is a hardening
of the function that is worth doing to protect against possible unknown
vulnerabilities.

One approach to fixing this would be modifying the signature of
`split_cmdline()` to look something like:

    int split_cmdline(char *cmdline, const char ***argv, size_t *argc);

Where the return value of `split_cmdline()` is negative for errors, and
zero otherwise. If non-NULL, the `*argc` pointer is modified to contain
the size of the `**argv` array.

But this implies an absurdly large `argv` array, which more than likely
larger than the system's argument limit. So even if split_cmdline()
allowed this, it would fail immediately afterwards when we called
execv(). So instead of converting all of `split_cmdline()`'s callers to
work with `size_t` types in this patch, instead pursue the minimal fix
here to prevent ever returning an array with more than INT_MAX entries
in it.

Signed-off-by: Kevin Backhouse <kevinbackhouse@github.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoshell: limit size of interactive commands
Jeff King [Wed, 28 Sep 2022 22:52:48 +0000 (18:52 -0400)] 
shell: limit size of interactive commands

When git-shell is run in interactive mode (which must be enabled by
creating $HOME/git-shell-commands), it reads commands from stdin, one
per line, and executes them.

We read the commands with git_read_line_interactively(), which uses a
strbuf under the hood. That means we'll accept an input of arbitrary
size (limited only by how much heap we can allocate). That creates two
problems:

  - the rest of the code is not prepared to handle large inputs. The
    most serious issue here is that split_cmdline() uses "int" for most
    of its types, which can lead to integer overflow and out-of-bounds
    array reads and writes. But even with that fixed, we assume that we
    can feed the command name to snprintf() (via xstrfmt()), which is
    stuck for historical reasons using "int", and causes it to fail (and
    even trigger a BUG() call).

  - since the point of git-shell is to take input from untrusted or
    semi-trusted clients, it's a mild denial-of-service. We'll allocate
    as many bytes as the client sends us (actually twice as many, since
    we immediately duplicate the buffer).

We can fix both by just limiting the amount of per-command input we're
willing to receive.

We should also fix split_cmdline(), of course, which is an accident
waiting to happen, but that can come on top. Most calls to
split_cmdline(), including the other one in git-shell, are OK because
they are reading from an OS-provided argv, which is limited in practice.
This patch should eliminate the immediate vulnerabilities.

I picked 4MB as an arbitrary limit. It's big enough that nobody should
ever run into it in practice (since the point is to run the commands via
exec, we're subject to OS limits which are typically much lower). But
it's small enough that allocating it isn't that big a deal.

The code is mostly just swapping out fgets() for the strbuf call, but we
have to add a few niceties like flushing and trimming line endings. We
could simplify things further by putting the buffer on the stack, but
4MB is probably a bit much there. Note that we'll _always_ allocate 4MB,
which for normal, non-malicious requests is more than we would before
this patch. But on the other hand, other git programs are happy to use
96MB for a delta cache. And since we'd never touch most of those pages,
on a lazy-allocating OS like Linux they won't even get allocated to
actual RAM.

The ideal would be a version of strbuf_getline() that accepted a maximum
value. But for a minimal vulnerability fix, let's keep things localized
and simple. We can always refactor further on top.

The included test fails in an obvious way with ASan or UBSan (which
notice the integer overflow and out-of-bounds reads). Without them, it
fails in a less obvious way: we may segfault, or we may try to xstrfmt()
a long string, leading to a BUG(). Either way, it fails reliably before
this patch, and passes with it. Note that we don't need an EXPENSIVE
prereq on it. It does take 10-15s to fail before this patch, but with
the new limit, we fail almost immediately (and the perl process
generating 2GB of data exits via SIGPIPE).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoshell: add basic tests
Jeff King [Wed, 28 Sep 2022 22:50:36 +0000 (18:50 -0400)] 
shell: add basic tests

We have no tests of even basic functionality of git-shell. Let's add a
couple of obvious ones. This will serve as a framework for adding tests
for new things we fix, as well as making sure we don't screw anything up
too badly while doing so.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agotransport: make `protocol.file.allow` be "user" by default
Taylor Blau [Fri, 29 Jul 2022 19:22:13 +0000 (15:22 -0400)] 
transport: make `protocol.file.allow` be "user" by default

An earlier patch discussed and fixed a scenario where Git could be used
as a vector to exfiltrate sensitive data through a Docker container when
a potential victim clones a suspicious repository with local submodules
that contain symlinks.

That security hole has since been plugged, but a similar one still
exists.  Instead of convincing a would-be victim to clone an embedded
submodule via the "file" protocol, an attacker could convince an
individual to clone a repository that has a submodule pointing to a
valid path on the victim's filesystem.

For example, if an individual (with username "foo") has their home
directory ("/home/foo") stored as a Git repository, then an attacker
could exfiltrate data by convincing a victim to clone a malicious
repository containing a submodule pointing at "/home/foo/.git" with
`--recurse-submodules`. Doing so would expose any sensitive contents in
stored in "/home/foo" tracked in Git.

For systems (such as Docker) that consider everything outside of the
immediate top-level working directory containing a Dockerfile as
inaccessible to the container (with the exception of volume mounts, and
so on), this is a violation of trust by exposing unexpected contents in
the working copy.

To mitigate the likelihood of this kind of attack, adjust the "file://"
protocol's default policy to be "user" to prevent commands that execute
without user input (including recursive submodule initialization) from
taking place by default.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t9NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:21:53 +0000 (15:21 -0400)] 
t/t9NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that interact with submodules a handful of times use
`test_config_global`.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t7NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:21:40 +0000 (15:21 -0400)] 
t/t7NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead. Test scripts that rely on
submodules throughout use a `git config --global` during a setup test
towards the beginning of the script.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t6NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:21:18 +0000 (15:21 -0400)] 
t/t6NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t5NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:21:06 +0000 (15:21 -0400)] 
t/t5NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead. Test scripts that rely on
submodules throughout use a `git config --global` during a setup test
towards the beginning of the script.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t4NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:20:43 +0000 (15:20 -0400)] 
t/t4NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead. Test scripts that rely on
submodules throughout use a `git config --global` during a setup test
towards the beginning of the script.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t3NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:20:28 +0000 (15:20 -0400)] 
t/t3NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead. Test scripts that rely on
submodules throughout use a `git config --global` during a setup test
towards the beginning of the script.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/2NNNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:20:03 +0000 (15:20 -0400)] 
t/2NNNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead. Test scripts that rely on
submodules throughout use a `git config --global` during a setup test
towards the beginning of the script.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/t1NNN: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:16:10 +0000 (15:16 -0400)] 
t/t1NNN: allow local submodules

To prepare for the default value of `protocol.file.allow` to change to
"user", ensure tests that rely on local submodules can initialize them
over the file protocol.

Tests that only need to interact with submodules in a limited capacity
have individual Git commands annotated with the appropriate
configuration via `-c`. Tests that interact with submodules a handful of
times use `test_config_global` instead.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agot/lib-submodule-update.sh: allow local submodules
Taylor Blau [Fri, 29 Jul 2022 19:13:58 +0000 (15:13 -0400)] 
t/lib-submodule-update.sh: allow local submodules

To prepare for changing the default value of `protocol.file.allow` to
"user", update the `prolog()` function in lib-submodule-update to allow
submodules to be cloned over the file protocol.

This is used by a handful of submodule-related test scripts, which
themselves will have to tweak the value of `protocol.file.allow` in
certain locations. Those will be done in subsequent commits.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agobuiltin/clone.c: disallow `--local` clones with symlinks
Taylor Blau [Thu, 28 Jul 2022 21:35:17 +0000 (17:35 -0400)] 
builtin/clone.c: disallow `--local` clones with symlinks

When cloning a repository with `--local`, Git relies on either making a
hardlink or copy to every file in the "objects" directory of the source
repository. This is done through the callpath `cmd_clone()` ->
`clone_local()` -> `copy_or_link_directory()`.

The way this optimization works is by enumerating every file and
directory recursively in the source repository's `$GIT_DIR/objects`
directory, and then either making a copy or hardlink of each file. The
only exception to this rule is when copying the "alternates" file, in
which case paths are rewritten to be absolute before writing a new
"alternates" file in the destination repo.

One quirk of this implementation is that it dereferences symlinks when
cloning. This behavior was most recently modified in 36596fd2df (clone:
better handle symlinked files at .git/objects/, 2019-07-10), which
attempted to support `--local` clones of repositories with symlinks in
their objects directory in a platform-independent way.

Unfortunately, this behavior of dereferencing symlinks (that is,
creating a hardlink or copy of the source's link target in the
destination repository) can be used as a component in attacking a
victim by inadvertently exposing the contents of file stored outside of
the repository.

Take, for example, a repository that stores a Dockerfile and is used to
build Docker images. When building an image, Docker copies the directory
contents into the VM, and then instructs the VM to execute the
Dockerfile at the root of the copied directory. This protects against
directory traversal attacks by copying symbolic links as-is without
dereferencing them.

That is, if a user has a symlink pointing at their private key material
(where the symlink is present in the same directory as the Dockerfile,
but the key itself is present outside of that directory), the key is
unreadable to a Docker image, since the link will appear broken from the
container's point of view.

This behavior enables an attack whereby a victim is convinced to clone a
repository containing an embedded submodule (with a URL like
"file:///proc/self/cwd/path/to/submodule") which has a symlink pointing
at a path containing sensitive information on the victim's machine. If a
user is tricked into doing this, the contents at the destination of
those symbolic links are exposed to the Docker image at runtime.

One approach to preventing this behavior is to recreate symlinks in the
destination repository. But this is problematic, since symlinking the
objects directory are not well-supported. (One potential problem is that
when sharing, e.g. a "pack" directory via symlinks, different writers
performing garbage collection may consider different sets of objects to
be reachable, enabling a situation whereby garbage collecting one
repository may remove reachable objects in another repository).

Instead, prohibit the local clone optimization when any symlinks are
present in the `$GIT_DIR/objects` directory of the source repository.
Users may clone the repository again by prepending the "file://" scheme
to their clone URL, or by adding the `--no-local` option to their `git
clone` invocation.

The directory iterator used by `copy_or_link_directory()` must no longer
dereference symlinks (i.e., it *must* call `lstat()` instead of `stat()`
in order to discover whether or not there are symlinks present). This has
no bearing on the overall behavior, since we will immediately `die()` on
encounter a symlink.

Note that t5604.33 suggests that we do support local clones with
symbolic links in the source repository's objects directory, but this
was likely unintentional, or at least did not take into consideration
the problem with sharing parts of the objects directory with symbolic
links at the time. Update this test to reflect which options are and
aren't supported.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
19 months agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sat, 1 Oct 2022 02:02:03 +0000 (10:02 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

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

19 months agoMerge branch 'l10n-de-2.38-rnd3' of github.com:ralfth/git
Jiang Xin [Thu, 29 Sep 2022 10:54:12 +0000 (18:54 +0800)] 
Merge branch 'l10n-de-2.38-rnd3' of github.com:ralfth/git

* 'l10n-de-2.38-rnd3' of github.com:ralfth/git:
  l10n: de.po: update German translation

19 months agoMerge branch 'fr_2.38_rnd3' of github.com:jnavila/git
Jiang Xin [Thu, 29 Sep 2022 00:00:30 +0000 (08:00 +0800)] 
Merge branch 'fr_2.38_rnd3' of github.com:jnavila/git

* 'fr_2.38_rnd3' of github.com:jnavila/git:
  l10n: fr: v2.38.0 round 3

19 months agoMerge branch 'catalan' of github.com:Softcatala/git-po
Jiang Xin [Wed, 28 Sep 2022 23:59:44 +0000 (07:59 +0800)] 
Merge branch 'catalan' of github.com:Softcatala/git-po

* 'catalan' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

19 months agol10n: fr: v2.38.0 round 3
Jean-Noël Avila [Wed, 28 Sep 2022 19:46:22 +0000 (21:46 +0200)] 
l10n: fr: v2.38.0 round 3

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
19 months agoread-cache: avoid misaligned reads in index v4
Victoria Dye [Wed, 28 Sep 2022 17:19:00 +0000 (17:19 +0000)] 
read-cache: avoid misaligned reads in index v4

The process for reading the index into memory from disk is to first read its
contents into a single memory-mapped file buffer (type 'char *'), then
sequentially convert each on-disk index entry into a corresponding incore
'cache_entry'. To access the contents of the on-disk entry for processing, a
moving pointer within the memory-mapped file is cast to type 'struct
ondisk_cache_entry *'.

In index v4, the entries in the on-disk index file are written *without*
aligning their first byte to a 4-byte boundary; entries are a variable
length (depending on the entry name and whether or not extended flags are
used). As a result, casting the 'char *' buffer pointer to 'struct
ondisk_cache_entry *' then accessing its contents in a 'SANITIZE=undefined'
build can trigger the following error:

  read-cache.c:1886:46: runtime error: member access within misaligned
  address <address> for type 'struct ondisk_cache_entry', which requires 4
  byte alignment

Avoid this error by reading fields directly from the 'char *' buffer, using
the 'offsetof' individual fields in 'struct ondisk_cache_entry'.
Additionally, add documentation describing why the new approach avoids the
misaligned address error, as well as advice on how to improve the
implementation in the future.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Victoria Dye <vdye@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agol10n: Update Catalan translation
Jordi Mas [Wed, 28 Sep 2022 17:05:55 +0000 (19:05 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
19 months agol10n: de.po: update German translation
Ralf Thielow [Wed, 28 Sep 2022 15:15:53 +0000 (17:15 +0200)] 
l10n: de.po: update German translation

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
19 months agol10n: zh_CN: 2.38.0 round 3
Fangyi Zhou [Wed, 28 Sep 2022 14:50:49 +0000 (15:50 +0100)] 
l10n: zh_CN: 2.38.0 round 3

Signed-off-by: Fangyi Zhou <me@fangyi.io>
19 months agoMerge branch 'turkish' of github.com:bitigchi/git-po
Jiang Xin [Wed, 28 Sep 2022 12:54:29 +0000 (20:54 +0800)] 
Merge branch 'turkish' of github.com:bitigchi/git-po

* 'turkish' of github.com:bitigchi/git-po:
  l10n: tr: v2.38.0 3rd round

19 months agoMerge branch 'master' of github.com:alshopov/git-po
Jiang Xin [Wed, 28 Sep 2022 12:52:34 +0000 (20:52 +0800)] 
Merge branch 'master' of github.com:alshopov/git-po

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

19 months agol10n: tr: v2.38.0 3rd round
Emir SARI [Wed, 28 Sep 2022 09:32:13 +0000 (12:32 +0300)] 
l10n: tr: v2.38.0 3rd round

Signed-off-by: Emir SARI <emir_sari@icloud.com>
19 months agol10n: bg.po: Updated Bulgarian translation (5484t)
Alexander Shopov [Wed, 28 Sep 2022 09:00:59 +0000 (11:00 +0200)] 
l10n: bg.po: Updated Bulgarian translation (5484t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
19 months agol10n: po-id for 2.38 (round 3)
Bagas Sanjaya [Sun, 25 Sep 2022 07:53:53 +0000 (14:53 +0700)] 
l10n: po-id for 2.38 (round 3)

Update following components:

  * sequencer.c
  * wt-status.c

Translate following new components:

  * compat/compiler.h
  * compat/disk.h
  * compat/fsmonitor/fsm-health-win32.c
  * compat/fsmonitor/fsm-listen-darwin.c
  * compat/fsmonitor/fsm-listen-win32.c
  * compat/fsmonitor/fsm-settings-win32.c
  * compat/mingw.c
  * compat/obstack.c
  * compat/regex/regcomp.c
  * compat/simple-ipc/ipc-unix-socket.c
  * compat/simple-ipc/ipc-win32.c
  * compat/terminal.c
  * convert.c
  * entry.c
  * environment.c
  * exec-cmd.c
  * git-merge-octopus.sh
  * git-sh-setup.sh
  * list-objects-filter-options.c
  * list-objects-filter-options.h
  * list-objects.c
  * lockfile.c
  * ls-refs.c
  * mailinfo.c
  * name-hash.c
  * notes-merge.c
  * notes-utils.c
  * pkt-line.c
  * preload-index.c
  * pretty.c
  * promisor-remote.c
  * protocol-caps.c
  * read-cache.c
  * scalar.c
  * transport-helper.c
  * transport.c
  * tree-walk.c
  * urlmatch.c
  * walker.c
  * wrapper.c

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
19 months agol10n: es: update translation
Alex Henrie [Wed, 28 Sep 2022 04:56:55 +0000 (22:56 -0600)] 
l10n: es: update translation

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
19 months agoMerge branch 'main' of github.com:git/git
Jiang Xin [Wed, 28 Sep 2022 00:03:38 +0000 (08:03 +0800)] 
Merge branch 'main' of github.com:git/git

* 'main' of github.com:git/git:
  Git 2.38-rc2
  pack-bitmap: remove trace2 region from hot path

19 months agoGit 2.38-rc2 v2.38.0-rc2
Junio C Hamano [Tue, 27 Sep 2022 18:25:52 +0000 (11:25 -0700)] 
Git 2.38-rc2

We have small updates since -rc1 but none of them is about a new
thing and there is no updates to the release notes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agoMerge branch 'ds/bitmap-lookup-remove-tracing'
Junio C Hamano [Tue, 27 Sep 2022 04:46:51 +0000 (21:46 -0700)] 
Merge branch 'ds/bitmap-lookup-remove-tracing'

Perf-fix.

* ds/bitmap-lookup-remove-tracing:
  pack-bitmap: remove trace2 region from hot path

19 months agopack-bitmap: remove trace2 region from hot path
Derrick Stolee [Mon, 26 Sep 2022 13:17:57 +0000 (13:17 +0000)] 
pack-bitmap: remove trace2 region from hot path

The trace2 region around the call to lazy_bitmap_for_commit() in
bitmap_for_commit() was added in 28cd730680d (pack-bitmap: prepare to
read lookup table extension, 2022-08-14). While adding trace2 regions is
typically helpful for tracking performance, this method is called
possibly thousands of times as a commit walk explores commit history
looking for a matching bitmap. When trace2 output is enabled, this
region is emitted many times and performance is throttled by that
output.

For now, remove these regions entirely.

This is a critical path, and it would be valuable to measure that the
time spent in bitmap_for_commit() does not increase when using the
commit lookup table. The best way to do that would be to use a mechanism
that sums the time spent in a region and reports a single value at the
end of the process. This technique was introduced but not merged by [1]
so maybe this example presents some justification to revisit that
approach.

[1] https://lore.kernel.org/git/pull.1099.v2.git.1640720202.gitgitgadget@gmail.com/

To help with the 'git blame' output in this region, add a comment that
warns against adding a trace2 region. Delete a test from t5310 that used
that trace output to check that this lookup optimization was activated.
To create this kind of test again in the future, the stopwatch traces
mentioned earlier could be used as a signal that we activated this code
path.

Helpedy-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agosequencer: avoid dropping fixup commit that targets self via commit-ish
Johannes Altmanninger [Sat, 24 Sep 2022 22:29:04 +0000 (17:29 -0500)] 
sequencer: avoid dropping fixup commit that targets self via commit-ish

Commit 68d5d03bc4 (rebase: teach --autosquash to match on sha1 in
addition to message, 2010-11-04) taught autosquash to recognize
subjects like "fixup! 7a235b" where 7a235b is an OID-prefix. It
actually did more than advertised: 7a235b can be an arbitrary
commit-ish (as long as it's not trailed by spaces).

Accidental(?) use of this secret feature revealed a bug where we
would silently drop a fixup commit. The bug can also be triggered
when using an OID-prefix but that's unlikely in practice.

Let the commit with subject "fixup! main" be the tip of the "main"
branch. When computing the fixup target for this commit, we find
the commit itself. This is wrong because, by definition, a fixup
target must be an earlier commit in the todo list. We wrongly find
the current commit because we added it to the todo list prematurely.
Avoid these fixup-cycles by only adding the current commit to the
todo list after we have finished looking for the fixup target.

Reported-by: Erik Cervin Edin <erik@cervined.in>
Signed-off-by: Johannes Altmanninger <aclopte@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
19 months agol10n: sv.po: Update Swedish translation (5484t0f0u)
Peter Krefting [Mon, 26 Sep 2022 05:36:23 +0000 (06:36 +0100)] 
l10n: sv.po: Update Swedish translation (5484t0f0u)

Also fix a couple of typos.

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
19 months agol10n: Update Catalan translation
Jordi Mas [Sun, 25 Sep 2022 19:04:22 +0000 (21:04 +0200)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
19 months agoMerge branch 'main' of github.com:git/git
Jiang Xin [Sat, 24 Sep 2022 13:51:06 +0000 (21:51 +0800)] 
Merge branch 'main' of github.com:git/git

* 'main' of github.com:git/git:
  cmd-list.perl: fix identifying man sections
  pack-bitmap: improve grammar of "xor chain" error message

19 months agoMerge branch 'fr_quickfix' of github.com:jnavila/git
Jiang Xin [Sat, 24 Sep 2022 13:12:37 +0000 (21:12 +0800)] 
Merge branch 'fr_quickfix' of github.com:jnavila/git

* 'fr_quickfix' of github.com:jnavila/git:
  l10n: fr: don't say that merge is "the default strategy"

19 months agoMerge branch 'po-id' of github.com:bagasme/git-po
Jiang Xin [Sat, 24 Sep 2022 13:09:22 +0000 (21:09 +0800)] 
Merge branch 'po-id' of github.com:bagasme/git-po

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

19 months agoMerge branch 'turkish' of github.com:bitigchi/git-po
Jiang Xin [Sat, 24 Sep 2022 13:08:11 +0000 (21:08 +0800)] 
Merge branch 'turkish' of github.com:bitigchi/git-po

* 'turkish' of github.com:bitigchi/git-po:
  l10n: tr: v2.38.0 round 2

20 months agol10n: fr: don't say that merge is "the default strategy"
Alex Henrie [Mon, 27 Jun 2022 04:17:24 +0000 (22:17 -0600)] 
l10n: fr: don't say that merge is "the default strategy"

The text of this message was changed in commit
71076d0edde43a7672a9a0f555753ff078602a64 to avoid making any
suggestion about which strategy is better for the situation at hand.
Update the Franch translation to match.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
20 months agoMerge branch 'ac/bitmap-lookup-table'
Junio C Hamano [Fri, 23 Sep 2022 18:07:49 +0000 (11:07 -0700)] 
Merge branch 'ac/bitmap-lookup-table'

Grammofix.

* ac/bitmap-lookup-table:
  pack-bitmap: improve grammar of "xor chain" error message

20 months agoMerge branch 'ma/scalar-to-main-fix'
Junio C Hamano [Fri, 23 Sep 2022 18:07:48 +0000 (11:07 -0700)] 
Merge branch 'ma/scalar-to-main-fix'

Fix manpage generation.

* ma/scalar-to-main-fix:
  cmd-list.perl: fix identifying man sections

20 months agocmd-list.perl: fix identifying man sections
Martin Ågren [Fri, 23 Sep 2022 08:07:33 +0000 (10:07 +0200)] 
cmd-list.perl: fix identifying man sections

We attribute each documentation text file to a man section by finding a
line in the file that looks like "gitfoo(<digit>)". Commit cc75e556a9
("scalar: add to 'git help -a' command list", 2022-09-02) updated this
logic to look not only for "gitfoo" but also "scalarfoo". In doing so,
it forgot to account for the fact that after the updated regex has found
a match, the man section is no longer to be found in `$1` but now lives
in `$2`.

This makes our git(1) manpage look as follows:

  Main porcelain commands
       git-add(git)
           Add file contents to the index.

  [...]

       gitk(git)
           The Git repository browser.

       scalar(scalar)
           A tool for managing large Git repositories.

Restore the man sections by not capturing the (git|scalar) part of the
match into `$1`.

As noted by Ævar [1], we could even match any "foo" rather than just
"gitfoo" and "scalarfoo", but that's a larger change. For now, just fix
the regression in cc75e556a9.

[1] https://lore.kernel.org/git/220923.86wn9u4joo.gmgdl@evledraar.gmail.com/#t

Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agopack-bitmap: improve grammar of "xor chain" error message
Alex Henrie [Thu, 22 Sep 2022 02:51:58 +0000 (20:51 -0600)] 
pack-bitmap: improve grammar of "xor chain" error message

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agol10n: zh_CN v2.38.0 rounds 1 & 2
Fangyi Zhou [Fri, 16 Sep 2022 10:31:26 +0000 (11:31 +0100)] 
l10n: zh_CN v2.38.0 rounds 1 & 2

Reviewed-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Li Linchao <lilinchao@oschina.cn>
Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Fangyi Zhou <me@fangyi.io>
20 months agol10n: po-id for 2.38 (round 2)
Bagas Sanjaya [Thu, 22 Sep 2022 07:54:56 +0000 (14:54 +0700)] 
l10n: po-id for 2.38 (round 2)

Update following components:

  * branch.c
  * builtin/log.c
  * builtin/rebase.c
  * builtin/remote.c
  * builtin/reset.c
  * builtin/rev-list.c
  * builtin/rev-parse.c
  * builtin/revert.c
  * builtin/sparse-checkout.c
  * builtin/submodule--helper.c
  * command-list.h
  * help.c
  * merge.c

Translate following new components:

  * builtin/check-attr.c
  * builtin/check-ignore.c
  * builtin/check-mailmap.c
  * builtin/column.c
  * builtin/credential-cache--daemon.c
  * builtin/credential-cache.c
  * builtin/credential-store.c
  * builtin/diagnose.c
  * builtin/env--helper.c
  * builtin/fsmonitor--daemon.c
  * builtin/interpret-trailers.c
  * builtin/mailinfo.c
  * builtin/mailsplit.c
  * builtin/mktag.c
  * builtin/mktree.c
  * builtin/pack-redundant.c
  * builtin/replace.c
  * builtin/rerere.c
  * builtin/stripspace.c
  * bulk-checkin.c
  * commit.c
  * credential.c
  * fsmonitor-ipc.c
  * fsmonitor-settings.c
  * http-fetch.c
  * http.c

Also remove unused strings.

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
20 months agol10n: tr: v2.38.0 round 2
Emir SARI [Thu, 22 Sep 2022 13:40:33 +0000 (16:40 +0300)] 
l10n: tr: v2.38.0 round 2

Signed-off-by: Emir SARI <emir_sari@icloud.com>
20 months agol10n: bg.po: Updated Bulgarian translation (5484t)
Alexander Shopov [Fri, 23 Sep 2022 09:18:57 +0000 (11:18 +0200)] 
l10n: bg.po: Updated Bulgarian translation (5484t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
20 months agoMerge branch 'fr_v2.38_rnd2' of github.com:jnavila/git
Jiang Xin [Fri, 23 Sep 2022 09:06:12 +0000 (17:06 +0800)] 
Merge branch 'fr_v2.38_rnd2' of github.com:jnavila/git

* 'fr_v2.38_rnd2' of github.com:jnavila/git:
  l10n: fr: v2.38.0 round 2
  l10n: fr: v2.38 round 1
  l10n: fr: The word 'branche' is only feminine

20 months agoMerge branch 'catalan' of github.com:Softcatala/git-po
Jiang Xin [Fri, 23 Sep 2022 08:58:14 +0000 (16:58 +0800)] 
Merge branch 'catalan' of github.com:Softcatala/git-po

* 'catalan' of github.com:Softcatala/git-po:
  l10n: Update Catalan translation

20 months agoMerge branch 'l10n-de-2.38' of github.com:ralfth/git
Jiang Xin [Fri, 23 Sep 2022 08:51:23 +0000 (16:51 +0800)] 
Merge branch 'l10n-de-2.38' of github.com:ralfth/git

* 'l10n-de-2.38' of github.com:ralfth/git:
  l10n: de.po: update German translation

20 months agoMerge branch 'main' of github.com:git/git
Jiang Xin [Fri, 23 Sep 2022 08:50:32 +0000 (16:50 +0800)] 
Merge branch 'main' of github.com:git/git

* 'main' of github.com:git/git:
  list-objects-filter: initialize sub-filter structs
  Git 2.38-rc1
  Final batch before -rc1
  builtin/diagnose.c: don't translate the two mode values
  t/Makefile: remove 'test-results' on 'make clean'
  gc: don't translate literal commands
  Documentation: clean up various typos in technical docs
  Documentation: clean up a few misspelled word typos
  version: fix builtin linking & documentation
  diagnose: add to command-list.txt
  Documentation: add ReviewingGuidelines
  commit-graph: Fix missing closedir in expire_commit_graphs
  diagnose.c: refactor to safely use 'd_type'
  help: fix doubled words in explanation for developer interfaces
  api docs: link to html version of api-trace2
  docs: fix a few recently broken links
  reftable: use a pointer for pq_entry param

20 months agoMerge branch 'jk/list-objects-filter-cleanup'
Junio C Hamano [Thu, 22 Sep 2022 22:30:47 +0000 (15:30 -0700)] 
Merge branch 'jk/list-objects-filter-cleanup'

Fix uninitialized memory access in a recent fix-up that is already
in -rc1.

* jk/list-objects-filter-cleanup:
  list-objects-filter: initialize sub-filter structs

20 months agoremote: handle rename of remote without fetch refspec
Jeff King [Thu, 22 Sep 2022 05:33:29 +0000 (01:33 -0400)] 
remote: handle rename of remote without fetch refspec

We return an error when trying to rename a remote that has no fetch
refspec:

  $ git config --unset-all remote.origin.fetch
  $ git remote rename origin foo
  fatal: could not unset 'remote.foo.fetch'

To make things even more confusing, we actually _do_ complete the config
modification, via git_config_rename_section(). After that we try to
rewrite the fetch refspec (to say refs/remotes/foo instead of origin).
But our call to git_config_set_multivar() to remove the existing entries
fails, since there aren't any, and it calls die().

We could fix this by using the "gently" form of the config call, and
checking the error code. But there is an even simpler fix: if we know
that there are no refspecs to rewrite, then we can skip that part
entirely.

Reported-by: John A. Leuenhagen <john@zlima12.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agoclone: allow "--bare" with "-o"
Jeff King [Thu, 22 Sep 2022 05:32:05 +0000 (01:32 -0400)] 
clone: allow "--bare" with "-o"

We explicitly forbid the combination of "--bare" with "-o", but there
doesn't seem to be any good reason to do so. The original logic came as
part of e6489a1bdf (clone: do not accept more than one -o option.,
2006-01-22), but that commit does not give any reason.

Furthermore, the equivalent combination via config is allowed:

  git -c clone.defaultRemoteName=foo clone ...

and works as expected. It may be that this combination was considered
useless, because a bare clone does not set remote.origin.fetch (and
hence there is no refs/remotes/origin hierarchy). But it does set
remote.origin.url, and that name is visible to the user via "git fetch
origin", etc.

Let's allow the options to be used together, and switch the "forbid"
test in t5606 to check that we use the requested name. That test came
much later in 349cff76de (clone: add tests for --template and some
disallowed option pairs, 2020-09-29), and does not offer any logic
beyond "let's test what the code currently does".

Reported-by: John A. Leuenhagen <john@zlima12.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
20 months agol10n: fr: v2.38.0 round 2
Jean-Noël Avila [Thu, 22 Sep 2022 19:42:36 +0000 (21:42 +0200)] 
l10n: fr: v2.38.0 round 2

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>