Skip to content

Commit bc93d2f

Browse files
committed
rn-4: review of the "clean/smudge empty contents" topic
1 parent 8c32749 commit bc93d2f

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

‎rev_news/drafts/edition-4.md‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,32 @@ He thought that as the owner of the official Git repository it would
101101
be irresponsible for him to grant submitGit the authorization it asks
102102
for. Roberto though [fixed this issue](https://github.com/rtyley/submitgit/pull/3) a few days later.
103103

104-
<!---
105104
### Reviews
106-
-->
107105

106+
*[clean/smudge empty contents](http://thread.gmane.org/gmane.comp.version-control.git/269050)
107+
108+
Jim Hill noticed that Git issues an error message saying that copy_fd() was given a bad
109+
file descriptor when clean/smudge filters is fed an file with empty contents, found that
110+
the problem was caused because an in-memory contents that was empty was passed (by mistake)
111+
as `NULL`, instead of an empty string `""` in this codepath, but the `NULL` was used as a
112+
signal to tell Git to instead read from a given file descriptor. The fix was trivially
113+
correct and was applied.
114+
115+
The new test script, however, exhibited a flaky behaviour. Sometimes it passed, sometimes
116+
it saw EPIPE. Peff observed:
117+
118+
> Hmm, I thought we turned off SIGPIPE when writing to filters these days.
119+
> Looks like we still complain if we get EPIPE, though. I feel like it
120+
> should be the filter's business whether it wants to consume all of the
121+
> input or not[1], and we should only be checking its exit status.
122+
>
123+
> [1] As a practical example, consider a file format that has a lot of
124+
> cruft at the end. The clean filter would want to read only to the
125+
> start of the cruft, and then stop for reasons of efficiency.
126+
127+
The discussion lead to
128+
an [enhancement](http://thread.gmane.org/gmane.comp.version-control.git/269050/focus=269383)
129+
to allow clean/smudge filters to quit before reading their input fully.
108130

109131
### Support
110132

0 commit comments

Comments
(0)