Skip to content
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

Improve clicking in diff view to enter staging/patch building #3985

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

stefanhaller
Copy link
Collaborator

@stefanhaller stefanhaller commented Oct 11, 2024

When using delta with the --hyperlinks --hyperlinks-file-link-format="lazygit-edit://{path}:{line}" option, you can now click on a line that has an underlined line number, and it will take you straight to the staging panel (when you're in the files panel) or the patch building panel (when you're looking at a commit). Previously this was already possible when a single file was selected in the files panel; but it didn't work when a directory was selected, or when looking at the diff of a commit.

See #3986 for more information.

The implementation is a very rough proof of concept only; don't review the code (yet).

Copy link

codacy-production bot commented Oct 11, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 052974b1 40.17%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (052974b) Report Missing Report Missing Report Missing
Head commit (a20477d) 50784 43598 85.85%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3985) 239 96 40.17%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Apparently this was an attempt at working around go's lack of default arguments,
but it's very unidiomatic and a bit confusing. Make it a normal parameter
instead, so all clients have to pass it explicitly.
I can only guess here: maybe they were added to more clearly document the public
interface of the classes? If so, I don't think that works. Developers who are
not familiar with the convention will just add a new public method to the class
without updating the interface.
This involves first switching to the commit files view, and then entering the
clicked file from there.
@stefanhaller stefanhaller force-pushed the use-delta-hyperlinks-for-clicking-in-diff branch from 5e84f7e to a20477d Compare October 13, 2024 15:26
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.

Improve clicking in diff view to enter staging/patch building
1 participant