Re: [PATCH 2/2] catfile.c: add --batch-command mode
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Feb 4, 2022, 16:46 UTC
- Message-ID
- <767d5f5a-8395-78bc-865f-a39acc39e061@gmail.com>
- In-Reply-To
- <74E01F50-D5B4-41F0-A6F0-BBCA462ED74A@gmail.com>
Hi John
On 04/02/2022 04:11, John Cai wrote:
Show 19 quoted lines
> Hi Junio, thanks for the review! > [...] >> So, from that point of view, >> >> begin <cmd> >> <parameter> >> <parameter> >> ... >> end >> >> may be a better design, no? > > Good point. Now I'm wondering if we can simplify where commands get queued up > and a "get" will execute them along with an implicit flush. > > <cmd> <parameter> > <cmd> <parameter> > <cmd> <parameter> > get
I think that would be an improvement (I'd suggest calling "get" "flush" instead), the begin ... get <cmd> sequence seems unnecessarily complex compared the the RFC of this series. If the user gives --buffer on the command line then we can buffer the input until we see a "flush" command and if the user does not give --buffer on the command line then we should flush the output after each command.
Best Wishes
Phillip