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

[PATCH 0/2] Write multi-ref updates directly to packed refs

From
Ronnie Sahlberg <sahlberg@google.com>
Date
Jun 5, 2014, 23:26 UTC
Message-ID
<1402010788-8236-1-git-send-email-sahlberg@google.com>

This patch adds support to the transaction system to update all non-refs as packed refs instead of loose refs.

This series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions-req-packed-refs

This series adds support to have transaction write updates to packed refs instead of as loose refs. If the transaction only contains a single update to a single ref, such as the commit case, we continue to update this as locking and writing to the loose ref file. But If on the other hand the transaction will update more than one ref, then we perform all these updates inside the packed refs file and remove all the affected loose refs files. This allows us to both perform deletes (added previously) as well as updates-of-more-than-one-ref as one single atomic rename operation.

Since the transactions will now by default write directly to the packed refs file for updates to more than one ref, we no longer need to provide a pacekd refs api to builtin/clone.c any more. So lets change clone.c to use a transaction. This removes 4 fucntions from the refs.c API we can now unexport and make static.

This change means that clone will now apear as one single atomic operation to any external observer where all refs appear at once instead of one ref becoming visible at a time.

Ronnie Sahlberg (2):
  refs.c: write updates to packed refs when a transaction has more than
    one ref
  refs.c: make the *_packed_refs functions static
 builtin/clone.c | 16 ++++++++---
 refs.c          | 82 ++++++++++++++++++++++++++++++++++++++++-----------------
 refs.h          | 28 --------------------
 3 files changed, 70 insertions(+), 56 deletions(-)
-- 
2.0.0.583.g402232d
Next: Ronnie Sahlberg
Message 1 of 5 in “Write multi-ref updates directly to packed refs”
  1. 0/2 Write multi-ref updates directly to packed refsRonnie Sahlberg, Jun 5, 2014
  2. 1/2 refs.c: write updates to packed refs when a transaction has more than one refRonnie Sahlberg, Jun 5, 2014
  3. Eric SunshineJun 8, 2014
  4. Ronnie SahlbergJun 9, 2014
  5. 2/2 refs.c: make the *_packed_refs functions staticRonnie Sahlberg, Jun 5, 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.