Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
remote-helper: Improve Handling of Divergence
Merged lorenz opened 7 months ago

This patch improves how the remote helper handles divergence.

Without quorum for the default branch, the remote helper would report an error, suggesting that the patch was not updated, while, inconsistently, actually updating the ref in storage without creating a new revision.

$ git push …
To rad://z…5/z…z
…
 ! [remote rejected]       612… -> patches/a77… (…)
error: failed to push some refs to 'rad://z…5/z…z'
…
$ git ls-remote rad://z…5/z…z
612…        refs/heads/patches/a77…

This is very confusing.

Fix this by only calling push_ref after the base of the revision (and the user provided a message, just in case that errors) is known.

While at it, also move the logic into patch_base and share it between patch_open and patch_update. Computation of the canonical head via stored.canonical_head is moved to a branch that is only taken if the user did not specify a base explicitly. This allows to update patches even when there is no quorum for the default branch.

remote-helper: Check base when matching revisions

It is impossible to preserve the head of a revision and only change the base of same revision via push.

Strenghthen the precondition for skipping updates to also consider the base commit.

lorenz opened with revision 0bac4558 on base ee49e287 +40 -26 7 months ago

This patch improves how the remote helper handles divergence.

Without quorum for the default branch, the remote helper would report an error, suggesting that the patch was not updated, while, inconsistently, actually updating the ref in storage without creating a new revision.

$ git push …
To rad://z…5/z…z
…
 ! [remote rejected]       612… -> patches/a77… (…)
error: failed to push some refs to 'rad://z…5/z…z'
…
$ git ls-remote rad://z…5/z…z
612…        refs/heads/patches/a77…

This is very confusing.

Fix this by only calling push_ref after the base of the revision (and the user provided a message, just in case that errors) is known.

While at it, also move the logic into patch_base and share it between patch_open and patch_update. Computation of the canonical head via stored.canonical_head is moved to a branch that is only taken if the user did not specify a base explicitly. This allows to update patches even when there is no quorum for the default branch.

remote-helper: Check base when matching revisions

It is impossible to preserve the head of a revision and only change the base of same revision via push.

Strenghthen the precondition for skipping updates to also consider the base commit.

lorenz pushed revision 2 dadfd90e on base ee49e287 +40 -26 7 months ago

Fix commit message.

lorenz pushed revision 3 76ccbd10 on base ee49e287 +158 -120 7 months ago

Fix

lorenz pushed revision 4 a9552fc0 on base 9c8ab7fa +148 -120 7 months ago
fintohaps pushed revision 5 867f5499 on base 9c8ab7fa +148 -120 7 months ago

REVIEW

Generally, looks good to me and nice use of Drop.

Review consists of:

  • A crucial change in using and_then rather than map
  • A nit in naming of the struct
lorenz pushed revision 6 4617d2ab on base 9c8ab7fa +148 -120 7 months ago

Squash in review.

fintohaps pushed revision 7 1a399cf0 on base 5cd016b5 +148 -120 6 months ago

Rebase

fintohaps merged revision 1a399cf0 at 5caa7b30 6 months ago