From: Junio C Hamano Date: Wed, 21 Mar 2018 18:30:15 +0000 (-0700) Subject: Merge branch 'jk/attributes-path-doc' X-Git-Tag: v2.17.0-rc1~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d16c37964c284fa599251caafb51128c0df925a9?ds=inline;hp=-c Merge branch 'jk/attributes-path-doc' Doc update. * jk/attributes-path-doc: doc/gitattributes: mention non-recursive behavior --- d16c37964c284fa599251caafb51128c0df925a9 diff --combined Documentation/gitattributes.txt index d52b254a22,a2a025400b..1094fe2b5b --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@@ -56,9 -56,16 +56,16 @@@ Unspecified: When more than one pattern matches the path, a later line overrides an earlier line. This overriding is done per - attribute. The rules how the pattern matches paths are the - same as in `.gitignore` files; see linkgit:gitignore[5]. - Unlike `.gitignore`, negative patterns are forbidden. + attribute. + + The rules by which the pattern matches paths are the same as in + `.gitignore` files (see linkgit:gitignore[5]), with a few exceptions: + + - negative patterns are forbidden + + - patterns that match a directory do not recursively match paths + inside that directory (so using the trailing-slash `path/` syntax is + pointless in an attributes file; use `path/**` instead) When deciding what attributes are assigned to a path, Git consults `$GIT_DIR/info/attributes` file (which has the highest @@@ -392,14 -399,46 +399,14 @@@ Long Running Filter Proces If the filter command (a string value) is defined via `filter..process` then Git can process all blobs with a single filter invocation for the entire life of a single Git -command. This is achieved by using a packet format (pkt-line, -see technical/protocol-common.txt) based protocol over standard -input and standard output as follows. All packets, except for the -"*CONTENT" packets and the "0000" flush packet, are considered -text and therefore are terminated by a LF. - -Git starts the filter when it encounters the first file -that needs to be cleaned or smudged. After the filter started -Git sends a welcome message ("git-filter-client"), a list of supported -protocol version numbers, and a flush packet. Git expects to read a welcome -response message ("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 -version. - -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 ------------------------- -Supported filter capabilities in version 2 are "clean", "smudge", -and "delay". +command. This is achieved by using the long-running process protocol +(described in technical/long-running-process-protocol.txt). + +When Git encounters the first file that needs to be cleaned or smudged, +it starts the filter and performs the handshake. In the handshake, the +welcome message sent by Git is "git-filter-client", only version 2 is +suppported, and the supported capabilities are "clean", "smudge", and +"delay". Afterwards Git sends a list of "key=value" pairs terminated with a flush packet. The list will contain at least the filter command @@@ -485,6 -524,12 +492,6 @@@ the protocol then Git will stop the fil with the next file that needs to be processed. Depending on the `filter..required` flag Git will interpret that as error. -After the filter has processed a command it is expected to wait for -a "key=value" list containing the next command. 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. - Delay ^^^^^ @@@ -714,8 -759,6 +721,8 @@@ patterns are available - `fountain` suitable for Fountain documents. +- `golang` suitable for source code in the Go language. + - `html` suitable for HTML/XHTML documents. - `java` suitable for source code in the Java language.