-
-
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
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.54.2` -> `v0.55.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary> ### [`v0.55.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.55.0) [Compare Source](jesseduffield/lazygit@v0.54.2...v0.55.0) <!-- Release notes generated using configuration in .github/release.yml at v0.55.0 --> #### What's Changed ##### Enhancements 🔥 - Allow filtering the keybindings menu by keybinding by [@​stefanhaller](https://github.com/stefanhaller) in [#​4821](jesseduffield/lazygit#4821) - Add support for suspending LazyGit with Ctrl+Z on Unix systems by [@​cowboy8625](https://github.com/cowboy8625) in [#​4757](jesseduffield/lazygit#4757) - Add "CopyToClipboard" command to `ConfirmationController` by [@​kyu08](https://github.com/kyu08) in [#​4810](jesseduffield/lazygit#4810) - Add a user config for using git's external diff command for paging by [@​stefanhaller](https://github.com/stefanhaller) in [#​4832](jesseduffield/lazygit#4832) - Log the hash of dropped stashes by [@​stefanhaller](https://github.com/stefanhaller) in [#​4850](jesseduffield/lazygit#4850) ##### Fixes 🔧 - Fix right-alignment of divergence from base branch for branch checked out in a worktree by [@​stefanhaller](https://github.com/stefanhaller) in [#​4824](jesseduffield/lazygit#4824) - Support Azure DevOps vs-ssh.visualstudio.com SSH remotes as hosting provider by [@​Kahitar](https://github.com/Kahitar) in [#​4822](jesseduffield/lazygit#4822) - Improve display of "esc" keybinding in the keybindings status bar by [@​stefanhaller](https://github.com/stefanhaller) in [#​4819](jesseduffield/lazygit#4819) - Use external diff command in stashes panel by [@​stefanhaller](https://github.com/stefanhaller) in [#​4836](jesseduffield/lazygit#4836) - Remove the git.paging.useConfig option by [@​stefanhaller](https://github.com/stefanhaller) in [#​4837](jesseduffield/lazygit#4837) - Don't auto-forward branches that are checked out in another worktree by [@​stefanhaller](https://github.com/stefanhaller) in [#​4833](jesseduffield/lazygit#4833) - Fix dropping range selection of filtered stashes by [@​stefanhaller](https://github.com/stefanhaller) in [#​4849](jesseduffield/lazygit#4849) - Fix rare crash in interactive rebase (merge command without comment) by [@​stefanhaller](https://github.com/stefanhaller) in [#​4872](jesseduffield/lazygit#4872) - Make it possible to rebind the Confirm keybinding by [@​stefanhaller](https://github.com/stefanhaller) in [#​4860](jesseduffield/lazygit#4860) ##### Maintenance ⚙️ - Pass only Git-tracked Go files to gofumpt by [@​kyu08](https://github.com/kyu08) in [#​4809](jesseduffield/lazygit#4809) - Update donation wording so that it's clear there's no strings attached by [@​jesseduffield](https://github.com/jesseduffield) in [#​4827](jesseduffield/lazygit#4827) - Enhance MR/Issue templates readability by [@​kyu08](https://github.com/kyu08) in [#​4829](jesseduffield/lazygit#4829) - Run label check workflow only on label events and open pr event by [@​kyu08](https://github.com/kyu08) in [#​4830](jesseduffield/lazygit#4830) ##### Docs 📖 - Add installation with gah by [@​marverix](https://github.com/marverix) in [#​4820](jesseduffield/lazygit#4820) - docs(VISION): fix "Dicoverability" typo by [@​Rudxain](https://github.com/Rudxain) in [#​4866](jesseduffield/lazygit#4866) - Add dev container feature as installation method to README by [@​HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) in [#​4876](jesseduffield/lazygit#4876) ##### I18n 🌎 - Update translations from Crowdin by [@​stefanhaller](https://github.com/stefanhaller) in [#​4873](jesseduffield/lazygit#4873) #### New Contributors - [@​marverix](https://github.com/marverix) made their first contribution in [#​4820](jesseduffield/lazygit#4820) - [@​Kahitar](https://github.com/Kahitar) made their first contribution in [#​4822](jesseduffield/lazygit#4822) - [@​cowboy8625](https://github.com/cowboy8625) made their first contribution in [#​4757](jesseduffield/lazygit#4757) - [@​Rudxain](https://github.com/Rudxain) made their first contribution in [#​4866](jesseduffield/lazygit#4866) - [@​HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) made their first contribution in [#​4876](jesseduffield/lazygit#4876) **Full Changelog**: <jesseduffield/lazygit@v0.54.2...v0.55.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45Ny40IiwidXBkYXRlZEluVmVyIjoiNDEuOTcuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
@stefanhaller After migrating from Screen.Recording.2025-09-14.at.10.04.42.mov |
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.