interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / Documentation / technical / long-running-process-protocol.adoc

51 lines · 1930 bytes Raw Blame History
1Long-running process protocol
2=============================
3
4This protocol is used when Git needs to communicate with an external
5process throughout the entire life of a single Git command. All
6communication is in pkt-line format (see linkgit:gitprotocol-common[5])
7over standard input and standard output.
8
9Handshake
10---------
11
12Git starts by sending a welcome message (for example,
13"git-filter-client"), a list of supported protocol version numbers, and
14a flush packet. Git expects to read the welcome message with "server"
15instead of "client" (for example, "git-filter-server"), exactly one
16protocol version number from the previously sent list, and a flush
17packet. All further communication will be based on the selected version.
18The remaining protocol description below documents "version=2". Please
19note that "version=42" in the example below does not exist and is only
20there to illustrate how the protocol would look like with more than one
21version.
22
23After the version negotiation Git sends a list of all capabilities that
24it supports and a flush packet. Git expects to read a list of desired
25capabilities, which must be a subset of the supported capabilities list,
26and a flush packet as response:
27
28------------------------
29packet: git> git-filter-client
30packet: git> version=2
31packet: git> version=42
32packet: git> 0000
33packet: git< git-filter-server
34packet: git< version=2
35packet: git< 0000
36packet: git> capability=clean
37packet: git> capability=smudge
38packet: git> capability=not-yet-invented
39packet: git> 0000
40packet: git< capability=clean
41packet: git< capability=smudge
42packet: git< 0000
43------------------------
44
45Shutdown
46--------
47
48Git will close
49the command pipe on exit. The filter is expected to detect EOF
50and exit gracefully on its own. Git will wait until the filter
51process has stopped.