feat: added a open repo in browser command #241

Merged
Aviac merged 3 commits from lunatrium/codeberg-cli:main into main 2025-10-07 16:40:22 +02:00
Contributor

Implements #169,
uses the already used crate webbrowser for actually opening the website.
also is able to open the wiki subrepository (eg. codeberg.org/knut/foobar.wiki.git)

berg repo open

Implements #169, uses the already used crate webbrowser for actually opening the website. also is able to open the wiki subrepository (eg. codeberg.org/knut/foobar.wiki.git) `berg repo open`
Author
Contributor

This is my first pull request. Could you please give me some kind of feedback?

This is my first pull request. Could you please give me some kind of feedback?
Aviac approved these changes 2025-10-06 08:54:00 +02:00
Dismissed
Aviac left a comment
Owner

Thank you for your contribution! This looks really clean Will merge once you give me the go that you don't want to do any further changes!

Thank you for your contribution! This looks really clean ✨ Will merge once you give me the go that you don't want to do any further changes!
@ -0,0 +28,4 @@
.unwrap_or(
ctx.owner_repo()
.map(|OwnerRepo { repo, owner }| (owner, repo))?,
);
Owner

I would suggest using

        let (owner, repo) = ctx
            .args
            .owner_and_repo
            .as_ref()
            .and_then(|s| parse_owner_and_repo(s).ok())
            .or_else(|| {
                ctx.owner_repo()
                    .map(|OwnerRepo { repo, owner }| (owner, repo))
                    .ok()
            })
            .context("Couldn't determine owner and repo")?;

here instead.

I would suggest using ```rs let (owner, repo) = ctx .args .owner_and_repo .as_ref() .and_then(|s| parse_owner_and_repo(s).ok()) .or_else(|| { ctx.owner_repo() .map(|OwnerRepo { repo, owner }| (owner, repo)) .ok() }) .context("Couldn't determine owner and repo")?; ``` here instead.
Author
Contributor
let (owner, repo) = ctx
            .args
            .owner_and_repo
            .as_ref()
            .and_then(|s| parse_owner_and_repo(s).ok())
            .or_else(|| {
                ctx.owner_repo()
                    .ok()
                    .map(|OwnerRepo {repo, owner}| (owner, repo))
            })
            .context("Couldn't determine owner and repo")?;

Thanks.
Should I rebase/squash the change to a single commit or should I make a new commit?

```rust let (owner, repo) = ctx .args .owner_and_repo .as_ref() .and_then(|s| parse_owner_and_repo(s).ok()) .or_else(|| { ctx.owner_repo() .ok() .map(|OwnerRepo {repo, owner}| (owner, repo)) }) .context("Couldn't determine owner and repo")?; ``` Thanks. Should I rebase/squash the change to a single commit or should I make a new commit?
Owner

You're welcome!

You don't have to squash, I'll do that when merging. So a new commit is fine. Rebasing this on main would be useful though, so I can merge asap before new conflicts appear!

You're welcome! You don't have to squash, I'll do that when merging. So a new commit is fine. Rebasing this on main would be useful though, so I can merge asap before new conflicts appear!
Author
Contributor

refactored code so it matches with the lastest upstream changes eg. b2d662581e, 833d5e73cf.
Thank you for your help, from my side you can merge this now.

refactored code so it matches with the lastest upstream changes eg. b2d662581e, 833d5e73cf. Thank you for your help, from my side you can merge this now.
Aviac approved these changes 2025-10-07 16:40:06 +02:00
Aviac left a comment
Owner

LGTM! Thank you a lot for the contribution! 💚

LGTM! Thank you a lot for the contribution! 💚
Aviac merged commit ce43ce9db4 into main 2025-10-07 16:40:22 +02:00
Sign in to join this conversation.
No description provided.