Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Change rad init default to not announce
◌ 0/1 checks passed ade wants to merge 3 commits into master · opened 2 months ago

As part of the continued effort of safe by default, rad init has been updated to --no-announce, --announce has been introduced to enable the prior behaviour. Additionally a message is supplied to the user about their repository not being announced.

Checks in progress — 0 passed, 1 pending View logs ↗
ade opened with revision cdbbedaf3551ddb483488bba76b37339f2509dc8 on base b04f487b3ae2efcd23f52f8138abe32e73a718fd +93 -17 2 months ago
ade pushed revision 2 bddb4ab4d15de12e298e739667af53aece443d77 on base b04f487b3ae2efcd23f52f8138abe32e73a718fd +104 -18 2 months ago

cli: Add interactive step for announce during init

If the visibility is private then no announcement is required, if it's public and no cli arg has been passed (--announce, --no-announce) then prompt user to choose. Defaults to no announce for safety.

did:key:z6MkrxqT...yQRh commented on revision 1 2 months ago

As rad patch review --patch is obsolete (it says so) and without --patch, the command crashes for me (see issue 2942c9b3cc41fc92a85d3d3f59c984d5da61c412), here goes my review:

That hunk:

pub(super) fn announce(&self) -> Option<bool> {
    match (self.announce, self.no_announce) {
        (false, false) => None,
        (false, true) => Some(false),
        (true, false) => Some(true),
        (true, true) => Some(false),
    }
}

could be written something like

pub(super) fn announce(&self) -> Option<bool> {
    if !self.announce && !self.no_announce {
        None
    } else {
        Some(self.announce && !self.no_announce)
    }
}

right?

Besides that it looks good to me.