On Tuesday, 09.11.2021 at 18:26 +0000, Reuben Thomas wrote:

> On Tue, 9 Nov 2021 at 17:45, Dave Ewart <[email protected]> wrote:
> 
> > To be honest I’m not sure. Feel free to inspect the source :-)
> >
> 
> As far as I can tell, STDOUT in perl is line buffered when connected to a
> terminal anyway (which should have been my case).
> 
> Perhaps therefore the problem is that the diff process, as it's running
> asynchronously, might simply interleave its output in any case, and to fix
> it it would be necessary to capture its stderr…

I must be honest, I can't replicate the issue you are seeing at all,
neither on Debian/10.x nor Ubuntu/20.04 LTS. This is using the packaged
version of colordiff (which happens to be 1.0.18 in both cases).

Testing the commands 'colordiff -r foo bar' and '/usr/bin/diff -r foo
bar' for the artificially-created test case results in this output in
both cases on Debian:

diff -r foo/afile1 bar/afile1
1c1
< Something is here
---
> Something else is here
/usr/bin/diff: foo/baz: No such file or directory
diff -r foo/file1 bar/file1
1c1
< This is a file
---
> This is another file

On Ubuntu I get the same as above for the plain diff invocation and instead:

diff: foo/baz: No such file or directory
diff -r foo/afile1 bar/afile1
1c1
< Something is here
---
> Something else is here
diff -r foo/file1 bar/file1
1c1
< This is a file
---
> This is another file

for the colordiff variant.

None of the above show your original text where the line breaks were
broken up:

-Foo
diff: bar/baz.html+Bar
: No such file or directory

As it stands it seems necessary to understand why different results are
appearing in different contexts, because it seems likely due to
something other than colordiff per se.

Dave.

-- 
Dave Ewart [email protected]

Reply via email to