Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
e3d7dfe
trim trailing slash from custom URLs
harrisoncramer Feb 26, 2024
438d126
Updated .github/CONTRIBUTING.md
harrisoncramer Feb 26, 2024
d29bd0b
Updated .github/ISSUE_TEMPLATE/bug_report.md
harrisoncramer Feb 26, 2024
a6401d9
Feat: Improve discussion tree toggling (#192)
jakubbortlik Feb 27, 2024
d985d71
Fix Multi Line Issues (Large Refactor) (#197)
harrisoncramer Feb 27, 2024
8859c47
Fix: location provider (#198)
harrisoncramer Feb 28, 2024
00e3e24
fix: add nil check for diffview performance issue (#199)
harrisoncramer Feb 28, 2024
8937783
Fix: Switch Tabs During Comment Creation (#200)
harrisoncramer Feb 28, 2024
7a3e761
Fix: Check if file is modified (#201)
harrisoncramer Feb 28, 2024
4c4f4b5
Fix: Off by 1 Error in Old Sha (#202)
harrisoncramer Feb 28, 2024
2010c24
Fix: Rebuild Diagnostics + Signs (#203)
harrisoncramer Mar 2, 2024
f6ada57
Fixes Off-By-One Issue w/ New SHA (#205)
harrisoncramer Mar 2, 2024
949e076
Fix: Reviewer Jump (#206)
harrisoncramer Mar 3, 2024
816338f
Merge branch 'main' into develop
harrisoncramer Mar 3, 2024
e6cc34c
Fix Typo In Settings Check (#209)
harrisoncramer Mar 3, 2024
d5ad0ea
fix: Calculate new line in ranged comment after all hunks correctly (…
harrisoncramer Mar 4, 2024
ca35faa
fix: range in new SHA (#212)
harrisoncramer Mar 4, 2024
6288ab5
Merge branch 'main' into develop
harrisoncramer Mar 4, 2024
1bf75e2
fix: address mIssing get_lines function (#224)
harrisoncramer Mar 26, 2024
6016624
fix: diagnostic creation for comments on deleted lines (#226)
harrisoncramer Mar 28, 2024
3e9b155
feat: Allow insecure https connection to Gitlab (#229)
harrisoncramer Mar 29, 2024
6b4fba3
Merge branch 'main' into develop
harrisoncramer Apr 3, 2024
f55852f
Merge branch 'main' into develop
harrisoncramer Apr 3, 2024
8b4ccaf
fix: remove esc keybinding (#240)
harrisoncramer Apr 4, 2024
61291a3
Removes backup register option (#242)
harrisoncramer Apr 4, 2024
09d5c55
fix: update go-gitlab and fix label code (#243)
harrisoncramer Apr 6, 2024
081ad8f
feat: enable pipeline command on main/master (#244)
harrisoncramer Apr 7, 2024
b00b168
Expose Gitlab Data via API (#235)
harrisoncramer Apr 8, 2024
db90a36
fix: line code fix (#245)
harrisoncramer Apr 8, 2024
3852084
Merge branch 'main' into develop
harrisoncramer Apr 8, 2024
bce50d0
feat: add squash and remove source branch (#230)
jakubbortlik Apr 8, 2024
50cded6
Fix: Treat INFO.labels as a table not as a string (#250)
jakubbortlik Apr 8, 2024
330c012
merged main
harrisoncramer Apr 8, 2024
77a6d92
feat: ssh remote url can have custom port (#248)
sunfuze Apr 9, 2024
2d59ac6
feat: Allow saving popup contents to temp_registers when quitting (#238)
jakubbortlik Apr 9, 2024
cc689a1
fix: Autocommand causes exit() to be called twice (#252)
jakubbortlik Apr 10, 2024
6d15f23
feat: Add keymap to copy node URL to clipboard (#253)
jakubbortlik Apr 10, 2024
77c64ae
merged main
harrisoncramer Apr 10, 2024
48a03c6
fix: do not colorize output if no info is provided (#255)
harrisoncramer Apr 10, 2024
d92bc09
Merge branch 'main' into develop
harrisoncramer Apr 10, 2024
9bdd077
feat: Copy web url of MR to clipboard (#258)
jakubbortlik Apr 11, 2024
9ab1a7a
Merge branch 'main' into develop
harrisoncramer Apr 12, 2024
7d76187
fix: Jumping to wrong buffer (#261)
harrisoncramer Apr 12, 2024
540986a
Fix: Go to last line and show warning when diagnostic is past the end…
jakubbortlik Apr 14, 2024
5df7bb3
fix: Get recent pipeline through other means (#266)
harrisoncramer Apr 14, 2024
15a02cb
feat: Add keymaps and linewise actions to layouts (#265)
jakubbortlik Apr 15, 2024
a2c79c3
ix: File comments don't have line number information (#268)
jakubbortlik Apr 16, 2024
442dea1
feat: add authentication provider setting (#270)
patrickpichler Apr 19, 2024
7aba653
Merge branch 'main' into develop
harrisoncramer Apr 19, 2024
f604c94
feat: Create and Manage Reviews (Draft Notes) (#264)
harrisoncramer Apr 19, 2024
e71e848
feat: 272 feature allow mr selection within neovim (#273)
harrisoncramer Apr 20, 2024
adc20bf
Fixes no draft notes, winbar issue (#275)
harrisoncramer Apr 20, 2024
1ecbf35
Merge branch 'main' into develop
harrisoncramer Apr 20, 2024
2c2d0eb
Fix: Restore focus (#277)
harrisoncramer Apr 20, 2024
9ec134d
fix: draft note edits + reply keybinding (#279)
harrisoncramer Apr 21, 2024
681c29e
Feat: Check feature branch is up-to-date on remote (#278)
jakubbortlik Apr 21, 2024
fa16905
feat: wrap CLI commands, toggle draft/live mode (#280)
harrisoncramer Apr 22, 2024
8affee7
fix: Update readme w/ correct packer installation (#285)
harrisoncramer Apr 22, 2024
9c22fd1
fix: non-existent buffer comments (#284)
harrisoncramer Apr 22, 2024
7a6e9c2
Merge branch 'main' into develop
harrisoncramer Apr 22, 2024
8a546af
Feat: Make toggle_draft_mode available outside discussion tree (#281)
jakubbortlik Apr 23, 2024
80fbcee
feat: allow refreshing discussion data (#288)
harrisoncramer Apr 23, 2024
8382d1f
Always refresh discussion data for discussion view toggle
harrisoncramer Apr 23, 2024
fcd8dbc
feat: support draft note replies (#290)
harrisoncramer Apr 24, 2024
475b950
remove print note
harrisoncramer Apr 24, 2024
81d7f0c
Fix: Use base_sha for calculating diff hunks (#291)
jakubbortlik Apr 24, 2024
85737e9
fix: Use backticks in code suggestions (#292)
jakubbortlik Apr 25, 2024
0115c58
Merge branch 'main' into develop
harrisoncramer Apr 28, 2024
3592d9e
Fix: Copy node url to clipboard (#295)
jakubbortlik May 5, 2024
a8b82b1
Fix: List remote branches for merge targets (#293)
jakubbortlik May 5, 2024
3dabc55
fix: consider remote branches (#297)
levouh May 5, 2024
2c7d983
Fix: Save popup contents to temp_registers (#294)
jakubbortlik May 5, 2024
75e5536
Fix: Ranged comment signs not showing (#305)
jakubbortlik Jun 10, 2024
3dd51aa
merged back main
harrisoncramer Jun 10, 2024
654e1fa
Merge branch 'main' into develop
harrisoncramer Jun 10, 2024
25ce496
remove print!
harrisoncramer Jun 11, 2024
5d17493
Fix docs: choose_merge_request's open_reviewer default value is true …
eclbg Jun 19, 2024
ac1edb9
Fix: Only set autocommands for select popups (#315)
jakubbortlik Jun 20, 2024
a32b610
Docs: Small iprovements to README and docs
jakubbortlik Jun 24, 2024
82fe076
Merge pull request #320 from jakubbortlik/docs-improvements
jakubbortlik Jun 24, 2024
f1ec78a
Feat: Add branch info to choose_merge_request menu (#318)
jakubbortlik Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ To view these help docs and to get more detailed help information, please run `:

This will checkout the branch locally, and open the plugin's reviewer pane.

NOTE: At the moment, the plugin assumes that the remote where you want to merge your feature branch
is called "origin".

For more detailed information about the Lua APIs please run `:h gitlab.nvim.api`

## Installation
Expand Down
70 changes: 37 additions & 33 deletions doc/gitlab.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ QUICK START *gitlab.nvim.quick-start*

This will checkout the branch locally, and up the plugin's reviewer pane.

NOTE: At the moment, the plugin assumes that the remote where you want to
merge your feature branch is called "origin".


INSTALLATION *gitlab.nvim.installation*

Expand All @@ -78,25 +81,25 @@ With Lazy:
<
And with Packer:
>lua
use {
"harrisoncramer/gitlab.nvim",
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim"
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
},
build = function()
require("gitlab.server").build()
end,
branch = "develop",
config = function()
require("diffview") -- We require some global state from diffview
local gitlab = require("gitlab")
gitlab.setup()
end,
}
use {
"harrisoncramer/gitlab.nvim",
requires = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"sindrets/diffview.nvim",
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
},
build = function()
require("gitlab.server").build()
end,
branch = "develop",
config = function()
require("diffview") -- We require some global state from diffview
local gitlab = require("gitlab")
gitlab.setup()
end,
}
<

CONNECTING TO GITLAB *gitlab.nvim.connecting-to-gitlab*
Expand Down Expand Up @@ -418,18 +421,18 @@ SIGNS AND DIAGNOSTICS *gitlab.nvim.signs-and-diagnostics*
By default when reviewing files, you will see diagnostics for comments that
have been added to a review. These are the default settings:
>lua
discussion_signs = {
enabled = true, -- Show diagnostics for gitlab comments in the reviewer
skip_resolved_discussion = false, -- Show diagnostics for resolved discussions
severity = vim.diagnostic.severity.INFO, -- ERROR, WARN, INFO, or HINT
virtual_text = false, -- Whether to show the comment text inline as floating virtual text
use_diagnostic_signs = true, -- Show diagnostic sign (depending on the `severity` setting, e.g., I for INFO) along with the comment icon
priority = 100, -- Higher will override LSP warnings, etc
icons = {
comment = "→|",
range = " |",
discussion_signs = {
enabled = true, -- Show diagnostics for gitlab comments in the reviewer
skip_resolved_discussion = false, -- Show diagnostics for resolved discussions
severity = vim.diagnostic.severity.INFO, -- ERROR, WARN, INFO, or HINT
virtual_text = false, -- Whether to show the comment text inline as floating virtual text
use_diagnostic_signs = true, -- Show diagnostic sign (depending on the `severity` setting, e.g., I for INFO) along with the comment icon
priority = 100, -- Higher will override LSP warnings, etc
icons = {
comment = "→|",
range = " |",
},
},
},

When the cursor is on a diagnostic line you can view the discussion thread by
using `vim.diagnostic.show()`.
Expand Down Expand Up @@ -630,9 +633,10 @@ default arguments outlined under "Configuring the Plugin".
*gitlab.nvim.choose_merge_request*
gitlab.choose_merge_request({opts}) ~

Choose a merge request from a list of those open in your current project to review.
This command will automatically check out that branch locally, and optionally
open the reviewer pane. This is the default behavior.
Choose a merge request from a list of those open in your current project to
review. This command will automatically check out the feature branch locally,
and by default also open the reviewer pane (this can be overridden with the
`open_reviewer` parameter).
>lua
require("gitlab").choose_merge_request()
require("gitlab").choose_merge_request({ open_reviewer = false })
Expand Down
2 changes: 0 additions & 2 deletions lua/gitlab/actions/create_mr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ M.create_mr = function()
forked_project_id = forked_project_id,
}

vim.print(body)

job.run_job("/create_mr", "POST", body, function(data)
u.notify(data.message, vim.log.levels.INFO)
M.reset_state()
Expand Down
2 changes: 1 addition & 1 deletion lua/gitlab/actions/merge_requests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ M.choose_merge_request = function(opts)
vim.ui.select(state.MERGE_REQUESTS, {
prompt = "Choose Merge Request",
format_item = function(mr)
return string.format("%s (%s)", mr.title, mr.author.name)
return string.format("%s [%s -> %s] (%s)", mr.title, mr.source_branch, mr.target_branch, mr.author.name)
end,
}, function(choice)
if not choice then
Expand Down
18 changes: 13 additions & 5 deletions lua/gitlab/actions/summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,20 @@ M.summary = function()
description_popup,
M.edit_summary,
miscellaneous.attach_file,
{ cb = exit, action_before_close = true, save_to_temp_register = true }
{ cb = exit, action_before_close = true, action_before_exit = true, save_to_temp_register = true }
)
state.set_popup_keymaps(
title_popup,
M.edit_summary,
nil,
{ cb = exit, action_before_close = true, action_before_exit = true }
)
state.set_popup_keymaps(
info_popup,
M.edit_summary,
nil,
{ cb = exit, action_before_close = true, action_before_exit = true }
)
state.set_popup_keymaps(title_popup, M.edit_summary, nil, { cb = exit, action_before_close = true })
state.set_popup_keymaps(info_popup, M.edit_summary, nil, { cb = exit, action_before_close = true })
miscellaneous.set_cycle_popups_keymaps(popups)

vim.api.nvim_set_current_buf(description_popup.bufnr)
Expand Down Expand Up @@ -151,8 +161,6 @@ M.edit_summary = function()
u.notify(data.message, vim.log.levels.INFO)
state.INFO.description = data.mr.description
state.INFO.title = data.mr.title
M.layout:unmount()
M.layout_visible = false
end)
end

Expand Down
28 changes: 18 additions & 10 deletions lua/gitlab/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ M.set_popup_keymaps = function(popup, action, linewise_action, opts)
local text = u.get_buffer_text(popup.bufnr)
if opts.action_before_close then
action(text, popup.bufnr)
vim.api.nvim_buf_delete(popup.bufnr, {})
exit(popup, opts)
else
vim.api.nvim_buf_delete(popup.bufnr, {})
exit(popup, opts)
action(text, popup.bufnr)
end
end, { buffer = popup.bufnr, desc = "Perform action" })
Expand All @@ -312,18 +312,26 @@ M.set_popup_keymaps = function(popup, action, linewise_action, opts)
end, { buffer = popup.bufnr, desc = "Perform linewise action" })
end

vim.api.nvim_create_autocmd("BufWinLeave", {
buffer = popup.bufnr,
callback = function()
if opts.save_to_temp_register then
if opts.save_to_temp_register then
vim.api.nvim_create_autocmd("BufWinLeave", {
buffer = popup.bufnr,
callback = function()
local text = u.get_buffer_text(popup.bufnr)
for _, register in ipairs(M.settings.popup.temp_registers) do
vim.fn.setreg(register, text)
end
end
exit(popup, opts)
end,
})
end,
})
end

if opts.action_before_exit then
vim.api.nvim_create_autocmd("BufWinLeave", {
buffer = popup.bufnr,
callback = function()
exit(popup, opts)
end,
})
end
end

-- Dependencies
Expand Down