Skip to content

Commit 0ec6ad8

Browse files
authored
Merge branch 'jesseduffield:master' into bump-go-1.25
2 parents 98bb612 + 5a6de12 commit 0ec6ad8

24 files changed

+244
-71
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,33 @@ labels: bug
66
assignees: ''
77
---
88

9-
**Describe the bug**
9+
### Describe the bug
1010
A clear and concise description of what the bug is.
1111

12-
**To Reproduce**
12+
### To Reproduce
1313
Steps to reproduce the behavior:
1414

1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'
1818
4. See error
1919

20-
**Expected behavior**
20+
### Expected behavior
2121
A clear and concise description of what you expected to happen.
2222

23-
**Screenshots**
23+
### Screenshots
2424
If applicable, add screenshots to help explain your problem.
2525

26-
**Version info:**
27-
_Run `lazygit --version` and paste the result here_
28-
_Run `git --version` and paste the result here_
26+
### Version info:
2927

30-
**Additional context**
28+
* _Run `lazygit --version` and paste the result here_
29+
* _Run `git --version` and paste the result here_
30+
31+
### Additional context
3132
Add any other context about the problem here.
3233

33-
**Note:** please try updating to the latest version or [manually building](https://github.com/jesseduffield/lazygit/#manual) the latest `master` to see if the issue still occurs.
34+
> [!NOTE]
35+
> Please try updating to the latest version or [manually building](https://github.com/jesseduffield/lazygit/#manual) the latest `master` to see if the issue still occurs.
3436
3537
<!--
3638
If you want to try and debug this issue yourself, you can run `lazygit --debug` in one terminal panel and `lazygit --logs` in another to view the logs.

.github/ISSUE_TEMPLATE/discussion.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ assignees: ''
77

88
---
99

10-
**Topic**
11-
A clear and concise description of what you want to discuss
10+
### Topic
11+
A clear and concise description of what you want to discuss.
1212

13-
**Your thoughts**
14-
What you have to say about the topic
13+
### Your thoughts
14+
What you have to say about the topic.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ labels: enhancement
66
assignees: ''
77
---
88

9-
**Is your feature request related to a problem? Please describe.**
9+
### Is your feature request related to a problem? Please describe.
1010
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1111

12-
**Describe the solution you'd like**
12+
### Describe the solution you'd like
1313
A clear and concise description of what you want to happen.
1414

15-
**Describe alternatives you've considered**
15+
### Describe alternatives you've considered
1616
A clear and concise description of any alternative solutions or features you've considered.
1717

18-
**Additional context**
18+
### Additional context
1919
Add any other context or screenshots about the feature request here.
2020

2121
<!--

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
- **PR Description**
1+
### PR Description
22

3-
- **Please check if the PR fulfills these requirements**
3+
### Please check if the PR fulfills these requirements
44

55
* [ ] Cheatsheets are up-to-date (run `go generate ./...`)
66
* [ ] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Check Required Labels
2+
3+
on:
4+
pull_request:
5+
types: [opened, labeled, unlabeled]
6+
7+
jobs:
8+
check-required-label:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: mheap/github-action-required-labels@v5
12+
with:
13+
mode: exactly
14+
count: 1
15+
labels: "ignore-for-release, feature, enhancement, bug, maintenance, docs, i18n, performance"

.github/workflows/ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,6 @@ jobs:
175175
- name: errors
176176
run: golangci-lint run
177177
if: ${{ failure() }}
178-
check-required-label:
179-
runs-on: ubuntu-latest
180-
if: github.ref != 'refs/heads/master'
181-
steps:
182-
- uses: mheap/github-action-required-labels@v5
183-
with:
184-
mode: exactly
185-
count: 1
186-
labels: "ignore-for-release, feature, enhancement, bug, maintenance, docs, i18n, performance"
187178
upload-coverage:
188179
# List all jobs that produce coverage files
189180
needs: [unit-tests, integration-tests]

docs/Config.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,12 @@ 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

309+
# 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.
310+
useExternalDiffGitConfig: false
311+
312312
# Config relating to committing
313313
commit:
314314
# If true, pass '--signoff' flag when committing

docs/Custom_Pagers.md

Lines changed: 11 additions & 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

@@ -86,3 +74,13 @@ git:
8674
paging:
8775
externalDiffCommand: difft --color=always --display=inline --syntax-highlight=off
8876
```
77+
78+
Instead of setting this command in lazygit's `externalDiffCommand` config, you can also tell lazygit to use the external diff command that is configured in git itself (`diff.external`), by using
79+
80+
```yaml
81+
git:
82+
paging:
83+
useExternalDiffGitConfig: true
84+
```
85+
86+
This can be useful if you also want to use it for diffs on the command line, and it also has the advantage that you can configure it per file type in `.gitattributes`; see https://git-scm.com/docs/gitattributes#_defining_an_external_diff_driver.

pkg/commands/git_commands/commit.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,11 @@ func (self *CommitCommands) ShowCmdObj(hash string, filterPaths []string) *oscom
257257
contextSize := self.UserConfig().Git.DiffContextSize
258258

259259
extDiffCmd := self.UserConfig().Git.Paging.ExternalDiffCommand
260+
useExtDiffGitConfig := self.UserConfig().Git.Paging.UseExternalDiffGitConfig
260261
cmdArgs := NewGitCmd("show").
261262
Config("diff.noprefix=false").
262263
ConfigIf(extDiffCmd != "", "diff.external="+extDiffCmd).
263-
ArgIfElse(extDiffCmd != "", "--ext-diff", "--no-ext-diff").
264+
ArgIfElse(extDiffCmd != "" || useExtDiffGitConfig, "--ext-diff", "--no-ext-diff").
264265
Arg("--submodule").
265266
Arg("--color="+self.UserConfig().Git.Paging.ColorArg).
266267
Arg(fmt.Sprintf("--unified=%d", contextSize)).

pkg/commands/git_commands/commit_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ func TestCommitShowCmdObj(t *testing.T) {
256256
similarityThreshold int
257257
ignoreWhitespace bool
258258
extDiffCmd string
259+
useExtDiffGitConfig bool
259260
expected []string
260261
}
261262

@@ -314,6 +315,15 @@ func TestCommitShowCmdObj(t *testing.T) {
314315
extDiffCmd: "difft --color=always",
315316
expected: []string{"-C", "/path/to/worktree", "-c", "diff.external=difft --color=always", "-c", "diff.noprefix=false", "show", "--ext-diff", "--submodule", "--color=always", "--unified=3", "--stat", "--decorate", "-p", "1234567890", "--find-renames=50%", "--"},
316317
},
318+
{
319+
testName: "Show diff using git's external diff config",
320+
filterPaths: []string{},
321+
contextSize: 3,
322+
similarityThreshold: 50,
323+
ignoreWhitespace: false,
324+
useExtDiffGitConfig: true,
325+
expected: []string{"-C", "/path/to/worktree", "-c", "diff.noprefix=false", "show", "--ext-diff", "--submodule", "--color=always", "--unified=3", "--stat", "--decorate", "-p", "1234567890", "--find-renames=50%", "--"},
326+
},
317327
}
318328

319329
for _, s := range scenarios {
@@ -323,6 +333,7 @@ func TestCommitShowCmdObj(t *testing.T) {
323333
userConfig.Git.IgnoreWhitespaceInDiffView = s.ignoreWhitespace
324334
userConfig.Git.DiffContextSize = s.contextSize
325335
userConfig.Git.RenameSimilarityThreshold = s.similarityThreshold
336+
userConfig.Git.Paging.UseExternalDiffGitConfig = s.useExtDiffGitConfig
326337

327338
runner := oscommands.NewFakeRunner(t).ExpectGitArgs(s.expected, "", nil)
328339
repoPaths := RepoPaths{

0 commit comments

Comments
 (0)