darcs diff --last=1 > PATCH
patch -p1 <PATCH
The patch command complains that "patch unexpectedly ends in middle
of line".
2. What behaviour were you expecting instead?
3. What darcs version are you using? (Try: darcs --exact-version)
4. What operating system are you running?
If the output is redirected to a file, the output order is messed up: diff comes first, then the patch infos. Without redirection, it works
as expected: first the patch infos, then the diff output.
How is that possible?
Ah, this is buffering: when we redirect to a file, stdout is block
buffered. So the data is not written out (if small enough) and then we
invoke the external diff program. Whereas terminal output is line
buffered, so it works. The fix is simple: add a hFlush stdout after
writing the patch infos.
The following patch sent by Ben Franksen <ben.franksen@online.de> updated issue issue2704 with
status=resolved;resolvedin=2.18.1
Hash: 7448eb013527a57354b07d9ab1075b255fd13172
Author: Ben Franksen <ben.franksen@online.de>
* resolve issue2704: flush stdout before invoking external diff