Re: [PATCH v4 2/3] diff: Let "git diff -O" read orderfile from any file, fail properly
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2013, 23:11 UTC
- Message-ID
- <xmqqvbynkr8e.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CALWbr2zXNF-aJHHnBnW1q1yaCmWt-rmMWypBWFanTBAK1pMWiQ@mail.gmail.com>
Antoine Pelisse <apelisse@gmail.com> 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?Show 12 quoted lines
>
> 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,