git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 0/5] ref-transactions-rename

From
Ronnie Sahlberg <sahlberg@google.com>
Date
Jun 18, 2014, 17:24 UTC
Message-ID
<1403112271-21331-1-git-send-email-sahlberg@google.com>

These patches can also be found at: https://github.com/rsahlberg/git/tree/ref-transactions-rename This series is based on, and applies ontop of, the previous ref-transactions-reflog series, also found at my githup repo.

This series updates the reflog handling and converts rename_ref to use a single transaction to delete the old ref, create the new ref and to move the reflog.

In order to make the transaction fully atomic we also introduce support for using the packed refs file for performing the delete-and-create that is done during the rename. This means that the rename operation is fully atomic for all external observers and there is no longer a point in time where the sha1 is unreferenced, after the old ref has been deleted but before the new ref has been created.

Additionally, since we now use the transaction API for the reflog changes we no longer need to disallow renames for refs whose reflogs are symbolic links.

Version 3:
 - Updated to build ontop of current ref-transactions-reflog
Ronnie Sahlberg (5):
  refs.c: allow passing raw git_committer_info as email to
    _update_reflog
  refs.c: return error instead of dying when locking fails during
    transaction
  refs.c: use packed refs when deleting refs during a transaction
  refs.c: update rename_ref to use a transaction
  refs.c: rollback the lockfile before we die() in repack_without_refs
 builtin/remote.c  |  13 +-
 refs.c            | 368 +++++++++++++++++++++++++++++-------------------------
 refs.h            |   1 +
 t/t3200-branch.sh |   7 --
 4 files changed, 209 insertions(+), 180 deletions(-)
-- 
2.0.0.467.g08c0633
Next: Ronnie Sahlberg
Message 1 of 6 in “ref-transactions-rename”
  1. 0/5 ref-transactions-renameRonnie Sahlberg, Jun 18, 2014
  2. 1/5 refs.c: allow passing raw git_committer_info as email to _update_reflogRonnie Sahlberg, Jun 18, 2014
  3. 2/5 refs.c: return error instead of dying when locking fails during transactionRonnie Sahlberg, Jun 18, 2014
  4. 3/5 refs.c: use packed refs when deleting refs during a transactionRonnie Sahlberg, Jun 18, 2014
  5. 4/5 refs.c: update rename_ref to use a transactionRonnie Sahlberg, Jun 18, 2014
  6. 5/5 refs.c: rollback the lockfile before we die() in repack_without_refsRonnie Sahlberg, Jun 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.