From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: "Jeff King" <peff@peff.net>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Stefan Beller" <sbeller@google.com>,
"Git Mailing List" <git@vger.kernel.org>,
"Jay Soffian" <jaysoffian@gmail.com>,
"Björn Gustavsson" <bgustavsson@gmail.com>
Subject: Re: Why is "git fetch --prune" so much slower than "git remote prune"?
Date: Fri, 20 Mar 2015 00:04:42 -0700 [thread overview]
Message-ID: <xmqq7fucgned.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <550BA76C.80501@alum.mit.edu> (Michael Haggerty's message of "Fri, 20 Mar 2015 05:51:56 +0100")
Michael Haggerty <mhagger@alum.mit.edu> writes:
> The lock conflict scenario is the only one that really worries me.
Actually, I'd feel worried if this were on the receive-pack side, as
it is entirely valid that two or more people make uncoordinated push
into a single meeting point, but much less for something like
"fetch". I do not see a valid reason why somebody cannot avoid
fetching into the same repository in a racy way.
> But I don't think it is *so* hard to keep the current "best-effort"
> behavior.
I agree that transaction is a wrong way to look at this. I view "We
know packed refs is a lot more efficient if written once" as in the
same category as "We know we will register many new objects with
this operation, so instead of creating them into separate loose
object files, declare that the object store is 'plugged' and send
them into a single new packfile" (aka "bulk checkin"). Both are
uninterested in all-or-none execution, but merely want to declare a
boundary between a group of operations to help Git optimize them.
> I am working on a function delete_refs() for the reference API
> that deletes a bunch of references on a "best effort" basis, reporting
> per-reference errors for any deletions that fail.
I think it would make sense, but I suspect you would want to make it
clear that the function is best-effort-bulk somewhere in its name
(e.g. delete-refs-if-able or something) and make it not to
automatically fail the surrounding transaction if any. That way
an application could do things like this:
transaction-begin;
create-ref;
update-ref;
...
delete-refs-if-able;
if trying to be as atomic as possible
then
if previous delete-refs-if-able found undeletable refs
then
transaction-abort;
fi
fi
transaction-commit;
Of course, supplying delete-refs that is not best-effort separately
would make it even easier to code the above (the last if/then/fi will
become unnecessary).
prev parent reply other threads:[~2015-03-20 7:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 16:48 Why is "git fetch --prune" so much slower than "git remote prune"? Ævar Arnfjörð Bjarmason
2015-03-06 22:59 ` Jeff King
2015-03-19 14:49 ` Michael Haggerty
2015-03-19 17:14 ` Jeff King
2015-03-19 19:24 ` Junio C Hamano
2015-03-19 21:26 ` Jeff King
2015-03-20 4:51 ` Michael Haggerty
2015-03-20 7:04 ` Junio C Hamano [this message]
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=xmqq7fucgned.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=bgustavsson@gmail.com \
--cc=git@vger.kernel.org \
--cc=jaysoffian@gmail.com \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
--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.