path: root/Documentation/technical
diff options
authorJunio C Hamano <>2018-02-13 21:39:15 (GMT)
committerJunio C Hamano <>2018-02-13 21:39:15 (GMT)
commit417c04c5a926d6c7b2dff22a460ec6dc49147df5 (patch)
tree9a2f35e1bda48d7112f87f2092dbe19b622a2b2e /Documentation/technical
parent1772ad1125a6f8a5473d73bbd17162bb20ebd825 (diff)
parentaddad10594583092ad92a4b82c40040b913bb8ee (diff)
Merge branch 'jt/long-running-process-doc'
Doc updates. * jt/long-running-process-doc: Docs: split out long-running subprocess handshake
Diffstat (limited to 'Documentation/technical')
1 files changed, 50 insertions, 0 deletions
diff --git a/Documentation/technical/long-running-process-protocol.txt b/Documentation/technical/long-running-process-protocol.txt
new file mode 100644
index 0000000..aa0aa9a
--- /dev/null
+++ b/Documentation/technical/long-running-process-protocol.txt
@@ -0,0 +1,50 @@
+Long-running process protocol
+This protocol is used when Git needs to communicate with an external
+process throughout the entire life of a single Git command. All
+communication is in pkt-line format (see technical/protocol-common.txt)
+over standard input and standard output.
+Git starts by sending a welcome message (for example,
+"git-filter-client"), a list of supported protocol version numbers, and
+a flush packet. Git expects to read the welcome message with "server"
+instead of "client" (for example, "git-filter-server"), exactly one
+protocol version number from the previously sent list, and a flush
+packet. All further communication will be based on the selected version.
+The remaining protocol description below documents "version=2". Please
+note that "version=42" in the example below does not exist and is only
+there to illustrate how the protocol would look like with more than one
+After the version negotiation Git sends a list of all capabilities that
+it supports and a flush packet. Git expects to read a list of desired
+capabilities, which must be a subset of the supported capabilities list,
+and a flush packet as response:
+packet: git> git-filter-client
+packet: git> version=2
+packet: git> version=42
+packet: git> 0000
+packet: git< git-filter-server
+packet: git< version=2
+packet: git< 0000
+packet: git> capability=clean
+packet: git> capability=smudge
+packet: git> capability=not-yet-invented
+packet: git> 0000
+packet: git< capability=clean
+packet: git< capability=smudge
+packet: git< 0000
+Git will close
+the command pipe on exit. The filter is expected to detect EOF
+and exit gracefully on its own. Git will wait until the filter
+process has stopped.