-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add a user config for using git's external diff command for paging #4832
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
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesFootnotes
|
Took a quick glance. The rationale of introducing a new parameter while keeping the old one for backward compatibility makes sense. Which panel(s) will pick up this new feature? I am not that familiar with lazygit's internal structure to know which panels the "commit.go", "diff.go", and "worktree.go" are affecting. |
Files and Commits. I just noticed that Stashes use neither the pager command nor the external diff command, I'll see if I can fix that as part of this PR. |
@@ -309,6 +309,9 @@ git: | |||
# e.g. 'difft --color=always' | |||
externalDiffCommand: "" | |||
|
|||
# If true, Lazygit will use git's `diff.external` config for paging. The advantage over `externalDiffCommand` is that this can be configured per file type in .gitattributes; see https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver. | |||
useExternalDiffGitConfig: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have tested this feature branch. Indeed, a useExternalDiffGitConfig: true
config will have lazygit honor git's existing external diff setup, in Files panel and in Commits panel. Ship it!
2b3eea7
to
e085d32
Compare
@rayluo And now it should work for stashes too. |
@stefanhaller And now it is also tested for stashes too. :-) |
This is similar to using lazygit's Git.Paging.ExternalDiffCommand config, except that the command is configured in git. This can be done either with git's `diff.external` config, or through .gitattributes, so it gives a bit more flexibility.
e085d32
to
40e9894
Compare
PR Description
This is similar to using lazygit's
Git.Paging.ExternalDiffCommand
config, except that the command is configured in git. This can be done either with git'sdiff.external
config, or through.gitattributes
, so it gives a bit more flexibility.We could consider removing the
Git.Paging.ExternalDiffCommand
config now, because its functionality is covered by the new config. I decided to keep it though, because I don't want to make this a breaking change, and also because some users might want to have the external diff command only in lazygit but not on the command line.