Re: [PATCH] git-rev-list: give better diagnostic for failed write
- From
Jeff King <peff@peff.net>
- Date
- Jun 26, 2007, 09:06 UTC
- Message-ID
- <20070626090605.GA4349@coredump.intra.peff.net>
- In-Reply-To
- <alpine.LFD.0.98.0706251536240.8675@woody.linux-foundation.org>
On Mon, Jun 25, 2007 at 03:56:11PM -0700, Linus Torvalds wrote:
Show 9 quoted lines
> --- a/log-tree.c > +++ b/log-tree.c > @@ -408,5 +408,6 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit) > shown = 1; > } > opt->loginfo = NULL; > + flush_or_die(stdout, "stdout"); > return shown; > }
I think flushing here is a good change regardless of the error checking. Sometimes, when you are severely limiting commits, the whole output is smaller than the buffer, and you end up waiting a long time for any output even though your answer may have been found immediately.
For example, 'git-whatchanged -Sfoo' when 'foo' was introduced in the last couple of commits (but wasn't referenced before) will have to calculate diffs on all of history before producing output. Flushing after every commit restores the illusion that git provides your answer instaneously. :)
-Peff