Skip to content

Commit b6b210c

Browse files
committed
Merge branch 'jk/ref-paranoia' into jt/no-abuse-alternate-odb-for-submodules
* jk/ref-paranoia: (71 commits) refs: drop "broken" flag from for_each_fullref_in() ref-filter: drop broken-ref code entirely ref-filter: stop setting FILTER_REFS_INCLUDE_BROKEN repack, prune: drop GIT_REF_PARANOIA settings refs: turn on GIT_REF_PARANOIA by default refs: omit dangling symrefs when using GIT_REF_PARANOIA refs: add DO_FOR_EACH_OMIT_DANGLING_SYMREFS flag refs-internal.h: reorganize DO_FOR_EACH_* flag documentation refs-internal.h: move DO_FOR_EACH_* flags next to each other t5312: be more assertive about command failure t5312: test non-destructive repack t5312: create bogus ref as necessary t5312: drop "verbose" helper t5600: provide detached HEAD for corruption failures t5516: don't use HEAD ref for invalid ref-deletion tests t7900: clean up some more broken refs The eighth batch t0000: avoid masking git exit value through pipes tree-diff: fix leak when not HAVE_ALLOCA_H pack-revindex.h: correct the time complexity descriptions ...
2 parents 6295f87 + 67985e4 commit b6b210c

File tree

92 files changed

+964
-472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+964
-472
lines changed

Documentation/RelNotes/2.34.0.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ UI, Workflows & Features
4848
entire directory outside the sparse cone to be removed, which is
4949
especially useful when the sparse patterns change.
5050

51+
* Taking advantage of the CGI interface, http-backend has been
52+
updated to enable protocol v2 automatically when the other side
53+
asks for it.
54+
55+
* The credential-cache helper has been adjusted to Windows.
56+
57+
* The error in "git help no-such-git-command" is handled better.
58+
5159

5260
Performance, Internal Implementation, Development Support etc.
5361

@@ -119,6 +127,9 @@ Performance, Internal Implementation, Development Support etc.
119127
ask the file descriptors open for packfiles to be closed immediately
120128
before spawning commands that may trigger auto-gc.
121129

130+
* An oddball OPTION_ARGUMENT feature has been removed from the
131+
parse-options API.
132+
122133

123134
Fixes since v2.33
124135
-----------------
@@ -245,6 +256,17 @@ Fixes since v2.33
245256
subsystem has been cleaned up.
246257
(merge 35cf94eaf6 rs/no-mode-to-open-when-appending later to maint).
247258

259+
* "git update-ref --stdin" failed to flush its output as needed,
260+
which potentially led the conversation to a deadlock.
261+
(merge 7c1200745b ps/update-ref-batch-flush later to maint).
262+
263+
* When "git am --abort" fails to abort correctly, it still exited
264+
with exit status of 0, which has been corrected.
265+
(merge c5ead19ea2 en/am-abort-fix later to maint).
266+
267+
* Correct nr and alloc members of strvec struct to be of type size_t.
268+
(merge 8d133a4653 jk/strvec-typefix later to maint).
269+
248270
* Other code cleanup, docfix, build fix, etc.
249271
(merge 1d9c8daef8 ab/bundle-doc later to maint).
250272
(merge 81483fe613 en/merge-strategy-docs later to maint).
@@ -276,3 +298,8 @@ Fixes since v2.33
276298
(merge 92a5d1c9b4 jc/prefix-filename-allocates later to maint).
277299
(merge d9a65b6c0a rs/setup-use-xopen-and-xdup later to maint).
278300
(merge e8f55568de jk/t5562-racefix later to maint).
301+
(merge 8f0f110156 rs/drop-core-compression-vars later to maint).
302+
(merge b6d8887d3d ma/doc-git-version later to maint).
303+
(merge 66c0c44df6 cb/plug-leaks-in-alloca-emu-users later to maint).
304+
(merge afb32e8101 kz/revindex-comment-fix later to maint).
305+
(merge ae578de926 po/git-config-doc-mentions-help-c later to maint).

Documentation/git-am.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ default. You can use `--no-utf8` to override this.
178178

179179
--abort::
180180
Restore the original branch and abort the patching operation.
181+
Revert contents of files involved in the am operation to their
182+
pre-am state.
181183

182184
--quit::
183185
Abort the patching operation but keep HEAD and the index

Documentation/git-config.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ codes are:
7171

7272
On success, the command returns the exit code 0.
7373

74+
A list of all available configuration variables can be obtained using the
75+
`git help --config` command.
76+
7477
[[OPTIONS]]
7578
OPTIONS
7679
-------

Documentation/git-http-backend.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ A simple CGI program to serve the contents of a Git repository to Git
1616
clients accessing the repository over http:// and https:// protocols.
1717
The program supports clients fetching using both the smart HTTP protocol
1818
and the backwards-compatible dumb HTTP protocol, as well as clients
19-
pushing using the smart HTTP protocol.
19+
pushing using the smart HTTP protocol. It also supports Git's
20+
more-efficient "v2" protocol if properly configured; see the
21+
discussion of `GIT_PROTOCOL` in the ENVIRONMENT section below.
2022

2123
It verifies that the directory has the magic file
2224
"git-daemon-export-ok", and it will refuse to export any Git directory
@@ -77,6 +79,18 @@ Apache 2.x::
7779
SetEnv GIT_PROJECT_ROOT /var/www/git
7880
SetEnv GIT_HTTP_EXPORT_ALL
7981
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
82+
83+
# This is not strictly necessary using Apache and a modern version of
84+
# git-http-backend, as the webserver will pass along the header in the
85+
# environment as HTTP_GIT_PROTOCOL, and http-backend will copy that into
86+
# GIT_PROTOCOL. But you may need this line (or something similar if you
87+
# are using a different webserver), or if you want to support older Git
88+
# versions that did not do that copying.
89+
#
90+
# Having the webserver set up GIT_PROTOCOL is perfectly fine even with
91+
# modern versions (and will take precedence over HTTP_GIT_PROTOCOL,
92+
# which means it can be used to override the client's request).
93+
SetEnvIf Git-Protocol ".*" GIT_PROTOCOL=$0
8094
----------------------------------------------------------------
8195
+
8296
To enable anonymous read access but authenticated write access,
@@ -264,6 +278,16 @@ a repository with an extremely large number of refs. The value can be
264278
specified with a unit (e.g., `100M` for 100 megabytes). The default is
265279
10 megabytes.
266280

281+
Clients may probe for optional protocol capabilities (like the v2
282+
protocol) using the `Git-Protocol` HTTP header. In order to support
283+
these, the contents of that header must appear in the `GIT_PROTOCOL`
284+
environment variable. Most webservers will pass this header to the CGI
285+
via the `HTTP_GIT_PROTOCOL` variable, and `git-http-backend` will
286+
automatically copy that to `GIT_PROTOCOL`. However, some webservers may
287+
be more selective about which headers they'll pass, in which case they
288+
need to be configured explicitly (see the mention of `Git-Protocol` in
289+
the Apache config from the earlier EXAMPLES section).
290+
267291
The backend process sets GIT_COMMITTER_NAME to '$REMOTE_USER' and
268292
GIT_COMMITTER_EMAIL to '$\{REMOTE_USER}@http.$\{REMOTE_ADDR\}',
269293
ensuring that any reflogs created by 'git-receive-pack' contain some

Documentation/git-upload-pack.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ OPTIONS
4848
<directory>::
4949
The repository to sync from.
5050

51+
ENVIRONMENT
52+
-----------
53+
54+
`GIT_PROTOCOL`::
55+
Internal variable used for handshaking the wire protocol. Server
56+
admins may need to configure some transports to allow this
57+
variable to be passed. See the discussion in linkgit:git[1].
58+
5159
SEE ALSO
5260
--------
5361
linkgit:gitnamespaces[7]

Documentation/git-version.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
git-version(1)
2+
==============
3+
4+
NAME
5+
----
6+
git-version - Display version information about Git
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
'git version' [--build-options]
12+
13+
DESCRIPTION
14+
-----------
15+
With no options given, the version of 'git' is printed on the standard output.
16+
17+
Note that `git --version` is identical to `git version` because the
18+
former is internally converted into the latter.
19+
20+
OPTIONS
21+
-------
22+
--build-options::
23+
Include additional information about how git was built for diagnostic
24+
purposes.
25+
26+
GIT
27+
---
28+
Part of the linkgit:git[1] suite

Documentation/git.txt

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ OPTIONS
4141
-------
4242
--version::
4343
Prints the Git suite version that the 'git' program came from.
44+
+
45+
This option is internaly converted to `git version ...` and accepts
46+
the same options as the linkgit:git-version[1] command. If `--help` is
47+
also given, it takes precedence over `--version`.
4448

4549
--help::
4650
Prints the synopsis and a list of the most commonly used
@@ -863,15 +867,16 @@ for full details.
863867
end user, to be recorded in the body of the reflog.
864868

865869
`GIT_REF_PARANOIA`::
866-
If set to `1`, include broken or badly named refs when iterating
867-
over lists of refs. In a normal, non-corrupted repository, this
868-
does nothing. However, enabling it may help git to detect and
869-
abort some operations in the presence of broken refs. Git sets
870-
this variable automatically when performing destructive
871-
operations like linkgit:git-prune[1]. You should not need to set
872-
it yourself unless you want to be paranoid about making sure
873-
an operation has touched every ref (e.g., because you are
874-
cloning a repository to make a backup).
870+
If set to `0`, ignore broken or badly named refs when iterating
871+
over lists of refs. Normally Git will try to include any such
872+
refs, which may cause some operations to fail. This is usually
873+
preferable, as potentially destructive operations (e.g.,
874+
linkgit:git-prune[1]) are better off aborting rather than
875+
ignoring broken refs (and thus considering the history they
876+
point to as not worth saving). The default value is `1` (i.e.,
877+
be paranoid about detecting and aborting all operations). You
878+
should not normally need to set this to `0`, but it may be
879+
useful when trying to salvage data from a corrupted repository.
875880

876881
`GIT_ALLOW_PROTOCOL`::
877882
If set to a colon-separated list of protocols, behave as if
@@ -894,6 +899,21 @@ for full details.
894899
Contains a colon ':' separated list of keys with optional values
895900
'key[=value]'. Presence of unknown keys and values must be
896901
ignored.
902+
+
903+
Note that servers may need to be configured to allow this variable to
904+
pass over some transports. It will be propagated automatically when
905+
accessing local repositories (i.e., `file://` or a filesystem path), as
906+
well as over the `git://` protocol. For git-over-http, it should work
907+
automatically in most configurations, but see the discussion in
908+
linkgit:git-http-backend[1]. For git-over-ssh, the ssh server may need
909+
to be configured to allow clients to pass this variable (e.g., by using
910+
`AcceptEnv GIT_PROTOCOL` with OpenSSH).
911+
+
912+
This configuration is optional. If the variable is not propagated, then
913+
clients will fall back to the original "v0" protocol (but may miss out
914+
on some performance improvements or features). This variable currently
915+
only affects clones and fetches; it is not yet used for pushes (but may
916+
be in the future).
897917

898918
`GIT_OPTIONAL_LOCKS`::
899919
If set to `0`, Git will complete any requested operation without

Documentation/technical/api-parse-options.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ There are some macros to easily define options:
198198
The filename will be prefixed by passing the filename along with
199199
the prefix argument of `parse_options()` to `prefix_filename()`.
200200

201-
`OPT_ARGUMENT(long, &int_var, description)`::
202-
Introduce a long-option argument that will be kept in `argv[]`.
203-
If this option was seen, `int_var` will be set to one (except
204-
if a `NULL` pointer was passed).
205-
206201
`OPT_NUMBER_CALLBACK(&var, description, func_ptr)`::
207202
Recognize numerical options like -123 and feed the integer as
208203
if it was an argument to the function given by `func_ptr`.

Documentation/technical/protocol-v2.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ Initial Client Request
4242
In general a client can request to speak protocol v2 by sending
4343
`version=2` through the respective side-channel for the transport being
4444
used which inevitably sets `GIT_PROTOCOL`. More information can be
45-
found in `pack-protocol.txt` and `http-protocol.txt`. In all cases the
45+
found in `pack-protocol.txt` and `http-protocol.txt`, as well as the
46+
`GIT_PROTOCOL` definition in `git.txt`. In all cases the
4647
response from the server is the capability advertisement.
4748

4849
Git Transport
@@ -58,6 +59,8 @@ SSH and File Transport
5859

5960
When using either the ssh:// or file:// transport, the GIT_PROTOCOL
6061
environment variable must be set explicitly to include "version=2".
62+
The server may need to be configured to allow this environment variable
63+
to pass.
6164

6265
HTTP Transport
6366
~~~~~~~~~~~~~~
@@ -84,6 +87,9 @@ Subsequent requests are then made directly to the service
8487
Uses the `--http-backend-info-refs` option to
8588
linkgit:git-upload-pack[1].
8689

90+
The server may need to be configured to pass this header's contents via
91+
the `GIT_PROTOCOL` variable. See the discussion in `git-http-backend.txt`.
92+
8793
Capability Advertisement
8894
------------------------
8995

INSTALL

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,15 @@ Issues of note:
138138
BLK_SHA1. Also included is a version optimized for PowerPC
139139
(PPC_SHA1).
140140

141-
- "libcurl" library is used by git-http-fetch, git-fetch, and, if
142-
the curl version >= 7.34.0, for git-imap-send. You might also
143-
want the "curl" executable for debugging purposes. If you do not
144-
use http:// or https:// repositories, and do not want to put
145-
patches into an IMAP mailbox, you do not have to have them
146-
(use NO_CURL).
141+
- "libcurl" library is used for fetching and pushing
142+
repositories over http:// or https://, as well as by
143+
git-imap-send if the curl version is >= 7.34.0. If you do
144+
not need that functionality, use NO_CURL to build without
145+
it.
146+
147+
Git requires version "7.19.4" or later of "libcurl" to build
148+
without NO_CURL. This version requirement may be bumped in
149+
the future.
147150

148151
- "expat" library; git-http-push uses it for remote lock
149152
management over DAV. Similar to "curl" above, this is optional

0 commit comments

Comments
 (0)