From c750ba9519f7e25a22072578a80ac0eafb423ed1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 Sep 2013 09:22:32 -0400 Subject: update-ref: support multiple simultaneous updates 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 Signed-off-by: Junio C Hamano --- Documentation/git-update-ref.txt | 54 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'Documentation/git-update-ref.txt') diff --git a/Documentation/git-update-ref.txt b/Documentation/git-update-ref.txt index 0df13ff6f4..0a0a5512b3 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 [-z]) DESCRIPTION ----------- @@ -58,6 +58,58 @@ 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. Specify commands of the form: + + update SP SP [SP ] LF + create 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: + + update SP NUL NUL [] NUL + create SP 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: + +update:: + Set to after verifying , if given. + Specify a zero to ensure the ref does not exist + after the update and/or a zero to make sure the + ref does not exist before the update. + +create:: + Create with after verifying it does not + exist. The given may not be zero. + +delete:: + Delete after verifying it exists with , if + given. If given, may not be zero. + +verify:: + Verify against but do not change it. If + zero or missing, the ref must not exist. + +option:: + Modify behavior of the next command naming a . + The only valid option is `no-deref` to avoid dereferencing + a symbolic ref. + +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. Logging Updates --------------- -- cgit v1.2.1