Skip to content

Commit f1ed7fe

Browse files
aspiersgitster
authored andcommitted
Documentation: add caveats about I/O buffering for check-{attr,ignore}
check-attr and check-ignore have the potential to deadlock callers which do not read back the output in real-time. For example, if a caller writes N paths out and then reads N lines back in, it risks becoming blocked on write() to check-*, and check-* is blocked on write back to the caller. Somebody has to buffer; the pipe buffers provide some leeway, but they are limited. Thanks to Peff for pointing this out: http://article.gmane.org/gmane.comp.version-control.git/220534 Signed-off-by: Adam Spiers <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0c8e8c0 commit f1ed7fe

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Documentation/git-check-attr.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ being queried and <info> can be either:
5656
'set';; when the attribute is defined as true.
5757
<value>;; when a value has been assigned to the attribute.
5858

59+
Buffering happens as documented under the `GIT_FLUSH` option in
60+
linkgit:git[1]. The caller is responsible for avoiding deadlocks
61+
caused by overfilling an input buffer or reading from an empty output
62+
buffer.
63+
5964
EXAMPLES
6065
--------
6166

Documentation/git-check-ignore.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ not. (Without this option, it would be impossible to tell whether the
8181
absence of output for a given file meant that it didn't match any
8282
pattern, or that the output hadn't been generated yet.)
8383

84+
Buffering happens as documented under the `GIT_FLUSH` option in
85+
linkgit:git[1]. The caller is responsible for avoiding deadlocks
86+
caused by overfilling an input buffer or reading from an empty output
87+
buffer.
88+
8489
EXIT STATUS
8590
-----------
8691

Documentation/git.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,9 @@ for further details.
771771
'GIT_FLUSH'::
772772
If this environment variable is set to "1", then commands such
773773
as 'git blame' (in incremental mode), 'git rev-list', 'git log',
774-
and 'git whatchanged' will force a flush of the output stream
775-
after each commit-oriented record have been flushed. If this
774+
'git check-attr', 'git check-ignore', and 'git whatchanged' will
775+
force a flush of the output stream after each record have been
776+
flushed. If this
776777
variable is set to "0", the output of these commands will be done
777778
using completely buffered I/O. If this environment variable is
778779
not set, git will choose buffered or record-oriented flushing

0 commit comments

Comments
 (0)