update-ref: add support for update-symref option
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest8 patches 22 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | files-backend: extract out `create_symref_lock`refs/ | +27 | 2 replies | |
| 2/8 | reftable-backend: extract out `write_symref_with_log`refs/ | +25 | 1 reply | |
| 3/8 | reftable-backend: move `write_symref_with_log` uprefs/ | +58 | 0 replies | |
| 4/8 | refs: accept symref in `ref_transaction_add_update`branch.c builtin/ builtin/ +11 more | +46 | 0 replies | |
| 5/8 | refs/files-backend: add support for symref updatesrefs/ | +42 | 1 reply | |
| 6/8 | refs/reftable-backend: add support for symref updatesrefs/ | +19 | 1 reply | |
| 7/8 | refs: add 'update-symref' command to 'update-ref'Documentation/ builtin/ refs.c +2 more | +229 | 16 replies | |
| 8/8 | refs: support symrefs in 'reference-transaction' hookDocumentation/ refs.c t/ | +47 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/8] update-ref: add support for update-symref option
From: Karthik Nayak <[email protected]>
The 'git-update-ref(1)' command allows transactional reference updates. But currently only supports regular reference updates. Meaning, if one wants to update HEAD (symbolic ref) in a transaction, there is no tool to do so.
One option to obtain transactional updates for the HEAD ref is to manually create the HEAD.lock file and commit. This is intrusive, where the user needs to mimic internal git behavior. Also, this only works when using the files backend.
At GitLab, we've been using the manual process till date, to allow users to set and change their default branch. But with the introduction of reftables as a reference backend, this becomes a necessity to be solved within git.
This patch series goes about introducing 'update-symref' command for 'git-update-ref(1)'. This command allows the user to create symref in a transaction similar to the 'update' command of 'git-update-ref(1)'. This command also works well with the existing 'no-deref' option.
We don't create a dedicated 'create-symref' since 'update-symref' can also create symrefs. We don't create 'delete-symref', since the 'delete' command can also delete symrefs.
Karthik Nayak (8):
files-backend: extract out create_symref_lock
reftable-backend: extract out write_symref_with_log
reftable-backend: move write_symref_with_log up
refs: accept symref in ref_transaction_add_update refs/files-backend: add support for symref updates refs/reftable-backend: add support for symref updates
refs: add 'update-symref' command to 'update-ref'
refs: support symrefs in 'reference-transaction' hook
Documentation/git-update-ref.txt | 11 ++- Documentation/githooks.txt | 13 ++- branch.c | 2 +- builtin/fast-import.c | 6 +- builtin/fetch.c | 2 +- builtin/receive-pack.c | 2 +- builtin/replace.c | 2 +- builtin/tag.c | 2 +- builtin/update-ref.c | 63 +++++++++++--- refs.c | 37 ++++++--- refs.h | 9 +- refs/files-backend.c | 95 ++++++++++++++++----- refs/refs-internal.h | 12 ++- refs/reftable-backend.c | 136 ++++++++++++++++++------------- sequencer.c | 6 +- t/t0600-reffiles-backend.sh | 30 +++++++ t/t1400-update-ref.sh | 127 +++++++++++++++++++++++++++++ t/t1416-ref-transaction-hooks.sh | 27 ++++++ walker.c | 2 +- 19 files changed, 464 insertions(+), 120 deletions(-)
Signature · 1 line
2.43.GIT