@@ -392,46 +392,14 @@ Long Running Filter Process
392
392
If the filter command (a string value) is defined via
393
393
`filter.<driver>.process` then Git can process all blobs with a
394
394
single filter invocation for the entire life of a single Git
395
- command. This is achieved by using a packet format (pkt-line,
396
- see technical/protocol-common.txt) based protocol over standard
397
- input and standard output as follows. All packets, except for the
398
- "*CONTENT" packets and the "0000" flush packet, are considered
399
- text and therefore are terminated by a LF.
400
-
401
- Git starts the filter when it encounters the first file
402
- that needs to be cleaned or smudged. After the filter started
403
- Git sends a welcome message ("git-filter-client"), a list of supported
404
- protocol version numbers, and a flush packet. Git expects to read a welcome
405
- response message ("git-filter-server"), exactly one protocol version number
406
- from the previously sent list, and a flush packet. All further
407
- communication will be based on the selected version. The remaining
408
- protocol description below documents "version=2". Please note that
409
- "version=42" in the example below does not exist and is only there
410
- to illustrate how the protocol would look like with more than one
411
- version.
412
-
413
- After the version negotiation Git sends a list of all capabilities that
414
- it supports and a flush packet. Git expects to read a list of desired
415
- capabilities, which must be a subset of the supported capabilities list,
416
- and a flush packet as response:
417
- ------------------------
418
- packet: git> git-filter-client
419
- packet: git> version=2
420
- packet: git> version=42
421
- packet: git> 0000
422
- packet: git< git-filter-server
423
- packet: git< version=2
424
- packet: git< 0000
425
- packet: git> capability=clean
426
- packet: git> capability=smudge
427
- packet: git> capability=not-yet-invented
428
- packet: git> 0000
429
- packet: git< capability=clean
430
- packet: git< capability=smudge
431
- packet: git< 0000
432
- ------------------------
433
- Supported filter capabilities in version 2 are "clean", "smudge",
434
- and "delay".
395
+ command. This is achieved by using the long-running process protocol
396
+ (described in technical/long-running-process-protocol.txt).
397
+
398
+ When Git encounters the first file that needs to be cleaned or smudged,
399
+ it starts the filter and performs the handshake. In the handshake, the
400
+ welcome message sent by Git is "git-filter-client", only version 2 is
401
+ suppported, and the supported capabilities are "clean", "smudge", and
402
+ "delay".
435
403
436
404
Afterwards Git sends a list of "key=value" pairs terminated with
437
405
a flush packet. The list will contain at least the filter command
@@ -517,12 +485,6 @@ the protocol then Git will stop the filter process and restart it
517
485
with the next file that needs to be processed. Depending on the
518
486
`filter.<driver>.required` flag Git will interpret that as error.
519
487
520
- After the filter has processed a command it is expected to wait for
521
- a "key=value" list containing the next command. Git will close
522
- the command pipe on exit. The filter is expected to detect EOF
523
- and exit gracefully on its own. Git will wait until the filter
524
- process has stopped.
525
-
526
488
Delay
527
489
^^^^^
528
490
0 commit comments