From: Brad King Date: Thu, 05 Sep 2013 20:32:34 GMT Subject: Re: [PATCH v4 7/8] update-ref: support multiple simultaneous updates Message-ID: <5228EA62.7030606@kitware.com> In-Reply-To: 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 proposed format documentation for review: ------------------------------------------------------------------------- With `--stdin`, update-ref reads instructions from standard input and performs all modifications together. Specify commands of the form: create SP SP LF update SP SP [SP ] LF delete SP [SP ] LF verify SP [SP ] LF option SP LF Quote fields containing whitespace as if they were strings in C source code. Alternatively, use `-z` to specify commands without quoting: create SP NUL NUL update SP NUL NUL [] NUL delete SP NUL [] NUL verify SP NUL [] NUL option SP NUL Lines of any other format or a repeated produce an error. Command meanings are: create:: Create with only if it does not exist. update:: Update to be , verifying if given. Specify a zero to delete a ref and/or a zero to make sure that a ref does not exist. delete:: Delete , verifying if given. verify:: Verify against but do not change it. If zero or missing, the ref must not exist. option:: Specify an option to take effect for following commands. Valid options are `deref` and `no-deref` to specify whether to dereference symbolic refs. Use 40 "0" or the empty string to specify a zero value, except that with `-z` an empty is considered missing. If all s can be locked with matching s simultaneously, all modifications are performed. Otherwise, no modifications are performed. Note that while each individual is updated or deleted atomically, a concurrent reader may still see a subset of the modifications. ------------------------------------------------------------------------- Thanks, -Brad