Closed sportshead closed 2 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.
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.
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.
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 })
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.
git remote set-url --push origin
to get the url instead of parsing fromgit remote -v
string.match
instead ofstring.find
handler_options.git_remotes
that takes astring[]
orfunction(fname: string): string[]
, indicating the order of remote names to search for a valid URLFixes #45, #56 Supersedes #24