App-karr
view release on metacpan or search on metacpan
local path is taken off the native transport, because libgit2's local
transport pushes to the remote's fetch URL rather than the URL it
connected to -- writing `refs/karr/*` into the wrong repository and
calling it success; the CLI fallback lands at the push URL, and the
detection is narrow enough to leave every real transport to libgit2
(k208).
- `karr sync` reports what a fetch moved correctly against libgit2 1.9,
by requiring `Git::Native 0.006`. 0.006 takes `git_fetch_options.prune`
from `Git::Libgit2::fetch_options_prune_offset` rather than a constant
derived from libgit2 1.5; against 1.9 -- where the embedded callbacks
struct is 128 bytes, not 120 -- that constant put the prune value eight
bytes early, on the `update_refs` callback pointer 1.9 prefers over
`update_tips`. `App::karr::Git::_fetch_refspecs` reads the fetch
result's `updated` list to decide what a sync moved, so a fetch that
did report ref updates was the case that misread it.
- Parallel writes and fresh clones stopped losing races (k172, k173,
k181, k182, k183). Eight `karr create` at once handed id 8 to two
cards, because a pull adopted a remote counter behind the local one;
the counter is now merged, taken only when ahead and compare-and-swapped
lib/App/karr/Git.pm view on Meta::CPAN
# refspec can never apply one. push has always been forced; pull was not, and
# libgit2 declines a non-ff fetch update without raising an error, so pull
# returned success while leaving the ref stale -- and the next push then
# force-wrote that stale ref over the other agent's work (#40). Both
# directions are forced now; see _fetch_refspec for the pull side.
#
# The semantics this settles on are last-writer-wins, which is what the
# parentless-commit design already implied everywhere else. Doing better
# would need compare-and-swap on the ref (git_reference_create_matching,
# unbound in Git::Libgit2 -- see ticket #81) plus per-ref rejection reporting
# from libgit2's update_tips/push_update_reference callbacks (not installed
# by Git::Native -- ticket #80). Neither is reachable from karr today.
use constant BOARD_REFSPEC => '+refs/karr/*:refs/karr/*';
use constant BOARD_ROOT => 'refs/karr/';
# The board's identity (#95): stamped once at board birth, compared on every
# pull before any reconciliation -- see _check_board_identity. Declared with
# the other namespace constants because use constant is only visible from its
# textual point on, and _check_board_identity needs it.
use constant BOARD_ID_REF => 'refs/karr/meta/board-id';
lib/App/karr/Role/TaskMutation.pm view on Meta::CPAN
# same string; this role needs it directly because it reads the OID and the
# content together (App::karr::Git::read_ref_with_oid), which is the pair a
# compare-and-swap has to guard against, and no BoardStore method hands both
# back.
sub _task_data_ref {
my ($self, $id) = @_;
return "refs/karr/tasks/$id/data";
}
# The one way a callback can say "there is nothing here to write". A
# package-lexical scalar ref, compared by address, because the callbacks on
# this path return whatever their last statement happened to evaluate to -- a
# title, a status, the result of a clearer -- and no value a caller can
# construct by accident is this one.
#
# The address is read with Scalar::Util::refaddr, which is how identity is
# asked in this distribution (App::karr::SyncGuard keys its registry of armed
# guards the same way). It also settles the overloading question instead of
# stepping around it: refaddr returns the address itself and never consults an
# overloaded `==`, so a blessed return value cannot be asked a comparison it
# would answer with an exception.
( run in 1.216 second using v1.01-cache-2.11-cpan-364913b4093 )