@@ -3,20 +3,69 @@ git-remote-helpers(1)
33
44NAME
55----
6- git-remote-helpers - Helper programs for interoperation with remote git
6+ git-remote-helpers - Helper programs to interact with remote repositories
77
88SYNOPSIS
99--------
10- 'git remote-<transport>' <remote>
10+ 'git remote-<transport>' <repository> [<URL>]
1111
1212DESCRIPTION
1313-----------
1414
15- These programs are normally not used directly by end users, but are
16- invoked by various git programs that interact with remote repositories
17- when the repository they would operate on will be accessed using
18- transport code not linked into the main git binary. Various particular
19- helper programs will behave as documented here.
15+ Remote helper programs are normally not used directly by end users,
16+ but they are invoked by git when it needs to interact with remote
17+ repositories git does not support natively. A given helper will
18+ implement a subset of the capabilities documented here. When git
19+ needs to interact with a repository using a remote helper, it spawns
20+ the helper as an independent process, sends commands to the helper's
21+ standard input, and expects results from the helper's standard
22+ output. Because a remote helper runs as an independent process from
23+ git, there is no need to re-link git to add a new helper, nor any
24+ need to link the helper with the implementation of git.
25+
26+ Every helper must support the "capabilities" command, which git will
27+ use to determine what other commands the helper will accept. Other
28+ commands generally concern facilities like discovering and updating
29+ remote refs, transporting objects between the object database and
30+ the remote repository, and updating the local object store.
31+
32+ Helpers supporting the 'fetch' capability can discover refs from the
33+ remote repository and transfer objects reachable from those refs to
34+ the local object store. Helpers supporting the 'push' capability can
35+ transfer local objects to the remote repository and update remote refs.
36+
37+ Git comes with a "curl" family of remote helpers, that handle various
38+ transport protocols, such as 'git-remote-http', 'git-remote-https',
39+ 'git-remote-ftp' and 'git-remote-ftps'. They implement the capabilities
40+ 'fetch', 'option', and 'push'.
41+
42+ INVOCATION
43+ ----------
44+
45+ Remote helper programs are invoked with one or (optionally) two
46+ arguments. The first argument specifies a remote repository as in git;
47+ it is either the name of a configured remote or a URL. The second
48+ argument specifies a URL; it is usually of the form
49+ '<transport>://<address>', but any arbitrary string is possible.
50+
51+ When git encounters a URL of the form '<transport>://<address>', where
52+ '<transport>' is a protocol that it cannot handle natively, it
53+ automatically invokes 'git remote-<transport>' with the full URL as
54+ the second argument. If such a URL is encountered directly on the
55+ command line, the first argument is the same as the second, and if it
56+ is encountered in a configured remote, the first argument is the name
57+ of that remote.
58+
59+ A URL of the form '<transport>::<address>' explicitly instructs git to
60+ invoke 'git remote-<transport>' with '<address>' as the second
61+ argument. If such a URL is encountered directly on the command line,
62+ the first argument is '<address>', and if it is encountered in a
63+ configured remote, the first argument is the name of that remote.
64+
65+ Additionally, when a configured remote has 'remote.<name>.vcs' set to
66+ '<transport>', git explicitly invokes 'git remote-<transport>' with
67+ '<name>' as the first argument. If set, the second argument is
68+ 'remote.<name>.url'; otherwise, the second argument is omitted.
2069
2170COMMANDS
2271--------
@@ -25,8 +74,8 @@ Commands are given by the caller on the helper's standard input, one per line.
2574
2675'capabilities'::
2776 Lists the capabilities of the helper, one per line, ending
28- with a blank line. Each capability may be preceded with '*'.
29- This marks them mandatory for git version using the remote
77+ with a blank line. Each capability may be preceded with '*',
78+ which marks them mandatory for git version using the remote
3079 helper to understand (unknown mandatory capability is fatal
3180 error).
3281
@@ -35,27 +84,27 @@ Commands are given by the caller on the helper's standard input, one per line.
3584 [<attr> ...]". The value may be a hex sha1 hash, "@<dest>" for
3685 a symref, or "?" to indicate that the helper could not get the
3786 value of the ref. A space-separated list of attributes follows
38- the name; unrecognized attributes are ignored. After the
39- complete list, outputs a blank line.
87+ the name; unrecognized attributes are ignored. The list ends
88+ with a blank line.
4089+
4190If 'push' is supported this may be called as 'list for-push'
4291to obtain the current refs prior to sending one or more 'push'
4392commands to the helper.
4493
4594'option' <name> <value>::
46- Set the transport helper option <name> to <value>. Outputs a
95+ Sets the transport helper option <name> to <value>. Outputs a
4796 single line containing one of 'ok' (option successfully set),
4897 'unsupported' (option not recognized) or 'error <msg>'
49- (option <name> is supported but <value> is not correct
98+ (option <name> is supported but <value> is not valid
5099 for it). Options should be set before other commands,
51- and may how those commands behave .
100+ and may influence the behavior of those commands.
52101+
53102Supported if the helper has the "option" capability.
54103
55104'fetch' <sha1> <name>::
56105 Fetches the given object, writing the necessary objects
57106 to the database. Fetch commands are sent in a batch, one
58- per line, and the batch is terminated with a blank line.
107+ per line, terminated with a blank line.
59108 Outputs a single blank line when all fetch commands in the
60109 same batch are complete. Only objects which were reported
61110 in the ref list with a sha1 may be fetched this way.
@@ -67,7 +116,7 @@ suitably updated.
67116Supported if the helper has the "fetch" capability.
68117
69118'push' +<src>:<dst>::
70- Pushes the given <src> commit or branch locally to the
119+ Pushes the given local <src> commit or branch to the
71120 remote branch described by <dst>. A batch sequence of
72121 one or more push commands is terminated with a blank line.
73122+
@@ -91,6 +140,9 @@ Supported if the helper has the "push" capability.
91140 by applying the refspecs from the "refspec" capability to the
92141 name of the ref.
93142+
143+ Especially useful for interoperability with a foreign versioning
144+ system.
145+ +
94146Supported if the helper has the "import" capability.
95147
96148'connect' <service>::
@@ -119,16 +171,11 @@ CAPABILITIES
119171------------
120172
121173'fetch'::
122- This helper supports the 'fetch' command.
123-
124174'option'::
125- This helper supports the option command.
126-
127175'push'::
128- This helper supports the 'push' command.
129-
130176'import'::
131- This helper supports the 'import' command.
177+ 'connect'::
178+ This helper supports the corresponding command with the same name.
132179
133180'refspec' 'spec'::
134181 When using the import command, expect the source ref to have
@@ -140,9 +187,6 @@ CAPABILITIES
140187 all, it must cover all refs reported by the list command; if
141188 it is not used, it is effectively "*:*"
142189
143- 'connect'::
144- This helper supports the 'connect' command.
145-
146190REF LIST ATTRIBUTES
147191-------------------
148192
@@ -158,19 +202,19 @@ REF LIST ATTRIBUTES
158202OPTIONS
159203-------
160204'option verbosity' <N>::
161- Change the level of messages displayed by the helper.
162- When N is 0 the end-user has asked the process to be
163- quiet , and the helper should produce only error output.
164- N of 1 is the default level of verbosity, higher values
205+ Changes the verbosity of messages displayed by the helper.
206+ A value of 0 for N means that processes operate
207+ quietly , and the helper produces only error output.
208+ 1 is the default level of verbosity, and higher values
165209 of N correspond to the number of -v flags passed on the
166210 command line.
167211
168212'option progress' \{'true'|'false'\}::
169- Enable (or disable ) progress messages displayed by the
213+ Enables (or disables ) progress messages displayed by the
170214 transport helper during a command.
171215
172216'option depth' <depth>::
173- Deepen the history of a shallow repository.
217+ Deepens the history of a shallow repository.
174218
175219'option followtags' \{'true'|'false'\}::
176220 If enabled the helper should automatically fetch annotated
@@ -186,11 +230,15 @@ OPTIONS
186230 helpers this only applies to the 'push', if supported.
187231
188232'option servpath <c-style-quoted-path>'::
189- Set service path (--upload-pack, --receive-pack etc.) for
190- next connect. Remote helper MAY support this option. Remote
191- helper MUST NOT rely on this option being set before
233+ Sets service path (--upload-pack, --receive-pack etc.) for
234+ next connect. Remote helper may support this option, but
235+ must not rely on this option being set before
192236 connect request occurs.
193237
238+ SEE ALSO
239+ --------
240+ linkgit:git-remote[1]
241+
194242Documentation
195243-------------
196244Documentation by Daniel Barkalow and Ilari Liusvaara
0 commit comments