Commit graph

10628 commits

Author SHA1 Message Date
Johannes Schindelin 7cdafcaacf Git 2.15.4
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-12-06 16:26:58 +01:00
Jonathan Nieder e904deb89d submodule: reject submodule.update = !command in .gitmodules
Since ac1fbbda20 (submodule: do not copy unknown update mode from
.gitmodules, 2013-12-02), Git has been careful to avoid copying

	[submodule "foo"]
		update = !run an arbitrary scary command

from .gitmodules to a repository's local config, copying in the
setting 'update = none' instead.  The gitmodules(5) manpage documents
the intention:

	The !command form is intentionally ignored here for security
	reasons

Unfortunately, starting with v2.20.0-rc0 (which integrated ee69b2a9
(submodule--helper: introduce new update-module-mode helper,
2018-08-13, first released in v2.20.0-rc0)), there are scenarios where
we *don't* ignore it: if the config store contains no
submodule.foo.update setting, the submodule-config API falls back to
reading .gitmodules and the repository-supplied !command gets run
after all.

This was part of a general change over time in submodule support to
read more directly from .gitmodules, since unlike .git/config it
allows a project to change values between branches and over time
(while still allowing .git/config to override things).  But it was
never intended to apply to this kind of dangerous configuration.

The behavior change was not advertised in ee69b2a9's commit message
and was missed in review.

Let's take the opportunity to make the protection more robust, even in
Git versions that are technically not affected: instead of quietly
converting 'update = !command' to 'update = none', noisily treat it as
an error.  Allowing the setting but treating it as meaning something
else was just confusing; users are better served by seeing the error
sooner.  Forbidding the construct makes the semantics simpler and
means we can check for it in fsck (in a separate patch).

As a result, the submodule-config API cannot read this value from
.gitmodules under any circumstance, and we can declare with confidence

	For security reasons, the '!command' form is not accepted
	here.

Reported-by: Joern Schneeweisz <jschneeweisz@gitlab.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2019-12-06 16:26:58 +01:00
Johannes Schindelin d3ac8c3f27 Sync with 2.14.6
* maint-2.14: (28 commits)
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  is_ntfs_dotgit(): speed it up
  mingw: disallow backslash characters in tree objects' file names
  path: safeguard `.git` against NTFS Alternate Streams Accesses
  clone --recurse-submodules: prevent name squatting on Windows
  is_ntfs_dotgit(): only verify the leading segment
  test-path-utils: offer to run a protectNTFS/protectHFS benchmark
  ...
2019-12-06 16:26:55 +01:00
Johannes Schindelin 66d2a6159f Git 2.14.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2019-12-06 16:26:15 +01:00
Jeff King a52ed76142 fast-import: disallow "feature import-marks" by default
As with export-marks in the previous commit, import-marks can access the
filesystem. This is significantly less dangerous than export-marks
because it only involves reading from arbitrary paths, rather than
writing them. However, it could still be surprising and have security
implications (e.g., exfiltrating data from a service that accepts
fast-import streams).

Let's lump it (and its "if-exists" counterpart) in with export-marks,
and enable the in-stream version only if --allow-unsafe-features is set.

Signed-off-by: Jeff King <peff@peff.net>
2019-12-04 13:20:04 +01:00
Jeff King 68061e3470 fast-import: disallow "feature export-marks" by default
The fast-import stream command "feature export-marks=<path>" lets the
stream write marks to an arbitrary path. This may be surprising if you
are running fast-import against an untrusted input (which otherwise
cannot do anything except update Git objects and refs).

Let's disallow the use of this feature by default, and provide a
command-line option to re-enable it (you can always just use the
command-line --export-marks as well, but the in-stream version provides
an easy way for exporters to control the process).

This is a backwards-incompatible change, since the default is flipping
to the new, safer behavior. However, since the main users of the
in-stream versions would be import/export-based remote helpers, and
since we trust remote helpers already (which are already running
arbitrary code), we'll pass the new option by default when reading a
remote helper's stream. This should minimize the impact.

Note that the implementation isn't totally simple, as we have to work
around the fact that fast-import doesn't parse its command-line options
until after it has read any "feature" lines from the stream. This is how
it lets command-line options override in-stream. But in our case, it's
important to parse the new --allow-unsafe-features first.

There are three options for resolving this:

  1. Do a separate "early" pass over the options. This is easy for us to
     do because there are no command-line options that allow the
     "unstuck" form (so there's no chance of us mistaking an argument
     for an option), though it does introduce a risk of incorrect
     parsing later (e.g,. if we convert to parse-options).

  2. Move the option parsing phase back to the start of the program, but
     teach the stream-reading code never to override an existing value.
     This is tricky, because stream "feature" lines override each other
     (meaning we'd have to start tracking the source for every option).

  3. Accept that we might parse a "feature export-marks" line that is
     forbidden, as long we don't _act_ on it until after we've parsed
     the command line options.

     This would, in fact, work with the current code, but only because
     the previous patch fixed the export-marks parser to avoid touching
     the filesystem.

     So while it works, it does carry risk of somebody getting it wrong
     in the future in a rather subtle and unsafe way.

I've gone with option (1) here as simple, safe, and unlikely to cause
regressions.

This fixes CVE-2019-1348.

Signed-off-by: Jeff King <peff@peff.net>
2019-12-04 13:20:04 +01:00
Junio C Hamano 924c623e1c Git 2.15.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-09-27 11:33:47 -07:00
Junio C Hamano 902df9f5c4 Sync with Git 2.14.4
* maint-2.14:
  Git 2.14.5
  submodule-config: ban submodule paths that start with a dash
  submodule-config: ban submodule urls that start with dash
  submodule--helper: use "--" to signal end of clone options
2018-09-27 11:20:22 -07:00
Junio C Hamano d0832b2847 Git 2.14.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-09-27 11:19:11 -07:00
Junio C Hamano d33c87517a Git 2.15.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-22 14:15:59 +09:00
Junio C Hamano 9e0f06d55d Sync with Git 2.14.4
* maint-2.14:
  Git 2.14.4
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths
2018-05-22 14:15:14 +09:00
Junio C Hamano 4dde7b8799 Git 2.14.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-22 14:12:02 +09:00
Junio C Hamano 7b01c71b64 Sync with Git 2.13.7
* maint-2.13:
  Git 2.13.7
  verify_path: disallow symlinks in .gitmodules
  update-index: stat updated files earlier
  verify_dotfile: mention case-insensitivity in comment
  verify_path: drop clever fallthrough
  skip_prefix: add case-insensitive variant
  is_{hfs,ntfs}_dotgitmodules: add tests
  is_ntfs_dotgit: match other .git files
  is_hfs_dotgit: match other .git files
  is_ntfs_dotgit: use a size_t for traversing string
  submodule-config: verify submodule names as paths
2018-05-22 14:10:49 +09:00
Junio C Hamano 0114f71344 Git 2.13.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-22 13:50:36 +09:00
Junio C Hamano 3013dff866 Prepare for 2.15.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-12-06 09:10:35 -08:00
Junio C Hamano 03d4bc1edf Merge branch 'jc/merge-base-fork-point-doc' into maint
Clarify and enhance documentation for "merge-base --fork-point", as
it was clear what it computed but not why/what for.

* jc/merge-base-fork-point-doc:
  merge-base --fork-point doc: clarify the example and failure modes
2017-12-06 09:09:05 -08:00
Junio C Hamano 3cdea38707 Merge branch 'bc/submitting-patches-in-asciidoc' into maint
The SubmittingPatches document has been converted to produce an
HTML version via AsciiDoc/Asciidoctor.

* bc/submitting-patches-in-asciidoc:
  Documentation: convert SubmittingPatches to AsciiDoc
  Documentation: enable compat-mode for Asciidoctor
2017-12-06 09:08:59 -08:00
Junio C Hamano 9b185bef0c Git 2.15.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-28 13:39:14 +09:00
Junio C Hamano 7bc77766e1 A bit more fixes for 2.15.1
We've been waiting long enough, a few more would not hurt ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-27 10:58:31 +09:00
Junio C Hamano b51df7d306 Merge branch 'ad/submitting-patches-title-decoration' into maint
Doc update around use of "format-patch --subject-prefix" etc.

* ad/submitting-patches-title-decoration:
  doc/SubmittingPatches: correct subject guidance
2017-11-27 10:57:01 +09:00
Todd Zullinger 7d22aec681 RelNotes: minor typo fixes in 2.15.1 draft
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-26 12:49:23 +09:00
Junio C Hamano 95a731ce92 Almost ready for 2.15.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-21 14:07:08 +09:00
Junio C Hamano 5a1f5c3060 Start preparation for 2.15.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-15 12:05:22 +09:00
Junio C Hamano 2d35c507d2 Merge branch 'jm/relnotes-2.15-typofix' into maint
Typofix.

* jm/relnotes-2.15-typofix:
  fix typos in 2.15.0 release notes
2017-11-15 12:05:04 +09:00
Junio C Hamano da2b4ee388 Merge branch 'cn/diff-indent-no-longer-is-experimental' into maint
Doc update.

* cn/diff-indent-no-longer-is-experimental:
  diff: --indent-heuristic is no longer experimental
2017-11-15 12:05:04 +09:00
Junio C Hamano 74ef46558e Merge branch 'js/mingw-redirect-std-handles' into maint
MinGW updates.

* js/mingw-redirect-std-handles:
  mingw: document the standard handle redirection
  mingw: optionally redirect stderr/stdout via the same handle
  mingw: add experimental feature to redirect standard handles
2017-11-15 12:05:03 +09:00
Junio C Hamano 4a1ddb561c Merge branch 'sb/blame-config-doc' into maint
Description of blame.{showroot,blankboundary,showemail,date}
configuration variables have been added to "git config --help".

* sb/blame-config-doc:
  config: document blame configuration
2017-11-15 12:04:59 +09:00
Junio C Hamano 3be9ac7e56 Merge branch 'jc/check-ref-format-oor' into maint
"git check-ref-format --branch @{-1}" bit a "BUG()" when run
outside a repository for obvious reasons; clarify the documentation
and make sure we do not even try to expand the at-mark magic in
such a case, but still call the validation logic for branch names.

* jc/check-ref-format-oor:
  check-ref-format doc: --branch validates and expands <branch>
  check-ref-format --branch: strip refs/heads/ using skip_prefix
  check-ref-format --branch: do not expand @{...} outside repository
2017-11-15 12:04:57 +09:00
brian m. carlson 049e64aa50 Documentation: convert SubmittingPatches to AsciiDoc
The SubmittingPatches document is often cited by outside parties as an
example of good practices to follow, including logical, independent
commits; patch sign-offs; and sending patches to a mailing list.
Currently, people who want to cite a particular section tend to either
refer to it by name and let the interested party search through the
document to find it, or link to a given line number on GitHub and hope
the file doesn't change.

Instead, convert the document to AsciiDoc.  Build it as part of the
technical documentation, since it is likely of interest to the same
group of people.  Provide stable links to the sections which outside
parties are likely to want to link to.  Make some minor structural
changes to organize it so that it can be formatted sanely.

Since the makefile needs a .txt extension in order to build with the
rest of the documentation, simply copy the file.  Ignore the temporary
file so it doesn't get checked in accidentally, and remove it as part of
the clean process.  Do this instead of renaming the file so that people
who have already linked to the documentation (who we're trying to help)
don't find their links broken.  Avoid symlinking since Windows will not
like that.

This allows us to render the document as part of the website for the
benefit of others who wish to link to it as well as providing a more
nicely formatted display for our community and potential contributors.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-13 13:25:19 +09:00
Adam Dinwoodie f6be7edcac doc/SubmittingPatches: correct subject guidance
The examples and common practice for adding markers such as "RFC" or
"v2" to the subject of patch emails is to have them within the same
brackets as the "PATCH" text, not after the closing bracket.  Further,
the practice of `git format-patch` and the like, as well as what appears
to be the more common pratice on the mailing list, is to use "[RFC
PATCH]", not "[PATCH/RFC]".

Update the SubmittingPatches article to match and to reference the
`format-patch` helper arguments, and also make some minor text
clarifications in the area.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-11 03:07:03 +09:00
Junio C Hamano 6d1700b8af merge-base --fork-point doc: clarify the example and failure modes
The illustrated history used to explain the `--fork-point` mode
named three keypoint commits B3, B2 and B1 from the oldest to the
newest, which was hard to read.  Relabel them to B0, B1, B2.  Also
illustrate the history after the rebase using the `--fork-point`
facility was made.

The text already mentions use of reflog, but the description is not
clear what benefit we are trying to gain by using reflog.  Clarify
that it is to find the commits that were known to be at the tip of
the remote-tracking branch.  This in turn necessitates users to know
the ramifications of the underlying assumptions, namely, expiry of
reflog entries will make it impossible to determine which commits
were at the tip of the remote-tracking branches and we fail when in
doubt (instead of giving a random and incorrect result without even
warning).  Another limitation is that it won't be useful if you did
not fork from the tip of a remote-tracking branch but from in the
middle.

Describe them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-09 12:28:30 +09:00
Jean Carlo Machado 8684dde10d fix typos in 2.15.0 release notes
Signed-off-by: Jean Carlo Machado <contato@jeancarlomachado.com.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-06 11:34:26 +09:00
Stefan Beller de0bc11d13 config: document blame configuration
The options are currently only referenced by the git-blame man page,
also explain them in git-config, which is the canonical page to
contain all config options.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-06 10:13:15 +09:00
Carlos Martín Nieto bab76141da diff: --indent-heuristic is no longer experimental
This heuristic has been the default since 2.14 so we should not confuse our
users by saying that it's experimental and off by default.

Signed-off-by: Carlos Martín Nieto <cmn@dwim.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-02 14:51:24 +09:00
Johannes Schindelin b2f55717c7 mingw: document the standard handle redirection
This feature has been in Git for Windows since v2.11.0(2), as an
experimental option. Now it is considered mature, and it is high time to
document it properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-02 11:19:44 +09:00
brian m. carlson b072e0a3f8 Documentation: enable compat-mode for Asciidoctor
Asciidoctor 1.5.0 and later have a compatibility mode that makes it more
compatible with some Asciidoc syntax, notably the single and double
quote handling.  While this doesn't affect any of our current
documentation, it would be beneficial to enable this mode to reduce the
differences between AsciiDoc and Asciidoctor if we make use of those
features in the future.

Since this mode is specified as an attribute, if a version of
Asciidoctor doesn't understand it, it will simply be ignored.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-30 12:44:00 +09:00
Junio C Hamano 2f899857a9 Hopefully final batch before 2.15
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-28 10:20:30 +09:00
Junio C Hamano d8f3074c48 Merge branch 'sg/rev-list-doc-reorder-fix'
Doc flow fix.

* sg/rev-list-doc-reorder-fix:
  rev-list-options.txt: use correct directional reference
2017-10-28 10:18:42 +09:00
Junio C Hamano 986ffdc83e Merge branch 'sb/rev-parse-show-superproject-root'
Doc markup fix.

* sb/rev-parse-show-superproject-root:
  docs: fix formatting of rev-parse's --show-superproject-working-tree
2017-10-28 10:18:40 +09:00
Junio C Hamano 2d8f12d282 Merge branch 'np/config-path-doc'
Doc update.

* np/config-path-doc:
  config doc: clarify "git config --path" example
2017-10-28 10:18:39 +09:00
Sebastian Schuberth e38c681fb7 docs: fix formatting of rev-parse's --show-superproject-working-tree
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-27 10:31:46 +09:00
SZEDER Gábor 4f851dc883 rev-list-options.txt: use correct directional reference
The descriptions of the options '--parents', '--children' and
'--graph' say "see 'History Simplification' below", although the
referred section is in fact above the description of these options.

Send readers in the right direction by saying "above" instead of
"below".

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-27 10:29:38 +09:00
Junio C Hamano c52ca88430 Git 2.14.3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJZ7YHBAAoJELC16IaWr+bLbCMP/iLZm1btOvbXcATV6sCrqdWJ
 lJdaDxAPipF2vOCvvppw7/lzbcuXokPBWW0v9dMAyXe7fJ1DxfZYReQyBJEHzrdG
 cG6l0SBUL7CSs4IdqFsvq3Qo/4xGqfrdd+54M6ujn+Qus12/0FaE9efVrhv2PhYm
 OAwIlFQCciN8y3YneO/ayo/NmBwNZ3eyQ2LACYjGjCWzNcPi4FHHrWXDQ3oFapGh
 bPzrmME8xRtWEsTB3EZmfjVNrI4K5+WgisHRMjDYiPf18j9dx1ByKOW6WgwBHUDH
 xg4dAS0a4Q18lVY8D4B0BjT71l8VpTtXQwtH4znD5Va9LQWYEc7XkagQp9EFRNBH
 MuIPazfwI9zkZckrkEbOj/y9Fh936IMGhiicCA7gJ9n/Z60AgGJqrHzUwrWzsEfz
 vEvw2lbGhn37tCBaDMdyYnR1iaZzYcsUmw5txESICdIlkPbnmuVOIoRrl4RXBLP+
 /mai3FJr1NDKCzcaWsRkE8YGZAhQukZil/cw61zA3TYeg20ZmzlBY3WUNyjcP2pb
 YAhVXPEDTegbS8BfU3QaWKTbdvQ5yszr5zOYYakVbHJD7TUlKUV+6MWYPNqUYT52
 jHOqWMXMF25/ieJbijdwyYT3/RpgSxWgj4vo5xs5XJ6HCXgtsmYjW8hkG7kY33ed
 e3h76qohhTtdyvpeKtRz
 =7wWT
 -----END PGP SIGNATURE-----

Sync with 2.14.3
2017-10-23 14:54:30 +09:00
Junio C Hamano fc849d8d6b Git 2.14.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-23 14:44:17 +09:00
Junio C Hamano 9fc7bc6568 Merge branch 'jc/fetch-refspec-doc-update' into maint
"git fetch <there> <src>:<dst>" allows an object name on the <src>
side when the other side accepts such a request since Git v2.5, but
the documentation was left stale.

* jc/fetch-refspec-doc-update:
  fetch doc: src side of refspec could be full SHA-1
2017-10-23 14:39:08 +09:00
Junio C Hamano 4843cdefe3 Git 2.15-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-19 14:49:17 +09:00
Junio C Hamano a4ebf9e0c5 Merge branch 'jc/branch-force-doc-readability-fix'
Doc update.

* jc/branch-force-doc-readability-fix:
  branch doc: sprinkle a few commas for readability
2017-10-19 14:45:45 +09:00
Junio C Hamano e336afdfb6 Merge branch 'dg/filter-branch-filter-order-doc'
Update the documentation for "git filter-branch" so that the filter
options are listed in the same order as they are applied, as
described in an earlier part of the doc.

* dg/filter-branch-filter-order-doc:
  doc: list filter-branch subdirectory-filter first
2017-10-19 14:45:45 +09:00
Junio C Hamano 39a2aeacc5 Merge branch 'jc/fetch-refspec-doc-update'
"git fetch <there> <src>:<dst>" allows an object name on the <src>
side when the other side accepts such a request since Git v2.5, but
the documentation was left stale.

* jc/fetch-refspec-doc-update:
  fetch doc: src side of refspec could be full SHA-1
2017-10-19 14:45:45 +09:00
Junio C Hamano 9f8468be43 Merge branch 'wk/merge-options-gpg-sign-doc'
Doc updates.

* wk/merge-options-gpg-sign-doc:
  Documentation/merge-options.txt: describe -S/--gpg-sign for 'pull'
2017-10-19 14:45:43 +09:00