Re: [PATCH 3/3] cat-file: handle streaming failures consistently

2018-10-31 Thread Jeff King
On Wed, Oct 31, 2018 at 01:38:59PM -0400, Eric Sunshine wrote: > On Tue, Oct 30, 2018 at 07:23:38PM -0400, Jeff King wrote: > > There are three ways to convince cat-file to stream a blob: > > > > - cat-file -p $blob > > > > - cat-file blob $blob > > > > - echo $batch | cat-file --batch >

Re: [PATCH 3/3] cat-file: handle streaming failures consistently

2018-10-31 Thread Eric Sunshine
On Tue, Oct 30, 2018 at 07:23:38PM -0400, Jeff King wrote: > There are three ways to convince cat-file to stream a blob: > > - cat-file -p $blob > > - cat-file blob $blob > > - echo $batch | cat-file --batch > > In the first two, we simply exit with the error code of >

Re: [PATCH 3/3] cat-file: handle streaming failures consistently

2018-10-31 Thread Jeff King
On Wed, Oct 31, 2018 at 11:23:48PM +0900, Junio C Hamano wrote: > Torsten Bögershausen writes: > > >> +static int stream_blob(const struct object_id *oid) > > > > Sorry for nit-picking: > > could this be renamed into stream_blob_to_stdout() ? > > I think that name makes sense, even though

Re: [PATCH 3/3] cat-file: handle streaming failures consistently

2018-10-31 Thread Junio C Hamano
Torsten Bögershausen writes: >> +static int stream_blob(const struct object_id *oid) > > Sorry for nit-picking: > could this be renamed into stream_blob_to_stdout() ? I think that name makes sense, even though stream_blob() is just fine for a fuction that takes a single parameter oid, as there

Re: [PATCH 3/3] cat-file: handle streaming failures consistently

2018-10-31 Thread Torsten Bögershausen
On Tue, Oct 30, 2018 at 07:23:38PM -0400, Jeff King wrote: > There are three ways to convince cat-file to stream a blob: > > - cat-file -p $blob > > - cat-file blob $blob > > - echo $batch | cat-file --batch > > In the first two, we simply exit with the error code of >

[PATCH 3/3] cat-file: handle streaming failures consistently

2018-10-30 Thread Jeff King
There are three ways to convince cat-file to stream a blob: - cat-file -p $blob - cat-file blob $blob - echo $batch | cat-file --batch In the first two, we simply exit with the error code of streaw_blob_to_fd(). That means that an error will cause us to exit with "-1" (which we try to