Skip to content

Commit 86934ce

Browse files
authored
Remove the git.paging.useConfig option (#4837)
### PR Description Many people don't understand what this means, which is apparent from the amount of issues that got filed because of this. Let's get rid of it to avoid this confusion. People will have to configure their pager twice if they want to use it both on the command line and in lazygit, which I think is not a big deal. See [here](#3704 (comment)) for more rationale. Closes #3704.
2 parents 13f97fb + 548244c commit 86934ce

File tree

6 files changed

+3
-30
lines changed

6 files changed

+3
-30
lines changed

docs/Config.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,6 @@ git:
303303
# ydiff -p cat -s --wrap --width={{columnWidth}}
304304
pager: ""
305305

306-
# If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager).
307-
useConfig: false
308-
309306
# e.g. 'difft --color=always'
310307
externalDiffCommand: ""
311308

docs/Custom_Pagers.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Support does not extend to Windows users, because we're making use of a package
1010
git:
1111
paging:
1212
colorArg: always
13-
useConfig: false
1413
```
1514
1615
the `colorArg` key is for whether you want the `--color=always` arg in your `git diff` command. Some pagers want it set to `always`, others want it set to `never`.
@@ -54,17 +53,6 @@ git:
5453

5554
Be careful with this one, I think the homebrew and pip versions are behind master. I needed to directly download the ydiff script to get the no-pager functionality working.
5655

57-
## Using git config
58-
59-
```yaml
60-
git:
61-
paging:
62-
colorArg: always
63-
useConfig: true
64-
```
65-
66-
If you set `useConfig: true`, lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager).
67-
6856
## Using external diff commands
6957

7058
Some diff tools can't work as a simple pager like the ones above do, because they need access to the entire diff, so just post-processing git's diff is not enough for them. The most notable example is probably [difftastic](https://difftastic.wilfred.me.uk).
@@ -77,7 +65,7 @@ git:
7765
externalDiffCommand: difft --color=always
7866
```
7967

80-
The `colorArg`, `pager`, and `useConfig` options are not used in this case.
68+
The `colorArg` and `pager` options are not used in this case.
8169

8270
You can add whatever extra arguments you prefer for your difftool; for instance
8371

pkg/commands/git_commands/config.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ func (self *ConfigCommands) ConfiguredPager() string {
4343
}
4444

4545
func (self *ConfigCommands) GetPager(width int) string {
46-
useConfig := self.UserConfig().Git.Paging.UseConfig
47-
if useConfig {
48-
pager := self.ConfiguredPager()
49-
return strings.Split(pager, "| less")[0]
50-
}
51-
5246
templateValues := map[string]string{
5347
"columnWidth": strconv.Itoa(width/2 - 6),
5448
}

pkg/config/user_config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,6 @@ type PagingConfig struct {
316316
// delta --dark --paging=never
317317
// ydiff -p cat -s --wrap --width={{columnWidth}}
318318
Pager PagerType `yaml:"pager"`
319-
// If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager).
320-
UseConfig bool `yaml:"useConfig"`
321319
// e.g. 'difft --color=always'
322320
ExternalDiffCommand string `yaml:"externalDiffCommand"`
323321
}
@@ -797,7 +795,6 @@ func GetDefaultConfig() *UserConfig {
797795
Paging: PagingConfig{
798796
ColorArg: "always",
799797
Pager: "",
800-
UseConfig: false,
801798
ExternalDiffCommand: "",
802799
},
803800
Commit: CommitConfig{

pkg/i18n/english.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,6 +2169,8 @@ keybinding:
21692169
universal:
21702170
suspendApp: <disabled>
21712171
redo: <c-z>
2172+
2173+
- The 'git.paging.useConfig' option has been removed. If you were relying on it to configure your pager, you'll have to explicitly set the pager again using the git.paging.pager' option.
21722174
`,
21732175
},
21742176
}

schema/config.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,11 +1672,6 @@
16721672
"ydiff -p cat -s --wrap --width={{columnWidth}}"
16731673
]
16741674
},
1675-
"useConfig": {
1676-
"type": "boolean",
1677-
"description": "If true, Lazygit will use whatever pager is specified in `$GIT_PAGER`, `$PAGER`, or your *git config*. If the pager ends with something like ` | less` we will strip that part out, because less doesn't play nice with our rendering approach. If the custom pager uses less under the hood, that will also break rendering (hence the `--paging=never` flag for the `delta` pager).",
1678-
"default": false
1679-
},
16801675
"externalDiffCommand": {
16811676
"type": "string",
16821677
"description": "e.g. 'difft --color=always'"

0 commit comments

Comments
 (0)