Skip to content

Commit c54ef7a

Browse files
stefanhallerkarolzwolak
authored andcommitted
Remove the git.paging.useConfig option (jesseduffield#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](jesseduffield#3704 (comment)) for more rationale. Closes jesseduffield#3704.
2 parents a8cbe18 + cba937a commit c54ef7a

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
}
@@ -798,7 +796,6 @@ func GetDefaultConfig() *UserConfig {
798796
Paging: PagingConfig{
799797
ColorArg: "always",
800798
Pager: "",
801-
UseConfig: false,
802799
ExternalDiffCommand: "",
803800
},
804801
Commit: CommitConfig{

pkg/i18n/english.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,6 +2175,8 @@ keybinding:
21752175
universal:
21762176
suspendApp: <disabled>
21772177
redo: <c-z>
2178+
2179+
- 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.
21782180
`,
21792181
},
21802182
}

schema/config.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,11 +1676,6 @@
16761676
"ydiff -p cat -s --wrap --width={{columnWidth}}"
16771677
]
16781678
},
1679-
"useConfig": {
1680-
"type": "boolean",
1681-
"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).",
1682-
"default": false
1683-
},
16841679
"externalDiffCommand": {
16851680
"type": "string",
16861681
"description": "e.g. 'difft --color=always'"

0 commit comments

Comments
 (0)