Re: [PATCH] Add --show-size to git log to print message size
- From
- Marco Costalba <mcostalba@gmail.com>
- Date
- Jul 16, 2007, 12:04 UTC
- Message-ID
- <e5bfff550707160504p52770227l9af66aa750d9efd6@mail.gmail.com>
- In-Reply-To
- <7vodiehko7.fsf@assigned-by-dhcp.cox.net>
On 7/14/07, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> "Marco Costalba" <mcostalba@gmail.com> writes: > > > "size" is a bit vague here. What if we later want to extend > things so that you can ask for the entire log entry size > including the patch output part (I am not saying that would be > an easy change --- I am more worried about the stability of the > external interface). So is --show-"size". "message-size" would > have been a bit easier to swallow, but I sense the problem runs > deeper. >
I'm rewriting the patch + documentation cleaned up and with a different option name (--show-log).
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).
If it is not possible I have to give up in extending the scope of this 'show me the size' patch to diff content and I will stick to the proper name --show-log.
Thanks Marco