Skip to content

Commit 7e880f4

Browse files
authored
Merge branch 'master' into add-coauthor-support
2 parents c25f9b2 + 3215839 commit 7e880f4

File tree

172 files changed

+2733
-1628
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+2733
-1628
lines changed

.vscode/launch.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
],
1414
"hideSystemGoroutines": true,
1515
"console": "integratedTerminal",
16-
"presentation": {
17-
"hidden": true
18-
}
1916
},
2017
{
2118
"name": "Tail Lazygit logs",
@@ -28,9 +25,6 @@
2825
"--use-config-file=${workspaceFolder}/.vscode/debugger_config.yml"
2926
],
3027
"console": "integratedTerminal",
31-
"presentation": {
32-
"hidden": true
33-
}
3428
},
3529
{
3630
"name": "Attach to a running Lazygit",

README.md

Lines changed: 5 additions & 3 deletions
Large diffs are not rendered by default.

docs/Config.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ gui:
5757
- blue
5858
selectedLineBgColor:
5959
- blue # set to `default` to have no background colour
60-
selectedRangeBgColor:
61-
- blue
6260
cherryPickedCommitBgColor:
6361
- cyan
6462
cherryPickedCommitFgColor:
@@ -201,6 +199,9 @@ keybinding:
201199
toggleWhitespaceInDiffView: '<c-w>'
202200
increaseContextInDiffView: '}'
203201
decreaseContextInDiffView: '{'
202+
toggleRangeSelect: 'v'
203+
rangeSelectUp: '<s-up>'
204+
rangeSelectDown: '<s-down>'
204205
status:
205206
checkForUpdate: 'u'
206207
recentRepos: '<enter>'
@@ -249,9 +250,8 @@ keybinding:
249250
amendAttributeMenu: 'a'
250251
pickCommit: 'p' # pick commit (when mid-rebase)
251252
revertCommit: 't'
252-
cherryPickCopy: 'c'
253-
cherryPickCopyRange: 'C'
254-
pasteCommits: 'v'
253+
cherryPickCopy: 'C'
254+
pasteCommits: 'V'
255255
tagCommit: 'T'
256256
checkoutCommit: '<space>'
257257
resetCherryPick: '<c-R>'
@@ -264,8 +264,6 @@ keybinding:
264264
commitFiles:
265265
checkoutCommitFile: 'c'
266266
main:
267-
toggleDragSelect: 'v'
268-
toggleDragSelect-alt: 'V'
269267
toggleSelectHunk: 'a'
270268
pickBothHunks: 'b'
271269
submodules:
@@ -396,15 +394,13 @@ The available attributes are:
396394

397395
## Highlighting the selected line
398396

399-
If you don't like the default behaviour of highlighting the selected line with a blue background, you can use the `selectedLineBgColor` and `selectedRangeBgColor` keys to customise the behaviour. If you just want to embolden the selected line (this was the original default), you can do the following:
397+
If you don't like the default behaviour of highlighting the selected line with a blue background, you can use the `selectedLineBgColor` key to customise the behaviour. If you just want to embolden the selected line (this was the original default), you can do the following:
400398

401399
```yaml
402400
gui:
403401
theme:
404402
selectedLineBgColor:
405403
- default
406-
selectedRangeBgColor:
407-
- default
408404
```
409405

410406
You can also use the reverse attribute like so:
@@ -414,8 +410,6 @@ gui:
414410
theme:
415411
selectedLineBgColor:
416412
- reverse
417-
selectedRangeBgColor:
418-
- reverse
419413
```
420414

421415
## Custom Author Color

docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
* [Configuration](./Config.md).
44
* [Custom Commands](./Custom_Command_Keybindings.md)
55
* [Custom Pagers](./Custom_Pagers.md)
6+
* [Dev docs](./dev)
67
* [Keybindings](./keybindings)
78
* [Undo/Redo](./Undoing.md)
9+
* [Range Select](./Range_Select.md)
810
* [Searching/Filtering](./Searching.md)
911
* [Stacked Branches](./Stacked_Branches.md)
10-
* [Dev docs](./dev)

docs/Range_Select.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Range Select
2+
3+
Some actions can be performed on a range of contiguous items. For example:
4+
* staging multiple files at once
5+
* squashing multiple commits at once
6+
* copying (for cherry-pick) multiple commits at once
7+
8+
There are two ways to select a range of items:
9+
1. Sticky range select: Press 'v' to toggle range select, then expand the selection using the up/down arrow key. To reset the selection, press 'v' again.
10+
2. Non-sticky range select: Press shift+up or shift+down to expand the selection. To reset the selection, press up/down without shift.
11+
12+
The sticky option will be more familiar to vim users, and the second option will feel more natural to users who aren't used to doing things in a modal way.
13+
14+
In order to perform an action on a range of items, simply press the normal key for that action. If the action only works on individual items, it will raise an error. This is a new feature and the plan is to incrementally support range select for more and more actions. If there is an action you would like to support range select which currently does not, please raise an issue in the repo.

docs/dev/Codebase_Guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
* `pkg/gui/gui_common.go`: defines gui-specific methods that all controllers and helpers have access to
5959
* `pkg/i18n/english.go`: defines the set of i18n strings and their English values
6060
* `pkg/gui/controllers/helpers/refresh_helper.go`: manages refreshing of models. The refresh helper is typically invoked at the end of an action to re-load affected models from git (e.g. re-load branches after doing a git pull)
61+
* `pkg/gui/controllers/quit_actions.go`: contains code that runs when you hit 'escape' on a view (assuming the view doesn't define its own escape handler)
6162
* `vendor/github.com/jesseduffield/gocui/gui.go`: defines the gocui gui struct
6263
* `vendor/github.com/jesseduffield/gocui/view.go`: defines the gocui view struct
6364

@@ -75,6 +76,8 @@ In terms of dependencies, controllers sit at the highest level, so they can refe
7576
* **Tab**: Each tab in a window (e.g. Files, Worktrees, Submodules) actually has a corresponding view which we bring to the front upon changing tabs.
7677
* **Model**: Representation of a git object e.g. commits, branches, files.
7778
* **ViewModel**: Used by a context to maintain state related to the view.
79+
* **Keybinding**: A keybinding associates a _key_ with an _action_. For example if you press the 'down' arrow, the action performed will be your cursor moving down a list by one.
80+
* **Action**: An action is the thing that happens when you press a key. Often an action will invoke a git command, but not always: for example, navigation actions don't involve git.
7881
* **Common structs**: Most structs have a field named `c` which contains a 'common' struct: a struct containing a bag of dependencies that most structs of the same layer require. For example if you want to access a helper from a controller you can do so with `self.c.Helpers.MyHelper`.
7982

8083
## Event loop and threads

docs/keybindings/Keybindings_en.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
3737
<kbd>.</kbd>: Next page
3838
<kbd>&lt;</kbd>: Scroll to top
3939
<kbd>&gt;</kbd>: Scroll to bottom
40+
<kbd>v</kbd>: Toggle range select
41+
<kbd>&lt;s-down&gt;</kbd>: Range select down
42+
<kbd>&lt;s-up&gt;</kbd>: Range select up
4043
<kbd>/</kbd>: Search the current view by text
4144
<kbd>H</kbd>: Scroll left
4245
<kbd>L</kbd>: Scroll right
@@ -79,12 +82,13 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
7982
<kbd>R</kbd>: Reword commit with editor
8083
<kbd>d</kbd>: Delete commit
8184
<kbd>e</kbd>: Edit commit
85+
<kbd>i</kbd>: Start interactive rebase
8286
<kbd>p</kbd>: Pick commit (when mid-rebase)
8387
<kbd>F</kbd>: Create fixup commit for this commit
8488
<kbd>S</kbd>: Squash all 'fixup!' commits above selected commit (autosquash)
8589
<kbd>&lt;c-j&gt;</kbd>: Move commit down one
8690
<kbd>&lt;c-k&gt;</kbd>: Move commit up one
87-
<kbd>v</kbd>: Paste commits (cherry-pick)
91+
<kbd>V</kbd>: Paste commits (cherry-pick)
8892
<kbd>B</kbd>: Mark commit as base commit for rebase
8993
<kbd>A</kbd>: Amend commit with staged changes
9094
<kbd>a</kbd>: Open amend commit attributes menu
@@ -97,8 +101,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
97101
<kbd>o</kbd>: Open commit in browser
98102
<kbd>n</kbd>: Create new branch off of commit
99103
<kbd>g</kbd>: View reset options
100-
<kbd>c</kbd>: Copy commit (cherry-pick)
101-
<kbd>C</kbd>: Copy commit range (cherry-pick)
104+
<kbd>C</kbd>: Copy commit (cherry-pick)
102105
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
103106
<kbd>&lt;enter&gt;</kbd>: View selected item's files
104107
<kbd>/</kbd>: Search the current view by text
@@ -195,8 +198,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
195198
<pre>
196199
<kbd>&lt;left&gt;</kbd>: Select previous hunk
197200
<kbd>&lt;right&gt;</kbd>: Select next hunk
198-
<kbd>v</kbd>: Toggle drag select
199-
<kbd>V</kbd>: Toggle drag select
201+
<kbd>v</kbd>: Toggle range select
200202
<kbd>a</kbd>: Toggle select hunk
201203
<kbd>&lt;c-o&gt;</kbd>: Copy the selected text to the clipboard
202204
<kbd>o</kbd>: Open file
@@ -211,8 +213,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
211213
<pre>
212214
<kbd>&lt;left&gt;</kbd>: Select previous hunk
213215
<kbd>&lt;right&gt;</kbd>: Select next hunk
214-
<kbd>v</kbd>: Toggle drag select
215-
<kbd>V</kbd>: Toggle drag select
216+
<kbd>v</kbd>: Toggle range select
216217
<kbd>a</kbd>: Toggle select hunk
217218
<kbd>&lt;c-o&gt;</kbd>: Copy the selected text to the clipboard
218219
<kbd>o</kbd>: Open file
@@ -246,8 +247,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
246247
<kbd>o</kbd>: Open commit in browser
247248
<kbd>n</kbd>: Create new branch off of commit
248249
<kbd>g</kbd>: View reset options
249-
<kbd>c</kbd>: Copy commit (cherry-pick)
250-
<kbd>C</kbd>: Copy commit range (cherry-pick)
250+
<kbd>C</kbd>: Copy commit (cherry-pick)
251251
<kbd>&lt;c-r&gt;</kbd>: Reset cherry-picked (copied) commits selection
252252
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
253253
<kbd>&lt;enter&gt;</kbd>: View commits
@@ -314,8 +314,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
314314
<kbd>o</kbd>: Open commit in browser
315315
<kbd>n</kbd>: Create new branch off of commit
316316
<kbd>g</kbd>: View reset options
317-
<kbd>c</kbd>: Copy commit (cherry-pick)
318-
<kbd>C</kbd>: Copy commit range (cherry-pick)
317+
<kbd>C</kbd>: Copy commit (cherry-pick)
319318
<kbd>&lt;c-r&gt;</kbd>: Reset cherry-picked (copied) commits selection
320319
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
321320
<kbd>&lt;enter&gt;</kbd>: View selected item's files

docs/keybindings/Keybindings_ja.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
3737
<kbd>.</kbd>: 次のページ
3838
<kbd>&lt;</kbd>: 最上部までスクロール
3939
<kbd>&gt;</kbd>: 最下部までスクロール
40+
<kbd>v</kbd>: 範囲選択を切り替え
41+
<kbd>&lt;s-down&gt;</kbd>: Range select down
42+
<kbd>&lt;s-up&gt;</kbd>: Range select up
4043
<kbd>/</kbd>: 検索を開始
4144
<kbd>H</kbd>: 左スクロール
4245
<kbd>L</kbd>: 右スクロール
@@ -67,8 +70,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
6770
<kbd>o</kbd>: ブラウザでコミットを開く
6871
<kbd>n</kbd>: コミットにブランチを作成
6972
<kbd>g</kbd>: View reset options
70-
<kbd>c</kbd>: コミットをコピー (cherry-pick)
71-
<kbd>C</kbd>: コミットを範囲コピー (cherry-pick)
73+
<kbd>C</kbd>: コミットをコピー (cherry-pick)
7274
<kbd>&lt;c-r&gt;</kbd>: Reset cherry-picked (copied) commits selection
7375
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
7476
<kbd>&lt;enter&gt;</kbd>: View selected item's files
@@ -98,12 +100,13 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
98100
<kbd>R</kbd>: エディタでコミットメッセージを編集
99101
<kbd>d</kbd>: コミットを削除
100102
<kbd>e</kbd>: コミットを編集
103+
<kbd>i</kbd>: Start interactive rebase
101104
<kbd>p</kbd>: Pick commit (when mid-rebase)
102105
<kbd>F</kbd>: このコミットに対するfixupコミットを作成
103106
<kbd>S</kbd>: Squash all 'fixup!' commits above selected commit (autosquash)
104107
<kbd>&lt;c-j&gt;</kbd>: コミットを1つ下に移動
105108
<kbd>&lt;c-k&gt;</kbd>: コミットを1つ上に移動
106-
<kbd>v</kbd>: コミットを貼り付け (cherry-pick)
109+
<kbd>V</kbd>: コミットを貼り付け (cherry-pick)
107110
<kbd>B</kbd>: Mark commit as base commit for rebase
108111
<kbd>A</kbd>: ステージされた変更でamendコミット
109112
<kbd>a</kbd>: Open amend commit attributes menu
@@ -116,8 +119,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
116119
<kbd>o</kbd>: ブラウザでコミットを開く
117120
<kbd>n</kbd>: コミットにブランチを作成
118121
<kbd>g</kbd>: View reset options
119-
<kbd>c</kbd>: コミットをコピー (cherry-pick)
120-
<kbd>C</kbd>: コミットを範囲コピー (cherry-pick)
122+
<kbd>C</kbd>: コミットをコピー (cherry-pick)
121123
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
122124
<kbd>&lt;enter&gt;</kbd>: View selected item's files
123125
<kbd>/</kbd>: 検索を開始
@@ -269,7 +271,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
269271
<kbd>&lt;left&gt;</kbd>: 前のhunkを選択
270272
<kbd>&lt;right&gt;</kbd>: 次のhunkを選択
271273
<kbd>v</kbd>: 範囲選択を切り替え
272-
<kbd>V</kbd>: 範囲選択を切り替え
273274
<kbd>a</kbd>: Hunk選択を切り替え
274275
<kbd>&lt;c-o&gt;</kbd>: 選択されたテキストをクリップボードにコピー
275276
<kbd>o</kbd>: ファイルを開く
@@ -285,7 +286,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
285286
<kbd>&lt;left&gt;</kbd>: 前のhunkを選択
286287
<kbd>&lt;right&gt;</kbd>: 次のhunkを選択
287288
<kbd>v</kbd>: 範囲選択を切り替え
288-
<kbd>V</kbd>: 範囲選択を切り替え
289289
<kbd>a</kbd>: Hunk選択を切り替え
290290
<kbd>&lt;c-o&gt;</kbd>: 選択されたテキストをクリップボードにコピー
291291
<kbd>o</kbd>: ファイルを開く
@@ -346,8 +346,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
346346
<kbd>o</kbd>: ブラウザでコミットを開く
347347
<kbd>n</kbd>: コミットにブランチを作成
348348
<kbd>g</kbd>: View reset options
349-
<kbd>c</kbd>: コミットをコピー (cherry-pick)
350-
<kbd>C</kbd>: コミットを範囲コピー (cherry-pick)
349+
<kbd>C</kbd>: コミットをコピー (cherry-pick)
351350
<kbd>&lt;c-r&gt;</kbd>: Reset cherry-picked (copied) commits selection
352351
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
353352
<kbd>&lt;enter&gt;</kbd>: コミットを閲覧

docs/keybindings/Keybindings_ko.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
3737
<kbd>.</kbd>: 다음 페이지
3838
<kbd>&lt;</kbd>: 맨 위로 스크롤
3939
<kbd>&gt;</kbd>: 맨 아래로 스크롤
40+
<kbd>v</kbd>: 드래그 선택 전환
41+
<kbd>&lt;s-down&gt;</kbd>: Range select down
42+
<kbd>&lt;s-up&gt;</kbd>: Range select up
4043
<kbd>/</kbd>: 검색 시작
4144
<kbd>H</kbd>: 우 스크롤
4245
<kbd>L</kbd>: 좌 스크롤
@@ -54,8 +57,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
5457
<kbd>o</kbd>: 브라우저에서 커밋 열기
5558
<kbd>n</kbd>: 커밋에서 새 브랜치를 만듭니다.
5659
<kbd>g</kbd>: View reset options
57-
<kbd>c</kbd>: 커밋을 복사 (cherry-pick)
58-
<kbd>C</kbd>: 커밋을 범위로 복사 (cherry-pick)
60+
<kbd>C</kbd>: 커밋을 복사 (cherry-pick)
5961
<kbd>&lt;c-r&gt;</kbd>: Reset cherry-picked (copied) commits selection
6062
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
6163
<kbd>&lt;enter&gt;</kbd>: 커밋 보기
@@ -85,8 +87,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
8587
<kbd>o</kbd>: 브라우저에서 커밋 열기
8688
<kbd>n</kbd>: 커밋에서 새 브랜치를 만듭니다.
8789
<kbd>g</kbd>: View reset options
88-
<kbd>c</kbd>: 커밋을 복사 (cherry-pick)
89-
<kbd>C</kbd>: 커밋을 범위로 복사 (cherry-pick)
90+
<kbd>C</kbd>: 커밋을 복사 (cherry-pick)
9091
<kbd>&lt;c-r&gt;</kbd>: Reset cherry-picked (copied) commits selection
9192
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
9293
<kbd>&lt;enter&gt;</kbd>: View selected item's files
@@ -141,7 +142,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
141142
<kbd>&lt;left&gt;</kbd>: 이전 hunk를 선택
142143
<kbd>&lt;right&gt;</kbd>: 다음 hunk를 선택
143144
<kbd>v</kbd>: 드래그 선택 전환
144-
<kbd>V</kbd>: 드래그 선택 전환
145145
<kbd>a</kbd>: Toggle select hunk
146146
<kbd>&lt;c-o&gt;</kbd>: 선택한 텍스트를 클립보드에 복사
147147
<kbd>o</kbd>: 파일 닫기
@@ -157,7 +157,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
157157
<kbd>&lt;left&gt;</kbd>: 이전 hunk를 선택
158158
<kbd>&lt;right&gt;</kbd>: 다음 hunk를 선택
159159
<kbd>v</kbd>: 드래그 선택 전환
160-
<kbd>V</kbd>: 드래그 선택 전환
161160
<kbd>a</kbd>: Toggle select hunk
162161
<kbd>&lt;c-o&gt;</kbd>: 선택한 텍스트를 클립보드에 복사
163162
<kbd>o</kbd>: 파일 닫기
@@ -263,12 +262,13 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
263262
<kbd>R</kbd>: 에디터에서 커밋메시지 수정
264263
<kbd>d</kbd>: 커밋 삭제
265264
<kbd>e</kbd>: 커밋을 편집
265+
<kbd>i</kbd>: Start interactive rebase
266266
<kbd>p</kbd>: Pick commit (when mid-rebase)
267267
<kbd>F</kbd>: Create fixup commit for this commit
268268
<kbd>S</kbd>: Squash all 'fixup!' commits above selected commit (autosquash)
269269
<kbd>&lt;c-j&gt;</kbd>: 커밋을 1개 아래로 이동
270270
<kbd>&lt;c-k&gt;</kbd>: 커밋을 1개 위로 이동
271-
<kbd>v</kbd>: 커밋을 붙여넣기 (cherry-pick)
271+
<kbd>V</kbd>: 커밋을 붙여넣기 (cherry-pick)
272272
<kbd>B</kbd>: Mark commit as base commit for rebase
273273
<kbd>A</kbd>: Amend commit with staged changes
274274
<kbd>a</kbd>: Open amend commit attributes menu
@@ -281,8 +281,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
281281
<kbd>o</kbd>: 브라우저에서 커밋 열기
282282
<kbd>n</kbd>: 커밋에서 새 브랜치를 만듭니다.
283283
<kbd>g</kbd>: View reset options
284-
<kbd>c</kbd>: 커밋을 복사 (cherry-pick)
285-
<kbd>C</kbd>: 커밋을 범위로 복사 (cherry-pick)
284+
<kbd>C</kbd>: 커밋을 복사 (cherry-pick)
286285
<kbd>&lt;c-t&gt;</kbd>: Open external diff tool (git difftool)
287286
<kbd>&lt;enter&gt;</kbd>: View selected item's files
288287
<kbd>/</kbd>: 검색 시작

0 commit comments

Comments
 (0)