Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-05 Thread Brad King
On 9/5/2013 5:23 PM, Junio C Hamano wrote: > Brad King writes: >> create SP NUL NUL >> update SP NUL NUL [] NUL > > That SP in '-z' format looks strange. Was there a reason why NUL > was inappropriate? The precedent I saw in the -z survey I posted is that NUL is used to terminate

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-05 Thread Junio C Hamano
Brad King writes: > On 09/04/2013 05:27 PM, Junio C Hamano wrote: >> I am not saying the above is the best format, but the point is that >> the mode of the operation defines the structure > > Great, thanks for your comments. Based on that I've prototyped a > new format. Rather than jumping stra

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-05 Thread Brad King
On 09/04/2013 05:27 PM, Junio C Hamano wrote: > I am not saying the above is the best format, but the point is that > the mode of the operation defines the structure Great, thanks for your comments. Based on that I've prototyped a new format. Rather than jumping straight to the patch, here is my

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-04 Thread Junio C Hamano
Brad King writes: > Nothing else uses LF NUL. I chose it as a starting point for > this very discussion, which I asked about in $gmane/233653. The primary reason why LF raised my eyebrow was because the reason why many subcommands use "-z" (and NUL) is often because the payload may have LF in a

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-04 Thread Brad King
On 09/04/2013 02:23 PM, Junio C Hamano wrote: > "whitespace-separated" implies that we may allow fields separated with not a > single SP, but with double SPs or even HTs between them. I personally do not > think we should be so loose Okay, I will look at making it more strict. See proposed form

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-04 Thread Brad King
On 09/04/2013 03:17 PM, Junio C Hamano wrote: > Brad King writes: >> +static void update_refs_stdin_read_n() >> +static void update_refs_stdin_read_z() > > These need to be defined with explicit (void) argument list. Oops, fixed. Thanks, -Brad -- To unsubscribe from this list: send the line "un

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-04 Thread Junio C Hamano
Brad King writes: > +static void update_refs_stdin_read_n() > +{ > + struct strbuf line = STRBUF_INIT; > + > + while (strbuf_getline(&line, stdin, '\n') != EOF) > + update_refs_stdin_parse_line(line.buf); > + > + strbuf_release(&line); > +} > + > +static void update_refs_s

Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates

2013-09-04 Thread Junio C Hamano
Brad King writes: > +With `--stdin`, update-ref reads instructions from standard input and > +performs all modifications together. Empty lines are ignored. > +Each non-empty line is parsed as whitespace-separated arguments. "whitespace-separated" implies that we may allow fields separated with