From: Michael Haggerty <mhagger@alum.mit.edu>
To: Stefan Beller <sbeller@google.com>,
git@vger.kernel.org, jrnieder@gmail.com,
ronniesahlberg@gmail.com, gitster@pobox.com
Subject: Re: [PATCH 0/8] Making reflog modifications part of the transactions API
Date: Fri, 12 Dec 2014 17:17:16 +0100 [thread overview]
Message-ID: <548B150C.2090606@alum.mit.edu> (raw)
In-Reply-To: <1417833995-25687-1-git-send-email-sbeller@google.com>
On 12/06/2014 03:46 AM, Stefan Beller wrote:
> This goes on top of Michaels series. The idea of this series is make the
> reflogs being part of the transaction API, so it will be part of the contract
> of transaction_commit to either commit all the changes or none at all.
>
> Currently when using the transaction API to change refs, also reflogs are changed.
> But the changes to the reflogs just happen as a side effect and not as part of
> the atomic part of changes we want to commit altogether.
Would you please explain why this patch series is still needed if my
"reflog_expire()" series is accepted?
reflog_expire() already has its own little transaction. Reflog
expiration never needs to be combined with other reference changes, so
there is no need for reflog expiration to be done via a ref_transaction.
ref_transaction_commit() already updates the reflog if necessary when a
reference is updated. That update is part of the containing
ref_transaction, because it is locked by the lock on the reference
itself at the beginning of the transaction and unlocked at the end of
the transaction [1]. It can't fail in normal circumstances because the
preconditions for the transaction have already been checked.
As far as I can tell, the only thing left to do is provide a substitute
for log_ref_setup() a.k.a. create_reflog() that can be triggered within
a transaction. In my opinion the easiest way to do that is to give
ref_transaction_update()'s flag parameter an additional option,
REF_CREATE_REFLOG, which forces the reference's reflog to be created if
it does not already exist.
What am I missing?
Michael
[1] The reflog updates are not atomic in the face of disk errors and
power outages and stuff, but neither are reference updates. In other
words, I think reflog updates in ref_transaction_commit() are done as
safely as reference updates, which is surely good enough for this
reference backend. Other reference backends can do a better job with
both while staying within the existing API.
--
Michael Haggerty
mhagger@alum.mit.edu
next prev parent reply other threads:[~2014-12-12 16:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-06 2:46 [PATCH 0/8] Making reflog modifications part of the transactions API Stefan Beller
2014-12-06 2:46 ` [PATCH 1/8] refs.c: let fprintf handle the formatting Stefan Beller
2014-12-06 2:46 ` [PATCH 2/8] refs.c: rename the transaction functions Stefan Beller
2014-12-11 21:42 ` Junio C Hamano
2014-12-11 21:48 ` Stefan Beller
2014-12-06 2:46 ` [PATCH 3/8] refs.c: rename transaction.updates to transaction.ref_updates Stefan Beller
2014-12-06 2:46 ` [PATCH 4/8] refs.c: add transaction function to append to the reflog Stefan Beller
2014-12-11 21:50 ` Junio C Hamano
2014-12-06 2:46 ` [PATCH 5/8] refs.c: add transaction function to delete " Stefan Beller
2014-12-06 2:46 ` [PATCH 6/8] refs.c: use a reflog transaction when writing during expire Stefan Beller
2014-12-06 2:46 ` [PATCH 7/8] refs.c: rename log_ref_setup to create_reflog Stefan Beller
2014-12-06 2:46 ` [PATCH 8/8] refs.c: allow deleting refs with a broken sha1 Stefan Beller
2014-12-08 20:05 ` [PATCH 0/8] Making reflog modifications part of the transactions API Stefan Beller
2014-12-08 21:54 ` Jonathan Nieder
2014-12-12 16:17 ` Michael Haggerty [this message]
2014-12-12 20:51 ` Stefan Beller
2014-12-12 21:16 ` ronnie sahlberg
2014-12-14 23:17 ` Michael Haggerty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=548B150C.2090606@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
--cc=ronniesahlberg@gmail.com \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.