Re: [PATCH] Add --show-size to git log to print message size
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- Jul 16, 2007, 12:31 UTC
- Message-ID
- <81b0412b0707160531mad35ed4x4c89b2d6c6f5f707@mail.gmail.com>
- In-Reply-To
- <e5bfff550707160504p52770227l9af66aa750d9efd6@mail.gmail.com>
On 7/16/07, Marco Costalba <mcostalba@gmail.com> wrote:
Show 8 quoted lines
> Currently the patch just include the log message because the diff > content (-p option) is not buffered but is written with a combination > of printf, puts, fputs, fwrite and putchar directly to stdout. > > My question is, there is a way to get the quantity of bytes written to > stdout before they are printed? I'm not an expert of C stdio library, > so perhaps this is nonsense, but I was thinking of reading the size of > stout buffer before to fflush() (I don't know if it is possible).
It is not possible. Buffers can be flushed at any time (i.e. they are flushed when EOL reached and the output is a terminal for stdout).
It is also a bit unclear _why_ do you need the diff output. You don't show it immediately anyway.