chrishrb / gx.nvim

Implementation of gx without the need of netrw
Apache License 2.0
186 stars 19 forks source link

fix: improve git handler regexes #46

Closed sportshead closed 2 months ago

sportshead commented 4 months ago

Fixes #45, #56 Supersedes #24

phanen commented 4 months ago

Would be better to use git remote set-url --no-push? Sometimes I just pull from one repo and push to my fork repo, so the /issues link may not exist in my own repo.

chrishrb commented 3 months ago

for me this handler works as expected. 👍

@sportshead what do you think about the suggestion from @phanen? After this is resolved, this PR can be merged.

sportshead commented 3 months ago

for me this handler works as expected. 👍

@sportshead what do you think about the suggestion from @phanen? After this is resolved, this PR can be merged.

@chrishrb @phanen - thanks for the comments, I'll add an option to allow configuring whether to use the push url or not, to give the user the most flexibility.

phanen commented 3 months ago

And maybe it would be better to execute git on the parent dir of buffer(:

local path = vim.fs.dirname(vim.api.nvim_buf_get_name(0))
local exit_code, result = require("gx.shell").execute("git", { "-C", path, "remote", "get-url", "--no-push", remote })
sportshead commented 2 months ago

Apologies for the late fixes @chrishrb. Got very busy and forgot about this PR. I've rebased the PR and added a git_remote_push option defaulting to false, which should resolve @phanen's suggestion.