Compare commits

..

36 Commits

Author SHA1 Message Date
7556e5d737 Git 2.38.4
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:43:30 +01:00
6487e9c459 Sync with 2.37.6
* maint-2.37:
  Git 2.37.6
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:43:28 +01:00
eb88fe1ff5 Git 2.37.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:38:32 +01:00
16004682f9 Sync with 2.36.5
* maint-2.36:
  Git 2.36.5
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:38:31 +01:00
673472a963 Git 2.36.5
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:37:53 +01:00
40843216c5 Sync with 2.35.7
* maint-2.35:
  Git 2.35.7
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:37:52 +01:00
b7a92d078b Git 2.35.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:29:45 +01:00
6a53a59bf9 Sync with 2.34.7
* maint-2.34:
  Git 2.34.7
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:29:44 +01:00
91da4a29e1 Git 2.34.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:29:17 +01:00
a7237f5ae9 Sync with 2.33.7
* maint-2.33:
  Git 2.33.7
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:29:16 +01:00
bd6d3de01f Merge branch 'jk/curl-avoid-deprecated-api'
Deal with a few deprecation warning from cURL library.

* jk/curl-avoid-deprecated-api:
  http: support CURLOPT_PROTOCOLS_STR
  http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
  http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
2023-02-06 09:27:41 +01:00
f44e6a2105 http: support CURLOPT_PROTOCOLS_STR
The CURLOPT_PROTOCOLS (and matching CURLOPT_REDIR_PROTOCOLS) flag was
deprecated in curl 7.85.0, and using it generate compiler warnings as of
curl 7.87.0. The path forward is to use CURLOPT_PROTOCOLS_STR, but we
can't just do so unilaterally, as it was only introduced less than a
year ago in 7.85.0.

Until that version becomes ubiquitous, we have to either disable the
deprecation warning or conditionally use the "STR" variant on newer
versions of libcurl. This patch switches to the new variant, which is
nice for two reasons:

  - we don't have to worry that silencing curl's deprecation warnings
    might cause us to miss other more useful ones

  - we'd eventually want to move to the new variant anyway, so this gets
    us set up (albeit with some extra ugly boilerplate for the
    conditional)

There are a lot of ways to split up the two cases. One way would be to
abstract the storage type (strbuf versus a long), how to append
(strbuf_addstr vs bitwise OR), how to initialize, which CURLOPT to use,
and so on. But the resulting code looks pretty magical:

  GIT_CURL_PROTOCOL_TYPE allowed = GIT_CURL_PROTOCOL_TYPE_INIT;
  if (...http is allowed...)
	GIT_CURL_PROTOCOL_APPEND(&allowed, "http", CURLOPT_HTTP);

and you end up with more "#define GIT_CURL_PROTOCOL_TYPE" macros than
actual code.

On the other end of the spectrum, we could just implement two separate
functions, one that handles a string list and one that handles bits. But
then we end up repeating our list of protocols (http, https, ftp, ftp).

This patch takes the middle ground. The run-time code is always there to
handle both types, and we just choose which one to feed to curl.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:27:09 +01:00
4bd481e0ad http: prefer CURLOPT_SEEKFUNCTION to CURLOPT_IOCTLFUNCTION
The IOCTLFUNCTION option has been deprecated, and generates a compiler
warning in recent versions of curl. We can switch to using SEEKFUNCTION
instead. It was added in 2008 via curl 7.18.0; our INSTALL file already
indicates we require at least curl 7.19.4.

But there's one catch: curl says we should use CURL_SEEKFUNC_{OK,FAIL},
and those didn't arrive until 7.19.5. One workaround would be to use a
bare 0/1 here (or define our own macros).  But let's just bump the
minimum required version to 7.19.5. That version is only a minor version
bump from our existing requirement, and is only a 2 month time bump for
versions that are almost 13 years old. So it's not likely that anybody
cares about the distinction.

Switching means we have to rewrite the ioctl functions into seek
functions. In some ways they are simpler (seeking is the only
operation), but in some ways more complex (the ioctl allowed only a full
rewind, but now we can seek to arbitrary offsets).

Curl will only ever use SEEK_SET (per their documentation), so I didn't
bother implementing anything else, since it would naturally be
completely untested. This seems unlikely to change, but I added an
assertion just in case.

Likewise, I doubt curl will ever try to seek outside of the buffer sizes
we've told it, but I erred on the defensive side here, rather than do an
out-of-bounds read.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:27:09 +01:00
4fab049258 http-push: prefer CURLOPT_UPLOAD to CURLOPT_PUT
The two options do exactly the same thing, but the latter has been
deprecated and in recent versions of curl may produce a compiler
warning. Since the UPLOAD form is available everywhere (it was
introduced in the year 2000 by curl 7.1), we can just switch to it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:27:08 +01:00
ed4404af3c Git 2.33.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:25:58 +01:00
87248c5933 Sync with 2.32.6
* maint-2.32:
  Git 2.32.6
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:25:56 +01:00
2aedeff35f Git 2.32.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:25:09 +01:00
aeb93d7da2 Sync with 2.31.7
* maint-2.31:
  Git 2.31.7
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:25:08 +01:00
0bbcf95194 Git 2.31.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:24:07 +01:00
e14d6b8408 Sync with 2.30.8
* maint-2.30:
  Git 2.30.8
  apply: fix writing behind newly created symbolic links
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:24:06 +01:00
394a759d2b Git 2.30.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-02-06 09:14:45 +01:00
a3033a68ac Merge branch 'ps/apply-beyond-symlink' into maint-2.30
Fix a vulnerability (CVE-2023-23946) that allows crafted input to trick
`git apply` into writing files outside of the working tree.

* ps/apply-beyond-symlink:
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2023-02-06 09:12:16 +01:00
2c9a4c7310 Merge branch 'tb/clone-local-symlinks' into maint-2.30
Resolve a security vulnerability (CVE-2023-22490) where `clone_local()`
is used in conjunction with non-local transports, leading to arbitrary
path exfiltration.

* tb/clone-local-symlinks:
  dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
  clone: delay picking a transport until after get_repo_path()
  t5619: demonstrate clone_local() with ambiguous transport
2023-02-06 09:09:14 +01:00
fade728df1 apply: fix writing behind newly created symbolic links
When writing files git-apply(1) initially makes sure that none of the
files it is about to create are behind a symlink:

```
 $ git init repo
 Initialized empty Git repository in /tmp/repo/.git/
 $ cd repo/
 $ ln -s dir symlink
 $ git apply - <<EOF
 diff --git a/symlink/file b/symlink/file
 new file mode 100644
 index 0000000..e69de29
 EOF
 error: affected file 'symlink/file' is beyond a symbolic link
```

This safety mechanism is crucial to ensure that we don't write outside
of the repository's working directory. It can be fooled though when the
patch that is being applied creates the symbolic link in the first
place, which can lead to writing files in arbitrary locations.

Fix this by checking whether the path we're about to create is
beyond a symlink or not. Tightening these checks like this should be
fine as we already have these precautions in Git as explained
above. Ideally, we should update the check we do up-front before
starting to reflect the computed changes to the working tree so that
we catch this case as well, but as part of embargoed security work,
adding an equivalent check just before we try to write out a file
should serve us well as a reasonable first step.

Digging back into history shows that this vulnerability has existed
since at least Git v2.9.0. As Git v2.8.0 and older don't build on my
system anymore I cannot tell whether older versions are affected, as
well.

Reported-by: Joern Schneeweisz <jschneeweisz@gitlab.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-02-03 14:41:31 -08:00
bffc762f87 dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS
When using the dir_iterator API, we first stat(2) the base path, and
then use that as a starting point to enumerate the directory's contents.

If the directory contains symbolic links, we will immediately die() upon
encountering them without the `FOLLOW_SYMLINKS` flag. The same is not
true when resolving the top-level directory, though.

As explained in a previous commit, this oversight in 6f054f9fb3
(builtin/clone.c: disallow `--local` clones with symlinks, 2022-07-28)
can be used as an attack vector to include arbitrary files on a victim's
filesystem from outside of the repository.

Prevent resolving top-level symlinks unless the FOLLOW_SYMLINKS flag is
given, which will cause clones of a repository with a symlink'd
"$GIT_DIR/objects" directory to fail.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-24 16:52:16 -08:00
cf8f6ce02a clone: delay picking a transport until after get_repo_path()
In the previous commit, t5619 demonstrates an issue where two calls to
`get_repo_path()` could trick Git into using its local clone mechanism
in conjunction with a non-local transport.

That sequence is:

 - the starting state is that the local path https:/example.com/foo is a
   symlink that points to ../../../.git/modules/foo. So it's dangling.

 - get_repo_path() sees that no such path exists (because it's
   dangling), and thus we do not canonicalize it into an absolute path

 - because we're using --separate-git-dir, we create .git/modules/foo.
   Now our symlink is no longer dangling!

 - we pass the url to transport_get(), which sees it as an https URL.

 - we call get_repo_path() again, on the url. This second call was
   introduced by f38aa83f9a (use local cloning if insteadOf makes a
   local URL, 2014-07-17). The idea is that we want to pull the url
   fresh from the remote.c API, because it will apply any aliases.

And of course now it sees that there is a local file, which is a
mismatch with the transport we already selected.

The issue in the above sequence is calling `transport_get()` before
deciding whether or not the repository is indeed local, and not passing
in an absolute path if it is local.

This is reminiscent of a similar bug report in [1], where it was
suggested to perform the `insteadOf` lookup earlier. Taking that
approach may not be as straightforward, since the intent is to store the
original URL in the config, but to actually fetch from the insteadOf
one, so conflating the two early on is a non-starter.

Note: we pass the path returned by `get_repo_path(remote->url[0])`,
which should be the same as `repo_name` (aside from any `insteadOf`
rewrites).

We *could* pass `absolute_pathdup()` of the same argument, which
86521acaca (Bring local clone's origin URL in line with that of a remote
clone, 2008-09-01) indicates may differ depending on the presence of
".git/" for a non-bare repo. That matters for forming relative submodule
paths, but doesn't matter for the second call, since we're just feeding
it to the transport code, which is fine either way.

[1]: https://lore.kernel.org/git/CAMoD=Bi41mB3QRn3JdZL-FGHs4w3C2jGpnJB-CqSndO7FMtfzA@mail.gmail.com/

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-24 16:52:16 -08:00
58325b93c5 t5619: demonstrate clone_local() with ambiguous transport
When cloning a repository, Git must determine (a) what transport
mechanism to use, and (b) whether or not the clone is local.

Since f38aa83f9a (use local cloning if insteadOf makes a local URL,
2014-07-17), the latter check happens after the remote has been
initialized, and references the remote's URL instead of the local path.
This is done to make it possible for a `url.<base>.insteadOf` rule to
convert a remote URL into a local one, in which case the `clone_local()`
mechanism should be used.

However, with a specially crafted repository, Git can be tricked into
using a non-local transport while still setting `is_local` to "1" and
using the `clone_local()` optimization. The below test case
demonstrates such an instance, and shows that it can be used to include
arbitrary (known) paths in the working copy of a cloned repository on a
victim's machine[^1], even if local file clones are forbidden by
`protocol.file.allow`.

This happens in a few parts:

 1. We first call `get_repo_path()` to see if the remote is a local
    path. If it is, we replace the repo name with its absolute path.

 2. We then call `transport_get()` on the repo name and decide how to
    access it. If it was turned into an absolute path in the previous
    step, then we should always treat it like a file.

 3. We use `get_repo_path()` again, and set `is_local` as appropriate.
    But it's already too late to rewrite the repo name as an absolute
    path, since we've already fed it to the transport code.

The attack works by including a submodule whose URL corresponds to a
path on disk. In the below example, the repository "sub" is reachable
via the dumb HTTP protocol at (something like):

    http://127.0.0.1:NNNN/dumb/sub.git

However, the path "http:/127.0.0.1:NNNN/dumb" (that is, a top-level
directory called "http:", then nested directories "127.0.0.1:NNNN", and
"dumb") exists within the repository, too.

To determine this, it first picks the appropriate transport, which is
dumb HTTP. It then uses the remote's URL in order to determine whether
the repository exists locally on disk. However, the malicious repository
also contains an embedded stub repository which is the target of a
symbolic link at the local path corresponding to the "sub" repository on
disk (i.e., there is a symbolic link at "http:/127.0.0.1/dumb/sub.git",
pointing to the stub repository via ".git/modules/sub/../../../repo").

This stub repository fools Git into thinking that a local repository
exists at that URL and thus can be cloned locally. The affected call is
in `get_repo_path()`, which in turn calls `get_repo_path_1()`, which
locates a valid repository at that target.

This then causes Git to set the `is_local` variable to "1", and in turn
instructs Git to clone the repository using its local clone optimization
via the `clone_local()` function.

The exploit comes into play because the stub repository's top-level
"$GIT_DIR/objects" directory is a symbolic link which can point to an
arbitrary path on the victim's machine. `clone_local()` resolves the
top-level "objects" directory through a `stat(2)` call, meaning that we
read through the symbolic link and copy or hardlink the directory
contents at the destination of the link.

In other words, we can get steps (1) and (3) to disagree by leveraging
the dangling symlink to pick a non-local transport in the first step,
and then set is_local to "1" in the third step when cloning with
`--separate-git-dir`, which makes the symlink non-dangling.

This can result in data-exfiltration on the victim's machine when
sensitive data is at a known path (e.g., "/home/$USER/.ssh").

The appropriate fix is two-fold:

 - Resolve the transport later on (to avoid using the local
   clone optimization with a non-local transport).

 - Avoid reading through the top-level "objects" directory when
   (correctly) using the clone_local() optimization.

This patch merely demonstrates the issue. The following two patches will
implement each part of the above fix, respectively.

[^1]: Provided that any target directory does not contain symbolic
  links, in which case the changes from 6f054f9fb3 (builtin/clone.c:
  disallow `--local` clones with symlinks, 2022-07-28) will abort the
  clone.

Reported-by: yvvdwf <yvvdwf@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-24 16:52:16 -08:00
b78628d426 Sync with maint-2.37
* maint-2.37:
  attr: adjust a mismatched data type
2023-01-19 13:48:26 -08:00
f2027d2626 Sync with maint-2.36
* maint-2.36:
  attr: adjust a mismatched data type
2023-01-19 13:48:17 -08:00
5c1fc48d68 Sync with maint-2.35
* maint-2.35:
  attr: adjust a mismatched data type
2023-01-19 13:48:08 -08:00
c508c30968 Sync with maint-2.34
* maint-2.34:
  attr: adjust a mismatched data type
2023-01-19 13:48:00 -08:00
f39fe8fcb2 Sync with maint-2.33
* maint-2.33:
  attr: adjust a mismatched data type
2023-01-19 13:47:42 -08:00
25d7cb600c Sync with maint-2.32
* maint-2.32:
  attr: adjust a mismatched data type
2023-01-19 13:46:04 -08:00
012e0d76dc Sync with maint-2.31
* maint-2.31:
  attr: adjust a mismatched data type
2023-01-19 13:45:37 -08:00
f8bf6b8f3d Sync with maint-2.30
* maint-2.30:
  attr: adjust a mismatched data type
2023-01-19 13:45:23 -08:00
0227130244 attr: adjust a mismatched data type
On platforms where `size_t` does not have the same width as `unsigned
long`, passing a pointer to the former when a pointer to the latter is
expected can lead to problems.

Windows and 32-bit Linux are among the affected platforms.

In this instance, we want to store the size of the blob that was read in
that variable. However, `read_blob_data_from_index()` passes that
pointer to `read_object_file()` which expects an `unsigned long *`.
Which means that on affected platforms, the variable is not fully
populated and part of its value is left uninitialized. (On Big-Endian
platforms, this problem would be even worse.)

The consequence is that depending on the uninitialized memory's
contents, we may erroneously reject perfectly fine attributes.

Let's address this by passing a pointer to a variable of the expected
data type.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-01-19 13:38:06 -08:00
469 changed files with 7639 additions and 17732 deletions

View File

@ -249,12 +249,6 @@ jobs:
- jobname: linux-leaks
cc: gcc
pool: ubuntu-latest
- jobname: linux-asan
cc: gcc
pool: ubuntu-latest
- jobname: linux-ubsan
cc: gcc
pool: ubuntu-latest
env:
CC: ${{matrix.vector.cc}}
CC_PACKAGE: ${{matrix.vector.cc_package}}

5
.gitignore vendored
View File

@ -1,5 +1,7 @@
/fuzz-commit-graph
/fuzz_corpora
/GIT-BUILD-DIR
/fuzz-pack-headers
/fuzz-pack-idx
/GIT-BUILD-OPTIONS
/GIT-CFLAGS
/GIT-LDFLAGS
@ -8,7 +10,6 @@
/GIT-PERL-HEADER
/GIT-PYTHON-VARS
/GIT-SCRIPT-DEFINES
/GIT-SPATCH-DEFINES
/GIT-USER-AGENT
/GIT-VERSION-FILE
/bin-wrappers/

View File

@ -165,7 +165,6 @@ Mark Rada <marada@uwaterloo.ca>
Martin Langhoff <martin@laptop.org> <martin@catalyst.net.nz>
Martin von Zweigbergk <martinvonz@gmail.com> <martin.von.zweigbergk@gmail.com>
Masaya Suzuki <masayasuzuki@google.com> <draftcode@gmail.com>
Matheus Tavares <matheus.tavb@gmail.com> <matheus.bernardino@usp.br>
Matt Draisey <matt@draisey.ca> <mattdraisey@sympatico.ca>
Matt Kraai <kraai@ftbfs.org> <matt.kraai@amo.abbott.com>
Matt McCutchen <matt@mattmccutchen.net> <hashproduct@gmail.com>

View File

@ -162,6 +162,8 @@ For shell scripts specifically (not exhaustive):
- We do not use \{m,n\};
- We do not use -E;
- We do not use ? or + (which are \{0,1\} and \{1,\}
respectively in BRE) but that goes without saying as these
are ERE elements not BRE (note that \? and \+ are not even part
@ -663,8 +665,8 @@ Writing Documentation:
(One or more of <file>.)
Optional parts are enclosed in square brackets:
[<file>...]
(Zero or more of <file>.)
[<extra>]
(Zero or one <extra>.)
--exec-path[=<path>]
(Option with an optional argument. Note that the "=" is inside the
@ -678,16 +680,6 @@ Writing Documentation:
[-q | --quiet]
[--utf8 | --no-utf8]
Use spacing around "|" token(s), but not immediately after opening or
before closing a [] or () pair:
Do: [-q | --quiet]
Don't: [-q|--quiet]
Don't use spacing around "|" tokens when they're used to seperate the
alternate arguments of an option:
Do: --track[=(direct|inherit)]
Don't: --track[=(direct | inherit)]
Parentheses are used for grouping:
[(<rev> | <range>)...]
(Any number of either <rev> or <range>. Parens are needed to make

View File

@ -351,16 +351,8 @@ $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS)
manpage-base-url.xsl: manpage-base-url.xsl.in
$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
manpage-prereqs := manpage-base-url.xsl $(wildcard manpage*.xsl)
manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
%.1 : %.xml $(manpage-prereqs)
$(manpage-cmd)
%.5 : %.xml $(manpage-prereqs)
$(manpage-cmd)
%.7 : %.xml $(manpage-prereqs)
$(manpage-cmd)
%.1 %.5 %.7 : %.xml manpage-base-url.xsl $(wildcard manpage*.xsl)
$(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
%.xml : %.txt $(ASCIIDOC_DEPS)
$(QUIET_ASCIIDOC)$(TXT_TO_XML) -d manpage -o $@ $<
@ -484,19 +476,8 @@ $(LINT_DOCS_MAN_SECTION_ORDER): .build/lint-docs/man-section-order/%.ok: %.txt
.PHONY: lint-docs-man-section-order
lint-docs-man-section-order: $(LINT_DOCS_MAN_SECTION_ORDER)
.PHONY: lint-docs-fsck-msgids
LINT_DOCS_FSCK_MSGIDS = .build/lint-docs/fsck-msgids.ok
$(LINT_DOCS_FSCK_MSGIDS): lint-fsck-msgids.perl
$(LINT_DOCS_FSCK_MSGIDS): ../fsck.h fsck-msgids.txt
$(call mkdir_p_parent_template)
$(QUIET_GEN)$(PERL_PATH) lint-fsck-msgids.perl \
../fsck.h fsck-msgids.txt $@
lint-docs-fsck-msgids: $(LINT_DOCS_FSCK_MSGIDS)
## Lint: list of targets above
.PHONY: lint-docs
lint-docs: lint-docs-fsck-msgids
lint-docs: lint-docs-gitlink
lint-docs: lint-docs-man-end-blurb
lint-docs: lint-docs-man-section-order

View File

@ -736,7 +736,7 @@ the {lore}[Git mailing list archive]:
2022-02-21 1:43 ` John Cai
2022-02-21 1:50 ` Taylor Blau
2022-02-23 19:50 ` John Cai
2022-02-18 20:00 ` // other replies elided
2022-02-18 20:00 ` // other replies ellided
2022-02-18 18:40 ` [PATCH 2/3] reflog: call reflog_delete from reflog.c John Cai via GitGitGadget
2022-02-18 19:15 ` Ævar Arnfjörð Bjarmason
2022-02-18 20:26 ` Junio C Hamano

View File

@ -0,0 +1,52 @@
Git v2.30.8 Release Notes
=========================
This release addresses the security issues CVE-2023-22490 and
CVE-2023-23946.
Fixes since v2.30.7
-------------------
* CVE-2023-22490:
Using a specially-crafted repository, Git can be tricked into using
its local clone optimization even when using a non-local transport.
Though Git will abort local clones whose source $GIT_DIR/objects
directory contains symbolic links (c.f., CVE-2022-39253), the objects
directory itself may still be a symbolic link.
These two may be combined to include arbitrary files based on known
paths on the victim's filesystem within the malicious repository's
working copy, allowing for data exfiltration in a similar manner as
CVE-2022-39253.
* CVE-2023-23946:
By feeding a crafted input to "git apply", a path outside the
working tree can be overwritten as the user who is running "git
apply".
* A mismatched type in `attr.c::read_attr_from_index()` which could
cause Git to errantly reject attributes on Windows and 32-bit Linux
has been corrected.
Credit for finding CVE-2023-22490 goes to yvvdwf, and the fix was
developed by Taylor Blau, with additional help from others on the
Git security mailing list.
Credit for finding CVE-2023-23946 goes to Joern Schneeweisz, and the
fix was developed by Patrick Steinhardt.
Johannes Schindelin (1):
attr: adjust a mismatched data type
Patrick Steinhardt (1):
apply: fix writing behind newly created symbolic links
Taylor Blau (3):
t5619: demonstrate clone_local() with ambiguous transport
clone: delay picking a transport until after get_repo_path()
dir-iterator: prevent top-level symlinks without FOLLOW_SYMLINKS

View File

@ -0,0 +1,6 @@
Git v2.31.7 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8 to
address the security issues CVE-2023-22490 and CVE-2023-23946;
see the release notes for that version for details.

View File

@ -0,0 +1,6 @@
Git v2.32.6 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8 and v2.31.7
to address the security issues CVE-2023-22490 and CVE-2023-23946;
see the release notes for these versions for details.

View File

@ -0,0 +1,7 @@
Git v2.33.7 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8, v2.31.7
and v2.32.6 to address the security issues CVE-2023-22490 and
CVE-2023-23946; see the release notes for these versions for
details.

View File

@ -0,0 +1,7 @@
Git v2.34.7 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8, v2.31.7,
v2.32.6 and v2.33.7 to address the security issues CVE-2023-22490
and CVE-2023-23946; see the release notes for these versions
for details.

View File

@ -0,0 +1,7 @@
Git v2.35.7 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8, v2.31.7,
v2.32.6, v2.33.7 and v2.34.7 to address the security issues
CVE-2023-22490 and CVE-2023-23946; see the release notes for
these versions for details.

View File

@ -0,0 +1,7 @@
Git v2.36.5 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8, v2.31.7,
v2.32.6, v2.33.7, v2.34.7 and v2.35.7 to address the security
issues CVE-2023-22490 and CVE-2023-23946; see the release notes
for these versions for details.

View File

@ -0,0 +1,7 @@
Git v2.37.6 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8, v2.31.7,
v2.32.6, v2.33.7, v2.34.7, v2.35.7 and v2.36.5 to address the
security issues CVE-2023-22490 and CVE-2023-23946; see the release
notes for these versions for details.

View File

@ -0,0 +1,7 @@
Git v2.38.4 Release Notes
=========================
This release merges up the fixes that appear in v2.30.8, v2.31.7,
v2.32.6, v2.33.7, v2.34.7, v2.35.7, v2.36.5 and v2.37.6 to
address the security issues CVE-2023-22490 and CVE-2023-23946;
see the release notes for these versions for details.

View File

@ -1,346 +0,0 @@
Git v2.39 Release Notes
=======================
UI, Workflows & Features
------------------------
* "git grep" learned to expand the sparse-index more lazily and on
demand in a sparse checkout.
* By default, use of fsmonitor on a repository on networked
filesystem is disabled. Add knobs to make it workable on macOS.
* After checking out a "branch" that is a symbolic-ref that points at
another branch, "git symbolic-ref HEAD" reports the underlying
branch, not the symbolic-ref the user gave checkout as argument.
The command learned the "--no-recurse" option to stop after
dereferencing a symbolic-ref only once.
* "git branch --edit-description @{-1}" is now a way to edit branch
description of the branch you were on before switching to the
current branch.
* "git merge-tree --stdin" is a new way to request a series of merges
and report the merge results.
* "git shortlog" learned to group by the "format" string.
* A new "--include-whitespace" option is added to "git patch-id", and
existing bugs in the internal patch-id logic that did not match
what "git patch-id" produces have been corrected.
* Enable gc.cruftpacks by default for those who opt into
feature.experimental setting.
* "git repack" learns to send cruft objects out of the way into
packfiles outside the repository.
* 'scalar reconfigure -a' is taught to automatically remove
scalar.repo entires which no longer exist.
* Redact headers from cURL's h2h3 module in GIT_CURL_VERBOSE and
others.
* 'git maintenance register' is taught to write configuration to an
arbitrary path, and 'git for-each-repo' is taught to expand tilde
characters in paths.
* When creating new notes, the template used to get a stray empty
newline, which has been removed.
* "git receive-pack" used to use all the local refs as the boundary for
checking connectivity of the data "git push" sent, but now it uses
only the refs that it advertised to the pusher. In a repository with
the .hideRefs configuration, this reduces the resources needed to
perform the check.
* With '--recurse-submodules=on-demand', all submodules are
recursively pushed.
Performance, Internal Implementation, Development Support etc.
--------------------------------------------------------------
* With a bit of header twiddling, use the native regexp library on
macOS instead of the compat/ one.
* Prepare for GNU [ef]grep that throw warning of their uses.
* Sources related to fuzz testing have been moved down to their own
directory.
* Most credential helpers ignored unknown entries in a credential
description, but a few died upon seeing them. The latter were
taught to ignore them, too
* "scalar unregister" in a repository that is already been
unregistered reported an error.
* Remove error detection from a function that fetches from promisor
remotes, and make it die when such a fetch fails to bring all the
requested objects, to give an early failure to various operations.
* Update CodingGuidelines to clarify what features to use and avoid
in C99.
* Avoid false-positive from LSan whose assumption may be broken with
higher optimization levels.
* Enable address and undefined sanitizer tasks at GitHub Actions CI.
* More UNUSED annotation to help using -Wunused option with the
compiler.
(merge 4b992f0a24 jk/unused-anno-more later to maint).
* Rewrite a deep recursion in the skipping negotiator to use a loop
with on-heap prio queue to avoid stack wastage.
* Add documentation for message IDs in fsck error messages.
* Define the logical elements of a "bundle list", data structure to
store them in-core, format to transfer them, and code to parse
them.
* The role the security mailing list plays in an embargoed release
has been documented.
* Two new facilities, "timer" and "counter", are introduced to the
trace2 API.
* Code simplification by using strvec_pushf() instead of building an
argument in a separate strbuf.
* Make sure generated dependency file is stably sorted to help
developers debugging their build issues.
* The glossary entries for "commit-graph file" and "reachability
bitmap" have been added.
* Various tests exercising the transfer.credentialsInUrl
configuration are taught to avoid making requests which require
resolving localhost to reduce CI-flakiness.
* A redundant diagnostic message is dropped from test_path_is_missing().
* Simplify the run-command API.
* Update the actions/github-script dependency in CI to avoid a
deprecation warning.
* Progress on being able to initialize a rev_info struct with a
macro.
* Add trace2 counters to the region to clear skip worktree bits in a
sparse checkout.
* Modernize test script to avoid "test -f" and friends.
* Avoid calling 'cache_tree_update()' when doing so would be
redundant.
* Update the credential-cache documentation to provide a more
realistic example.
* Makefile comments updates and reordering to clarify knobs used to
choose SHA implementations.
* A design document for sparse-checkout's future directions has been
added.
* Teach chainlint.pl to annotate the original test definition instead
of the token stream.
* "make coccicheck" is time consuming. It has been made to run more
incrementally.
* `parse_object()` has been hardened to check for the existence of a
suspected blob object.
* The build procedure has been adjusted to GNUmake version 4.4, which
made some changes to how pattern rule with multiple targets are
handled.
Fixes since v2.38
-----------------
* The codepath that reads from the index v4 had unaligned memory
accesses, which has been corrected.
* Fix messages incorrectly marked for translation.
* "git fsck" failed to release contents of tree objects already used
from the memory, which has been fixed.
* "git clone" did not like to see the "--bare" and the "--origin"
options used together without a good reason.
* "git remote rename" failed to rename a remote without fetch
refspec, which has been corrected.
* Documentation on various Boolean GIT_* environment variables have
been clarified.
* "git rebase -i" can mistakenly attempt to apply a fixup to a commit
itself, which has been corrected.
* "git multi-pack-index repack/expire" used to repack unreachable
cruft into a new pack, which have been corrected.
* In read-only repositories, "git merge-tree" tried to come up with a
merge result tree object, which it failed (which is not wrong) and
led to a segfault (which is bad), which has been corrected.
* Force C locale while running tests around httpd to make sure we can
find expected error messages in the log.
* Fix a logic in "mailinfo -b" that miscomputed the length of a
substring, which lead to an out-of-bounds access.
* The codepath to sign learned to report errors when it fails to read
from "ssh-keygen".
* Code clean-up that results in plugging a leak.
* "GIT_EDITOR=: git branch --edit-description" resulted in failure,
which has been corrected.
* The code to clean temporary object directories (used for
quarantine) tried to remove them inside its signal handler, which
was a no-no.
* Update comment in the Makefile about the RUNTIME_PREFIX config knob.
* Clarify that "the sentence after <area>: prefix does not begin with
a capital letter" rule applies only to the commit title.
* "git branch --edit-description" on an unborn branch misleadingly
said that no such branch exists, which has been corrected.
* Work around older clang that warns against C99 zero initialization
syntax for struct.
* Giving "--invert-grep" and "--all-match" without "--grep" to the
"git log" command resulted in an attempt to access grep pattern
expression structure that has not been allocated, which has been
corrected.
(merge db84376f98 ab/grep-simplify-extended-expression later to maint).
* "git diff rev^!" did not show combined diff to go to the rev from
its parents.
(merge a79c6b6081 rs/diff-caret-bang-with-parents later to maint).
* Allow configuration files in "protected" scopes to include other
configuration files.
(merge ecec57b3c9 gc/bare-repo-discovery later to maint).
* Give a bit more diversity to macOS CI by using sha1dc in one of the
jobs (the other one tests Apple Common Crypto).
(merge 1ad5c3df35 jc/ci-osx-with-sha1dc later to maint).
* A bugfix with tracing support in midx codepath
(merge e9c3839944 tb/midx-bitmap-selection-fix later to maint).
* When geometric repacking feature is in use together with the
--pack-kept-objects option, we lost packs marked with .keep files.
(merge 197443e80a tb/save-keep-pack-during-geometric-repack later to maint).
* Move a global variable added as a hack during regression fixes to
its proper place in the API.
(merge 0b0ab95f17 ab/run-hook-api-cleanup later to maint).
* Update to build procedure with VS using CMake/CTest.
(merge c858750b41 js/cmake-updates later to maint).
* The short-help text shown by "git cmd -h" and the synopsis text
shown at the beginning of "git help cmd" have been made more
consistent.
* When creating a multi-pack bitmap, remove per-pack bitmap files
unconditionally as they will never be consulted.
(merge 55d902cd61 tb/remove-unused-pack-bitmap later to maint).
* Fix a longstanding syntax error in Git.pm error codepath.
* "git diff --stat" etc. were invented back when everything was ASCII
and strlen() was a way to measure the display width of a string;
adjust them to compute the display width assuming UTF-8 pathnames.
(merge ce8529b2bb tb/diffstat-with-utf8-strwidth later to maint).
* "git branch --edit-description" can exit with status -1 which is
not a good practice; it learned to use 1 as everybody else instead.
* "git apply" limits its input to a bit less than 1 GiB.
* Merging a branch with directory renames into a branch that changes
the directory to a symlink was mishandled by the ort merge
strategy, which has been corrected.
* A bugfix to "git subtree" in its split and merge features.
* Fix some bugs in the reflog messages when rebasing and changes the
reflog messages of "rebase --apply" to match "rebase --merge" with
the aim of making the reflog easier to parse.
* "git rebase --keep-base" used to discard the commits that are
already cherry-picked to the upstream, even when "keep-base" meant
that the base, on top of which the history is being rebuilt, does
not yet include these cherry-picked commits. The --keep-base
option now implies --reapply-cherry-picks and --no-fork-point
options.
* The way "git repack" created temporary files when it received a
signal was prone to deadlocking, which has been corrected.
* Various tests exercising the transfer.credentialsInUrl
configuration are taught to avoid making requests which require
resolving localhost to reduce CI-flakiness.
* The adjust_shared_perm() helper function learned to refrain from
setting the "g+s" bit on directories when it is not necessary.
* "git archive" mistakenly complained twice about a missing
executable, which has been corrected.
* Fix a bug where `git branch -d` did not work on an orphaned HEAD.
* `git rebase --update-refs` would delete references when all
`update-ref` commands in the sequencer were removed, which has been
corrected.
* Fix a regression in the bisect-helper which mistakenly treats
arguments to the command given to 'git bisect run' as arguments to
the helper.
* Correct an error where `git rebase` would mistakenly use a branch or
tag named "refs/rewritten/xyz" when missing a rebase label.
* Assorted fixes of parsing end-user input as integers.
(merge 14770cf0de pw/config-int-parse-fixes later to maint).
* "git prune" may try to iterate over .git/objects/pack for trash
files to remove in it, and loudly fail when the directory is
missing, which is not necessary. The command has been taught to
ignore such a failure.
(merge 6974765352 ew/prune-with-missing-objects-pack later to maint).
* Add one more candidate directory that may house httpd modules while
running tests.
(merge 1c7dc23d41 es/locate-httpd-module-location-in-test later to maint).
* A handful of leaks in the line-log machinery have been plugged.
* The format of a line in /proc/cpuinfo that describes a CPU on s390x
looked different from everybody else, and the code in chainlint.pl
failed to parse it.
(merge 1f51b77f4f ah/chainlint-cpuinfo-parse-fix later to maint).
* Adjust the GitHub CI to newer ubuntu release.
(merge 0d3507f3e7 jx/ci-ubuntu-fix later to maint).
* Other code cleanup, docfix, build fix, etc.
(merge 413bc6d20a ds/cmd-main-reorder later to maint).
(merge 8d2863e4ed nw/t1002-cleanup later to maint).
(merge 7c2dc122f9 rs/list-objects-filter-leakfix later to maint).
(merge 288fcb1c94 zk/push-use-bitmaps later to maint).
(merge 42db324c0f km/merge-recursive-typofix later to maint).

View File

@ -1,5 +0,0 @@
Git v2.39.1 Release Notes
=========================
This release merges the security fix that appears in v2.30.7; see
the release notes for that version for details.

View File

@ -38,10 +38,9 @@ while ($changed) {
}
}
foreach my $text (sort keys %include) {
my $included = $include{$text};
while (my ($text, $included) = each %include) {
if (! exists $included{$text} &&
(my $base = $text) =~ s/\.txt$//) {
print "$base.html $base.xml : ", join(" ", sort keys %$included), "\n";
print "$base.html $base.xml : ", join(" ", keys %$included), "\n";
}
}

View File

@ -387,8 +387,6 @@ include::config/branch.txt[]
include::config/browser.txt[]
include::config/bundle.txt[]
include::config/checkout.txt[]
include::config/clean.txt[]
@ -425,8 +423,6 @@ include::config/filter.txt[]
include::config/fsck.txt[]
include::config/fsmonitor--daemon.txt[]
include::config/gc.txt[]
include::config/gitcvs.txt[]

View File

@ -1,24 +0,0 @@
bundle.*::
The `bundle.*` keys may appear in a bundle list file found via the
`git clone --bundle-uri` option. These keys currently have no effect
if placed in a repository config file, though this will change in the
future. See link:technical/bundle-uri.html[the bundle URI design
document] for more details.
bundle.version::
This integer value advertises the version of the bundle list format
used by the bundle list. Currently, the only accepted value is `1`.
bundle.mode::
This string value should be either `all` or `any`. This value describes
whether all of the advertised bundles are required to unbundle a
complete understanding of the bundled information (`all`) or if any one
of the listed bundle URIs is sufficient (`any`).
bundle.<id>.*::
The `bundle.<id>.*` keys are used to describe a single item in the
bundle list, grouped under `<id>` for identification purposes.
bundle.<id>.uri::
This string value defines the URI by which Git can reach the contents
of this `<id>`. This URI may be a bundle file or another bundle list.

View File

@ -618,7 +618,7 @@ but risks losing recent work in the event of an unclean system shutdown.
* `loose-object` hardens objects added to the repo in loose-object form.
* `pack` hardens objects added to the repo in packfile form.
* `pack-metadata` hardens packfile bitmaps and indexes.
* `commit-graph` hardens the commit-graph file.
* `commit-graph` hardens the commit graph file.
* `index` hardens the index when it is modified.
* `objects` is an aggregate option that is equivalent to
`loose-object,pack`.

View File

@ -14,9 +14,6 @@ feature.experimental::
+
* `fetch.negotiationAlgorithm=skipping` may improve fetch negotiation times by
skipping more commits at a time, reducing the number of round trips.
+
* `gc.cruftPacks=true` reduces disk space used by unreachable objects during
garbage collection, preventing loose object explosions.
feature.manyFiles::
Enable config options that optimize for repos with many files in the

View File

@ -35,10 +35,6 @@ allow new instances of the same breakages go unnoticed.
Setting an unknown `fsck.<msg-id>` value will cause fsck to die, but
doing the same for `receive.fsck.<msg-id>` and `fetch.fsck.<msg-id>`
will only cause git to warn.
+
See `Fsck Messages` section of linkgit:git-fsck[1] for supported
values of `<msg-id>`.
fsck.skipList::
The path to a list of object names (i.e. one unabbreviated SHA-1 per

View File

@ -1,11 +0,0 @@
fsmonitor.allowRemote::
By default, the fsmonitor daemon refuses to work against network-mounted
repositories. Setting `fsmonitor.allowRemote` to `true` overrides this
behavior. Only respected when `core.fsmonitor` is set to `true`.
fsmonitor.socketDir::
This Mac OS-specific option, if set, specifies the directory in
which to create the Unix domain socket used for communication
between the fsmonitor daemon and various Git commands. The directory must
reside on a native Mac OS filesystem. Only respected when `core.fsmonitor`
is set to `true`.

View File

@ -110,8 +110,18 @@ This will result in only b (a and c are cleared).
----
push.recurseSubmodules::
May be "check", "on-demand", "only", or "no", with the same behavior
as that of "push --recurse-submodules".
Make sure all submodule commits used by the revisions to be pushed
are available on a remote-tracking branch. If the value is 'check'
then Git will verify that all submodule commits that changed in the
revisions to be pushed are available on at least one remote of the
submodule. If any commits are missing, the push will be aborted and
exit with non-zero status. If the value is 'on-demand' then all
submodules that changed in the revisions to be pushed will be
pushed. If on-demand was not able to push all necessary revisions
it will also be aborted and exit with non-zero status. If the value
is 'no' then default behavior of ignoring submodules when pushing
is retained. You may override this configuration at time of push by
specifying '--recurse-submodules=check|on-demand|no'.
If not set, 'no' is used by default, unless 'submodule.recurse' is
set (in which case a 'true' value means 'on-demand').

View File

@ -1,161 +0,0 @@
`badDate`::
(ERROR) Invalid date format in an author/committer line.
`badDateOverflow`::
(ERROR) Invalid date value in an author/committer line.
`badEmail`::
(ERROR) Invalid email format in an author/committer line.
`badFilemode`::
(INFO) A tree contains a bad filemode entry.
`badName`::
(ERROR) An author/committer name is empty.
`badObjectSha1`::
(ERROR) An object has a bad sha1.
`badParentSha1`::
(ERROR) A commit object has a bad parent sha1.
`badTagName`::
(INFO) A tag has an invalid format.
`badTimezone`::
(ERROR) Found an invalid time zone in an author/committer line.
`badTree`::
(ERROR) A tree cannot be parsed.
`badTreeSha1`::
(ERROR) A tree has an invalid format.
`badType`::
(ERROR) Found an invalid object type.
`duplicateEntries`::
(ERROR) A tree contains duplicate file entries.
`emptyName`::
(WARN) A path contains an empty name.
`extraHeaderEntry`::
(IGNORE) Extra headers found after `tagger`.
`fullPathname`::
(WARN) A path contains the full path starting with "/".
`gitattributesSymlink`::
(INFO) `.gitattributes` is a symlink.
`gitignoreSymlink`::
(INFO) `.gitignore` is a symlink.
`gitmodulesBlob`::
(ERROR) A non-blob found at `.gitmodules`.
`gitmodulesLarge`::
(ERROR) The `.gitmodules` file is too large to parse.
`gitmodulesMissing`::
(ERROR) Unable to read `.gitmodules` blob.
`gitmodulesName`::
(ERROR) A submodule name is invalid.
`gitmodulesParse`::
(INFO) Could not parse `.gitmodules` blob.
`gitmodulesLarge`;
(ERROR) `.gitmodules` blob is too large to parse.
`gitmodulesPath`::
(ERROR) `.gitmodules` path is invalid.
`gitmodulesSymlink`::
(ERROR) `.gitmodules` is a symlink.
`gitmodulesUpdate`::
(ERROR) Found an invalid submodule update setting.
`gitmodulesUrl`::
(ERROR) Found an invalid submodule url.
`hasDot`::
(WARN) A tree contains an entry named `.`.
`hasDotdot`::
(WARN) A tree contains an entry named `..`.
`hasDotgit`::
(WARN) A tree contains an entry named `.git`.
`mailmapSymlink`::
(INFO) `.mailmap` is a symlink.
`missingAuthor`::
(ERROR) Author is missing.
`missingCommitter`::
(ERROR) Committer is missing.
`missingEmail`::
(ERROR) Email is missing in an author/committer line.
`missingNameBeforeEmail`::
(ERROR) Missing name before an email in an author/committer line.
`missingObject`::
(ERROR) Missing `object` line in tag object.
`missingSpaceBeforeDate`::
(ERROR) Missing space before date in an author/committer line.
`missingSpaceBeforeEmail`::
(ERROR) Missing space before the email in author/committer line.
`missingTag`::
(ERROR) Unexpected end after `type` line in a tag object.
`missingTagEntry`::
(ERROR) Missing `tag` line in a tag object.
`missingTaggerEntry`::
(INFO) Missing `tagger` line in a tag object.
`missingTree`::
(ERROR) Missing `tree` line in a commit object.
`missingType`::
(ERROR) Invalid type value on the `type` line in a tag object.
`missingTypeEntry`::
(ERROR) Missing `type` line in a tag object.
`multipleAuthors`::
(ERROR) Multiple author lines found in a commit.
`nulInCommit`::
(WARN) Found a NUL byte in the commit object body.
`nulInHeader`::
(FATAL) NUL byte exists in the object header.
`nullSha1`::
(WARN) Tree contains entries pointing to a null sha1.
`treeNotSorted`::
(ERROR) A tree is not properly sorted.
`unknownType`::
(ERROR) Found an unknown object type.
`unterminatedHeader`::
(FATAL) Missing end-of-line in the object header.
`zeroPaddedDate`::
(ERROR) Found a zero padded date in an author/commiter line.
`zeroPaddedFilemode`::
(WARN) Found a zero padded filemode in a tree.

View File

@ -8,7 +8,7 @@ git-annotate - Annotate file lines with commit information
SYNOPSIS
--------
[verse]
'git annotate' [<options>] [<rev-opts>] [<rev>] [--] <file>
'git annotate' [<options>] <file> [<revision>]
DESCRIPTION
-----------

View File

@ -8,7 +8,7 @@ git-clean - Remove untracked files from the working tree
SYNOPSIS
--------
[verse]
'git clean' [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] [<pathspec>...]
'git clean' [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>...
DESCRIPTION
-----------
@ -20,16 +20,16 @@ Normally, only files unknown to Git are removed, but if the `-x`
option is specified, ignored files are also removed. This can, for
example, be useful to remove all build products.
If any optional `<pathspec>...` arguments are given, only those paths
that match the pathspec are affected.
If any optional `<path>...` arguments are given, only those paths
are affected.
OPTIONS
-------
-d::
Normally, when no <pathspec> is specified, git clean will not
Normally, when no <path> is specified, git clean will not
recurse into untracked directories to avoid removing too much.
Specify -d to have it recurse into such directories as well.
If a <pathspec> is specified, -d is irrelevant; all untracked
If any paths are specified, -d is irrelevant; all untracked
files matching the specified paths (with exceptions for nested
git directories mentioned under `--force`) will be removed.

View File

@ -10,10 +10,7 @@ SYNOPSIS
--------
[verse]
'git commit-graph verify' [--object-dir <dir>] [--shallow] [--[no-]progress]
'git commit-graph write' [--object-dir <dir>] [--append]
[--split[=<strategy>]] [--reachable | --stdin-packs | --stdin-commits]
[--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress]
<split options>
'git commit-graph write' <options> [--object-dir <dir>] [--[no-]progress]
DESCRIPTION

View File

@ -8,7 +8,7 @@ git-credential-cache--daemon - Temporarily store user credentials in memory
SYNOPSIS
--------
[verse]
'git credential-cache{litdd}daemon' [--debug] <socket-path>
'git credential-cache{litdd}daemon' [--debug] <socket>
DESCRIPTION
-----------
@ -16,7 +16,7 @@ DESCRIPTION
NOTE: You probably don't want to invoke this command yourself; it is
started automatically when you use linkgit:git-credential-cache[1].
This command listens on the Unix domain socket specified by `<socket-path>`
This command listens on the Unix domain socket specified by `<socket>`
for `git-credential-cache` clients. Clients may store and retrieve
credentials. Each credential is held for a timeout specified by the
client; once no credentials are held, the daemon exits.

View File

@ -69,10 +69,10 @@ $ git push http://example.com/repo.git
------------------------------------
You can provide options via the credential.helper configuration
variable (this example increases the cache time to 1 hour):
variable (this example drops the cache time to 5 minutes):
-------------------------------------------------------
$ git config credential.helper 'cache --timeout=3600'
$ git config credential.helper 'cache --timeout=300'
-------------------------------------------------------
GIT

View File

@ -160,8 +160,6 @@ empty string.
Components which are missing from the URL (e.g., there is no
username in the example above) will be left unset.
Unrecognised attributes are silently discarded.
GIT
---
Part of the linkgit:git[1] suite

View File

@ -9,7 +9,7 @@ git-diff-files - Compares files in the working tree and the index
SYNOPSIS
--------
[verse]
'git diff-files' [-q] [-0 | -1 | -2 | -3 | -c | --cc] [<common-diff-options>] [<path>...]
'git diff-files' [-q] [-0|-1|-2|-3|-c|--cc] [<common-diff-options>] [<path>...]
DESCRIPTION
-----------

View File

@ -79,10 +79,10 @@ If --merge-base is given, use the merge base of the two commits for the
This form is to view the results of a merge commit. The first
listed <commit> must be the merge itself; the remaining two or
more commits should be its parents. Convenient ways to produce
the desired set of revisions are to use the suffixes `^@` and
`^!`. If A is a merge commit, then `git diff A A^@`,
`git diff A^!` and `git show A` all give the same combined diff.
more commits should be its parents. A convenient way to produce
the desired set of revisions is to use the `^@` suffix.
For instance, if `master` names a merge commit, `git diff master
master^@` gives the same combined diff as `git show master`.
'git diff' [<options>] <commit>..<commit> [--] [<path>...]::

View File

@ -9,7 +9,7 @@ git-fast-export - Git data exporter
SYNOPSIS
--------
[verse]
'git fast-export' [<options>] | 'git fast-import'
'git fast-export [<options>]' | 'git fast-import'
DESCRIPTION
-----------

View File

@ -152,18 +152,6 @@ hash mismatch <object>::
object database value.
This indicates a serious data integrity problem.
FSCK MESSAGES
-------------
The following lists the types of errors `git fsck` detects and what
each error means, with their default severity. The severity of the
error, other than those that are marked as "(FATAL)", can be tweaked
by setting the corresponding `fsck.<msg-id>` configuration variable.
include::fsck-msgids.txt[]
Environment Variables
---------------------

View File

@ -3,7 +3,7 @@ git-fsmonitor{litdd}daemon(1)
NAME
----
git-fsmonitor--daemon - A Built-in Filesystem Monitor
git-fsmonitor--daemon - A Built-in File System Monitor
SYNOPSIS
--------
@ -17,7 +17,7 @@ DESCRIPTION
-----------
A daemon to watch the working directory for file and directory
changes using platform-specific filesystem notification facilities.
changes using platform-specific file system notification facilities.
This daemon communicates directly with commands like `git status`
using the link:technical/api-simple-ipc.html[simple IPC] interface
@ -63,44 +63,13 @@ CAVEATS
-------
The fsmonitor daemon does not currently know about submodules and does
not know to filter out filesystem events that happen within a
not know to filter out file system events that happen within a
submodule. If fsmonitor daemon is watching a super repo and a file is
modified within the working directory of a submodule, it will report
the change (as happening against the super repo). However, the client
will properly ignore these extra events, so performance may be affected
but it will not cause an incorrect result.
By default, the fsmonitor daemon refuses to work against network-mounted
repositories; this may be overridden by setting `fsmonitor.allowRemote` to
`true`. Note, however, that the fsmonitor daemon is not guaranteed to work
correctly with all network-mounted repositories and such use is considered
experimental.
On Mac OS, the inter-process communication (IPC) between various Git
commands and the fsmonitor daemon is done via a Unix domain socket (UDS) -- a
special type of file -- which is supported by native Mac OS filesystems,
but not on network-mounted filesystems, NTFS, or FAT32. Other filesystems
may or may not have the needed support; the fsmonitor daemon is not guaranteed
to work with these filesystems and such use is considered experimental.
By default, the socket is created in the `.git` directory, however, if the
`.git` directory is on a network-mounted filesystem, it will be instead be
created at `$HOME/.git-fsmonitor-*` unless `$HOME` itself is on a
network-mounted filesystem in which case you must set the configuration
variable `fsmonitor.socketDir` to the path of a directory on a Mac OS native
filesystem in which to create the socket file.
If none of the above directories (`.git`, `$HOME`, or `fsmonitor.socketDir`)
is on a native Mac OS file filesystem the fsmonitor daemon will report an
error that will cause the daemon and the currently running command to exit.
CONFIGURATION
-------------
include::includes/cmd-config-section-all.txt[]
include::config/fsmonitor--daemon.txt[]
GIT
---
Part of the linkgit:git[1] suite

View File

@ -9,8 +9,7 @@ git-hash-object - Compute object ID and optionally creates a blob from a file
SYNOPSIS
--------
[verse]
'git hash-object' [-t <type>] [-w] [--path=<file> | --no-filters]
[--stdin [--literally]] [--] <file>...
'git hash-object' [-t <type>] [-w] [--path=<file>|--no-filters] [--stdin [--literally]] [--] <file>...
'git hash-object' [-t <type>] [-w] --stdin-paths [--no-filters]
DESCRIPTION

View File

@ -8,9 +8,8 @@ git-interpret-trailers - Add or parse structured information in commit messages
SYNOPSIS
--------
[verse]
'git interpret-trailers' [--in-place] [--trim-empty]
[(--trailer <token>[(=|:)<value>])...]
[--parse] [<file>...]
'git interpret-trailers' [<options>] [(--trailer <token>[(=|:)<value>])...] [<file>...]
'git interpret-trailers' [<options>] [--parse] [<file>...]
DESCRIPTION
-----------

View File

@ -10,8 +10,8 @@ SYNOPSIS
--------
[verse]
'git ls-files' [-z] [-t] [-v] [-f]
[-c|--cached] [-d|--deleted] [-o|--others] [-i|--ignored]
[-s|--stage] [-u|--unmerged] [-k|--killed] [-m|--modified]
[-c|--cached] [-d|--deleted] [-o|--others] [-i|--|ignored]
[-s|--stage] [-u|--unmerged] [-k|--|killed] [-m|--modified]
[--directory [--no-empty-directory]] [--eol]
[--deduplicate]
[-x <pattern>|--exclude=<pattern>]

View File

@ -11,7 +11,7 @@ SYNOPSIS
[verse]
'git maintenance' run [<options>]
'git maintenance' start [--scheduler=<scheduler>]
'git maintenance' (stop|register|unregister) [<options>]
'git maintenance' (stop|register|unregister)
DESCRIPTION
@ -50,13 +50,13 @@ stop::
the background maintenance is restarted later.
register::
Initialize Git config values so any scheduled maintenance will start
running on this repository. This adds the repository to the
`maintenance.repo` config variable in the current user's global config,
or the config specified by --config-file option, and enables some
recommended configuration values for `maintenance.<task>.schedule`. The
tasks that are enabled are safe for running in the background without
disrupting foreground processes.
Initialize Git config values so any scheduled maintenance will
start running on this repository. This adds the repository to the
`maintenance.repo` config variable in the current user's global
config and enables some recommended configuration values for
`maintenance.<task>.schedule`. The tasks that are enabled are safe
for running in the background without disrupting foreground
processes.
+
The `register` subcommand will also set the `maintenance.strategy` config
value to `incremental`, if this value is not previously set. The
@ -79,10 +79,6 @@ unregister::
Remove the current repository from background maintenance. This
only removes the repository from the configured list. It does not
stop the background maintenance processes from running.
+
The `unregister` subcommand will report an error if the current repository
is not already registered. Use the `--force` option to return success even
when the current repository is not registered.
TASKS
-----

View File

@ -9,8 +9,8 @@ git-merge-base - Find as good common ancestors as possible for a merge
SYNOPSIS
--------
[verse]
'git merge-base' [-a | --all] <commit> <commit>...
'git merge-base' [-a | --all] --octopus <commit>...
'git merge-base' [-a|--all] <commit> <commit>...
'git merge-base' [-a|--all] --octopus <commit>...
'git merge-base' --is-ancestor <commit> <commit>
'git merge-base' --independent <commit>...
'git merge-base' --fork-point <ref> [<commit>]

View File

@ -81,31 +81,6 @@ Whereas for a conflicted merge, the output is by default of the form:
These are discussed individually below.
However, there is an exception. If `--stdin` is passed, then there is
an extra section at the beginning, a NUL character at the end, and then
all the sections repeat for each line of input. Thus, if the first merge
is conflicted and the second is clean, the output would be of the form:
<Merge status>
<OID of toplevel tree>
<Conflicted file info>
<Informational messages>
NUL
<Merge status>
<OID of toplevel tree>
NUL
[[MS]]
Merge status
~~~~~~~~~~~~
This is an integer status followed by a NUL character. The integer status is:
0: merge had conflicts
1: merge was clean
&lt;0: something prevented the merge from running (e.g. access to repository
objects denied by filesystem)
[[OIDTLT]]
OID of toplevel tree
~~~~~~~~~~~~~~~~~~~~
@ -133,50 +108,18 @@ character instead of a newline character.
Informational messages
~~~~~~~~~~~~~~~~~~~~~~
This section provides informational messages, typically about
conflicts. The format of the section varies significantly depending
on whether `-z` is passed.
If `-z` is passed:
The output format is zero or more conflict informational records, each
of the form:
<list-of-paths><conflict-type>NUL<conflict-message>NUL
where <list-of-paths> is of the form
<number-of-paths>NUL<path1>NUL<path2>NUL...<pathN>NUL
and includes paths (or branch names) affected by the conflict or
informational message in <conflict-message>. Also, <conflict-type> is a
stable string explaining the type of conflict, such as
* "Auto-merging"
* "CONFLICT (rename/delete)"
* "CONFLICT (submodule lacks merge base)"
* "CONFLICT (binary)"
and <conflict-message> is a more detailed message about the conflict which often
(but not always) embeds the <stable-short-type-description> within it. These
strings may change in future Git versions. Some examples:
This always starts with a blank line (or NUL if `-z` is passed) to
separate it from the previous sections, and then has free-form
messages about the merge, such as:
* "Auto-merging <file>"
* "CONFLICT (rename/delete): <oldfile> renamed...but deleted in..."
* "Failed to merge submodule <submodule> (no merge base)"
* "Failed to merge submodule <submodule> (<reason>)"
* "Warning: cannot merge binary files: <filename>"
If `-z` is NOT passed:
This section starts with a blank line to separate it from the previous
sections, and then only contains the <conflict-message> information
from the previous section (separated by newlines). These are
non-stable strings that should not be parsed by scripts, and are just
meant for human consumption. Also, note that while <conflict-message>
strings usually do not contain embedded newlines, they sometimes do.
(However, the free-form messages will never have an embedded NUL
character). So, the entire block of information is meant for human
readers as an agglomeration of all conflict messages.
Note that these free-form messages will never have a NUL character
in or between them, even if -z is passed. It is simply a large block
of text taking up the remainder of the output.
EXIT STATUS
-----------
@ -184,10 +127,7 @@ EXIT STATUS
For a successful, non-conflicted merge, the exit status is 0. When the
merge has conflicts, the exit status is 1. If the merge is not able to
complete (or start) due to some kind of error, the exit status is
something other than 0 or 1 (and the output is unspecified). When
--stdin is passed, the return status is 0 for both successful and
conflicted merges, and something other than 0 or 1 if it cannot complete
all the requested merges.
something other than 0 or 1 (and the output is unspecified).
USAGE NOTES
-----------

View File

@ -9,7 +9,7 @@ git-mv - Move or rename a file, a directory, or a symlink
SYNOPSIS
--------
[verse]
'git mv' [<options>] <source>... <destination>
'git mv' <options>... <args>...
DESCRIPTION
-----------
@ -30,7 +30,7 @@ OPTIONS
-------
-f::
--force::
Force renaming or moving of a file even if the <destination> exists.
Force renaming or moving of a file even if the target exists
-k::
Skip move or rename actions which would lead to an error
condition. An error happens when a source is neither existing nor

View File

@ -9,7 +9,7 @@ git-pack-redundant - Find redundant pack files
SYNOPSIS
--------
[verse]
'git pack-redundant' [--verbose] [--alt-odb] (--all | <pack-filename>...)
'git pack-redundant' [ --verbose ] [ --alt-odb ] ( --all | <pack-filename>... )
DESCRIPTION
-----------
@ -34,7 +34,7 @@ OPTIONS
--alt-odb::
Don't require objects present in packs from alternate object
database (odb) directories to be present in local packs.
directories to be present in local packs.
--verbose::
Outputs some statistics to stderr. Has a small performance penalty.

View File

@ -8,18 +8,18 @@ git-patch-id - Compute unique ID for a patch
SYNOPSIS
--------
[verse]
'git patch-id' [--stable | --unstable | --verbatim]
'git patch-id' [--stable | --unstable]
DESCRIPTION
-----------
Read a patch from the standard input and compute the patch ID for it.
A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a
patch, with line numbers ignored. As such, it's "reasonably stable", but at
the same time also reasonably unique, i.e., two patches that have the same
"patch ID" are almost guaranteed to be the same thing.
patch, with whitespace and line numbers ignored. As such, it's "reasonably
stable", but at the same time also reasonably unique, i.e., two patches that
have the same "patch ID" are almost guaranteed to be the same thing.
The main usecase for this command is to look for likely duplicate commits.
IOW, you can use this thing to look for likely duplicate commits.
When dealing with 'git diff-tree' output, it takes advantage of
the fact that the patch is prefixed with the object name of the
@ -30,12 +30,6 @@ This can be used to make a mapping from patch ID to commit ID.
OPTIONS
-------
--verbatim::
Calculate the patch-id of the input as it is given, do not strip
any whitespace.
This is the default if patchid.verbatim is true.
--stable::
Use a "stable" sum of hashes as the patch ID. With this option:
- Reordering file diffs that make up a patch does not affect the ID.
@ -51,16 +45,14 @@ OPTIONS
of "-O<orderfile>", thereby making existing databases storing such
"unstable" or historical patch-ids unusable.
- All whitespace within the patch is ignored and does not affect the id.
This is the default if patchid.stable is set to true.
--unstable::
Use an "unstable" hash as the patch ID. With this option,
the result produced is compatible with the patch-id value produced
by git 1.9 and older and whitespace is ignored. Users with pre-existing
databases storing patch-ids produced by git 1.9 and older (who do not deal
with reordered patches) may want to use this option.
by git 1.9 and older. Users with pre-existing databases storing
patch-ids produced by git 1.9 and older (who do not deal with reordered
patches) may want to use this option.
This is the default.

View File

@ -9,7 +9,7 @@ git-prune-packed - Remove extra objects that are already in pack files
SYNOPSIS
--------
[verse]
'git prune-packed' [-n | --dry-run] [-q | --quiet]
'git prune-packed' [-n|--dry-run] [-q|--quiet]
DESCRIPTION

View File

@ -409,14 +409,10 @@ Specifying `--no-force-if-includes` disables this behavior.
all submodules that changed in the revisions to be pushed will be
pushed. If on-demand was not able to push all necessary revisions it will
also be aborted and exit with non-zero status. If 'only' is used all
submodules will be pushed while the superproject is left
submodules will be recursively pushed while the superproject is left
unpushed. A value of 'no' or using `--no-recurse-submodules` can be used
to override the push.recurseSubmodules configuration variable when no
submodule recursion is required.
+
When using 'on-demand' or 'only', if a submodule has a
"push.recurseSubmodules={on-demand,only}" or "submodule.recurse" configuration,
further recursion will occur. In this case, "only" is treated as "on-demand".
--[no-]verify::
Toggle the pre-push hook (see linkgit:githooks[5]). The

View File

@ -9,7 +9,7 @@ git-read-tree - Reads tree information into the index
SYNOPSIS
--------
[verse]
'git read-tree' [(-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>)
'git read-tree' [[-m [--trivial] [--aggressive] | --reset | --prefix=<prefix>]
[-u | -i]] [--index-output=<file>] [--no-sparse-checkout]
(--empty | <tree-ish1> [<tree-ish2> [<tree-ish3>]])

View File

@ -218,14 +218,12 @@ leave out at most one of A and B, in which case it defaults to HEAD.
merge base of `<upstream>` and `<branch>`. Running
`git rebase --keep-base <upstream> <branch>` is equivalent to
running
`git rebase --reapply-cherry-picks --no-fork-point --onto <upstream>...<branch> <upstream> <branch>`.
`git rebase --onto <upstream>...<branch> <upstream> <branch>`.
+
This option is useful in the case where one is developing a feature on
top of an upstream branch. While the feature is being worked on, the
upstream branch may advance and it may not be the best idea to keep
rebasing on top of the upstream but to keep the base commit as-is. As
the base commit is unchanged this option implies `--reapply-cherry-picks`
to avoid losing commits.
rebasing on top of the upstream but to keep the base commit as-is.
+
Although both this option and `--fork-point` find the merge base between
`<upstream>` and `<branch>`, this option uses the merge base as the _starting
@ -280,8 +278,7 @@ See also INCOMPATIBLE OPTIONS below.
Note that commits which start empty are kept (unless `--no-keep-empty`
is specified), and commits which are clean cherry-picks (as determined
by `git log --cherry-mark ...`) are detected and dropped as a
preliminary step (unless `--reapply-cherry-picks` or `--keep-base` is
passed).
preliminary step (unless `--reapply-cherry-picks` is passed).
+
See also INCOMPATIBLE OPTIONS below.
@ -314,16 +311,13 @@ See also INCOMPATIBLE OPTIONS below.
upstream changes, the behavior towards them is controlled by
the `--empty` flag.)
+
In the absence of `--keep-base` (or if `--no-reapply-cherry-picks` is
given), these commits will be automatically dropped. Because this
necessitates reading all upstream commits, this can be expensive in
repositories with a large number of upstream commits that need to be
read. When using the 'merge' backend, warnings will be issued for each
dropped commit (unless `--quiet` is given). Advice will also be issued
unless `advice.skippedCherryPicks` is set to false (see
linkgit:git-config[1]).
By default (or if `--no-reapply-cherry-picks` is given), these commits
will be automatically dropped. Because this necessitates reading all
upstream commits, this can be expensive in repos with a large number
of upstream commits that need to be read. When using the 'merge'
backend, warnings will be issued for each dropped commit (unless
`--quiet` is given). Advice will also be issued unless
`advice.skippedCherryPicks` is set to false (see linkgit:git-config[1]).
+
`--reapply-cherry-picks` allows rebase to forgo reading all upstream
commits, potentially improving performance.
@ -449,9 +443,9 @@ When `--fork-point` is active, 'fork_point' will be used instead of
<branch>` command (see linkgit:git-merge-base[1]). If 'fork_point'
ends up being empty, the `<upstream>` will be used as a fallback.
+
If `<upstream>` or `--keep-base` is given on the command line, then
the default is `--no-fork-point`, otherwise the default is
`--fork-point`. See also `rebase.forkpoint` in linkgit:git-config[1].
If `<upstream>` is given on the command line, then the default is
`--no-fork-point`, otherwise the default is `--fork-point`. See also
`rebase.forkpoint` in linkgit:git-config[1].
+
If your branch was based on `<upstream>` but `<upstream>` was rewound and
your branch contains commits which were dropped, this option can be used

View File

@ -9,7 +9,7 @@ git-receive-pack - Receive what is pushed into the repository
SYNOPSIS
--------
[verse]
'git receive-pack' <git-dir>
'git-receive-pack' <directory>
DESCRIPTION
-----------
@ -38,7 +38,7 @@ its behavior, see linkgit:git-config[1].
OPTIONS
-------
<git-dir>::
<directory>::
The repository to sync into.
--http-backend-info-refs::

View File

@ -9,7 +9,15 @@ git-reflog - Manage reflog information
SYNOPSIS
--------
[verse]
'git reflog' [show] [<log-options>] [<ref>]
'git reflog' <subcommand> <options>
DESCRIPTION
-----------
The command takes various subcommands, and different options
depending on the subcommand:
[verse]
'git reflog' ['show'] [<log-options>] [<ref>]
'git reflog expire' [--expire=<time>] [--expire-unreachable=<time>]
[--rewrite] [--updateref] [--stale-fix]
[--dry-run | -n] [--verbose] [--all [--single-worktree] | <refs>...]
@ -17,10 +25,6 @@ SYNOPSIS
[--dry-run | -n] [--verbose] <ref>@{<specifier>}...
'git reflog exists' <ref>
DESCRIPTION
-----------
This command manages the information recorded in the reflogs.
Reference logs, or "reflogs", record when the tips of branches and
other references were updated in the local repository. Reflogs are
useful in various Git commands, to specify the old value of a
@ -29,8 +33,7 @@ moves ago", `master@{one.week.ago}` means "where master used to point
to one week ago in this local repository", and so on. See
linkgit:gitrevisions[7] for more details.
The command takes various subcommands, and different options
depending on the subcommand:
This command manages the information recorded in the reflogs.
The "show" subcommand (which is also the default, in the absence of
any subcommands) shows the log of the reference provided in the

View File

@ -74,12 +74,6 @@ to the new separate pack will be written.
immediately instead of waiting for the next `git gc` invocation.
Only useful with `--cruft -d`.
--expire-to=<dir>::
Write a cruft pack containing pruned objects (if any) to the
directory `<dir>`. This option is useful for keeping a copy of
any pruned objects in a separate directory as a backup. Only
useful with `--cruft -d`.
-l::
Pass the `--local` option to 'git pack-objects'. See
linkgit:git-pack-objects[1].

View File

@ -8,7 +8,7 @@ git-rerere - Reuse recorded resolution of conflicted merges
SYNOPSIS
--------
[verse]
'git rerere' [clear | forget <pathspec>... | diff | status | remaining | gc]
'git rerere' ['clear'|'forget' <pathspec>|'diff'|'remaining'|'status'|'gc']
DESCRIPTION
-----------

View File

@ -9,7 +9,7 @@ git-rev-list - Lists commit objects in reverse chronological order
SYNOPSIS
--------
[verse]
'git rev-list' [<options>] <commit>... [--] [<path>...]
'git rev-list' [<options>] <commit>... [[--] <path>...]
DESCRIPTION
-----------

View File

@ -197,13 +197,6 @@ respectively, and they must begin with `refs/` when applied to `--glob`
or `--all`. If a trailing '/{asterisk}' is intended, it must be given
explicitly.
--exclude-hidden=[receive|uploadpack]::
Do not include refs that would be hidden by `git-receive-pack` or
`git-upload-pack` by consulting the appropriate `receive.hideRefs` or
`uploadpack.hideRefs` configuration along with `transfer.hideRefs` (see
linkgit:git-config[1]). This option affects the next pseudo-ref option
`--all` or `--glob` and is cleared after processing them.
--disambiguate=<prefix>::
Show every object whose name begins with the given prefix.
The <prefix> must be at least 4 hexadecimal digits long to

View File

@ -8,7 +8,7 @@ git-revert - Revert some existing commits
SYNOPSIS
--------
[verse]
'git revert' [--[no-]edit] [-n] [-m <parent-number>] [-s] [-S[<keyid>]] <commit>...
'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] [-S[<keyid>]] <commit>...
'git revert' (--continue | --skip | --abort | --quit)
DESCRIPTION

View File

@ -178,18 +178,9 @@ Sending
for `sendmail` in `/usr/sbin`, `/usr/lib` and $PATH.
--smtp-encryption=<encryption>::
Specify in what way encrypting begins for the SMTP connection.
Valid values are 'ssl' and 'tls'. Any other value reverts to plain
(unencrypted) SMTP, which defaults to port 25.
Despite the names, both values will use the same newer version of TLS,
but for historic reasons have these names. 'ssl' refers to "implicit"
encryption (sometimes called SMTPS), that uses port 465 by default.
'tls' refers to "explicit" encryption (often known as STARTTLS),
that uses port 25 by default. Other ports might be used by the SMTP
server, which are not the default. Commonly found alternative port for
'tls' and unencrypted is 587. You need to check your provider's
documentation or your server configuration to make sure
for your own case. Default is the value of `sendemail.smtpEncryption`.
Specify the encryption to use, either 'ssl' or 'tls'. Any other
value reverts to plain SMTP. Default is the value of
`sendemail.smtpEncryption`.
--smtp-domain=<FQDN>::
Specifies the Fully Qualified Domain Name (FQDN) used in the

View File

@ -9,10 +9,9 @@ git-send-pack - Push objects over Git protocol to another repository
SYNOPSIS
--------
[verse]
'git send-pack' [--mirror] [--dry-run] [--force]
[--receive-pack=<git-receive-pack>]
'git send-pack' [--dry-run] [--force] [--receive-pack=<git-receive-pack>]
[--verbose] [--thin] [--atomic]
[--[no-]signed | --signed=(true|false|if-asked)]
[--[no-]signed|--signed=(true|false|if-asked)]
[<host>:]<directory> (--all | <ref>...)
DESCRIPTION

View File

@ -47,11 +47,6 @@ OPTIONS
Each pretty-printed commit will be rewrapped before it is shown.
--date=<format>::
Show dates formatted according to the given date string. (See
the `--date` option in the "Commit Formatting" section of
linkgit:git-log[1]). Useful with `--group=format:<format>`.
--group=<type>::
Group commits based on `<type>`. If no `--group` option is
specified, the default is `author`. `<type>` is one of:
@ -64,9 +59,6 @@ OPTIONS
example, if your project uses `Reviewed-by` trailers, you might want
to see who has been reviewing with
`git shortlog -ns --group=trailer:reviewed-by`.
- `format:<format>`, any string accepted by the `--format` option of
'git log'. (See the "PRETTY FORMATS" section of
linkgit:git-log[1].)
+
Note that commits that do not include the trailer will not be counted.
Likewise, commits with multiple trailers (e.g., multiple signoffs) may

View File

@ -8,12 +8,12 @@ git-show-branch - Show branches and their commits
SYNOPSIS
--------
[verse]
'git show-branch' [-a | --all] [-r | --remotes] [--topo-order | --date-order]
'git show-branch' [-a|--all] [-r|--remotes] [--topo-order | --date-order]
[--current] [--color[=<when>] | --no-color] [--sparse]
[--more=<n> | --list | --independent | --merge-base]
[--no-name | --sha1-name] [--topics]
[(<rev> | <glob>)...]
'git show-branch' (-g | --reflog)[=<n>[,<base>]] [--list] [<ref>]
'git show-branch' (-g|--reflog)[=<n>[,<base>]] [--list] [<ref>]
DESCRIPTION
-----------

View File

@ -8,8 +8,8 @@ git-show-ref - List references in a local repository
SYNOPSIS
--------
[verse]
'git show-ref' [-q | --quiet] [--verify] [--head] [-d | --dereference]
[-s | --hash[=<n>]] [--abbrev[=<n>]] [--tags]
'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference]
[-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags]
[--heads] [--] [<pattern>...]
'git show-ref' --exclude-existing[=<pattern>]

View File

@ -9,7 +9,7 @@ git-sparse-checkout - Reduce your working tree to a subset of tracked files
SYNOPSIS
--------
[verse]
'git sparse-checkout' (init | list | set | add | reapply | disable) [<options>]
'git sparse-checkout <subcommand> [<options>]'
DESCRIPTION

View File

@ -9,20 +9,17 @@ SYNOPSIS
--------
[verse]
'git stash' list [<log-options>]
'git stash' show [-u | --include-untracked | --only-untracked] [<diff-options>] [<stash>]
'git stash' drop [-q | --quiet] [<stash>]
'git stash' pop [--index] [-q | --quiet] [<stash>]
'git stash' apply [--index] [-q | --quiet] [<stash>]
'git stash' show [-u|--include-untracked|--only-untracked] [<diff-options>] [<stash>]
'git stash' drop [-q|--quiet] [<stash>]
'git stash' ( pop | apply ) [--index] [-q|--quiet] [<stash>]
'git stash' branch <branchname> [<stash>]
'git stash' [push [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
[-u | --include-untracked] [-a | --all] [(-m | --message) <message>]
'git stash' [push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-q|--quiet]
[-u|--include-untracked] [-a|--all] [-m|--message <message>]
[--pathspec-from-file=<file> [--pathspec-file-nul]]
[--] [<pathspec>...]]
'git stash' save [-p | --patch] [-S | --staged] [-k | --[no-]keep-index] [-q | --quiet]
[-u | --include-untracked] [-a | --all] [<message>]
'git stash' clear
'git stash' create [<message>]
'git stash' store [(-m | --message) <message>] [-q | --quiet] <commit>
'git stash' store [-m|--message <message>] [-q|--quiet] <commit>
DESCRIPTION
-----------
@ -50,7 +47,7 @@ stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
COMMANDS
--------
push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [(-m|--message) <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]::
push [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] [-m|--message <message>] [--pathspec-from-file=<file> [--pathspec-file-nul]] [--] [<pathspec>...]::
Save your local modifications to a new 'stash entry' and roll them
back to HEAD (in the working tree and in the index).

View File

@ -9,7 +9,7 @@ git-status - Show the working tree status
SYNOPSIS
--------
[verse]
'git status' [<options>] [--] [<pathspec>...]
'git status' [<options>...] [--] [<pathspec>...]
DESCRIPTION
-----------

View File

@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git symbolic-ref' [-m <reason>] <name> <ref>
'git symbolic-ref' [-q] [--short] [--no-recurse] <name>
'git symbolic-ref' [-q] [--short] <name>
'git symbolic-ref' --delete [-q] <name>
DESCRIPTION
@ -46,15 +46,6 @@ OPTIONS
When showing the value of <name> as a symbolic ref, try to shorten the
value, e.g. from `refs/heads/master` to `master`.
--recurse::
--no-recurse::
When showing the value of <name> as a symbolic ref, if
<name> refers to another symbolic ref, follow such a chain
of symbolic refs until the result no longer points at a
symbolic ref (`--recurse`, which is the default).
`--no-recurse` stops after dereferencing only a single level
of symbolic ref.
-m::
Update the reflog for <name> with <reason>. This is valid only
when creating or updating a symbolic ref.

View File

@ -9,7 +9,7 @@ git-tag - Create, list, delete or verify a tag object signed with GPG
SYNOPSIS
--------
[verse]
'git tag' [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]
'git tag' [-a | -s | -u <keyid>] [-f] [-m <msg> | -F <file>] [-e]
<tagname> [<commit> | <object>]
'git tag' -d <tagname>...
'git tag' [-n[<num>]] -l [--contains <commit>] [--no-contains <commit>]
@ -26,19 +26,19 @@ to delete, list or verify tags.
Unless `-f` is given, the named tag must not yet exist.
If one of `-a`, `-s`, or `-u <key-id>` is passed, the command
If one of `-a`, `-s`, or `-u <keyid>` is passed, the command
creates a 'tag' object, and requires a tag message. Unless
`-m <msg>` or `-F <file>` is given, an editor is started for the user to type
in the tag message.
If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <key-id>`
If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <keyid>`
are absent, `-a` is implied.
Otherwise, a tag reference that points directly at the given object
(i.e., a lightweight tag) is created.
A GnuPG signed tag object will be created when `-s` or `-u
<key-id>` is used. When `-u <key-id>` is not used, the
<keyid>` is used. When `-u <keyid>` is not used, the
committer identity for the current user is used to find the
GnuPG key for signing. The configuration variable `gpg.program`
is used to specify custom GnuPG binary.
@ -72,8 +72,8 @@ OPTIONS
Override `tag.gpgSign` configuration variable that is
set to force each and every tag to be signed.
-u <key-id>::
--local-user=<key-id>::
-u <keyid>::
--local-user=<keyid>::
Make a GPG-signed tag, using the given key.
-f::
@ -164,14 +164,14 @@ This option is only applicable when listing tags without annotation lines.
Use the given tag message (instead of prompting).
If multiple `-m` options are given, their values are
concatenated as separate paragraphs.
Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
Implies `-a` if none of `-a`, `-s`, or `-u <keyid>`
is given.
-F <file>::
--file=<file>::
Take the tag message from the given file. Use '-' to
read the message from the standard input.
Implies `-a` if none of `-a`, `-s`, or `-u <key-id>`
Implies `-a` if none of `-a`, `-s`, or `-u <keyid>`
is given.
-e::
@ -220,7 +220,7 @@ it in the repository configuration as follows:
-------------------------------------
[user]
signingKey = <gpg-key_id>
signingKey = <gpg-keyid>
-------------------------------------
`pager.tag` is only respected when listing tags, i.e., when `-l` is

View File

@ -9,7 +9,7 @@ git-update-server-info - Update auxiliary info file to help dumb servers
SYNOPSIS
--------
[verse]
'git update-server-info' [-f | --force]
'git update-server-info'
DESCRIPTION
-----------
@ -19,12 +19,6 @@ $GIT_OBJECT_DIRECTORY/info directories to help clients discover
what references and packs the server has. This command
generates such auxiliary files.
OPTIONS
-------
-f::
--force::
update the info files from scratch.
OUTPUT
------

View File

@ -9,7 +9,7 @@ git-upload-archive - Send archive back to git-archive
SYNOPSIS
--------
[verse]
'git upload-archive' <repository>
'git upload-archive' <directory>
DESCRIPTION
-----------
@ -54,7 +54,7 @@ access via non-smart-http.
OPTIONS
-------
<repository>::
<directory>::
The repository to get a tar archive from.
GIT

View File

@ -9,7 +9,7 @@ git-var - Show a Git logical variable
SYNOPSIS
--------
[verse]
'git var' (-l | <variable>)
'git var' ( -l | <variable> )
DESCRIPTION
-----------

View File

@ -8,7 +8,7 @@ git-verify-commit - Check the GPG signature of commits
SYNOPSIS
--------
[verse]
'git verify-commit' [-v | --verbose] [--raw] <commit>...
'git verify-commit' <commit>...
DESCRIPTION
-----------

View File

@ -9,7 +9,7 @@ git-verify-pack - Validate packed Git archive files
SYNOPSIS
--------
[verse]
'git verify-pack' [-v | --verbose] [-s | --stat-only] [--] <pack>.idx...
'git verify-pack' [-v|--verbose] [-s|--stat-only] [--] <pack>.idx ...
DESCRIPTION

View File

@ -8,7 +8,7 @@ git-verify-tag - Check the GPG signature of tags
SYNOPSIS
--------
[verse]
'git verify-tag' [-v | --verbose] [--format=<format>] [--raw] <tag>...
'git verify-tag' [--format=<format>] <tag>...
DESCRIPTION
-----------

View File

@ -9,8 +9,7 @@ git-worktree - Manage multiple working trees
SYNOPSIS
--------
[verse]
'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]]
[-b <new-branch>] <path> [<commit-ish>]
'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason <string>]] [-b <new-branch>] <path> [<commit-ish>]
'git worktree list' [-v | --porcelain [-z]]
'git worktree lock' [--reason <string>] <worktree>
'git worktree move' <worktree> <new-path>

View File

@ -17,10 +17,9 @@ DESCRIPTION
Git will sometimes need credentials from the user in order to perform
operations; for example, it may need to ask for a username and password
in order to access a remote repository over HTTP. Some remotes accept
a personal access token or OAuth access token as a password. This
manual describes the mechanisms Git uses to request these credentials,
as well as some features to avoid inputting these credentials repeatedly.
in order to access a remote repository over HTTP. This manual describes
the mechanisms Git uses to request these credentials, as well as some
features to avoid inputting these credentials repeatedly.
REQUESTING CREDENTIALS
----------------------
@ -62,9 +61,7 @@ for a password. It is generally configured by adding this to your config:
Credential helpers, on the other hand, are external programs from which Git can
request both usernames and passwords; they typically interface with secure
storage provided by the OS or other programs. Alternatively, a
credential-generating helper might generate credentials for certain servers via
some API.
storage provided by the OS or other programs.
To use a helper, you must first select one to use. Git currently
includes the following helpers:
@ -272,7 +269,6 @@ stdout in the same format (see linkgit:git-credential[1] for common
attributes). A helper is free to produce a subset, or even no values at
all if it has nothing useful to provide. Any provided attributes will
overwrite those already known about by Git's credential subsystem.
Unrecognised attributes are silently discarded.
While it is possible to override all attributes, well behaving helpers
should refrain from doing so for any attribute other than username and
@ -290,8 +286,8 @@ For a `store` or `erase` operation, the helper's output is ignored.
If a helper fails to perform the requested operation or needs to notify
the user of a potential issue, it may write to stderr.
If it does not support the requested operation (e.g., a read-only store
or generator), it should silently ignore the request.
If it does not support the requested operation (e.g., a read-only store),
it should silently ignore the request.
If a helper receives any other operation, it should silently ignore the
request. This leaves room for future operations to be added (older

View File

@ -3,7 +3,7 @@ gitformat-commit-graph(5)
NAME
----
gitformat-commit-graph - Git commit-graph format
gitformat-commit-graph - Git commit graph format
SYNOPSIS
--------
@ -14,7 +14,7 @@ $GIT_DIR/objects/info/commit-graphs/*
DESCRIPTION
-----------
The Git commit-graph stores a list of commit OIDs and some associated
The Git commit graph stores a list of commit OIDs and some associated
metadata, including:
- The generation number of the commit.
@ -34,7 +34,7 @@ corresponding to the array position within the list of commit OIDs. Due
to some special constants we use to track parents, we can store at most
(1 << 30) + (1 << 29) + (1 << 28) - 1 (around 1.8 billion) commits.
== Commit-graph files have the following format:
== Commit graph files have the following format:
In order to allow extensions that add extra data to the graph, we organize
the body into "chunks" and provide a binary lookup table at the beginning

View File

@ -20,7 +20,7 @@
[[def_branch]]branch::
A "branch" is a line of development. The most recent
<<def_commit,commit>> on a branch is referred to as the tip of
that branch. The tip of the branch is <<def_ref,referenced>> by a branch
that branch. The tip of the branch is referenced by a branch
<<def_head,head>>, which moves forward as additional development
is done on the branch. A single Git
<<def_repository,repository>> can track an arbitrary number of
@ -75,21 +75,6 @@ state in the Git history, by creating a new commit representing the current
state of the <<def_index,index>> and advancing <<def_HEAD,HEAD>>
to point at the new commit.
[[def_commit_graph_general]]commit graph concept, representations and usage::
A synonym for the <<def_DAG,DAG>> structure formed by the commits
in the object database, <<def_ref,referenced>> by branch tips,
using their <<def_chain,chain>> of linked commits.
This structure is the definitive commit graph. The
graph can be represented in other ways, e.g. the
<<def_commit_graph_file,"commit-graph" file>>.
[[def_commit_graph_file]]commit-graph file::
The "commit-graph" (normally hyphenated) file is a supplemental
representation of the <<def_commit_graph_general,commit graph>>
which accelerates commit graph walks. The "commit-graph" file is
stored either in the .git/objects/info directory or in the info
directory of an alternate object database.
[[def_commit_object]]commit object::
An <<def_object,object>> which contains the information about a
particular <<def_revision,revision>>, such as <<def_parent,parents>>, committer,
@ -277,7 +262,7 @@ This commit is referred to as a "merge commit", or sometimes just a
identified by its <<def_object_name,object name>>. The objects usually
live in `$GIT_DIR/objects/`.
[[def_object_identifier]]object identifier (oid)::
[[def_object_identifier]]object identifier::
Synonym for <<def_object_name,object name>>.
[[def_object_name]]object name::
@ -508,14 +493,6 @@ exclude;;
<<def_tree_object,trees>> to the trees or <<def_blob_object,blobs>>
that they contain.
[[def_reachability_bitmap]]reachability bitmaps::
Reachability bitmaps store information about the
<<def_reachable,reachability>> of a selected set of commits in
a packfile, or a multi-pack index (MIDX), to speed up object search.
The bitmaps are stored in a ".bitmap" file. A repository may have at
most one bitmap file in use. The bitmap file may belong to either one
pack, or the repository's multi-pack index (if it exists).
[[def_rebase]]rebase::
To reapply a series of changes from a <<def_branch,branch>> to a
different base, and reset the <<def_head,head>> of that branch

View File

@ -1,10 +1,9 @@
Content-type: text/asciidoc
Abstract: When a vulnerability is reported, we follow these guidelines to
assess the vulnerability, create and review a fix, and coordinate embargoed
security releases.
Abstract: When a critical vulnerability is discovered and fixed, we follow this
script to coordinate a public release.
How we coordinate embargoed releases
------------------------------------
====================================
To protect Git users from critical vulnerabilities, we do not just release
fixed versions like regular maintenance releases. Instead, we coordinate
@ -12,147 +11,33 @@ releases with packagers, keeping the fixes under an embargo until the release
date. That way, users will have a chance to upgrade on that date, no matter
what Operating System or distribution they run.
The `git-security` mailing list
-------------------------------
Open a Security Advisory draft
------------------------------
Responsible disclosures of vulnerabilities, analysis, proposed fixes as
well as the orchestration of coordinated embargoed releases all happen on the
`git-security` mailing list at <git-security@googlegroups.com>.
The first step is to https://github.com/git/git/security/advisories/new[open an
advisory]. Technically, it is not necessary, but it is convenient and saves a
bit of hassle. This advisory can also be used to obtain the CVE number and it
will give us a private fork associated with it that can be used to collaborate
on a fix.
In this context, the term "embargo" refers to the time period that information
about a vulnerability is kept under wraps and only shared on a need-to-know
basis. This is necessary to protect Git's users from bad actors who would
otherwise be made aware of attack vectors that could be exploited. "Lifting the
embargo" refers to publishing the version that fixes the vulnerabilities.
Release date of the embargoed version
-------------------------------------
Audience of the `git-security` mailing list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If the vulnerability affects Windows users, we want to have our friends over at
Visual Studio on board. This means we need to target a "Patch Tuesday" (i.e. a
second Tuesday of the month), at the minimum three weeks from heads-up to
coordinated release.
Anybody may contact the `git-security` mailing list by sending an email
to <git-security@googlegroups.com>, though the archive is closed to the
public and only accessible to subscribed members.
There are a few dozen subscribed members: core Git developers who are trusted
with addressing vulnerabilities, and stakeholders (i.e. owners of products
affected by security vulnerabilities in Git).
Most of the discussions revolve around assessing the severity of the reported
issue (including the decision whether the report is security-relevant or can be
redirected to the public mailing list), how to remediate the issue, determining
the timeline of the disclosure as well as aligning priorities and
requirements.
Communications
~~~~~~~~~~~~~~
If you are a stakeholder, it is a good idea to pay close attention to the
discussions, as pertinent information may be buried in the middle of a lively
conversation that might not look relevant to your interests. For example, the
tentative timeline might be agreed upon in the middle of discussing code
comment formatting in one of the patches and whether or not to combine fixes
for multiple, separate vulnerabilities into the same embargoed release. Most
mail threads are not usually structured specifically to communicate
agreements, assessments or timelines.
Typical timeline
----------------
- A potential vulnerability is reported to the `git-security` mailing list.
- The members of the git-security list start a discussion to give an initial
assessment of the severity of the reported potential vulnerability.
We aspire to do so within a few days.
- After discussion, if consensus is reached that it is not critical enough
to warrant any embargo, the reporter is redirected to the public Git mailing
list. This ends the reporter's interaction with the `git-security` list.
- If it is deemed critical enough for an embargo, ideas are presented on how to
address the vulnerability.
- Usually around that time, the Git maintainer or their delegate(s) open a draft
security advisory in the `git/git` repository on GitHub (see below for more
details).
- Code review can take place in a variety of different locations,
depending on context. These are: patches sent inline on the git-security list,
a private fork on GitHub associated with the draft security advisory, or the
git/cabal repository.
- Contributors working on a fix should consider beginning by sending
patches to the git-security list (inline with the original thread), since they
are accessible to all subscribers, along with the original reporter.
- Once the review has settled and everyone involved in the review agrees that
the patches are nearing the finish line, the Git maintainer, and others
determine a release date as well as the release trains that are serviced. The
decision regarding which versions need a backported fix is based on input from
the reporter, the contributor who worked on the patches, and from
stakeholders. Operators of hosting sites who may want to analyze whether the
given issue is exploited via any of the repositories they host, and binary
packagers who want to make sure their product gets patched adequately against
the vulnerability, for example, may want to give their input at this stage.
- While the Git community does its best to accommodate the specific timeline
requests of the various binary packagers, the nature of the issue may preclude
a prolonged release schedule. For fixes deemed urgent, it may be in the best
interest of the Git users community to shorten the disclosure and release
timeline, and packagers may need to adapt accordingly.
- Subsequently, branches with the fixes are pushed to the git/cabal repository.
- The tags are created by the Git maintainer and pushed to the same repository.
- The Git for Windows, Git for macOS, BSD, Debian, etc. maintainers prepare the
corresponding release artifacts, based on the tags created that have been
prepared by the Git maintainer.
- The release artifacts prepared by various binary packagers can be
made available to stakeholders under embargo via a mail to the
`git-security` list.
- Less than a week before the release, a mail with the relevant information is
sent to <distros@vs.openwall.org> (see below), a list used to pre-announce
embargoed releases of open source projects to the stakeholders of all major
distributions of Linux as well as other OSes.
- Public communication is then prepared in advance of the release date. This
includes blog posts and mails to the Git and Git for Windows mailing lists.
- On the day of the release, at around 10am Pacific Time, the Git maintainer
pushes the tag and the `master` branch to the public repository, then sends
out an announcement mail.
- Once the tag is pushed, the Git for Windows maintainer publishes the
corresponding tag and creates a GitHub Release with the associated release
artifacts (Git for Windows installer, Portable Git, MinGit, etc).
- Git for Windows release is then announced via a mail to the public Git and
Git for Windows mailing lists as well as via a tweet.
- Ditto for distribution packagers for Linux and other platforms:
their releases are announced via their preferred channels.
- A mail to <oss-security@lists.openwall.org> (see below for details) is sent
as a follow-up to the <distros@vs.openwall.org> one, describing the
vulnerability in detail, often including a proof of concept of an exploit.
Note: The Git project makes no guarantees about timelines, but aims to keep
embargoes reasonably short in the interest of keeping Git's users safe.
Opening a Security Advisory draft
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The first step is to https://github.com/git/git/security/advisories/new[open
an advisory]. Technically, this is not necessary. However, it is the most
convenient way to obtain the CVE number and it give us a private repository
associated with it that can be used to collaborate on a fix.
If the vulnerability affects the server side, or can benefit from scans on the
server side (i.e. if `git fsck` can detect an attack), it is important to give
all involved Git repository hosting sites enough time to scan all of those
repositories.
Notifying the Linux distributions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------
At most two weeks before release date, we need to send a notification to
<distros@vs.openwall.org>, preferably less than 7 days before the release date.
distros@vs.openwall.org, preferably less than 7 days before the release date.
This will reach most (all?) Linux distributions. See an example below, and the
guidelines for this mailing list at
https://oss-security.openwall.org/wiki/mailing-lists/distros#how-to-use-the-lists[here].
@ -180,7 +65,7 @@ created using a command like this:
tar cJvf cve-xxx.bundle.tar.xz cve-xxx.bundle
Example mail to distros@vs.openwall.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------------
....
To: distros@vs.openwall.org
@ -216,7 +101,7 @@ Thanks,
....
Example mail to oss-security@lists.openwall.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------
....
To: oss-security@lists.openwall.com
@ -243,4 +128,4 @@ it goes to <developer>.
Thanks,
<name>
....
....

View File

@ -231,7 +231,7 @@ by doing the following:
- Prepare 'jch' branch, which is used to represent somewhere
between 'master' and 'seen' and often is slightly ahead of 'next'.
$ Meta/Reintegrate master..jch >Meta/redo-jch.sh
$ Meta/Reintegrate master..seen >Meta/redo-jch.sh
The result is a script that lists topics to be merged in order to
rebuild 'seen' as the input to Meta/Reintegrate script. Remove
@ -256,7 +256,7 @@ by doing the following:
merged to 'next', add it at the end of the list. Then:
$ git checkout -B jch master
$ sh Meta/redo-jch.sh -c1
$ Meta/redo-jch.sh -c1
to rebuild the 'jch' branch from scratch. "-c1" tells the script
to stop merging at the first line that begins with '###'
@ -283,11 +283,6 @@ by doing the following:
$ git diff jch next
Then build the rest of 'jch':
$ git checkout jch
$ sh Meta/redo-jch.sh
When all is well, clean up the redo-jch.sh script with
$ sh Meta/redo-jch.sh -u
@ -298,7 +293,7 @@ by doing the following:
- Rebuild 'seen'.
$ Meta/Reintegrate jch..seen >Meta/redo-seen.sh
$ Meta/Reintegrate master..seen >Meta/redo-seen.sh
Edit the result by adding new topics that are not still in 'seen'
in the script. Then

View File

@ -1,70 +0,0 @@
#!/usr/bin/perl
my ($fsck_h, $fsck_msgids_txt, $okfile) = @ARGV;
my (%in_fsck_h, $fh, $bad);
open($fh, "<", "$fsck_h") or die;
while (<$fh>) {
if (/^\s+FUNC\(([0-9A-Z_]+), ([A-Z]+)\)/) {
my ($name, $severity) = ($1, $2);
my ($first) = 1;
$name = join('',
map {
y/A-Z/a-z/;
if (!$first) {
s/^(.)/uc($1)/e;
} else {
$first = 0;
}
$_;
}
split(/_/, $name));
$in_fsck_h{$name} = $severity;
}
}
close($fh);
open($fh, "<", "$fsck_msgids_txt") or die;
my ($previous, $current);
while (<$fh>) {
if (!defined $current) {
if (/^\`([a-zA-Z0-9]*)\`::/) {
$current = $1;
if ((defined $previous) &&
($current le $previous)) {
print STDERR "$previous >= $current in doc\n";
$bad = 1;
}
}
} elsif (/^\s+\(([A-Z]+)\) /) {
my ($level) = $1;
if (!exists $in_fsck_h{$current}) {
print STDERR "$current does not exist in fsck.h\n";
$bad = 1;
} elsif ($in_fsck_h{$current} eq "") {
print STDERR "$current defined twice\n";
$bad = 1;
} elsif ($in_fsck_h{$current} ne $level) {
print STDERR "$current severity $level != $in_fsck_h{$current}\n";
$bad = 1;
}
$previous = $current;
$in_fsck_h{$current} = ""; # mark as seen.
undef $current;
}
}
close($fh);
for my $key (keys %in_fsck_h) {
if ($in_fsck_h{$key} ne "") {
print STDERR "$key not explained in doc.\n";
$bad = 1;
}
}
die if ($bad);
open($fh, ">", "$okfile");
print $fh "good\n";
close($fh);

View File

@ -195,13 +195,6 @@ respectively, and they must begin with `refs/` when applied to `--glob`
or `--all`. If a trailing '/{asterisk}' is intended, it must be given
explicitly.
--exclude-hidden=[receive|uploadpack]::
Do not include refs that would be hidden by `git-receive-pack` or
`git-upload-pack` by consulting the appropriate `receive.hideRefs` or
`uploadpack.hideRefs` configuration along with `transfer.hideRefs` (see
linkgit:git-config[1]). This option affects the next pseudo-ref option
`--all` or `--glob` and is cleared after processing them.
--reflog::
Pretend as if all objects mentioned by reflogs are listed on the
command line as `<commit>`.

View File

@ -363,7 +363,7 @@ Revision Range Summary
'<rev>{caret}!', e.g. 'HEAD{caret}!'::
A suffix '{caret}' followed by an exclamation mark is the same
as giving commit '<rev>' and all its parents prefixed with
as giving commit '<rev>' and then all its parents prefixed with
'{caret}' to exclude them (and their ancestors).
'<rev>{caret}-<n>', e.g. 'HEAD{caret}-, HEAD{caret}-2'::

View File

@ -148,18 +148,20 @@ filename collisions).
== Trace2 API
The Trace2 public API is defined and documented in `trace2.h`; refer to it for
more information. All public functions and macros are prefixed
with `trace2_` and are implemented in `trace2.c`.
All public Trace2 functions and macros are defined in `trace2.h` and
`trace2.c`. All public symbols are prefixed with `trace2_`.
There are no public Trace2 data structures.
The Trace2 code also defines a set of private functions and data types
in the `trace2/` directory. These symbols are prefixed with `tr2_`
and should only be used by functions in `trace2.c` (or other private
source files in `trace2/`).
and should only be used by functions in `trace2.c`.
=== Conventions for Public Functions and Macros
== Conventions for Public Functions and Macros
The functions defined by the Trace2 API are declared and documented
in `trace2.h`. It defines the API functions and wrapper macros for
Trace2.
Some functions have a `_fl()` suffix to indicate that they take `file`
and `line-number` arguments.
@ -170,7 +172,52 @@ take a `va_list` argument.
Some functions have a `_printf_fl()` suffix to indicate that they also
take a `printf()` style format with a variable number of arguments.
CPP wrapper macros are defined to hide most of these details.
There are CPP wrapper macros and `#ifdef`s to hide most of these details.
See `trace2.h` for more details. The following discussion will only
describe the simplified forms.
== Public API
All Trace2 API functions send a message to all of the active
Trace2 Targets. This section describes the set of available
messages.
It helps to divide these functions into groups for discussion
purposes.
=== Basic Command Messages
These are concerned with the lifetime of the overall git process.
e.g: `void trace2_initialize_clock()`, `void trace2_initialize()`,
`int trace2_is_enabled()`, `void trace2_cmd_start(int argc, const char **argv)`.
=== Command Detail Messages
These are concerned with describing the specific Git command
after the command line, config, and environment are inspected.
e.g: `void trace2_cmd_name(const char *name)`,
`void trace2_cmd_mode(const char *mode)`.
=== Child Process Messages
These are concerned with the various spawned child processes,
including shell scripts, git commands, editors, pagers, and hooks.
e.g: `void trace2_child_start(struct child_process *cmd)`.
=== Git Thread Messages
These messages are concerned with Git thread usage.
e.g: `void trace2_thread_start(const char *thread_name)`.
=== Region and Data Messages
These are concerned with recording performance data
over regions or spans of code. e.g:
`void trace2_region_enter(const char *category, const char *label, const struct repository *repo)`.
Refer to trace2.h for details about all trace2 functions.
== Trace2 Target Formats
@ -638,8 +685,8 @@ The "exec_id" field is a command-unique id and is only useful if the
`"thread_start"`::
This event is generated when a thread is started. It is
generated from *within* the new thread's thread-proc (because
it needs to access data in the thread's thread-local storage).
generated from *within* the new thread's thread-proc (for TLS
reasons).
+
------------
{
@ -651,7 +698,7 @@ The "exec_id" field is a command-unique id and is only useful if the
`"thread_exit"`::
This event is generated when a thread exits. It is generated
from *within* the thread's thread-proc.
from *within* the thread's thread-proc (for TLS reasons).
+
------------
{
@ -769,73 +816,6 @@ The "value" field may be an integer or a string.
}
------------
`"th_timer"`::
This event logs the amount of time that a stopwatch timer was
running in the thread. This event is generated when a thread
exits for timers that requested per-thread events.
+
------------
{
"event":"th_timer",
...
"category":"my_category",
"name":"my_timer",
"intervals":5, # number of time it was started/stopped
"t_total":0.052741, # total time in seconds it was running
"t_min":0.010061, # shortest interval
"t_max":0.011648 # longest interval
}
------------
`"timer"`::
This event logs the amount of time that a stopwatch timer was
running aggregated across all threads. This event is generated
when the process exits.
+
------------
{
"event":"timer",
...
"category":"my_category",
"name":"my_timer",
"intervals":5, # number of time it was started/stopped
"t_total":0.052741, # total time in seconds it was running
"t_min":0.010061, # shortest interval
"t_max":0.011648 # longest interval
}
------------
`"th_counter"`::
This event logs the value of a counter variable in a thread.
This event is generated when a thread exits for counters that
requested per-thread events.
+
------------
{
"event":"th_counter",
...
"category":"my_category",
"name":"my_counter",
"count":23
}
------------
`"counter"`::
This event logs the value of a counter variable across all threads.
This event is generated when the process exits. The total value
reported here is the sum across all threads.
+
------------
{
"event":"counter",
...
"category":"my_category",
"name":"my_counter",
"count":23
}
------------
== Example Trace2 API Usage
Here is a hypothetical usage of the Trace2 API showing the intended
@ -1226,7 +1206,7 @@ worked on 508 items at offset 2032. Thread "th04" worked on 508 items
at offset 508.
+
This example also shows that thread names are assigned in a racy manner
as each thread starts.
as each thread starts and allocates TLS storage.
Config (def param) Events::
@ -1267,60 +1247,6 @@ d0 | main | data | r0 | 0.002126 | 0.002126 | fsy
d0 | main | exit | | 0.000470 | | | code:0
d0 | main | atexit | | 0.000477 | | | code:0
----------------
Stopwatch Timer Events::
Measure the time spent in a function call or span of code
that might be called from many places within the code
throughout the life of the process.
+
----------------
static void expensive_function(void)
{
trace2_timer_start(TRACE2_TIMER_ID_TEST1);
...
sleep_millisec(1000); // Do something expensive
...
trace2_timer_stop(TRACE2_TIMER_ID_TEST1);
}
static int ut_100timer(int argc, const char **argv)
{
...
expensive_function();
// Do something else 1...
expensive_function();
// Do something else 2...
expensive_function();
return 0;
}
----------------
+
In this example, we measure the total time spent in
`expensive_function()` regardless of when it is called
in the overall flow of the program.
+
----------------
$ export GIT_TRACE2_PERF_BRIEF=1
$ export GIT_TRACE2_PERF=~/log.perf
$ t/helper/test-tool trace2 100timer 3 1000
...
$ cat ~/log.perf
d0 | main | version | | | | | ...
d0 | main | start | | 0.001453 | | | t/helper/test-tool trace2 100timer 3 1000
d0 | main | cmd_name | | | | | trace2 (trace2)
d0 | main | exit | | 3.003667 | | | code:0
d0 | main | timer | | | | test | name:test1 intervals:3 total:3.001686 min:1.000254 max:1.000929
d0 | main | atexit | | 3.003796 | | | code:0
----------------
== Future Work
=== Relationship to the Existing Trace Api (api-trace.txt)

View File

@ -1,4 +1,4 @@
Git Commit-Graph Design Notes
Git Commit Graph Design Notes
=============================
Git walks the commit graph for many reasons, including:
@ -17,7 +17,7 @@ There are two main costs here:
The commit-graph file is a supplemental data structure that accelerates
commit graph walks. If a user downgrades or disables the 'core.commitGraph'
config setting, then the existing object database is sufficient. The file is stored
config setting, then the existing ODB is sufficient. The file is stored
as "commit-graph" either in the .git/objects/info directory or in the info
directory of an alternate.
@ -95,7 +95,7 @@ with default order), but is not used when the topological order is
required (such as merge base calculations, "git log --graph").
In practice, we expect some commits to be created recently and not stored
in the commit-graph. We can treat these commits as having "infinite"
in the commit graph. We can treat these commits as having "infinite"
generation number and walk until reaching commits with known generation
number.
@ -149,7 +149,7 @@ Design Details
helpful for these clones, anyway. The commit-graph will not be read or
written when shallow commits are present.
Commit-Graphs Chains
Commit Graphs Chains
--------------------
Typically, repos grow with near-constant velocity (commits per day). Over time,

View File

@ -56,7 +56,7 @@ Rejected Multi-Threaded Solution
The most "straightforward" implementation would be to spread the set of
to-be-updated cache entries across multiple threads. But due to the
thread-unsafe functions in the object database code, we would have to use locks to
thread-unsafe functions in the ODB code, we would have to use locks to
coordinate the parallel operation. An early prototype of this solution
showed that the multi-threaded checkout would bring performance
improvements over the sequential code, but there was still too much lock

View File

@ -82,9 +82,9 @@ When the config key `extensions.preciousObjects` is set to `true`,
objects in the repository MUST NOT be deleted (e.g., by `git-prune` or
`git repack -d`).
==== `partialClone`
==== `partialclone`
When the config key `extensions.partialClone` is set, it indicates
When the config key `extensions.partialclone` is set, it indicates
that the repo was created with a partial clone (or later performed
a partial fetch) and that the remote may have omitted sending
certain unwanted objects. Such a remote is called a "promisor remote"

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=v2.39.1
DEF_VER=v2.38.4
LF='
'

View File

@ -133,13 +133,17 @@ Issues of note:
you are using libcurl older than 7.34.0. Otherwise you can use
NO_OPENSSL without losing git-imap-send.
By default, git uses OpenSSL for SHA1 but it will use its own
library (inspired by Mozilla's) with either NO_OPENSSL or
BLK_SHA1.
- "libcurl" library is used for fetching and pushing
repositories over http:// or https://, as well as by
git-imap-send if the curl version is >= 7.34.0. If you do
not need that functionality, use NO_CURL to build without
it.
Git requires version "7.19.4" or later of "libcurl" to build
Git requires version "7.19.5" or later of "libcurl" to build
without NO_CURL. This version requirement may be bumped in
the future.

442
Makefile
View File

@ -4,20 +4,8 @@ all::
# Import tree-wide shared Makefile behavior and libraries
include shared.mak
# == Makefile defines ==
#
# These defines change the behavior of the Makefile itself, but have
# no impact on what it builds:
#
# Define V=1 to have a more verbose compile.
#
# == Portability and optional library defines ==
#
# These defines indicate what Git can expect from the OS, what
# libraries are available etc. Much of this is auto-detected in
# config.mak.uname, or in configure.ac when using the optional "make
# configure && ./configure" (see INSTALL).
#
# Define SHELL_PATH to a POSIX shell if your /bin/sh is broken.
#
# Define SANE_TOOL_PATH to a colon-separated list of paths to prepend
@ -42,8 +30,68 @@ include shared.mak
#
# Define NO_OPENSSL environment variable if you do not have OpenSSL.
#
# Define USE_LIBPCRE if you have and want to use libpcre. Various
# commands such as log and grep offer runtime options to use
# Perl-compatible regular expressions instead of standard or extended
# POSIX regular expressions.
#
# Only libpcre version 2 is supported. USE_LIBPCRE2 is a synonym for
# USE_LIBPCRE, support for the old USE_LIBPCRE1 has been removed.
#
# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
# in /foo/bar/include and /foo/bar/lib directories.
#
# Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header.
#
# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
# git-http-push are not built, and you cannot use http:// and https://
# transports (neither smart nor dumb).
#
# Define CURLDIR=/foo/bar if your curl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define CURL_CONFIG to curl's configuration program that prints information
# about the library (e.g., its version number). The default is 'curl-config'.
#
# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl,
# if you do not want to rely on the libraries provided by CURL_CONFIG. The
# default value is a result of `curl-config --libs`. An example value for
# CURL_LDFLAGS is as follows:
#
# CURL_LDFLAGS=-lcurl
#
# Define NO_EXPAT if you do not have expat installed. git-http-push is
# not built, and you cannot push using http:// and https:// transports (dumb).
#
# Define EXPATDIR=/foo/bar if your expat header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
#
# Define NO_GETTEXT if you don't want Git output to be translated.
# A translated Git requires GNU libintl or another gettext implementation,
# plus libintl-perl at runtime.
#
# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
# the installed gettext translation of the shell scripts output.
#
# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
# trust the langinfo.h's nl_langinfo(CODESET) function to return the
# current character set. GNU and Solaris have a nl_langinfo(CODESET),
# FreeBSD can use either, but MinGW and some others need to use
# libcharset.h's locale_charset() instead.
#
# Define CHARSET_LIB to the library you need to link with in order to
# use locale_charset() function. On some platforms this needs to set to
# -lcharset, on others to -liconv .
#
# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
# need -lintl when linking.
#
# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
# doesn't support GNU extensions like --check and --statistics
#
# Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
# it specifies.
#
@ -104,6 +152,39 @@ include shared.mak
# and do not want to use Apple's CommonCrypto library. This allows you
# to provide your own OpenSSL library, for example from MacPorts.
#
# Define BLK_SHA1 environment variable to make use of the bundled
# optimized C SHA1 routine.
#
# Define DC_SHA1 to unconditionally enable the collision-detecting sha1
# algorithm. This is slower, but may detect attempted collision attacks.
# Takes priority over other *_SHA1 knobs.
#
# Define DC_SHA1_EXTERNAL in addition to DC_SHA1 if you want to build / link
# git with the external SHA1 collision-detect library.
# Without this option, i.e. the default behavior is to build git with its
# own built-in code (or submodule).
#
# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the
# sha1collisiondetection shipped as a submodule instead of the
# non-submodule copy in sha1dc/. This is an experimental option used
# by the git project to migrate to using sha1collisiondetection as a
# submodule.
#
# Define OPENSSL_SHA1 environment variable when running make to link
# with the SHA1 routine from openssl library.
#
# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
# in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
# wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
#
# Define BLK_SHA256 to use the built-in SHA-256 routines.
#
# Define NETTLE_SHA256 to use the SHA-256 routines in libnettle.
#
# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
#
# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
#
# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
#
# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
@ -409,151 +490,6 @@ include shared.mak
# to the "<name>" of the corresponding `compat/fsmonitor/fsm-settings-<name>.c`
# that implements the `fsm_os_settings__*()` routines.
#
# === Optional library: libintl ===
#
# Define NO_GETTEXT if you don't want Git output to be translated.
# A translated Git requires GNU libintl or another gettext implementation,
# plus libintl-perl at runtime.
#
# Define USE_GETTEXT_SCHEME and set it to 'fallthrough', if you don't trust
# the installed gettext translation of the shell scripts output.
#
# Define HAVE_LIBCHARSET_H if you haven't set NO_GETTEXT and you can't
# trust the langinfo.h's nl_langinfo(CODESET) function to return the
# current character set. GNU and Solaris have a nl_langinfo(CODESET),
# FreeBSD can use either, but MinGW and some others need to use
# libcharset.h's locale_charset() instead.
#
# Define CHARSET_LIB to the library you need to link with in order to
# use locale_charset() function. On some platforms this needs to set to
# -lcharset, on others to -liconv .
#
# Define LIBC_CONTAINS_LIBINTL if your gettext implementation doesn't
# need -lintl when linking.
#
# Define NO_MSGFMT_EXTENDED_OPTIONS if your implementation of msgfmt
# doesn't support GNU extensions like --check and --statistics
#
# === Optional library: libexpat ===
#
# Define NO_EXPAT if you do not have expat installed. git-http-push is
# not built, and you cannot push using http:// and https:// transports (dumb).
#
# Define EXPATDIR=/foo/bar if your expat header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
# === Optional library: libcurl ===
#
# Define NO_CURL if you do not have libcurl installed. git-http-fetch and
# git-http-push are not built, and you cannot use http:// and https://
# transports (neither smart nor dumb).
#
# Define CURLDIR=/foo/bar if your curl header and library files are in
# /foo/bar/include and /foo/bar/lib directories.
#
# Define CURL_CONFIG to curl's configuration program that prints information
# about the library (e.g., its version number). The default is 'curl-config'.
#
# Define CURL_LDFLAGS to specify flags that you need to link when using libcurl,
# if you do not want to rely on the libraries provided by CURL_CONFIG. The
# default value is a result of `curl-config --libs`. An example value for
# CURL_LDFLAGS is as follows:
#
# CURL_LDFLAGS=-lcurl
#
# === Optional library: libpcre2 ===
#
# Define USE_LIBPCRE if you have and want to use libpcre. Various
# commands such as log and grep offer runtime options to use
# Perl-compatible regular expressions instead of standard or extended
# POSIX regular expressions.
#
# Only libpcre version 2 is supported. USE_LIBPCRE2 is a synonym for
# USE_LIBPCRE, support for the old USE_LIBPCRE1 has been removed.
#
# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
# in /foo/bar/include and /foo/bar/lib directories.
#
# == SHA-1 and SHA-256 defines ==
#
# === SHA-1 backend ===
#
# ==== Security ====
#
# Due to the SHAttered (https://shattered.io) attack vector on SHA-1
# it's strongly recommended to use the sha1collisiondetection
# counter-cryptanalysis library for SHA-1 hashing.
#
# If you know that you can trust the repository contents, or where
# potential SHA-1 attacks are otherwise mitigated the other backends
# listed in "SHA-1 implementations" are faster than
# sha1collisiondetection.
#
# ==== Default SHA-1 backend ====
#
# If no *_SHA1 backend is picked, the first supported one listed in
# "SHA-1 implementations" will be picked.
#
# ==== Options common to all SHA-1 implementations ====
#
# Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
# in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
# wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
#
# ==== SHA-1 implementations ====
#
# Define OPENSSL_SHA1 to link to the SHA-1 routines from the OpenSSL
# library.
#
# Define BLK_SHA1 to make use of optimized C SHA-1 routines bundled
# with git (in the block-sha1/ directory).
#
# Define NO_APPLE_COMMON_CRYPTO on OSX to opt-out of using the
# "APPLE_COMMON_CRYPTO" backend for SHA-1, which is currently the
# default on that OS. On macOS 01.4 (Tiger) or older,
# NO_APPLE_COMMON_CRYPTO is defined by default.
#
# If don't enable any of the *_SHA1 settings in this section, Git will
# default to its built-in sha1collisiondetection library, which is a
# collision-detecting sha1 This is slower, but may detect attempted
# collision attacks.
#
# ==== Options for the sha1collisiondetection library ====
#
# Define DC_SHA1_EXTERNAL if you want to build / link
# git with the external SHA1 collision-detect library.
# Without this option, i.e. the default behavior is to build git with its
# own built-in code (or submodule).
#
# Define DC_SHA1_SUBMODULE to use the
# sha1collisiondetection shipped as a submodule instead of the
# non-submodule copy in sha1dc/. This is an experimental option used
# by the git project to migrate to using sha1collisiondetection as a
# submodule.
#
# === SHA-256 backend ===
#
# ==== Security ====
#
# Unlike SHA-1 the SHA-256 algorithm does not suffer from any known
# vulnerabilities, so any implementation will do.
#
# ==== SHA-256 implementations ====
#
# Define OPENSSL_SHA256 to use the SHA-256 routines in OpenSSL.
#
# Define NETTLE_SHA256 to use the SHA-256 routines in libnettle.
#
# Define GCRYPT_SHA256 to use the SHA-256 routines in libgcrypt.
#
# If don't enable any of the *_SHA256 settings in this section, Git
# will default to its built-in sha256 implementation.
#
# == DEVELOPER defines ==
#
# Define DEVELOPER to enable more compiler warnings. Compiler version
# and family are auto detected, but could be overridden by defining
# COMPILER_FEATURES (see config.mak.dev). You can still set
@ -753,9 +689,9 @@ SCRIPTS = $(SCRIPT_SH_GEN) \
ETAGS_TARGET = TAGS
FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
FUZZ_OBJS += fuzz-commit-graph.o
FUZZ_OBJS += fuzz-pack-headers.o
FUZZ_OBJS += fuzz-pack-idx.o
.PHONY: fuzz-objs
fuzz-objs: $(FUZZ_OBJS)
@ -786,8 +722,6 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
TEST_BUILTINS_OBJS += test-advise.o
TEST_BUILTINS_OBJS += test-bitmap.o
TEST_BUILTINS_OBJS += test-bloom.o
TEST_BUILTINS_OBJS += test-bundle-uri.o
TEST_BUILTINS_OBJS += test-cache-tree.o
TEST_BUILTINS_OBJS += test-chmtime.o
TEST_BUILTINS_OBJS += test-config.o
TEST_BUILTINS_OBJS += test-crontab.o
@ -1161,7 +1095,6 @@ LIB_OBJS += trace.o
LIB_OBJS += trace2.o
LIB_OBJS += trace2/tr2_cfg.o
LIB_OBJS += trace2/tr2_cmd_name.o
LIB_OBJS += trace2/tr2_ctr.o
LIB_OBJS += trace2/tr2_dst.o
LIB_OBJS += trace2/tr2_sid.o
LIB_OBJS += trace2/tr2_sysenv.o
@ -1170,7 +1103,6 @@ LIB_OBJS += trace2/tr2_tgt_event.o
LIB_OBJS += trace2/tr2_tgt_normal.o
LIB_OBJS += trace2/tr2_tgt_perf.o
LIB_OBJS += trace2/tr2_tls.o
LIB_OBJS += trace2/tr2_tmr.o
LIB_OBJS += trailer.o
LIB_OBJS += transport-helper.o
LIB_OBJS += transport.o
@ -1367,53 +1299,11 @@ SP_EXTRA_FLAGS = -Wno-universal-initializer
SANITIZE_LEAK =
SANITIZE_ADDRESS =
# For the 'coccicheck' target
SPATCH_INCLUDE_FLAGS = --all-includes
SPATCH_FLAGS =
SPATCH_TEST_FLAGS =
# If *.o files are present, have "coccicheck" depend on them, with
# COMPUTE_HEADER_DEPENDENCIES this will speed up the common-case of
# only needing to re-generate coccicheck results for the users of a
# given API if it's changed, and not all files in the project. If
# COMPUTE_HEADER_DEPENDENCIES=no this will be unset too.
SPATCH_USE_O_DEPENDENCIES = YesPlease
# Set SPATCH_CONCAT_COCCI to concatenate the contrib/cocci/*.cocci
# files into a single contrib/cocci/ALL.cocci before running
# "coccicheck".
#
# Pros:
#
# - Speeds up a one-shot run of "make coccicheck", as we won't have to
# parse *.[ch] files N times for the N *.cocci rules
#
# Cons:
#
# - Will make incremental development of *.cocci slower, as
# e.g. changing strbuf.cocci will re-run all *.cocci.
#
# - Makes error and performance analysis harder, as rules will be
# applied from a monolithic ALL.cocci, rather than
# e.g. strbuf.cocci. To work around this either undefine this, or
# generate a specific patch, e.g. this will always use strbuf.cocci,
# not ALL.cocci:
#
# make contrib/coccinelle/strbuf.cocci.patch
SPATCH_CONCAT_COCCI = YesPlease
# Rebuild 'coccicheck' if $(SPATCH), its flags etc. change
TRACK_SPATCH_DEFINES =
TRACK_SPATCH_DEFINES += $(SPATCH)
TRACK_SPATCH_DEFINES += $(SPATCH_INCLUDE_FLAGS)
TRACK_SPATCH_DEFINES += $(SPATCH_FLAGS)
TRACK_SPATCH_DEFINES += $(SPATCH_TEST_FLAGS)
GIT-SPATCH-DEFINES: FORCE
@FLAGS='$(TRACK_SPATCH_DEFINES)'; \
if test x"$$FLAGS" != x"`cat GIT-SPATCH-DEFINES 2>/dev/null`" ; then \
echo >&2 " * new spatch flags"; \
echo "$$FLAGS" >GIT-SPATCH-DEFINES; \
fi
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
# usually result in less CPU usage at the cost of higher peak memory.
# Setting it to 0 will feed all files in a single spatch invocation.
SPATCH_FLAGS = --all-includes
SPATCH_BATCH_SIZE = 1
include config.mak.uname
-include config.mak.autogen
@ -1554,6 +1444,7 @@ ifeq ($(uname_S),Darwin)
APPLE_COMMON_CRYPTO = YesPlease
COMPAT_CFLAGS += -DAPPLE_COMMON_CRYPTO
endif
NO_REGEX = YesPlease
PTHREAD_LIBS =
endif
@ -1933,6 +1824,7 @@ ifdef APPLE_COMMON_CRYPTO
COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
BASIC_CFLAGS += -DSHA1_APPLE
else
DC_SHA1 := YesPlease
BASIC_CFLAGS += -DSHA1_DC
LIB_OBJS += sha1dc_git.o
ifdef DC_SHA1_EXTERNAL
@ -2149,13 +2041,11 @@ ifdef FSMONITOR_DAEMON_BACKEND
COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND
COMPAT_OBJS += compat/fsmonitor/fsm-listen-$(FSMONITOR_DAEMON_BACKEND).o
COMPAT_OBJS += compat/fsmonitor/fsm-health-$(FSMONITOR_DAEMON_BACKEND).o
COMPAT_OBJS += compat/fsmonitor/fsm-ipc-$(FSMONITOR_DAEMON_BACKEND).o
endif
ifdef FSMONITOR_OS_SETTINGS
COMPAT_CFLAGS += -DHAVE_FSMONITOR_OS_SETTINGS
COMPAT_OBJS += compat/fsmonitor/fsm-settings-$(FSMONITOR_OS_SETTINGS).o
COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o
endif
ifeq ($(TCLTK_PATH),)
@ -3092,9 +2982,9 @@ GIT-BUILD-OPTIONS: FORCE
@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
@echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+
@echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
@echo NO_REGEX=\''$(subst ','\'',$(subst ','\'',$(NO_REGEX)))'\' >>$@+
@echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
@echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+
@echo SANITIZE_ADDRESS=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_ADDRESS)))'\' >>$@+
@echo X=\'$(X)\' >>$@+
@ -3150,7 +3040,6 @@ else
@echo RUNTIME_PREFIX=\'false\' >>$@+
endif
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
@if test -f GIT-BUILD-DIR; then rm GIT-BUILD-DIR; fi
### Detect Python interpreter path changes
ifndef NO_PYTHON
@ -3249,113 +3138,35 @@ check: $(GENERATED_H)
exit 1; \
fi
COCCI_GEN_ALL = .build/contrib/coccinelle/ALL.cocci
COCCI_GLOB = $(wildcard contrib/coccinelle/*.cocci)
COCCI_RULES_TRACKED = $(COCCI_GLOB:%=.build/%)
COCCI_RULES_TRACKED_NO_PENDING = $(filter-out %.pending.cocci,$(COCCI_RULES_TRACKED))
COCCI_RULES =
COCCI_RULES += $(COCCI_GEN_ALL)
COCCI_RULES += $(COCCI_RULES_TRACKED)
COCCI_NAMES =
COCCI_NAMES += $(COCCI_RULES:.build/contrib/coccinelle/%.cocci=%)
COCCICHECK_PENDING = $(filter %.pending.cocci,$(COCCI_RULES))
COCCICHECK = $(filter-out $(COCCICHECK_PENDING),$(COCCI_RULES))
COCCICHECK_PATCHES = $(COCCICHECK:%=%.patch)
COCCICHECK_PATCHES_PENDING = $(COCCICHECK_PENDING:%=%.patch)
COCCICHECK_PATCHES_INTREE = $(COCCICHECK_PATCHES:.build/%=%)
COCCICHECK_PATCHES_PENDING_INTREE = $(COCCICHECK_PATCHES_PENDING:.build/%=%)
# It's expensive to compute the many=many rules below, only eval them
# on $(MAKECMDGOALS) that match these $(COCCI_RULES)
COCCI_RULES_GLOB =
COCCI_RULES_GLOB += cocci%
COCCI_RULES_GLOB += .build/contrib/coccinelle/%
COCCI_RULES_GLOB += $(COCCICHECK_PATCHES)
COCCI_RULES_GLOB += $(COCCICHEC_PATCHES_PENDING)
COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_INTREE)
COCCI_RULES_GLOB += $(COCCICHECK_PATCHES_PENDING_INTREE)
COCCI_GOALS = $(filter $(COCCI_RULES_GLOB),$(MAKECMDGOALS))
COCCI_TEST_RES = $(wildcard contrib/coccinelle/tests/*.res)
$(COCCI_RULES_TRACKED): .build/% : %
$(call mkdir_p_parent_template)
$(QUIET_CP)cp $< $@
.build/contrib/coccinelle/FOUND_H_SOURCES: $(FOUND_H_SOURCES)
$(call mkdir_p_parent_template)
$(QUIET_GEN) >$@
$(COCCI_GEN_ALL): $(COCCI_RULES_TRACKED_NO_PENDING)
$(call mkdir_p_parent_template)
$(QUIET_SPATCH_CAT)cat $^ >$@
ifeq ($(COMPUTE_HEADER_DEPENDENCIES),no)
SPATCH_USE_O_DEPENDENCIES =
endif
define cocci-rule
## Rule for .build/$(1).patch/$(2); Params:
# $(1) = e.g. ".build/contrib/coccinelle/free.cocci"
# $(2) = e.g. "grep.c"
# $(3) = e.g. "grep.o"
COCCI_$(1:.build/contrib/coccinelle/%.cocci=%) += $(1).d/$(2).patch
$(1).d/$(2).patch: GIT-SPATCH-DEFINES
$(1).d/$(2).patch: $(if $(and $(SPATCH_USE_O_DEPENDENCIES),$(wildcard $(3))),$(3),.build/contrib/coccinelle/FOUND_H_SOURCES)
$(1).d/$(2).patch: $(1)
$(1).d/$(2).patch: $(1).d/%.patch : %
$$(call mkdir_p_parent_template)
$$(QUIET_SPATCH)if ! $$(SPATCH) $$(SPATCH_FLAGS) \
$$(SPATCH_INCLUDE_FLAGS) \
--sp-file $(1) --patch . $$< \
>$$@ 2>$$@.log; \
%.cocci.patch: %.cocci $(COCCI_SOURCES)
$(QUIET_SPATCH) \
if test $(SPATCH_BATCH_SIZE) = 0; then \
limit=; \
else \
limit='-n $(SPATCH_BATCH_SIZE)'; \
fi; \
if ! echo $(COCCI_SOURCES) | xargs $$limit \
$(SPATCH) $(SPATCH_FLAGS) \
--sp-file $< --patch . \
>$@+ 2>$@.log; \
then \
echo "ERROR when applying '$(1)' to '$$<'; '$$@.log' follows:"; \
cat $$@.log; \
cat $@.log; \
exit 1; \
fi
endef
define cocci-matrix
$(foreach s,$(COCCI_SOURCES),$(call cocci-rule,$(c),$(s),$(s:%.c=%.o)))
endef
ifdef COCCI_GOALS
$(eval $(foreach c,$(COCCI_RULES),$(call cocci-matrix,$(c))))
endif
define spatch-rule
.build/contrib/coccinelle/$(1).cocci.patch: $$(COCCI_$(1))
$$(QUIET_SPATCH_CAT)cat $$^ >$$@ && \
if test -s $$@; \
fi; \
mv $@+ $@; \
if test -s $@; \
then \
echo ' ' SPATCH result: $$@; \
echo ' ' SPATCH result: $@; \
fi
contrib/coccinelle/$(1).cocci.patch: .build/contrib/coccinelle/$(1).cocci.patch
$$(QUIET_CP)cp $$< $$@
endef
ifdef COCCI_GOALS
$(eval $(foreach n,$(COCCI_NAMES),$(call spatch-rule,$(n))))
endif
COCCI_TEST_RES_GEN = $(addprefix .build/,$(COCCI_TEST_RES))
$(COCCI_TEST_RES_GEN): GIT-SPATCH-DEFINES
$(COCCI_TEST_RES_GEN): .build/%.res : %.c
$(COCCI_TEST_RES_GEN): .build/%.res : %.res
ifdef SPATCH_CONCAT_COCCI
$(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : $(COCCI_GEN_ALL)
else
$(COCCI_TEST_RES_GEN): .build/contrib/coccinelle/tests/%.res : contrib/coccinelle/%.cocci
endif
$(call mkdir_p_parent_template)
$(QUIET_SPATCH_TEST)$(SPATCH) $(SPATCH_TEST_FLAGS) \
$(QUIET_SPATCH_T)$(SPATCH) $(SPATCH_FLAGS) \
--very-quiet --no-show-diff \
--sp-file $< -o $@ \
$(@:.build/%.res=%.c) && \
@ -3366,15 +3177,11 @@ endif
coccicheck-test: $(COCCI_TEST_RES_GEN)
coccicheck: coccicheck-test
ifdef SPATCH_CONCAT_COCCI
coccicheck: contrib/coccinelle/ALL.cocci.patch
else
coccicheck: $(COCCICHECK_PATCHES_INTREE)
endif
coccicheck: $(addsuffix .patch,$(filter-out %.pending.cocci,$(wildcard contrib/coccinelle/*.cocci)))
# See contrib/coccinelle/README
coccicheck-pending: coccicheck-test
coccicheck-pending: $(COCCICHECK_PATCHES_PENDING_INTREE)
coccicheck-pending: $(addsuffix .patch,$(wildcard contrib/coccinelle/*.pending.cocci))
.PHONY: coccicheck coccicheck-pending
@ -3641,9 +3448,8 @@ profile-clean:
$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
cocciclean:
$(RM) GIT-SPATCH-DEFINES
$(RM) -r .build/contrib/coccinelle
$(RM) contrib/coccinelle/*.cocci.patch
$(RM) contrib/coccinelle/*.cocci.patch*
clean: profile-clean coverage-clean cocciclean
$(RM) -r .build

View File

@ -1 +1 @@
Documentation/RelNotes/2.39.1.txt
Documentation/RelNotes/2.38.4.txt

View File

@ -530,8 +530,8 @@ static int get_modified_files(struct repository *r,
struct collection_status s = { 0 };
int i;
discard_index(r->index);
if (repo_read_index_preload(r, ps, 0) < 0)
if (discard_index(r->index) < 0 ||
repo_read_index_preload(r, ps, 0) < 0)
return error(_("could not read index"));
prefix_item_list_clear(files);
@ -997,17 +997,18 @@ static int run_diff(struct add_i_state *s, const struct pathspec *ps,
count = list_and_choose(s, files, opts);
opts->flags = 0;
if (count > 0) {
struct child_process cmd = CHILD_PROCESS_INIT;
struct strvec args = STRVEC_INIT;
strvec_pushl(&cmd.args, "git", "diff", "-p", "--cached",
strvec_pushl(&args, "git", "diff", "-p", "--cached",
oid_to_hex(!is_initial ? &oid :
s->r->hash_algo->empty_tree),
"--", NULL);
for (i = 0; i < files->items.nr; i++)
if (files->selected[i])
strvec_push(&cmd.args,
strvec_push(&args,
files->items.items[i].string);
res = run_command(&cmd);
res = run_command_v_opt(args.v, 0);
strvec_clear(&args);
}
putchar('\n');
@ -1156,8 +1157,8 @@ int run_add_i(struct repository *r, const struct pathspec *ps)
_("staged"), _("unstaged"), _("path"));
opts.list_opts.header = header.buf;
discard_index(r->index);
if (repo_read_index(r) < 0 ||
if (discard_index(r->index) < 0 ||
repo_read_index(r) < 0 ||
repo_refresh_and_write_index(r, REFRESH_QUIET, 0, 1,
NULL, NULL, NULL) < 0)
warning(_("could not refresh index"));

View File

@ -1750,8 +1750,7 @@ int run_add_p(struct repository *r, enum add_p_mode mode,
s.mode = &patch_mode_add;
s.revision = revision;
discard_index(r->index);
if (repo_read_index(r) < 0 ||
if (discard_index(r->index) < 0 || repo_read_index(r) < 0 ||
(!s.mode->index_only &&
repo_refresh_and_write_index(r, REFRESH_QUIET, 0, 1,
NULL, NULL, NULL) < 0) ||

57
apply.c
View File

@ -125,7 +125,7 @@ void clear_apply_state(struct apply_state *state)
/* &state->fn_table is cleared at the end of apply_patch() */
}
static void mute_routine(const char *msg UNUSED, va_list params UNUSED)
static void mute_routine(const char *msg, va_list params)
{
/* do nothing */
}
@ -386,19 +386,9 @@ static void say_patch_name(FILE *output, const char *fmt, struct patch *patch)
#define SLOP (16)
/*
* apply.c isn't equipped to handle arbitrarily large patches, because
* it intermingles `unsigned long` with `int` for the type used to store
* buffer lengths.
*
* Only process patches that are just shy of 1 GiB large in order to
* avoid any truncation or overflow issues.
*/
#define MAX_APPLY_SIZE (1024UL * 1024 * 1023)
static int read_patch_file(struct strbuf *sb, int fd)
{
if (strbuf_read(sb, fd, 0) < 0 || sb->len >= MAX_APPLY_SIZE)
if (strbuf_read(sb, fd, 0) < 0)
return error_errno("git apply: failed to read");
/*
@ -902,9 +892,9 @@ static int parse_traditional_patch(struct apply_state *state,
return 0;
}
static int gitdiff_hdrend(struct gitdiff_data *state UNUSED,
const char *line UNUSED,
struct patch *patch UNUSED)
static int gitdiff_hdrend(struct gitdiff_data *state,
const char *line,
struct patch *patch)
{
return 1;
}
@ -1054,7 +1044,7 @@ static int gitdiff_renamedst(struct gitdiff_data *state,
return 0;
}
static int gitdiff_similarity(struct gitdiff_data *state UNUSED,
static int gitdiff_similarity(struct gitdiff_data *state,
const char *line,
struct patch *patch)
{
@ -1064,7 +1054,7 @@ static int gitdiff_similarity(struct gitdiff_data *state UNUSED,
return 0;
}
static int gitdiff_dissimilarity(struct gitdiff_data *state UNUSED,
static int gitdiff_dissimilarity(struct gitdiff_data *state,
const char *line,
struct patch *patch)
{
@ -1114,9 +1104,9 @@ static int gitdiff_index(struct gitdiff_data *state,
* This is normal for a diff that doesn't change anything: we'll fall through
* into the next diff. Tell the parser to break out.
*/
static int gitdiff_unrecognized(struct gitdiff_data *state UNUSED,
const char *line UNUSED,
struct patch *patch UNUSED)
static int gitdiff_unrecognized(struct gitdiff_data *state,
const char *line,
struct patch *patch)
{
return 1;
}
@ -4418,6 +4408,33 @@ static int create_one_file(struct apply_state *state,
if (state->cached)
return 0;
/*
* We already try to detect whether files are beyond a symlink in our
* up-front checks. But in the case where symlinks are created by any
* of the intermediate hunks it can happen that our up-front checks
* didn't yet see the symlink, but at the point of arriving here there
* in fact is one. We thus repeat the check for symlinks here.
*
* Note that this does not make the up-front check obsolete as the
* failure mode is different:
*
* - The up-front checks cause us to abort before we have written
* anything into the working directory. So when we exit this way the
* working directory remains clean.
*
* - The checks here happen in the middle of the action where we have
* already started to apply the patch. The end result will be a dirty
* working directory.
*
* Ideally, we should update the up-front checks to catch what would
* happen when we apply the patch before we damage the working tree.
* We have all the information necessary to do so. But for now, as a
* part of embargoed security work, having this check would serve as a
* reasonable first step.
*/
if (path_is_beyond_symlink(state, path))
return error(_("affected file '%s' is beyond a symbolic link"), path);
res = try_create_file(state, path, mode, buf, size);
if (res < 0)
return -1;

View File

@ -498,7 +498,6 @@ static int write_tar_filter_archive(const struct archiver *ar,
strvec_push(&filter.args, cmd.buf);
filter.use_shell = 1;
filter.in = -1;
filter.silent_exec_failure = 1;
if (start_command(&filter) < 0)
die_errno(_("unable to start '%s' filter"), cmd.buf);

View File

@ -498,7 +498,7 @@ static void parse_treeish_arg(const char **argv,
ar_args->time = archive_time;
}
static void extra_file_info_clear(void *util, const char *str UNUSED)
static void extra_file_info_clear(void *util, const char *str)
{
struct extra_file_info *info = util;
free(info->base);

2
attr.c
View File

@ -752,7 +752,7 @@ static struct attr_stack *read_attr_from_index(struct index_state *istate,
struct attr_stack *res;
char *buf, *sp;
int lineno = 0;
size_t size;
unsigned long size;
if (!istate)
return NULL;

View File

@ -22,6 +22,8 @@ static struct oid_array skipped_revs;
static struct object_id *current_bad_oid;
static const char *argv_checkout[] = {"checkout", "-q", NULL, "--", NULL};
static const char *term_bad;
static const char *term_good;
@ -727,22 +729,20 @@ static int is_expected_rev(const struct object_id *oid)
enum bisect_error bisect_checkout(const struct object_id *bisect_rev,
int no_checkout)
{
char bisect_rev_hex[GIT_MAX_HEXSZ + 1];
struct commit *commit;
struct pretty_print_context pp = {0};
struct strbuf commit_msg = STRBUF_INIT;
oid_to_hex_r(bisect_rev_hex, bisect_rev);
update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev, NULL, 0, UPDATE_REFS_DIE_ON_ERR);
argv_checkout[2] = bisect_rev_hex;
if (no_checkout) {
update_ref(NULL, "BISECT_HEAD", bisect_rev, NULL, 0,
UPDATE_REFS_DIE_ON_ERR);
} else {
struct child_process cmd = CHILD_PROCESS_INIT;
cmd.git_cmd = 1;
strvec_pushl(&cmd.args, "checkout", "-q",
oid_to_hex(bisect_rev), "--", NULL);
if (run_command(&cmd))
if (run_command_v_opt(argv_checkout, RUN_GIT_CMD))
/*
* Errors in `run_command()` itself, signaled by res < 0,
* and errors in the child process, signaled by res > 0

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2006 Linus Torvalds
*/
#define USE_THE_INDEX_VARIABLE
#define USE_THE_INDEX_COMPATIBILITY_MACROS
#include "cache.h"
#include "config.h"
#include "builtin.h"
@ -42,8 +42,8 @@ static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
{
int i, ret = 0;
for (i = 0; i < the_index.cache_nr; i++) {
struct cache_entry *ce = the_index.cache[i];
for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];
int err;
if (!include_sparse &&
@ -55,7 +55,7 @@ static int chmod_pathspec(struct pathspec *pathspec, char flip, int show_only)
continue;
if (!show_only)
err = chmod_index_entry(&the_index, ce, flip);
err = chmod_cache_entry(ce, flip);
else
err = S_ISREG(ce->ce_mode) ? 0 : -1;
@ -159,8 +159,8 @@ static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
{
int i, retval = 0;
for (i = 0; i < the_index.cache_nr; i++) {
struct cache_entry *ce = the_index.cache[i];
for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];
if (!include_sparse &&
(ce_skip_worktree(ce) ||
@ -172,8 +172,7 @@ static int renormalize_tracked_files(const struct pathspec *pathspec, int flags)
continue; /* do not touch non blobs */
if (pathspec && !ce_path_match(&the_index, ce, pathspec, NULL))
continue;
retval |= add_file_to_index(&the_index, ce->name,
flags | ADD_CACHE_RENORMALIZE);
retval |= add_file_to_cache(ce->name, flags | ADD_CACHE_RENORMALIZE);
}
return retval;
@ -241,8 +240,8 @@ static int refresh(int verbose, const struct pathspec *pathspec)
int run_add_interactive(const char *revision, const char *patch_mode,
const struct pathspec *pathspec)
{
int i;
struct child_process cmd = CHILD_PROCESS_INIT;
int status, i;
struct strvec argv = STRVEC_INIT;
int use_builtin_add_i =
git_env_bool("GIT_TEST_ADD_I_USE_BUILTIN", -1);
@ -273,18 +272,19 @@ int run_add_interactive(const char *revision, const char *patch_mode,
return !!run_add_p(the_repository, mode, revision, pathspec);
}
strvec_push(&cmd.args, "add--interactive");
strvec_push(&argv, "add--interactive");
if (patch_mode)
strvec_push(&cmd.args, patch_mode);
strvec_push(&argv, patch_mode);
if (revision)
strvec_push(&cmd.args, revision);
strvec_push(&cmd.args, "--");
strvec_push(&argv, revision);
strvec_push(&argv, "--");
for (i = 0; i < pathspec->nr; i++)
/* pass original pathspec, to be re-parsed */
strvec_push(&cmd.args, pathspec->items[i].original);
strvec_push(&argv, pathspec->items[i].original);
cmd.git_cmd = 1;
return run_command(&cmd);
status = run_command_v_opt(argv.v, RUN_GIT_CMD);
strvec_clear(&argv);
return status;
}
int interactive_add(const char **argv, const char *prefix, int patch)
@ -312,7 +312,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
if (repo_read_index(the_repository) < 0)
if (read_cache() < 0)
die(_("Could not read the index"));
repo_init_revisions(the_repository, &rev, prefix);
@ -544,7 +544,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
prepare_repo_settings(the_repository);
the_repository->settings.command_requires_full_index = 0;
repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
/*
* Check the "pathspec '%s' did not match any files" block
@ -587,7 +587,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
(!(addremove || take_worktree_changes)
? ADD_CACHE_IGNORE_REMOVAL : 0));
if (repo_read_index_preload(the_repository, &pathspec, 0) < 0)
if (read_cache_preload(&pathspec) < 0)
die(_("index file corrupt"));
die_in_unpopulated_submodule(&the_index, prefix);

View File

@ -1519,8 +1519,8 @@ static int run_apply(const struct am_state *state, const char *index_file)
if (index_file) {
/* Reload index as apply_all_patches() will have modified it. */
discard_index(&the_index);
read_index_from(&the_index, index_file, get_git_dir());
discard_cache();
read_cache_from(index_file);
}
return 0;
@ -1562,8 +1562,8 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
if (build_fake_ancestor(state, index_path))
return error("could not build fake ancestor");
discard_index(&the_index);
read_index_from(&the_index, index_path, get_git_dir());
discard_cache();
read_cache_from(index_path);
if (write_index_as_tree(&orig_tree, &the_index, index_path, 0, NULL))
return error(_("Repository lacks necessary blobs to fall back on 3-way merge."));
@ -1596,8 +1596,8 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
say(state, stdout, _("Falling back to patching base and 3-way merge..."));
discard_index(&the_index);
repo_read_index(the_repository);
discard_cache();
read_cache();
/*
* This is not so wrong. Depending on which base we picked, orig_tree
@ -1781,8 +1781,7 @@ static void am_run(struct am_state *state, int resume)
unlink(am_path(state, "dirtyindex"));
if (repo_refresh_and_write_index(the_repository, REFRESH_QUIET, 0, 0,
NULL, NULL, NULL) < 0)
if (refresh_and_write_cache(REFRESH_QUIET, 0, 0) < 0)
die(_("unable to write index file"));
if (repo_index_has_changes(the_repository, NULL, &sb)) {
@ -1931,7 +1930,7 @@ static void am_resolve(struct am_state *state, int allow_empty)
}
}
if (unmerged_index(&the_index)) {
if (unmerged_cache()) {
printf_ln(_("You still have unmerged paths in your index.\n"
"You should 'git add' each file with resolved conflicts to mark them as such.\n"
"You might run `git rm` on a file to accept \"deleted by them\" for it."));
@ -1968,9 +1967,9 @@ static int fast_forward_to(struct tree *head, struct tree *remote, int reset)
if (parse_tree(head) || parse_tree(remote))
return -1;
repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
refresh_index(&the_index, REFRESH_QUIET, NULL, NULL, NULL);
refresh_cache(REFRESH_QUIET);
memset(&opts, 0, sizeof(opts));
opts.head_idx = 1;
@ -2008,7 +2007,7 @@ static int merge_tree(struct tree *tree)
if (parse_tree(tree))
return -1;
repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
hold_locked_index(&lock_file, LOCK_DIE_ON_ERROR);
memset(&opts, 0, sizeof(opts));
opts.head_idx = 1;
@ -2046,7 +2045,7 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
if (!remote_tree)
return error(_("Could not parse object '%s'."), oid_to_hex(remote));
repo_read_index_unmerged(the_repository);
read_cache_unmerged();
if (fast_forward_to(head_tree, head_tree, 1))
return -1;
@ -2188,12 +2187,14 @@ static int show_patch(struct am_state *state, enum show_patch_type sub_mode)
int len;
if (!is_null_oid(&state->orig_commit)) {
struct child_process cmd = CHILD_PROCESS_INIT;
const char *av[4] = { "show", NULL, "--", NULL };
char *new_oid_str;
int ret;
strvec_pushl(&cmd.args, "show", oid_to_hex(&state->orig_commit),
"--", NULL);
cmd.git_cmd = 1;
return run_command(&cmd);
av[1] = new_oid_str = xstrdup(oid_to_hex(&state->orig_commit));
ret = run_command_v_opt(av, RUN_GIT_CMD);
free(new_oid_str);
return ret;
}
switch (sub_mode) {

Some files were not shown because too many files have changed in this diff Show More