-
As the title says, how does one accomplish a push to Gerrit? A push to a "regular" repo, e.g. Github-based, would be something like: Git cmdline equivalent: And that's all to it. But with Gerrit I'm struggling to push, as that looks a bit different to the regular push: When using Magit I ended up writing my own transient prefix: Is there a way to do this in Neogit? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hmm. I think you could do something like: local original_fn = require("neogit.lib.git.push").push_interactive
local wrapper_fn = function(remote, branch, args)
original_fn(remote, "HEAD:refs/for/" .. branch, args)
end
require("neogit.lib.git.push").push_interactive = wrapper_fn If that needs to be changed on a per-project basis, you could consider setting an ENV variable with something like direnv for the project and reading that in the wrapper function. |
Beta Was this translation helpful? Give feedback.
If you make a fork, sure. Add a line in
lua/neogit/popups/push/init.lua
for a new action, andaction.lua
in that folder for the function. (or just do it inline, doesn't matter).But there's no built-in mechanism to do custom popup commands (at this time).
If you have a repo that exclusively uses gerrit, you could do something like
vim.loop.os_getenv("USE_GERRIT")
to determine if you should modify the branch argument being passed or not.