Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v4 2/3] diff: Let "git diff -O" read orderfile from any file, fail properly

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:28

Antoine Pelisse [off-list ref] writes:
I'm not sure about the deadlock though. Both read and write will wait
for each other to start operating on the fifo.
It is true only if the fifo already exists.  That is, if you did
this:

	a lot of &&
        commands &&
        before &&
        mkfifo fifo &&
        feed >fifo &

	git diff -Ofifo
        
the consumer may attempt to open and read fifo when the other
process is still running a lot of commands, no?
You can probably fix the &&-chain by doing something like:

    mkfifo order_fifo && {
        cat order_file_$i >order_fifo &
        git diff -O order_fifo --name-only HEAD^..HEAD >actual
    } && ...

Also, "rm -f order_fifo" should probably be done in test_when_finished
rather than at the beginning of the test.

Antoine,
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help