-
-
Notifications
You must be signed in to change notification settings - Fork 268
Ability to add custom predefined argument switches to the push menu #1684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey! Yeah, it would be great to allow users to augment the defaults provided. Though it doesn't need to be specific to the (As an aside, |
@CKolkey Agree, the custom arguments would need to be specific for each popup though, as I'll have a look at crafting a PR with this once I find some time. |
Hi @CKolkey, I've implemented a working version that I've been using on my own for a bit now, I'm curious if this approach is something you think would work well: require('neogit').setup({
builders = {
NeogitPushPopup = function(builder)
--
builder:switch('m', 'merge_request.create', 'Create merge request', { cli_prefix = '-o ', persisted = false })
end,
},
}) This would allow you to do more than just switches, basically customize the whole menu. Maybe this is too flexible? I also added a ignored_settings = vim.list_extend({ 'NeogitPushPopup--merge_request.create' }, config.values.ignored_settings) This could also replace all built-in non-persisted switches (like --force) and eventually possibly remove What do you think? |
I think that looks like a great way to expose the popups to users for customization, and I feel like this builds on top of #1546 very nicely too :) Also seems natural to add the Let me know when there is something for me to look at! |
Yeah, thats right. I think for a first-pass it's fine to just append items, but as an extension later the order key with multiples of ten seems reasonable. If you are interjecting more than 9... probably just make a custom popup. If people want full flexibility they can use the popup api to make their own, so we don't need to worry about that for the built in ones imo. Does that make sense? |
Sorry for the delay here, I've been using it at work for a month now and it has been working so great I kind of forgot about submitting the PR. I did some final cleanup and the PR is at #1705! |
No worries! I'm glad you took the time to complete this. It looks very nice, i must say. |
There's a few arguments you can pass while pushing:

It would be great if it was possible to add additional custom options here that can be appended to the push command. One example is
git push -o merge_request.create
where I would like to be able to add an argument switch on keys-m
which would add the argument-o merge_request.create
to the push command.The use-case is once I am done with my feature branch and it's time to make an MR, it's easy to do so automatically via the
merge_request.create
option.I believe
merge_request.create
is a GitLab specific option, hence why my suggested solution is the ability to append custom arguments to the push command, so you can tailor it to whatever backend you use. There's probably other useful options that can be passed via-o <option>
.Right now I have not found any alternatives, I push via the CLI every time I want to make an MR at the same time as the push.
I'd be happy to take a stab at this myself and make an MR, if this is something you guys would be OK with.
The text was updated successfully, but these errors were encountered: