Re: [PATCH v2 7/8] update-ref: support multiple simultaneous updates
- From
Brad King <brad.king@kitware.com>
- Date
- Sep 2, 2013, 17:23 UTC
- Message-ID
- <5224C990.8070701@kitware.com>
- In-Reply-To
- <xmqqbo4eyeps.fsf@gitster.dls.corp.google.com>
On 08/30/2013 06:51 PM, Junio C Hamano wrote:
Show 13 quoted lines
> Brad King <brad.king@kitware.com> 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. >> +Use single-quotes to enclose whitespace and backslashes and an >> +unquoted backslash to escape a single quote. > > That is somewhat unusual. > > When we need to deal with arbitrary strings (like pathnames), other > parts of the system usually give the user two interfaces, --stdin > with and without -z, and the strings are C-quoted when run without > the -z option, and terminated with NUL when run with the -z option.
Great, this was the kind of suggestion I was looking for in the original PATCH/RFC cover letter. Thanks. I'll start with the C-quoted version and think about adding -z once we've agreed on that format.
Show 7 quoted lines
>> +Specify updates with >> +lines of the form: >> + >> + [--no-deref] [--] <ref> <newvalue> [<oldvalue>] > > What is -- doing here? refs given to update-ref begin with refs/ > (otherwise it is HEAD), no?
The existing update-ref command line can be used to create all kinds of refs, even starting in "-". I didn't want to add any restriction in the stdin format. I'm not opposed to it though.
Thanks, -Brad