Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
`git push rad` could propose to set a base commit when the base branch has divergences
levitte opened 2 months ago

In a recent update of a patch, I encountered this failure:

$ git push -f
To rad://z2UcCU1LgMshWvXj6hXSDDrwB8q8M/z6Mku8hpprWTmCv3BqkssCYDfr2feUdyLSUnycVajFo9XVAx
 ! [remote rejected] patch/a8ec6d6 -> patches/a8ec6d69e668c81ad502f189fcf02cd1904e1b90 (could not determine target commit for canonical reference 'refs/heads/main', found diverging commits 8799f728bc1b2e8d1824d2e06557059f8c82127d and c66db16fa3a21fe301da0e27fedde461d77621d0, with base commit 8530300d045448b7b7173d8a5280d18e493edbbb and threshold 1)
error: failed to push some refs to 'rad://z2UcCU1LgMshWvXj6hXSDDrwB8q8M/z6Mku8hpprWTmCv3BqkssCYDfr2feUdyLSUnycVajFo9XVAx'

In a discussion on zulip, it turned out that I could work around this by setting the base of the new revision explictly (in this case, to the same as I had in previous revisions):

$ rad patch show a8ec6d69e668c81ad502f189fcf02cd1904e1b90 | grep Base
│ Base      8799f728bc1b2e8d1824d2e06557059f8c82127d                     │
$ git push -f -o patch.base=8799f728bc1b2e8d1824d2e06557059f8c82127d
...

It would be nice if the helper could mention that possibility for this case (and other cases where relevant). It would be nice if it could show an example with the base of the previous revision of the patch... unless that risks confusion.