Subject: Re: [PATCH v3] gitweb: redacted e-mail addresses feature.

From: Junio C Hamano <[email-masked]>
Date: Sun, 21 Mar 2021 11:57:58 -0700

Junio C Hamano <[email-masked]> writes:

>> @@ -8060,8 +8095,9 @@ sub git_commitdiff {
>>  		close $fd
>>  			or print "Reading git-diff-tree failed\n";
>>  	} elsif ($format eq 'patch') {
>> -		local $/ = undef;
>> -		print <$fd>;
>> +		while (my $line = <$fd>) {
>> +			print hide_mailaddr_if_private($line);
>> +		}
>
> And this is even worse.

And also Ævar is right.  The original just has a format-patch output
in $_ and prints it to the output stream in one go.  It won't make
any sense to attempt reading from that stream, which the original
code used to write to, at all.

In any case, I've already said that I do not think it is a good idea
to touch the 'patch' codepath at all, so this code won't do any
damage in the end by reading from the output pipe connected to
end-user's browser ;-)

Thanks.