]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
3 years agobisect: avoid tailing CR characters from revision in replay
Carlo Marcelo Arenas Belón [Wed, 20 May 2020 17:08:43 +0000 (10:08 -0700)] 
bisect: avoid tailing CR characters from revision in replay

6c722cbe5a (bisect: allow CRLF line endings in "git bisect replay"
input, 2020-05-07) includes CR as a field separator, but relies on
it not being included in the last field, which breaks at least when
running under OpenBSD 6.7's sh.

Instead of just assume the CR will get swallowed, read the rest of
the line into an otherwise unused variable and ignore it everywhere
except on the call for git bisect start, where it matters.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 years agobisect: allow CRLF line endings in "git bisect replay" input
Christopher Warrington [Thu, 7 May 2020 21:29:40 +0000 (21:29 +0000)] 
bisect: allow CRLF line endings in "git bisect replay" input

We advertise that the bisect log can be corrected in your editor
before being fed to "git bisect replay", but some editors may
turn the line endings to CRLF.

Update the parser of the input lines so that the CR at the end of
the line gets ignored.

Were anyone to intentionally be using terms/revs with embedded CRs,
replaying such bisects will no longer work with this change. I suspect
that this is incredibly rare.

Signed-off-by: Christopher Warrington <chwarr@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.26.2 v2.26.2
Jonathan Nieder [Sun, 19 Apr 2020 23:32:24 +0000 (16:32 -0700)] 
Git 2.26.2

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.25.4 v2.25.4
Jonathan Nieder [Sun, 19 Apr 2020 23:31:07 +0000 (16:31 -0700)] 
Git 2.25.4

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.24.3 v2.24.3
Jonathan Nieder [Sun, 19 Apr 2020 23:30:34 +0000 (16:30 -0700)] 
Git 2.24.3

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.23.3 v2.23.3
Jonathan Nieder [Sun, 19 Apr 2020 23:30:27 +0000 (16:30 -0700)] 
Git 2.23.3

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.22.4 v2.22.4
Jonathan Nieder [Sun, 19 Apr 2020 23:30:19 +0000 (16:30 -0700)] 
Git 2.22.4

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.21.3 v2.21.3
Jonathan Nieder [Sun, 19 Apr 2020 23:30:08 +0000 (16:30 -0700)] 
Git 2.21.3

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.20.4 v2.20.4
Jonathan Nieder [Sun, 19 Apr 2020 23:28:57 +0000 (16:28 -0700)] 
Git 2.20.4

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.19.5 v2.19.5
Jonathan Nieder [Sun, 19 Apr 2020 23:26:41 +0000 (16:26 -0700)] 
Git 2.19.5

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.18.4 v2.18.4
Jonathan Nieder [Sun, 19 Apr 2020 23:24:14 +0000 (16:24 -0700)] 
Git 2.18.4

This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.17.5 v2.17.5
Jeff King [Sun, 19 Apr 2020 06:34:55 +0000 (02:34 -0400)] 
Git 2.17.5

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agofsck: reject URL with empty host in .gitmodules
Jonathan Nieder [Sun, 19 Apr 2020 03:57:22 +0000 (20:57 -0700)] 
fsck: reject URL with empty host in .gitmodules

Git's URL parser interprets

https:///example.com/repo.git

to have no host and a path of "example.com/repo.git".  Curl, on the
other hand, internally redirects it to https://example.com/repo.git.  As
a result, until "credential: parse URL without host as empty host, not
unset", tricking a user into fetching from such a URL would cause Git to
send credentials for another host to example.com.

Teach fsck to block and detect .gitmodules files using such a URL to
prevent sharing them with Git versions that are not yet protected.

A relative URL in a .gitmodules file could also be used to trigger this.
The relative URL resolver used for .gitmodules does not normalize
sequences of slashes and can follow ".." components out of the path part
and to the host part of a URL, meaning that such a relative URL can be
used to traverse from a https://foo.example.com/innocent superproject to
a https:///attacker.example.com/exploit submodule. Fortunately,
redundant extra slashes in .gitmodules are rare, so we can catch this by
detecting one after a leading sequence of "./" and "../" components.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
4 years agocredential: treat URL with empty scheme as invalid
Jonathan Nieder [Sun, 19 Apr 2020 03:54:57 +0000 (20:54 -0700)] 
credential: treat URL with empty scheme as invalid

Until "credential: refuse to operate when missing host or protocol",
Git's credential handling code interpreted URLs with empty scheme to
mean "give me credentials matching this host for any protocol".

Luckily libcurl does not recognize such URLs (it tries to look for a
protocol named "" and fails). Just in case that changes, let's reject
them within Git as well. This way, credential_from_url is guaranteed to
always produce a "struct credential" with protocol and host set.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agocredential: treat URL without scheme as invalid
Jonathan Nieder [Sun, 19 Apr 2020 03:54:13 +0000 (20:54 -0700)] 
credential: treat URL without scheme as invalid

libcurl permits making requests without a URL scheme specified.  In
this case, it guesses the URL from the hostname, so I can run

git ls-remote http::ftp.example.com/path/to/repo

and it would make an FTP request.

Any user intentionally using such a URL is likely to have made a typo.
Unfortunately, credential_from_url is not able to determine the host and
protocol in order to determine appropriate credentials to send, and
until "credential: refuse to operate when missing host or protocol",
this resulted in another host's credentials being leaked to the named
host.

Teach credential_from_url_gently to consider such a URL to be invalid
so that fsck can detect and block gitmodules files with such URLs,
allowing server operators to avoid serving them to downstream users
running older versions of Git.

This also means that when such URLs are passed on the command line, Git
will print a clearer error so affected users can switch to the simpler
URL that explicitly specifies the host and protocol they intend.

One subtlety: .gitmodules files can contain relative URLs, representing
a URL relative to the URL they were cloned from.  The relative URL
resolver used for .gitmodules can follow ".." components out of the path
part and past the host part of a URL, meaning that such a relative URL
can be used to traverse from a https://foo.example.com/innocent
superproject to a https::attacker.example.com/exploit submodule.
Fortunately a leading ':' in the first path component after a series of
leading './' and '../' components is unlikely to show up in other
contexts, so we can catch this by detecting that pattern.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
4 years agocredential: die() when parsing invalid urls
Jeff King [Sun, 19 Apr 2020 03:53:09 +0000 (20:53 -0700)] 
credential: die() when parsing invalid urls

When we try to initialize credential loading by URL and find that the
URL is invalid, we set all fields to NULL in order to avoid acting on
malicious input. Later when we request credentials, we diagonse the
erroneous input:

fatal: refusing to work with credential missing host field

This is problematic in two ways:

- The message doesn't tell the user *why* we are missing the host
  field, so they can't tell from this message alone how to recover.
  There can be intervening messages after the original warning of
  bad input, so the user may not have the context to put two and two
  together.

- The error only occurs when we actually need to get a credential.  If
  the URL permits anonymous access, the only encouragement the user gets
  to correct their bogus URL is a quiet warning.

  This is inconsistent with the check we perform in fsck, where any use
  of such a URL as a submodule is an error.

When we see such a bogus URL, let's not try to be nice and continue
without helpers. Instead, die() immediately. This is simpler and
obviously safe. And there's very little chance of disrupting a normal
workflow.

It's _possible_ that somebody has a legitimate URL with a raw newline in
it. It already wouldn't work with credential helpers, so this patch
steps that up from an inconvenience to "we will refuse to work with it
at all". If such a case does exist, we should figure out a way to work
with it (especially if the newline is only in the path component, which
we normally don't even pass to helpers). But until we see a real report,
we're better off being defensive.

Reported-by: Carlo Arenas <carenas@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agofsck: convert gitmodules url to URL passed to curl
Jonathan Nieder [Sun, 19 Apr 2020 03:52:34 +0000 (20:52 -0700)] 
fsck: convert gitmodules url to URL passed to curl

In 07259e74ec1 (fsck: detect gitmodules URLs with embedded newlines,
2020-03-11), git fsck learned to check whether URLs in .gitmodules could
be understood by the credential machinery when they are handled by
git-remote-curl.

However, the check is overbroad: it checks all URLs instead of only
URLs that would be passed to git-remote-curl. In principle a git:// or
file:/// URL does not need to follow the same conventions as an http://
URL; in particular, git:// and file:// protocols are not succeptible to
issues in the credential API because they do not support attaching
credentials.

In the HTTP case, the URL in .gitmodules does not always match the URL
that would be passed to git-remote-curl and the credential machinery:
Git's URL syntax allows specifying a remote helper followed by a "::"
delimiter and a URL to be passed to it, so that

git ls-remote http::https://example.com/repo.git

invokes git-remote-http with https://example.com/repo.git as its URL
argument. With today's checks, that distinction does not make a
difference, but for a check we are about to introduce (for empty URL
schemes) it will matter.

.gitmodules files also support relative URLs. To ensure coverage for the
https based embedded-newline attack, urldecode and check them directly
for embedded newlines.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
4 years agocredential: refuse to operate when missing host or protocol
Jeff King [Sun, 19 Apr 2020 03:50:48 +0000 (20:50 -0700)] 
credential: refuse to operate when missing host or protocol

The credential helper protocol was designed to be very flexible: the
fields it takes as input are treated as a pattern, and any missing
fields are taken as wildcards. This allows unusual things like:

  echo protocol=https | git credential reject

to delete all stored https credentials (assuming the helpers themselves
treat the input that way). But when helpers are invoked automatically by
Git, this flexibility works against us. If for whatever reason we don't
have a "host" field, then we'd match _any_ host. When you're filling a
credential to send to a remote server, this is almost certainly not what
you want.

Prevent this at the layer that writes to the credential helper. Add a
check to the credential API that the host and protocol are always passed
in, and add an assertion to the credential_write function that speaks
credential helper protocol to be doubly sure.

There are a few ways this can be triggered in practice:

  - the "git credential" command passes along arbitrary credential
    parameters it reads from stdin.

  - until the previous patch, when the host field of a URL is empty, we
    would leave it unset (rather than setting it to the empty string)

  - a URL like "example.com/foo.git" is treated by curl as if "http://"
    was present, but our parser sees it as a non-URL and leaves all
    fields unset

  - the recent fix for URLs with embedded newlines blanks the URL but
    otherwise continues. Rather than having the desired effect of
    looking up no credential at all, many helpers will return _any_
    credential

Our earlier test for an embedded newline didn't catch this because it
only checked that the credential was cleared, but didn't configure an
actual helper. Configuring the "verbatim" helper in the test would show
that it is invoked (it's obviously a silly helper which doesn't look at
its input, but the point is that it shouldn't be run at all). Since
we're switching this case to die(), we don't need to bother with a
helper. We can see the new behavior just by checking that the operation
fails.

We'll add new tests covering partial input as well (these can be
triggered through various means with url-parsing, but it's simpler to
just check them directly, as we know we are covered even if the url
parser changes behavior in the future).

[jn: changed to die() instead of logging and showing a manual
 username/password prompt]

Reported-by: Carlo Arenas <carenas@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agocredential: parse URL without host as empty host, not unset
Jeff King [Sun, 19 Apr 2020 03:48:05 +0000 (20:48 -0700)] 
credential: parse URL without host as empty host, not unset

We may feed a URL like "cert:///path/to/cert.pem" into the credential
machinery to get the key for a client-side certificate. That
credential has no hostname field, which is about to be disallowed (to
avoid confusion with protocols where a helper _would_ expect a
hostname).

This means as of the next patch, credential helpers won't work for
unlocking certs. Let's fix that by doing two things:

  - when we parse a url with an empty host, set the host field to the
    empty string (asking only to match stored entries with an empty
    host) rather than NULL (asking to match _any_ host).

  - when we build a cert:// credential by hand, similarly assign an
    empty string

It's the latter that is more likely to impact real users in practice,
since it's what's used for http connections. But we don't have good
infrastructure to test it.

The url-parsing version will help anybody using git-credential in a
script, and is easy to test.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agot0300: use more realistic inputs
Jeff King [Sun, 19 Apr 2020 03:47:30 +0000 (20:47 -0700)] 
t0300: use more realistic inputs

Many of the tests in t0300 give partial inputs to git-credential,
omitting a protocol or hostname. We're checking only high-level things
like whether and how helpers are invoked at all, and we don't care about
specific hosts. However, in preparation for tightening up the rules
about when we're willing to run a helper, let's start using input that's
a bit more realistic: pretend as if http://example.com is being
examined.

This shouldn't change the point of any of the tests, but do note we have
to adjust the expected output to accommodate this (filling a credential
will repeat back the protocol/host fields to stdout, and the helper
debug messages and askpass prompt will change on stderr).

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agot0300: make "quit" helper more realistic
Jeff King [Sun, 19 Apr 2020 05:36:02 +0000 (01:36 -0400)] 
t0300: make "quit" helper more realistic

We test a toy credential helper that writes "quit=1" and confirms that
we stop running other helpers. However, that helper is unrealistic in
that it does not bother to read its stdin at all.

For now we don't send any input to it, because we feed git-credential a
blank credential. But that will change in the next patch, which will
cause this test to racily fail, as git-credential will get SIGPIPE
writing to the helper rather than exiting because it was asked to.

Let's make this one-off helper more like our other sample helpers, and
have it source the "dump" script. That will read stdin, fixing the
SIGPIPE problem. But it will also write what it sees to stderr. We can
make the test more robust by checking that output, which confirms that
we do run the quit helper, don't run any other helpers, and exit for the
reason we expected.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
4 years agoGit 2.26.1 v2.26.1
Junio C Hamano [Wed, 25 Mar 2020 20:07:47 +0000 (13:07 -0700)] 
Git 2.26.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.26 v2.26.0
Junio C Hamano [Sun, 22 Mar 2020 23:50:46 +0000 (16:50 -0700)] 
Git 2.26

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'en/rebase-backend'
Junio C Hamano [Sat, 21 Mar 2020 20:48:54 +0000 (13:48 -0700)] 
Merge branch 'en/rebase-backend'

Test fix.

* en/rebase-backend:
  t3419: prevent failure when run with EXPENSIVE

4 years agoMerge tag 'l10n-2.26.0-rnd2.1' of git://github.com/git-l10n/git-po.git
Junio C Hamano [Sat, 21 Mar 2020 19:12:28 +0000 (12:12 -0700)] 
Merge tag 'l10n-2.26.0-rnd2.1' of git://github.com/git-l10n/git-po.git

l10n-2.26.0-rnd2.1

* tag 'l10n-2.26.0-rnd2.1' of https://github.com/git-l10n/git-po: (28 commits)
  l10n: tr.po: change file mode to 644
  l10n: de.po: Update German translation for Git 2.26.0
  l10n: de.po: add missing space
  l10n: tr: Fix a couple of ambiguities
  l10n: Update Catalan translation
  l10n: sv.po: Update Swedish translation (4839t0f0u)
  l10n: zh_CN: Revise v2.26.0 translation
  l10n: zh_CN: for git v2.26.0 l10n round 1 and 2
  l10n: vi(4839t): Updated Vietnamese translation for v2.26.0
  l10n: vi: fix translation + grammar
  l10n: zh_TW.po: v2.26.0 round 2 (0 untranslated)
  l10n: zh_TW.po: v2.26.0 round 1 (11 untranslated)
  l10n: it.po: update the Italian translation for Git 2.26.0 round 2
  l10n: es: 2.26.0 round#2
  l10n: bg.po: Updated Bulgarian translation (4839t)
  l10n: tr: v2.26.0 round 2
  l10n: fr : v2.26.0 rnd 2
  l10n: git.pot: v2.26.0 round 2 (7 new, 2 removed)
  l10n: tr: Add glossary for Turkish translations
  l10n: sv.po: Update Swedish translation (4835t0f0u)
  ...

4 years agol10n: tr.po: change file mode to 644
Jiang Xin [Sat, 21 Mar 2020 10:26:56 +0000 (18:26 +0800)] 
l10n: tr.po: change file mode to 644

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agot3419: prevent failure when run with EXPENSIVE
brian m. carlson [Fri, 20 Mar 2020 21:52:41 +0000 (21:52 +0000)] 
t3419: prevent failure when run with EXPENSIVE

This test runs a function which itself runs several assertions.  The
last of these assertions cleans up the .git/rebase-apply directory,
since when run with EXPENSIVE set, the function is invoked a second time
to run the same tests with a larger data set.

However, as of 2ac0d6273f ("rebase: change the default backend from "am"
to "merge"", 2020-02-15), the default backend of rebase has changed, and
cleaning up the rebase-apply directory has no effect: it no longer
exists, since we're using rebase-merge instead.

Since we don't really care which rebase backend is in use, let's just
use the command "git rebase --quit", which will do the right thing
regardless.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: de.po: Update German translation for Git 2.26.0
Matthias Rüster [Sat, 14 Mar 2020 21:10:16 +0000 (22:10 +0100)] 
l10n: de.po: Update German translation for Git 2.26.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>
4 years agol10n: de.po: add missing space
Ralf Thielow [Tue, 21 Jan 2020 16:30:48 +0000 (17:30 +0100)] 
l10n: de.po: add missing space

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
4 years agoMerge https://github.com/prati0100/git-gui
Junio C Hamano [Thu, 19 Mar 2020 23:06:51 +0000 (16:06 -0700)] 
Merge https://github.com/prati0100/git-gui

* 'master' of https://github.com/prati0100/git-gui:
  git-gui: create a new namespace for chord script evaluation
  git-gui: reduce Tcl version requirement from 8.6 to 8.5
  git-gui--askpass: coerce answers to UTF-8 on Windows
  git-gui: fix error popup when doing blame -> "Show History Context"
  git-gui: add missing close bracket
  git-gui: update German translation
  git-gui: extend translation glossary template with more terms
  git-gui: update pot template and German translation to current source code

4 years agol10n: tr: Fix a couple of ambiguities
Emir Sarı [Thu, 19 Mar 2020 22:36:24 +0000 (01:36 +0300)] 
l10n: tr: Fix a couple of ambiguities

Signed-off-by: Emir Sarı <bitigchi@me.com>
4 years agoMerge branch 'py/remove-tcloo'
Pratyush Yadav [Thu, 19 Mar 2020 15:59:19 +0000 (21:29 +0530)] 
Merge branch 'py/remove-tcloo'

Reduce the Tcl version requirement to 8.5 to allow git-gui to run on
MacOS distributions like High Sierra. While here, fix a potential
variable name collision.

* py/remove-tcloo:
  git-gui: create a new namespace for chord script evaluation
  git-gui: reduce Tcl version requirement from 8.6 to 8.5

4 years agoRelNotes/2.26.0: fix various typos
Elijah Newren [Wed, 18 Mar 2020 21:18:26 +0000 (21:18 +0000)] 
RelNotes/2.26.0: fix various typos

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: Update Catalan translation
Jordi Mas [Wed, 18 Mar 2020 19:24:20 +0000 (20:24 +0100)] 
l10n: Update Catalan translation

Signed-off-by: Jordi Mas <jmas@softcatala.org>
4 years agoGit 2.25.3 v2.25.3
Junio C Hamano [Wed, 18 Mar 2020 01:12:01 +0000 (18:12 -0700)] 
Git 2.25.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoSync with Git 2.25.2
Junio C Hamano [Tue, 17 Mar 2020 22:16:14 +0000 (15:16 -0700)] 
Sync with Git 2.25.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.25.2 v2.25.2
Junio C Hamano [Tue, 17 Mar 2020 21:54:02 +0000 (14:54 -0700)] 
Git 2.25.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agounicode: update the width tables to Unicode 13.0
Beat Bolli [Tue, 17 Mar 2020 15:36:05 +0000 (16:36 +0100)] 
unicode: update the width tables to Unicode 13.0

Now that Unicode 13.0 has been announced[0], update the character
width tables to the new version.

[0] https://home.unicode.org/announcing-the-unicode-standard-version-13-0/

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'js/ci-windows-update' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:26 +0000 (15:02 -0700)] 
Merge branch 'js/ci-windows-update' into maint

Updates to the CI settings.

* js/ci-windows-update:
  Azure Pipeline: switch to the latest agent pools
  ci: prevent `perforce` from being quarantined
  t/lib-httpd: avoid using macOS' sed

4 years agoMerge branch 'jk/run-command-formatfix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:26 +0000 (15:02 -0700)] 
Merge branch 'jk/run-command-formatfix' into maint

Code style cleanup.

* jk/run-command-formatfix:
  run-command.h: fix mis-indented struct member

4 years agoMerge branch 'jk/doc-credential-helper' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:26 +0000 (15:02 -0700)] 
Merge branch 'jk/doc-credential-helper' into maint

Docfix.

* jk/doc-credential-helper:
  doc: move credential helper info into gitcredentials(7)

4 years agoMerge branch 'js/mingw-open-in-gdb' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:25 +0000 (15:02 -0700)] 
Merge branch 'js/mingw-open-in-gdb' into maint

Dev support.

* js/mingw-open-in-gdb:
  mingw: add a helper function to attach GDB to the current process

4 years agoMerge branch 'js/test-unc-fetch' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:25 +0000 (15:02 -0700)] 
Merge branch 'js/test-unc-fetch' into maint

Test updates.

* js/test-unc-fetch:
  t5580: test cloning without file://, test fetching via UNC paths

4 years agoMerge branch 'js/test-write-junit-xml-fix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:25 +0000 (15:02 -0700)] 
Merge branch 'js/test-write-junit-xml-fix' into maint

Testfix.

* js/test-write-junit-xml-fix:
  tests: fix --write-junit-xml with subshells

4 years agoMerge branch 'en/simplify-check-updates-in-unpack-trees' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:25 +0000 (15:02 -0700)] 
Merge branch 'en/simplify-check-updates-in-unpack-trees' into maint

Code simplification.

* en/simplify-check-updates-in-unpack-trees:
  unpack-trees: exit check_updates() early if updates are not wanted

4 years agoMerge branch 'jc/doc-single-h-is-for-help' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:24 +0000 (15:02 -0700)] 
Merge branch 'jc/doc-single-h-is-for-help' into maint

Both "git ls-remote -h" and "git grep -h" give short usage help,
like any other Git subcommand, but it is not unreasonable to expect
that the former would behave the same as "git ls-remote --head"
(there is no other sensible behaviour for the latter).  The
documentation has been updated in an attempt to clarify this.

* jc/doc-single-h-is-for-help:
  Documentation: clarify that `-h` alone stands for `help`

4 years agoMerge branch 'hd/show-one-mergetag-fix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:24 +0000 (15:02 -0700)] 
Merge branch 'hd/show-one-mergetag-fix' into maint

"git show" and others gave an object name in raw format in its
error output, which has been corrected to give it in hex.

* hd/show-one-mergetag-fix:
  show_one_mergetag: print non-parent in hex form.

4 years agoMerge branch 'am/mingw-poll-fix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:23 +0000 (15:02 -0700)] 
Merge branch 'am/mingw-poll-fix' into maint

MinGW's poll() emulation has been improved.

* am/mingw-poll-fix:
  mingw: workaround for hangs when sending STDIN

4 years agoMerge branch 'hi/gpg-use-check-signature' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:23 +0000 (15:02 -0700)] 
Merge branch 'hi/gpg-use-check-signature' into maint

"git merge signed-tag" while lacking the public key started to say
"No signature", which was utterly wrong.  This regression has been
reverted.

* hi/gpg-use-check-signature:
  Revert "gpg-interface: prefer check_signature() for GPG verification"

4 years agoMerge branch 'ds/partial-clone-fixes' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:23 +0000 (15:02 -0700)] 
Merge branch 'ds/partial-clone-fixes' into maint

Fix for a bug revealed by a recent change to make the protocol v2
the default.

* ds/partial-clone-fixes:
  partial-clone: avoid fetching when looking for objects
  partial-clone: demonstrate bugs in partial fetch

4 years agoMerge branch 'en/t3433-rebase-stat-dirty-failure' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:23 +0000 (15:02 -0700)] 
Merge branch 'en/t3433-rebase-stat-dirty-failure' into maint

The merge-recursive machinery failed to refresh the cache entry for
a merge result in a couple of places, resulting in an unnecessary
merge failure, which has been fixed.

* en/t3433-rebase-stat-dirty-failure:
  merge-recursive: fix the refresh logic in update_file_flags
  t3433: new rebase testcase documenting a stat-dirty-like failure

4 years agoMerge branch 'en/check-ignore' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:23 +0000 (15:02 -0700)] 
Merge branch 'en/check-ignore' into maint

"git check-ignore" did not work when the given path is explicitly
marked as not ignored with a negative entry in the .gitignore file.

* en/check-ignore:
  check-ignore: fix documentation and implementation to match

4 years agoMerge branch 'jk/push-option-doc-markup-fix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:22 +0000 (15:02 -0700)] 
Merge branch 'jk/push-option-doc-markup-fix' into maint

Doc markup fix.

* jk/push-option-doc-markup-fix:
  doc/config/push: use longer "--" line for preformatted example

4 years agoMerge branch 'jk/doc-diff-parallel' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:22 +0000 (15:02 -0700)] 
Merge branch 'jk/doc-diff-parallel' into maint

Update to doc-diff.

* jk/doc-diff-parallel:
  doc-diff: use single-colon rule in rendering Makefile

4 years agoMerge branch 'jh/notes-fanout-fix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:22 +0000 (15:02 -0700)] 
Merge branch 'jh/notes-fanout-fix' into maint

The code to automatically shrink the fan-out in the notes tree had
an off-by-one bug, which has been killed.

* jh/notes-fanout-fix:
  notes.c: fix off-by-one error when decreasing notes fanout
  t3305: check notes fanout more carefully and robustly

4 years agoMerge branch 'jk/index-pack-dupfix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:21 +0000 (15:02 -0700)] 
Merge branch 'jk/index-pack-dupfix' into maint

The index-pack code now diagnoses a bad input packstream that
records the same object twice when it is used as delta base; the
code used to declare a software bug when encountering such an
input, but it is an input error.

* jk/index-pack-dupfix:
  index-pack: downgrade twice-resolved REF_DELTA to die()

4 years agoMerge branch 'js/rebase-i-with-colliding-hash' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:21 +0000 (15:02 -0700)] 
Merge branch 'js/rebase-i-with-colliding-hash' into maint

"git rebase -i" identifies existing commits in its todo file with
their abbreviated object name, which could become ambigous as it
goes to create new commits, and has a mechanism to avoid ambiguity
in the main part of its execution.  A few other cases however were
not covered by the protection against ambiguity, which has been
corrected.

* js/rebase-i-with-colliding-hash:
  rebase -i: also avoid SHA-1 collisions with missingCommitsCheck
  rebase -i: re-fix short SHA-1 collision
  parse_insn_line(): improve error message when parsing failed

4 years agoMerge branch 'jk/clang-sanitizer-fixes' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:21 +0000 (15:02 -0700)] 
Merge branch 'jk/clang-sanitizer-fixes' into maint

C pedantry ;-) fix.

* jk/clang-sanitizer-fixes:
  obstack: avoid computing offsets from NULL pointer
  xdiff: avoid computing non-zero offset from NULL pointer
  avoid computing zero offsets from NULL pointer
  merge-recursive: use subtraction to flip stage
  merge-recursive: silence -Wxor-used-as-pow warning

4 years agoMerge branch 'dt/submodule-rm-with-stale-cache' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:21 +0000 (15:02 -0700)] 
Merge branch 'dt/submodule-rm-with-stale-cache' into maint

Running "git rm" on a submodule failed unnecessarily when
.gitmodules is only cache-dirty, which has been corrected.

* dt/submodule-rm-with-stale-cache:
  git rm submodule: succeed if .gitmodules index stat info is zero

4 years agoMerge branch 'pb/recurse-submodule-in-worktree-fix' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:21 +0000 (15:02 -0700)] 
Merge branch 'pb/recurse-submodule-in-worktree-fix' into maint

The "--recurse-submodules" option of various subcommands did not
work well when run in an alternate worktree, which has been
corrected.

* pb/recurse-submodule-in-worktree-fix:
  submodule.c: use get_git_dir() instead of get_git_common_dir()
  t2405: clarify test descriptions and simplify test
  t2405: use git -C and test_commit -C instead of subshells
  t7410: rename to t2405-worktree-submodule.sh

4 years agoMerge branch 'es/outside-repo-errmsg-hints' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:20 +0000 (15:02 -0700)] 
Merge branch 'es/outside-repo-errmsg-hints' into maint

An earlier update to show the location of working tree in the error
message did not consider the possibility that a git command may be
run in a bare repository, which has been corrected.

* es/outside-repo-errmsg-hints:
  prefix_path: show gitdir if worktree unavailable
  prefix_path: show gitdir when arg is outside repo

4 years agoMerge branch 'js/builtin-add-i-cmds' into maint
Junio C Hamano [Tue, 17 Mar 2020 22:02:20 +0000 (15:02 -0700)] 
Merge branch 'js/builtin-add-i-cmds' into maint

Minor bugfixes to "git add -i" that has recently been rewritten in C.

* js/builtin-add-i-cmds:
  built-in add -i: accept open-ended ranges again
  built-in add -i: do not try to `patch`/`diff` an empty list of files

4 years agoGit 2.24.2 v2.24.2
Junio C Hamano [Tue, 17 Mar 2020 21:36:45 +0000 (14:36 -0700)] 
Git 2.24.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.23.2 v2.23.2
Junio C Hamano [Tue, 17 Mar 2020 21:33:34 +0000 (14:33 -0700)] 
Git 2.23.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.22.3 v2.22.3
Junio C Hamano [Tue, 17 Mar 2020 21:24:55 +0000 (14:24 -0700)] 
Git 2.22.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.21.2 v2.21.2
Junio C Hamano [Tue, 17 Mar 2020 21:16:08 +0000 (14:16 -0700)] 
Git 2.21.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.20.3 v2.20.3
Junio C Hamano [Tue, 17 Mar 2020 20:42:38 +0000 (13:42 -0700)] 
Git 2.20.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.19.4 v2.19.4
Junio C Hamano [Tue, 17 Mar 2020 20:37:37 +0000 (13:37 -0700)] 
Git 2.19.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.18.3 v2.18.3
Junio C Hamano [Tue, 17 Mar 2020 20:34:12 +0000 (13:34 -0700)] 
Git 2.18.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoGit 2.17.4 v2.17.4
Junio C Hamano [Tue, 17 Mar 2020 20:23:48 +0000 (13:23 -0700)] 
Git 2.17.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: sv.po: Update Swedish translation (4839t0f0u)
Peter Krefting [Tue, 17 Mar 2020 17:33:22 +0000 (18:33 +0100)] 
l10n: sv.po: Update Swedish translation (4839t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
4 years agogit-gui: create a new namespace for chord script evaluation
Pratyush Yadav [Sat, 14 Mar 2020 21:38:36 +0000 (03:08 +0530)] 
git-gui: create a new namespace for chord script evaluation

Evaluating the script in the same namespace as the chord itself creates
potential for variable name collision. And in that case the script would
unknowingly use the chord's variables.

For example, say the script has a variable called 'is_completed', which
also exists in the chord's namespace. The script then calls 'eval' and
sets 'is_completed' to 1 thinking it is setting its own variable,
completely unaware of how the chord works behind the scenes. This leads
to the chord never actually executing because it sees 'is_completed' as
true and thinks it has already completed.

Avoid the potential collision by creating a separate namespace for the
script that is a child of the chord's namespace.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agogit-gui: reduce Tcl version requirement from 8.6 to 8.5
Pratyush Yadav [Mon, 17 Feb 2020 15:39:29 +0000 (21:09 +0530)] 
git-gui: reduce Tcl version requirement from 8.6 to 8.5

On some MacOS distributions like High Sierra, Tcl 8.5 is shipped by
default. This makes git-gui error out at startup because of the version
mismatch.

The only part that requires Tcl 8.6 is SimpleChord, which depends on
TclOO. So, don't use it and use our homegrown class.tcl instead.

This means some slight syntax changes. Since class.tcl doesn't have an
"unknown" method like TclOO does, we can't just call '$note', but have
to use '$note activate' instead. The constructor now needs a proper
namespace qualifier. Update the documentation to reflect the new syntax.

As of now, the only part of git-gui that needs Tcl 8.5 is a call to
'apply' in lib/index.tcl::lambda. Keep using it until someone shows up
shouting that their OS ships with 8.4 only. Then we would have to look
into implementing it in pure Tcl.

Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agol10n: zh_CN: Revise v2.26.0 translation
Fangyi Zhou [Wed, 11 Mar 2020 11:55:43 +0000 (11:55 +0000)] 
l10n: zh_CN: Revise v2.26.0 translation

Signed-off-by: Fangyi Zhou <me@fangyi.io>
Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agol10n: zh_CN: for git v2.26.0 l10n round 1 and 2
Jiang Xin [Mon, 30 Dec 2019 00:56:49 +0000 (08:56 +0800)] 
l10n: zh_CN: for git v2.26.0 l10n round 1 and 2

Translate 79 new messages (4839t0f0u) for git 2.26.0.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
4 years agoGit 2.26-rc2 v2.26.0-rc2
Junio C Hamano [Mon, 16 Mar 2020 19:46:32 +0000 (12:46 -0700)] 
Git 2.26-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'en/test-cleanup'
Junio C Hamano [Mon, 16 Mar 2020 19:43:30 +0000 (12:43 -0700)] 
Merge branch 'en/test-cleanup'

Test fixes.

* en/test-cleanup:
  t6022, t6046: fix flaky files-are-updated checks

4 years agoMerge branch 'es/outside-repo-errmsg-hints'
Junio C Hamano [Mon, 16 Mar 2020 19:43:29 +0000 (12:43 -0700)] 
Merge branch 'es/outside-repo-errmsg-hints'

An earlier update to show the location of working tree in the error
message did not consider the possibility that a git command may be
run in a bare repository, which has been corrected.

* es/outside-repo-errmsg-hints:
  prefix_path: show gitdir if worktree unavailable

4 years agol10n: vi(4839t): Updated Vietnamese translation for v2.26.0
Tran Ngoc Quan [Mon, 16 Mar 2020 01:55:40 +0000 (08:55 +0700)] 
l10n: vi(4839t): Updated Vietnamese translation for v2.26.0

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
4 years agol10n: vi: fix translation + grammar
Đoàn Trần Công Danh [Mon, 13 Jan 2020 15:48:39 +0000 (22:48 +0700)] 
l10n: vi: fix translation + grammar

- context should be translated to ngữ cảnh instead of nội dung
- add missing accents
- switch adjective and secondary objects position:
* The formatted English text will be "To remove '+/-' lines",
it should be translated to "Để bỏ dòng bắt đầu với '+/-'

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
4 years agoprefix_path: show gitdir if worktree unavailable
Emily Shaffer [Tue, 3 Mar 2020 04:05:06 +0000 (20:05 -0800)] 
prefix_path: show gitdir if worktree unavailable

If there is no worktree at present, we can still hint the user about
Git's current directory by showing them the absolute path to the Git
directory. Even though the Git directory doesn't make it as easy to
locate the worktree in question, it can still help a user figure out
what's going on while developing a script.

This fixes a segmentation fault introduced in e0020b2f
("prefix_path: show gitdir when arg is outside repo", 2020-02-14).

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
[jc: added minimum tests, with help from Szeder Gábor]
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agol10n: zh_TW.po: v2.26.0 round 2 (0 untranslated)
Yi-Jyun [Fri, 13 Mar 2020 17:12:19 +0000 (01:12 +0800)] 
l10n: zh_TW.po: v2.26.0 round 2 (0 untranslated)

Revision 2.

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
4 years agol10n: zh_TW.po: v2.26.0 round 1 (11 untranslated)
Yi-Jyun [Mon, 9 Mar 2020 17:33:00 +0000 (01:33 +0800)] 
l10n: zh_TW.po: v2.26.0 round 1 (11 untranslated)

Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
4 years agoMerge branch 'js/askpass-coerce-utf8'
Pratyush Yadav [Sat, 14 Mar 2020 17:22:43 +0000 (22:52 +0530)] 
Merge branch 'js/askpass-coerce-utf8'

Askpass can now send non-ASCII to Git on Windows.

* js/askpass-coerce-utf8:
  git-gui--askpass: coerce answers to UTF-8 on Windows

4 years agogit-gui--askpass: coerce answers to UTF-8 on Windows
Luke Bonanomi [Thu, 12 Mar 2020 21:31:50 +0000 (21:31 +0000)] 
git-gui--askpass: coerce answers to UTF-8 on Windows

This addresses the issue where Git for Windows asks the user for a
password, no credential helper is available, and then Git fails to pick
up non-ASCII characters from the Git GUI helper.

This can be verified e.g. via

echo host=http://abc.com |
git -c credential.helper= credential fill

and then pasting some umlauts.

The underlying reason is that Git for Windows tries to communicate using
the UTF-8 encoding no matter what the actual current code page is. So
let's indulge Git for Windows and do use that encoding.

This fixes https://github.com/git-for-windows/git/issues/2215

Signed-off-by: Luke Bonanomi <lbonanomi@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
4 years agoMerge branch 'py/blame-status-error'
Pratyush Yadav [Sat, 14 Mar 2020 17:11:45 +0000 (22:41 +0530)] 
Merge branch 'py/blame-status-error'

Fixes an error popup in blame because of a missing closing bracket.

* py/blame-status-error:
  git-gui: fix error popup when doing blame -> "Show History Context"

4 years agot6022, t6046: fix flaky files-are-updated checks
Elijah Newren [Fri, 13 Mar 2020 20:03:02 +0000 (20:03 +0000)] 
t6022, t6046: fix flaky files-are-updated checks

Several tests wanted to verify that files were actually modified by a
merge, which it would do by checking that the mtime was updated.  In
order to avoid problems with the merge completing so fast that the mtime
at the beginning and end of the operation was the same, these tests
would first set the mtime of a file to something "old".  This "old"
value was usually determined as current system clock minus one second,
truncated to the nearest integer.  Unfortunately, it appears the system
clock and filesystem clock are different and comparing across the two
runs into race problems resulting in flaky tests.

From https://stackoverflow.com/questions/14392975/timestamp-accuracy-on-ext4-sub-millsecond:

    date will call the gettimeofday system call which will always return
    the most accurate time available based on the cached kernel time,
    adjusted by the CPU cycle time if available to give nanosecond
    resolution. The timestamps stored in the file system however, are
    only based on the cached kernel time. ie The time calculated at the
    last timer interrupt.

and from https://apenwarr.ca/log/20181113:

    Does mtime get set to >= the current time?

    No, this depends on clock granularity. For example, gettimeofday()
    can return times in microseconds on my system, but ext4 rounds
    timestamps down to the previous ~10ms (but not exactly 10ms)
    increment, with the surprising result that a newly-created file is
    almost always created in the past:

      $ python -c "
      import os, time
      t0 = time.time()
      open('testfile', 'w').close()
      print os.stat('testfile').st_mtime - t0
      "

      -0.00234484672546

So, instead of trying to compare across what are effectively two
different clocks, just avoid using the system clock.  Any new updates to
files have to give an mtime at least as big as what is already in the
file, so we could define "old" as one second before the mtime found in
the file before the merge starts.  But, to avoid problems with leap
seconds, ntp updates, filesystems that only provide two second
resolution, and other such weirdness, let's just pick an hour before the
mtime found in the file before the merge starts.

Also, clarify in one test where we check the mtime of different files
that it really was intentional.  I totally forgot the reasons for that
and assumed it was a bug when asked.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoHopefully the final batch before -rc2
Junio C Hamano [Thu, 12 Mar 2020 21:36:00 +0000 (14:36 -0700)] 
Hopefully the final batch before -rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'en/rebase-backend'
Junio C Hamano [Thu, 12 Mar 2020 21:28:01 +0000 (14:28 -0700)] 
Merge branch 'en/rebase-backend'

Band-aid fixes for two fallouts from switching the default "rebase"
backend.

* en/rebase-backend:
  git-rebase.txt: highlight backend differences with commit rewording
  sequencer: clear state upon dropping a become-empty commit
  i18n: unmark a message in rebase.c

4 years agoMerge branch of github.com:ChrisADR/git-po into master
Jiang Xin [Thu, 12 Mar 2020 10:41:56 +0000 (18:41 +0800)] 
Merge branch of github.com:ChrisADR/git-po into master

* 'next' of github.com:ChrisADR/git-po:
  l10n: es: 2.26.0 round#2

4 years agofsck: detect gitmodules URLs with embedded newlines
Jeff King [Wed, 11 Mar 2020 22:48:24 +0000 (18:48 -0400)] 
fsck: detect gitmodules URLs with embedded newlines

The credential protocol can't handle values with newlines. We already
detect and block any such URLs from being used with credential helpers,
but let's also add an fsck check to detect and block gitmodules files
with such URLs. That will let us notice the problem earlier when
transfer.fsckObjects is turned on. And in particular it will prevent bad
objects from spreading, which may protect downstream users running older
versions of Git.

We'll file this under the existing gitmodulesUrl flag, which covers URLs
with option injection. There's really no need to distinguish the exact
flaw in the URL in this context. Likewise, I've expanded the description
of t7416 to cover all types of bogus URLs.

4 years agocredential: detect unrepresentable values when parsing urls
Jeff King [Thu, 12 Mar 2020 05:31:11 +0000 (01:31 -0400)] 
credential: detect unrepresentable values when parsing urls

The credential protocol can't represent newlines in values, but URLs can
embed percent-encoded newlines in various components. A previous commit
taught the low-level writing routines to die() when encountering this,
but we can be a little friendlier to the user by detecting them earlier
and handling them gracefully.

This patch teaches credential_from_url() to notice such components,
issue a warning, and blank the credential (which will generally result
in prompting the user for a username and password). We blank the whole
credential in this case. Another option would be to blank only the
invalid component. However, we're probably better off not feeding a
partially-parsed URL result to a credential helper. We don't know how a
given helper would handle it, so we're better off to err on the side of
matching nothing rather than something unexpected.

The die() call in credential_write() is _probably_ impossible to reach
after this patch. Values should end up in credential structs only by URL
parsing (which is covered here), or by reading credential protocol input
(which by definition cannot read a newline into a value). But we should
definitely keep the low-level check, as it's our final and most accurate
line of defense against protocol injection attacks. Arguably it could
become a BUG(), but it probably doesn't matter much either way.

Note that the public interface of credential_from_url() grows a little
more than we need here. We'll use the extra flexibility in a future
patch to help fsck catch these cases.

4 years agot/lib-credential: use test_i18ncmp to check stderr
Jeff King [Wed, 11 Mar 2020 22:11:37 +0000 (18:11 -0400)] 
t/lib-credential: use test_i18ncmp to check stderr

The credential tests have a "check" function which feeds some input to
git-credential and checks the stdout and stderr. We look for exact
matches in the output. For stdout, this makes sense; the output is
the credential protocol. But for stderr, we may be showing various
diagnostic messages, or the prompts fed to the askpass program, which
could be translated. Let's mark them as such.

4 years agocredential: avoid writing values with newlines
Jeff King [Wed, 11 Mar 2020 21:53:41 +0000 (17:53 -0400)] 
credential: avoid writing values with newlines

The credential protocol that we use to speak to helpers can't represent
values with newlines in them. This was an intentional design choice to
keep the protocol simple, since none of the values we pass should
generally have newlines.

However, if we _do_ encounter a newline in a value, we blindly transmit
it in credential_write(). Such values may break the protocol syntax, or
worse, inject new valid lines into the protocol stream.

The most likely way for a newline to end up in a credential struct is by
decoding a URL with a percent-encoded newline. However, since the bug
occurs at the moment we write the value to the protocol, we'll catch it
there. That should leave no possibility of accidentally missing a code
path that can trigger the problem.

At this level of the code we have little choice but to die(). However,
since we'd not ever expect to see this case outside of a malicious URL,
that's an acceptable outcome.

Reported-by: Felix Wilhelm <fwilhelm@google.com>
4 years agol10n: it.po: update the Italian translation for Git 2.26.0 round 2
Alessandro Menti [Thu, 12 Mar 2020 06:52:58 +0000 (07:52 +0100)] 
l10n: it.po: update the Italian translation for Git 2.26.0 round 2

Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
4 years agol10n: es: 2.26.0 round#2
Christopher Diaz Riveros [Thu, 12 Mar 2020 04:19:58 +0000 (23:19 -0500)] 
l10n: es: 2.26.0 round#2

Signed-off-by: Christopher Diaz Riveros <chrisadr@gentoo.org>
4 years agoMerge branch of github.com:alshopov/git-po into master
Jiang Xin [Thu, 12 Mar 2020 02:17:22 +0000 (10:17 +0800)] 
Merge branch of github.com:alshopov/git-po into master

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

4 years agoMerge branch of github.com:bitigchi/git-po into master
Jiang Xin [Thu, 12 Mar 2020 02:15:49 +0000 (10:15 +0800)] 
Merge branch of github.com:bitigchi/git-po into master

* 'tr_translations_2.26.1' of github.com:bitigchi/git-po:
  l10n: tr: v2.26.0 round 2

4 years agol10n: bg.po: Updated Bulgarian translation (4839t)
Alexander Shopov [Wed, 11 Mar 2020 23:04:37 +0000 (00:04 +0100)] 
l10n: bg.po: Updated Bulgarian translation (4839t)

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
4 years agol10n: tr: v2.26.0 round 2
Emir Sarı [Wed, 11 Mar 2020 21:09:51 +0000 (00:09 +0300)] 
l10n: tr: v2.26.0 round 2

Signed-off-by: Emir Sarı <bitigchi@me.com>