Skip to content

Commit ff464c0

Browse files
authored
Merge branch 'master' into master
2 parents 4b05d03 + 389ff29 commit ff464c0

File tree

12 files changed

+88
-45
lines changed

12 files changed

+88
-45
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,3 @@ jobs:
149149
args: release --clean
150150
env:
151151
GITHUB_TOKEN: ${{secrets.LAZYGIT_RELEASE_PAT}}
152-
153-
- name: Bump Homebrew formula
154-
uses: dawidd6/action-homebrew-bump-formula@v3
155-
with:
156-
token: ${{secrets.LAZYGIT_RELEASE_PAT}}
157-
formula: lazygit
158-
tag: ${{env.new_tag}}

CONTRIBUTING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,24 @@ Lazygit supports [Nerd Fonts](https://www.nerdfonts.com) to render certain icons
118118

119119
## Internationalisation
120120

121-
Boy that's a hard word to spell. Anyway, lazygit is translated into several languages within the pkg/i18n package. If you need to render text to the user, you should add a new field to the TranslationSet struct in `pkg/i18n/english.go` and add the actual content within the `EnglishTranslationSet()` method in the same file. Then you can access via `gui.Tr.YourNewText` (or `self.c.Tr.YourNewText`, etc). Although it is appreciated if you translate the text into other languages, it's not expected of you (google translate will likely do a bad job anyway!).
121+
Boy that's a hard word to spell. Anyway, lazygit is translated into several languages within the pkg/i18n package.
122+
123+
### For developers adding new text
124+
125+
If you need to render text to the user, you should add a new field to the TranslationSet struct in `pkg/i18n/english.go` and add the actual content within the `EnglishTranslationSet()` method in the same file. Then you can access via `gui.Tr.YourNewText` (or `self.c.Tr.YourNewText`, etc).
122126

123127
Note, we use 'Sentence case' for everything (so no 'Title Case' or 'whatever-it's-called-when-there's-no-capital-letters-case')
124128

129+
### For translators
130+
131+
Lazygit translations are managed through [Crowdin](https://crowdin.com/project/lazygit/). If you'd like to contribute translations:
132+
133+
1. Join the Crowdin project at https://crowdin.com/project/lazygit/
134+
2. Select your target language and help translate missing strings
135+
3. The translation files in `pkg/i18n/translations/` are managed by the maintainers - please don't edit them directly
136+
137+
For detailed information about the translation process, including how maintainers sync translations, see `pkg/i18n/translations/README.md`.
138+
125139
## Debugging
126140

127141
The easiest way to debug lazygit is to have two terminal tabs open at once: one for running lazygit (via `go run main.go -debug` in the project root) and one for viewing lazygit's logs (which can be done via `go run main.go --logs` or just `lazygit --logs`).

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ test: unit-test integration-test-all
3434
generate:
3535
go generate ./...
3636

37+
# If you execute `gofumpt -l -w .`, it will format all Go files in the current directory, including `test/_results/*` files.
38+
# We pass only Git-tracked Go files to gofumpt because we don't want to format the test results or get errors from it.
3739
.PHONY: format
3840
format:
39-
gofumpt -l -w .
41+
git ls-files '*.go' ':!vendor' | xargs gofumpt -l -w
4042

4143
.PHONY: lint
4244
lint:

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
A simple terminal UI for git commands
3737
<br/>
3838

39-
[![GitHub Releases](https://img.shields.io/github/downloads/jesseduffield/lazygit/total)](https://github.com/jesseduffield/lazygit/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/jesseduffield/lazygit)](https://goreportcard.com/report/github.com/jesseduffield/lazygit) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/f46416b715d74622895657935fcada21)](https://app.codacy.com/gh/jesseduffield/lazygit/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/f46416b715d74622895657935fcada21)](https://app.codacy.com/gh/jesseduffield/lazygit/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) [![GolangCI](https://golangci.com/badges/github.com/jesseduffield/lazygit.svg)](https://golangci.com) [![GitHub tag](https://img.shields.io/github/tag/jesseduffield/lazygit.svg)](https://github.com/jesseduffield/lazygit/releases/latest) [![homebrew](https://img.shields.io/homebrew/v/lazygit)](https://github.com/Homebrew/homebrew-core/blob/master/Formula/lazygit.rb)
39+
[![GitHub Releases](https://img.shields.io/github/downloads/jesseduffield/lazygit/total)](https://github.com/jesseduffield/lazygit/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/jesseduffield/lazygit)](https://goreportcard.com/report/github.com/jesseduffield/lazygit) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/f46416b715d74622895657935fcada21)](https://app.codacy.com/gh/jesseduffield/lazygit/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Codacy Badge](https://app.codacy.com/project/badge/Coverage/f46416b715d74622895657935fcada21)](https://app.codacy.com/gh/jesseduffield/lazygit/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage) [![golangci-lint](https://img.shields.io/badge/linted%20by-golangci--lint-brightgreen)](https://golangci-lint.run/) [![GitHub tag](https://img.shields.io/github/v/tag/jesseduffield/lazygit?color=blue)](https://github.com/jesseduffield/lazygit/releases/latest) [![homebrew](https://img.shields.io/homebrew/v/lazygit?color=blue)](https://formulae.brew.sh/formula/lazygit)
4040

4141
![commit_and_push](../assets/demo/commit_and_push-compressed.gif)
4242

@@ -270,6 +270,14 @@ scoop bucket add extras
270270
scoop install lazygit
271271
```
272272

273+
### gah (Linux and Mac OS)
274+
275+
You can install `lazygit` using [gah](https://github.com/marverix/gah/):
276+
277+
```sh
278+
gah install lazygit
279+
```
280+
273281
### Arch Linux
274282

275283
Packages for Arch Linux are available via pacman and AUR (Arch User Repository).

pkg/commands/oscommands/os.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package oscommands
22

33
import (
4-
"fmt"
54
"io"
65
"os"
76
"os/exec"
@@ -329,15 +328,3 @@ func GetLazygitPath() string {
329328
}
330329
return `"` + filepath.ToSlash(ex) + `"`
331330
}
332-
333-
func (c *OSCommand) UpdateWindowTitle() error {
334-
if c.Platform.OS != "windows" {
335-
return nil
336-
}
337-
path, getWdErr := os.Getwd()
338-
if getWdErr != nil {
339-
return getWdErr
340-
}
341-
argString := fmt.Sprint("title ", filepath.Base(path), " - Lazygit")
342-
return c.Cmd.NewShell(argString, c.UserConfig().OS.ShellFunctionsFile).Run()
343-
}

pkg/commands/oscommands/os_default_platform.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ package oscommands
44

55
import (
66
"os"
7+
"os/exec"
78
"runtime"
89
"strings"
10+
"syscall"
911
)
1012

1113
func GetPlatform() *Platform {
@@ -33,3 +35,15 @@ func getUserShell() string {
3335

3436
return "bash"
3537
}
38+
39+
func (c *OSCommand) UpdateWindowTitle() error {
40+
return nil
41+
}
42+
43+
func TerminateProcessGracefully(cmd *exec.Cmd) error {
44+
if cmd.Process == nil {
45+
return nil
46+
}
47+
48+
return cmd.Process.Signal(syscall.SIGTERM)
49+
}

pkg/commands/oscommands/os_windows.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,30 @@
11
package oscommands
22

3+
import (
4+
"fmt"
5+
"os"
6+
"os/exec"
7+
"path/filepath"
8+
)
9+
310
func GetPlatform() *Platform {
411
return &Platform{
512
OS: "windows",
613
Shell: "cmd",
714
ShellArg: "/c",
815
}
916
}
17+
18+
func (c *OSCommand) UpdateWindowTitle() error {
19+
path, getWdErr := os.Getwd()
20+
if getWdErr != nil {
21+
return getWdErr
22+
}
23+
argString := fmt.Sprint("title ", filepath.Base(path), " - Lazygit")
24+
return c.Cmd.NewShell(argString, c.UserConfig().OS.ShellFunctionsFile).Run()
25+
}
26+
27+
func TerminateProcessGracefully(cmd *exec.Cmd) error {
28+
// Signals other than SIGKILL are not supported on Windows
29+
return nil
30+
}

pkg/gui/controllers/helpers/confirmation_helper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package helpers
33
import (
44
goContext "context"
55
"fmt"
6+
"strings"
67

78
"github.com/jesseduffield/lazygit/pkg/gui/style"
89
"github.com/jesseduffield/lazygit/pkg/gui/types"
@@ -168,7 +169,7 @@ func (self *ConfirmationHelper) CreatePopupPanel(ctx goContext.Context, opts typ
168169
confirmationView.RenderTextArea()
169170
} else {
170171
self.c.ResetViewOrigin(confirmationView)
171-
self.c.SetViewContent(confirmationView, style.AttrBold.Sprint(opts.Prompt))
172+
self.c.SetViewContent(confirmationView, style.AttrBold.Sprint(strings.TrimSpace(opts.Prompt)))
172173
}
173174

174175
self.setKeyBindings(cancel, opts)

pkg/gui/presentation/branches.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ func getBranchDisplayStrings(
7171
if showCommitHash {
7272
availableWidth -= utils.COMMIT_HASH_SHORT_SIZE + 1
7373
}
74+
paddingNeededForDivergence := availableWidth
75+
7476
if checkedOutByWorkTree {
7577
availableWidth -= utils.StringWidth(worktreeIcon) + 1
7678
}
77-
paddingNeededForDivergence := availableWidth
7879

7980
if len(branchStatus) > 0 {
8081
availableWidth -= utils.StringWidth(utils.Decolorise(branchStatus)) + 1

pkg/i18n/english.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2143,7 +2143,7 @@ git:
21432143
- The default selection mode in the staging and custom patch building views has been changed to hunk mode. This is the more useful mode in most cases, as it usually saves a lot of keystrokes. If you want to switch back to the old line mode default, you can do so by adding the following to your config:
21442144
21452145
gui:
2146-
useHunkSelectionMode: false
2146+
useHunkModeInStagingView: false
21472147
`,
21482148
"0.55.0": `- The 'redo' command, which used to be bound to ctrl-z, is now bound to shift-Z instead. This is because ctrl-z is now used for suspending the application; it is a commonly known keybinding for that in the Linux world. If you want to revert this change, you can do so by adding the following to your config:
21492149

0 commit comments

Comments
 (0)