From: Junio C Hamano Date: Fri, 30 Aug 2013 22:51:43 GMT Subject: Re: [PATCH v2 7/8] update-ref: support multiple simultaneous updates Message-ID: In-Reply-To: Brad King writes: > Add a --stdin signature to read update instructions from standard input > and apply multiple ref updates together. Use an input format that > supports any update that could be specified via the command-line, > including object names like 'branch:path with space'. > > Signed-off-by: Brad King > --- > Documentation/git-update-ref.txt | 21 ++++++- > builtin/update-ref.c | 121 +++++++++++++++++++++++++++++++++++++- > 2 files changed, 140 insertions(+), 2 deletions(-) > > diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt > index 0df13ff..295d0bb 100644 > --- a/Documentation/git-update-ref.txt > +++ b/Documentation/git-update-ref.txt > @@ -8,7 +8,7 @@ git-update-ref - Update the object name stored in a ref safely > SYNOPSIS > -------- > [verse] > -'git update-ref' [-m ] (-d [] | [--no-deref] []) > +'git update-ref' [-m ] (-d [] | [--no-deref] [] | --stdin) > > DESCRIPTION > ----------- > @@ -58,6 +58,25 @@ archive by creating a symlink tree). > With `-d` flag, it deletes the named after verifying it > still contains . > > +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. > +Specify updates with > +lines of the form: > + > + [--no-deref] [--] [] What is -- doing here? refs given to update-ref begin with refs/ (otherwise it is HEAD), no?