From: Junio C Hamano <gitster@pobox.com>
To: Ronnie Sahlberg <sahlberg@google.com>
Cc: git@vger.kernel.org, Jonathan Nieder <jrnieder@gmail.com>,
Michael Haggerty <mhagger@alum.mit.edu>
Subject: Re: [PATCH 10/15] refs.c: allow multiple reflog updates during a single transaction
Date: Thu, 23 Oct 2014 11:54:43 -0700 [thread overview]
Message-ID: <xmqq4muusjkc.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1413919462-3458-11-git-send-email-sahlberg@google.com> (Ronnie Sahlberg's message of "Tue, 21 Oct 2014 12:24:17 -0700")
Ronnie Sahlberg <sahlberg@google.com> writes:
> @@ -3531,7 +3537,7 @@ struct ref_update {
> enum transaction_update_type update_type;
> unsigned char new_sha1[20];
> unsigned char old_sha1[20];
> - int flags; /* REF_NODEREF? */
> + int flags; /* REF_NODEREF? or private flags */
Not a very informative comment, I'd have to say. How are users of
this API expected to avoid stepping on each others' and API
implementation's toes?
> @@ -3539,8 +3545,9 @@ struct ref_update {
>
> /* used by reflog updates */
> int reflog_fd;
> - struct lock_file reflog_lock;
> + struct lock_file *reflog_lock;
What is this change about?
Does the lifetime rule for "struct lock_file" described in
Documentation/technical/api-lockfile.txt, namely, "once you call
hold_lock_file_* family on it, you cannot free it yourself", have
any implication on this?
> + if (!(update->flags & UPDATE_REFLOG_NOLOCK))
> + update->reflog_lock = xcalloc(1, sizeof(struct lock_file));
> +
Hmph, does this mean that the caller needs to keep track of the refs
it ever touched inside a single transaction, call this without nolock
on the first invocation on a particular ref and with nolock on the
subsequent invocation?
Or is the "caller" just implementation detail of the API and higher level
callers do not have to care?
next prev parent reply other threads:[~2014-10-23 18:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 19:24 [PATCH 00/15] ref-transactions-reflog Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 01/15] refs.c make ref_transaction_create a wrapper to ref_transaction_update Ronnie Sahlberg
2014-10-23 17:42 ` Junio C Hamano
2014-10-23 17:44 ` Ronnie Sahlberg
2014-10-23 17:54 ` Junio C Hamano
2014-10-28 18:40 ` Junio C Hamano
2014-10-21 19:24 ` [PATCH 02/15] refs.c: make ref_transaction_delete a wrapper for ref_transaction_update Ronnie Sahlberg
2014-10-23 17:43 ` Junio C Hamano
2014-10-21 19:24 ` [PATCH 03/15] refs.c: rename the transaction functions Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 04/15] refs.c: add a new update_type field to ref_update Ronnie Sahlberg
2014-10-23 17:47 ` Junio C Hamano
2014-10-21 19:24 ` [PATCH 05/15] refs.c: add a function to append a reflog entry to a fd Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 06/15] copy.c: make copy_fd preserve meaningful errno Ronnie Sahlberg
2014-10-23 17:51 ` Junio C Hamano
2014-10-23 17:54 ` Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 07/15] refs.c: add a transaction function to append a reflog entry Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 08/15] refs.c: add a flag to allow reflog updates to truncate the log Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 09/15] refs.c: only write reflog update if msg is non-NULL Ronnie Sahlberg
2014-10-23 18:32 ` Junio C Hamano
2014-10-28 19:17 ` Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 10/15] refs.c: allow multiple reflog updates during a single transaction Ronnie Sahlberg
2014-10-23 18:54 ` Junio C Hamano [this message]
2014-10-28 19:59 ` Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 11/15] reflog.c: use a reflog transaction when writing during expire Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 12/15] refs.c: rename log_ref_setup to create_reflog Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 13/15] refs.c: make unlock_ref/close_ref/commit_ref static Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 14/15] refs.c: remove lock_any_ref_for_update Ronnie Sahlberg
2014-10-21 19:24 ` [PATCH 15/15] refs.c: allow deleting refs with a broken sha1 Ronnie Sahlberg
-- strict thread matches above, loose matches on Subject: below --
2014-07-23 17:03 [PATCH 00/15] ref-transactions for reflogs Ronnie Sahlberg
2014-07-23 17:03 ` [PATCH 10/15] refs.c: allow multiple reflog updates during a single transaction Ronnie Sahlberg
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=xmqq4muusjkc.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=mhagger@alum.mit.edu \
--cc=sahlberg@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.