Skip to content

Commit bd590bd

Browse files
bk2204gitster
authored andcommitted
docs: set a limit on credential line length
We recently introduced a way for credential helpers to add arbitrary state as part of the protocol. Set some limits on line length to avoid helpers passing extremely large amounts of data. While Git doesn't have a fixed parsing length, there are other tools which support this protocol and it's kind to allow them to use a reasonable fixed-size buffer for parsing. In addition, we would like to be moderate in our memory usage and imposing reasonable limits is helpful for that purpose. In the event a credential helper is incapable of storing its serialized state in 64 KiB, it can feel free to serialize it on disk and store a reference instead. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 36f7d86 commit bd590bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Documentation/git-credential.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ attribute per line. Each attribute is specified by a key-value pair,
111111
separated by an `=` (equals) sign, followed by a newline.
112112

113113
The key may contain any bytes except `=`, newline, or NUL. The value may
114-
contain any bytes except newline or NUL.
114+
contain any bytes except newline or NUL. A line, including the trailing
115+
newline, may not exceed 65535 bytes in order to allow implementations to
116+
parse efficiently.
115117

116118
Attributes with keys that end with C-style array brackets `[]` can have
117119
multiple values. Each instance of a multi-valued attribute forms an

0 commit comments

Comments
 (0)