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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux