Skip to content

Conversation

jakubbortlik
Copy link
Collaborator

@jakubbortlik jakubbortlik commented Jun 10, 2025

Hi @harrisoncramer, I will be very grateful if you could have a look at this PR (and those other I've opened recently). They mostly fix some smaller bugs or add some small features that I find useful (like the date format toggling).

In DiffView, oldpath is set to nil in unrenamed files, and this causes the git diff command (lua/gitlab/hunks.lua lines 101-108) to return a diff for all files instead of a single file. This in turn can cause incorrect modification type identification (e.g., lua/gitlab/hunks.lua line 204) because the algorithm can incorrectly identify a line to be in_new_range even if it's in fact looking at a diff of a completely different file.

This primarily fixes some incorrectly identified comments on unchanged text, but maybe it will also prevent some of the pesky "invalid line code" errors that still occur from time to time.

`oldpath` is set to `nil` in unrenamed files, and this causes the `git diff` command
(lua/gitlab/hunks.lua lines 101-108) to return a diff for *all* files instead of a single file.
This in turn can cause incorrect modification type identification
(e.g., lua/gitlab/hunks.lua line 204).
The luarocksVersion 3.8.0 should work better with large manifests that cause the pipeline to fail.
@jakubbortlik
Copy link
Collaborator Author

I've tried to fix the failing pipeline but with no luck.

@harrisoncramer
Copy link
Owner

Pipeline failures seem possibly related to this issue: luarocks/luarocks#1797

LGTM.

@harrisoncramer harrisoncramer merged commit e9141cf into harrisoncramer:develop Jun 19, 2025
4 of 8 checks passed
harrisoncramer added a commit that referenced this pull request Jun 25, 2025
* Fix: Jumping to renamed files (#484)

* fix: prevent "cursor position outside buffer" error

* fix: swap file_name and old_file_name in reviewer data

`old_file_name` is not set to the empty string for un-renamed files anymore, because then we can
remove the empty-line check in `comment_helpers.go` which was used to replace the empty string with
the current file name anyway.

* fix: add old_file_name to discussion root node data

* fix: also consider old_file_name when jumping to the reviewer

This fixes jumping to renamed files, however, may not work for comments that
were created on renamed files with the previous version of `gitlab.nvim` as
that version assigned the `file_name` and `old_file_name` incorrectly.

* refactor: don't shadow variable

* fix: check file_name or old_file_name based on which SHA comment belongs to

* Fix: Store reviewer data before creating comment popup (#476)

* Fix: Make publishing drafts more robust (#483)

* Fix: Swap file_name and old_file_name in reviewer data (#485)

* Feat: Enable toggling date format between relative and absolute (#491)

* Fix: Add opts to help popup (#492)

* Fix: Force start_line for jumping to diagnostic to be inside buffer (#494)

* fix: redefine colors after reloading colorscheme (#500)

* Fix: Use path instead of oldpath as fallback for unrenamed files (#496)

* Fix: Use file_name when old_file_name is not set (#495)

* fix(ci): fix lua tests (#501)

* Proxy Support (#499)

This is a #MINOR release.

---------

Co-authored-by: Jakub F. Bortlík <[email protected]>
Co-authored-by: Jonathan Duck <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants