NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
4.03k stars 239 forks source link

Neogit Pull request link like in fugitive #1204

Closed DMunkei closed 7 months ago

DMunkei commented 7 months ago

I'm just wondering if there is a way to have the Remote URL shown after a push to a remote repository like it happens inside of Fugitive. That way I can navigate to the repository from inside from the terminal instead of having to go to the repository and then opening a PR. would be nice to have something like that.

CKolkey commented 7 months ago

Could you show me a screenshot with what you're describing? :)

DMunkei commented 7 months ago

Here's an example me pushing to a repo of mine. You can see the repos link. If it were a forked repo, going to that link would then allow you to open a PR. image

CKolkey commented 7 months ago

Oh, if you follow the nightly branch, then b o (buffer popup, open action) will open your web browser to the right page to open a PR. Requires neovim nightly, though, and for the current branch to have configured an upstream, which is done automatically with P u (push popup, upstream action).

oysandvik94 commented 7 months ago

@CKolkey I was trying this with Gitea, but nothing happens when I do b o (even though I get a PR link when I push from the commandline). I saw something in the docs that it could be configured using git config, but I'm not sure how I would do this, considering git already seems to receive a PR link.

CKolkey commented 7 months ago

Are you on nvim nightly & the nightly branch?

oysandvik94 commented 7 months ago

@CKolkey Yes, I think I updated to latest yesterday on nightly.

CKolkey commented 7 months ago

And you pushed to upstream using Pu?

oysandvik94 commented 7 months ago

Yes

oysandvik94 commented 7 months ago

I can probably fork neogit next week and see why it fails, could be some weird gitea edge cade that I can debug. Github worked fine.

CKolkey commented 7 months ago

Oh, I forgot gitea was a forge, not a client. Gitea isn't configured out of the box: https://github.com/NeogitOrg/neogit/blob/master/lua/neogit/config.lua#L188-L192

If you get it working, open a PR :)

oysandvik94 commented 7 months ago

Oh awesome, thanks! I'll do that, and I'll look at the docs I found, since I'm not sure they referred to that config you sent (or maybe they did and I didnt read properly).

CKolkey commented 7 months ago

Going to close this as it's not an issue - but do open a PR if you like :)

oysandvik94 commented 6 months ago

@CKolkey Just to provide an update on this:

I'm not sure a general solution is possible in my case. My org uses a custom domain for our gitea instance, so I'm not sure this would fit in to a general discovery. There is no way of knowing for example that my domain is for Gitea, so I wouldn't be able to determine the PR format.

A solution/stopgap would be to use the PR link that is returned on push, but this doesn't fit in with the current model of being able to just open a PR any time.

It's not a big deal though, as I can of course configure my own domain and PR template in the config.