Skip to content

Commit 12fa50a

Browse files
authored
Add a command to select all commits of the current branch (#4448)
- **PR Description** This is useful for seeing the combined diff of all commits of a branch. - **Please check if the PR fulfills these requirements** * [x] Cheatsheets are up-to-date (run `go generate ./...`) * [x] Code has been formatted (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting)) * [x] Tests have been added/updated (see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md) for the integration test guide) * [x] Text is internationalised (see [here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation)) * [ ] If a new UserConfig entry was added, make sure it can be hot-reloaded (see [here](https://github.com/jesseduffield/lazygit/blob/master/docs/dev/Codebase_Guide.md#using-userconfig)) * [ ] Docs have been updated if necessary * [x] You've read through your own file changes for silly mistakes etc
2 parents 7bccf84 + 80b5e21 commit 12fa50a

16 files changed

+159
-0
lines changed

Diff for: docs/Config.md

+1
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ keybinding:
616616
openInBrowser: o
617617
viewBisectOptions: b
618618
startInteractiveRebase: i
619+
selectCommitsOfCurrentBranch: '*'
619620
amendAttribute:
620621
resetAuthor: a
621622
setAuthor: A

Diff for: docs/keybindings/Keybindings_en.md

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If you would instead like to start an interactive rebase from the selected commi
111111
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
112112
| `` C `` | Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
113113
| `` <c-t> `` | Open external diff tool (git difftool) | |
114+
| `` * `` | Select commits of current branch | |
114115
| `` <enter> `` | View files | |
115116
| `` w `` | View worktree options | |
116117
| `` / `` | Search the current view by text | |
@@ -262,6 +263,7 @@ If you would instead like to start an interactive rebase from the selected commi
262263
| `` C `` | Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
263264
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
264265
| `` <c-t> `` | Open external diff tool (git difftool) | |
266+
| `` * `` | Select commits of current branch | |
265267
| `` <enter> `` | View commits | |
266268
| `` w `` | View worktree options | |
267269
| `` / `` | Filter the current view by text | |
@@ -331,6 +333,7 @@ If you would instead like to start an interactive rebase from the selected commi
331333
| `` C `` | Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
332334
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
333335
| `` <c-t> `` | Open external diff tool (git difftool) | |
336+
| `` * `` | Select commits of current branch | |
334337
| `` <enter> `` | View files | |
335338
| `` w `` | View worktree options | |
336339
| `` / `` | Search the current view by text | |

Diff for: docs/keybindings/Keybindings_ja.md

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
7777
| `` C `` | コミットをコピー (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
7878
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
7979
| `` <c-t> `` | Open external diff tool (git difftool) | |
80+
| `` * `` | Select commits of current branch | |
8081
| `` <enter> `` | View files | |
8182
| `` w `` | View worktree options | |
8283
| `` / `` | 検索を開始 | |
@@ -125,6 +126,7 @@ If you would instead like to start an interactive rebase from the selected commi
125126
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
126127
| `` C `` | コミットをコピー (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
127128
| `` <c-t> `` | Open external diff tool (git difftool) | |
129+
| `` * `` | Select commits of current branch | |
128130
| `` <enter> `` | View files | |
129131
| `` w `` | View worktree options | |
130132
| `` / `` | 検索を開始 | |
@@ -363,6 +365,7 @@ If you would instead like to start an interactive rebase from the selected commi
363365
| `` C `` | コミットをコピー (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
364366
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
365367
| `` <c-t> `` | Open external diff tool (git difftool) | |
368+
| `` * `` | Select commits of current branch | |
366369
| `` <enter> `` | コミットを閲覧 | |
367370
| `` w `` | View worktree options | |
368371
| `` / `` | Filter the current view by text | |

Diff for: docs/keybindings/Keybindings_ko.md

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
6464
| `` C `` | 커밋을 복사 (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
6565
| `` <c-r> `` | Reset cherry-picked (copied) commits selection | |
6666
| `` <c-t> `` | Open external diff tool (git difftool) | |
67+
| `` * `` | Select commits of current branch | |
6768
| `` <enter> `` | 커밋 보기 | |
6869
| `` w `` | View worktree options | |
6970
| `` / `` | Filter the current view by text | |
@@ -94,6 +95,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
9495
| `` C `` | 커밋을 복사 (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
9596
| `` <c-r> `` | Reset cherry-picked (copied) commits selection | |
9697
| `` <c-t> `` | Open external diff tool (git difftool) | |
98+
| `` * `` | Select commits of current branch | |
9799
| `` <enter> `` | View selected item's files | |
98100
| `` w `` | View worktree options | |
99101
| `` / `` | 검색 시작 | |
@@ -290,6 +292,7 @@ If you would instead like to start an interactive rebase from the selected commi
290292
| `` g `` | View reset options | View reset options (soft/mixed/hard) for resetting onto selected item. |
291293
| `` C `` | 커밋을 복사 (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
292294
| `` <c-t> `` | Open external diff tool (git difftool) | |
295+
| `` * `` | Select commits of current branch | |
293296
| `` <enter> `` | View selected item's files | |
294297
| `` w `` | View worktree options | |
295298
| `` / `` | 검색 시작 | |

Diff for: docs/keybindings/Keybindings_nl.md

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ If you would instead like to start an interactive rebase from the selected commi
177177
| `` g `` | Bekijk reset opties | View reset options (soft/mixed/hard) for resetting onto selected item. |
178178
| `` C `` | Kopieer commit (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
179179
| `` <c-t> `` | Open external diff tool (git difftool) | |
180+
| `` * `` | Select commits of current branch | |
180181
| `` <enter> `` | Bekijk gecommite bestanden | |
181182
| `` w `` | View worktree options | |
182183
| `` / `` | Start met zoeken | |
@@ -240,6 +241,7 @@ If you would instead like to start an interactive rebase from the selected commi
240241
| `` C `` | Kopieer commit (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
241242
| `` <c-r> `` | Reset cherry-picked (gekopieerde) commits selectie | |
242243
| `` <c-t> `` | Open external diff tool (git difftool) | |
244+
| `` * `` | Select commits of current branch | |
243245
| `` <enter> `` | Bekijk commits | |
244246
| `` w `` | View worktree options | |
245247
| `` / `` | Filter the current view by text | |
@@ -331,6 +333,7 @@ If you would instead like to start an interactive rebase from the selected commi
331333
| `` C `` | Kopieer commit (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
332334
| `` <c-r> `` | Reset cherry-picked (gekopieerde) commits selectie | |
333335
| `` <c-t> `` | Open external diff tool (git difftool) | |
336+
| `` * `` | Select commits of current branch | |
334337
| `` <enter> `` | Bekijk gecommite bestanden | |
335338
| `` w `` | View worktree options | |
336339
| `` / `` | Start met zoeken | |

Diff for: docs/keybindings/Keybindings_pl.md

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
8585
| `` g `` | Reset | Wyświetl opcje resetu (miękki/mieszany/twardy) do wybranego elementu. |
8686
| `` C `` | Kopiuj (cherry-pick) | Oznacz commit jako skopiowany. Następnie, w widoku lokalnych commitów, możesz nacisnąć `V`, aby wkleić (cherry-pick) skopiowane commity do sprawdzonej gałęzi. W dowolnym momencie możesz nacisnąć `<esc>`, aby anulować zaznaczenie. |
8787
| `` <c-t> `` | Otwórz zewnętrzne narzędzie różnic (git difftool) | |
88+
| `` * `` | Select commits of current branch | |
8889
| `` <enter> `` | Wyświetl pliki | |
8990
| `` w `` | Zobacz opcje drzewa pracy | |
9091
| `` / `` | Szukaj w bieżącym widoku po tekście | |
@@ -272,6 +273,7 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
272273
| `` C `` | Kopiuj (cherry-pick) | Oznacz commit jako skopiowany. Następnie, w widoku lokalnych commitów, możesz nacisnąć `V`, aby wkleić (cherry-pick) skopiowane commity do sprawdzonej gałęzi. W dowolnym momencie możesz nacisnąć `<esc>`, aby anulować zaznaczenie. |
273274
| `` <c-r> `` | Resetuj wybrane (cherry-picked) commity | |
274275
| `` <c-t> `` | Otwórz zewnętrzne narzędzie różnic (git difftool) | |
276+
| `` * `` | Select commits of current branch | |
275277
| `` <enter> `` | Pokaż commity | |
276278
| `` w `` | Zobacz opcje drzewa pracy | |
277279
| `` / `` | Filtruj bieżący widok po tekście | |
@@ -312,6 +314,7 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
312314
| `` C `` | Kopiuj (cherry-pick) | Oznacz commit jako skopiowany. Następnie, w widoku lokalnych commitów, możesz nacisnąć `V`, aby wkleić (cherry-pick) skopiowane commity do sprawdzonej gałęzi. W dowolnym momencie możesz nacisnąć `<esc>`, aby anulować zaznaczenie. |
313315
| `` <c-r> `` | Resetuj wybrane (cherry-picked) commity | |
314316
| `` <c-t> `` | Otwórz zewnętrzne narzędzie różnic (git difftool) | |
317+
| `` * `` | Select commits of current branch | |
315318
| `` <enter> `` | Wyświetl pliki | |
316319
| `` w `` | Zobacz opcje drzewa pracy | |
317320
| `` / `` | Szukaj w bieżącym widoku po tekście | |

Diff for: docs/keybindings/Keybindings_pt.md

+3
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ If you would instead like to start an interactive rebase from the selected commi
183183
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
184184
| `` C `` | Copiar (cherry-pick) | Marcar commit como copiado. Então, dentro da visualização local de commits, você pode pressionar `V` para colar (cherry-pick) o(s) commit(s) copiado(s) em seu branch de check-out. A qualquer momento você pode pressionar `<esc>` para cancelar a seleção. |
185185
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
186+
| `` * `` | Select commits of current branch | |
186187
| `` <enter> `` | View files | |
187188
| `` w `` | View worktree options | |
188189
| `` / `` | Search the current view by text | |
@@ -292,6 +293,7 @@ Veja a documentação:
292293
| `` C `` | Copiar (cherry-pick) | Marcar commit como copiado. Então, dentro da visualização local de commits, você pode pressionar `V` para colar (cherry-pick) o(s) commit(s) copiado(s) em seu branch de check-out. A qualquer momento você pode pressionar `<esc>` para cancelar a seleção. |
293294
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
294295
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
296+
| `` * `` | Select commits of current branch | |
295297
| `` <enter> `` | View commits | |
296298
| `` w `` | View worktree options | |
297299
| `` / `` | Filter the current view by text | |
@@ -343,6 +345,7 @@ Veja a documentação:
343345
| `` C `` | Copiar (cherry-pick) | Marcar commit como copiado. Então, dentro da visualização local de commits, você pode pressionar `V` para colar (cherry-pick) o(s) commit(s) copiado(s) em seu branch de check-out. A qualquer momento você pode pressionar `<esc>` para cancelar a seleção. |
344346
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
345347
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
348+
| `` * `` | Select commits of current branch | |
346349
| `` <enter> `` | View files | |
347350
| `` w `` | View worktree options | |
348351
| `` / `` | Search the current view by text | |

Diff for: docs/keybindings/Keybindings_ru.md

+3
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ _Связки клавиш_
134134
| `` C `` | Скопировать отобранные коммит (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
135135
| `` <c-r> `` | Сбросить отобранную (скопированную | cherry-picked) выборку коммитов | |
136136
| `` <c-t> `` | Open external diff tool (git difftool) | |
137+
| `` * `` | Select commits of current branch | |
137138
| `` <enter> `` | Просмотреть коммиты | |
138139
| `` w `` | View worktree options | |
139140
| `` / `` | Filter the current view by text | |
@@ -172,6 +173,7 @@ If you would instead like to start an interactive rebase from the selected commi
172173
| `` g `` | Просмотреть параметры сброса | View reset options (soft/mixed/hard) for resetting onto selected item. |
173174
| `` C `` | Скопировать отобранные коммит (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
174175
| `` <c-t> `` | Open external diff tool (git difftool) | |
176+
| `` * `` | Select commits of current branch | |
175177
| `` <enter> `` | Просмотреть файлы выбранного элемента | |
176178
| `` w `` | View worktree options | |
177179
| `` / `` | Найти | |
@@ -231,6 +233,7 @@ If you would instead like to start an interactive rebase from the selected commi
231233
| `` C `` | Скопировать отобранные коммит (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
232234
| `` <c-r> `` | Сбросить отобранную (скопированную | cherry-picked) выборку коммитов | |
233235
| `` <c-t> `` | Open external diff tool (git difftool) | |
236+
| `` * `` | Select commits of current branch | |
234237
| `` <enter> `` | Просмотреть файлы выбранного элемента | |
235238
| `` w `` | View worktree options | |
236239
| `` / `` | Найти | |

Diff for: docs/keybindings/Keybindings_zh-CN.md

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
6464
| `` C `` | 复制提交(拣选) | 标记提交为已复制。然后,在本地提交视图中,你可以按 `V` (Cherry-Pick) 将已复制的提交粘贴到已检出的分支中。任何时候都可以按 `<esc>` 来取消选择。 |
6565
| `` <c-r> `` | 重置已拣选(复制)的提交 | |
6666
| `` <c-t> `` | 使用外部差异比较工具(git difftool) | |
67+
| `` * `` | Select commits of current branch | |
6768
| `` <enter> `` | 查看提交 | |
6869
| `` w `` | 查看工作区选项 | |
6970
| `` / `` | 通过文本过滤当前视图 | |
@@ -108,6 +109,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
108109
| `` C `` | 复制提交(拣选) | 标记提交为已复制。然后,在本地提交视图中,你可以按 `V` (Cherry-Pick) 将已复制的提交粘贴到已检出的分支中。任何时候都可以按 `<esc>` 来取消选择。 |
109110
| `` <c-r> `` | 重置已拣选(复制)的提交 | |
110111
| `` <c-t> `` | 使用外部差异比较工具(git difftool) | |
112+
| `` * `` | Select commits of current branch | |
111113
| `` <enter> `` | 查看提交的文件 | |
112114
| `` w `` | 查看工作区选项 | |
113115
| `` / `` | 开始搜索 | |
@@ -170,6 +172,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
170172
| `` g `` | 查看重置选项 | 查看重置选项 (soft/mixed/hard) 用于重置到选择项 |
171173
| `` C `` | 复制提交(拣选) | 标记提交为已复制。然后,在本地提交视图中,你可以按 `V` (Cherry-Pick) 将已复制的提交粘贴到已检出的分支中。任何时候都可以按 `<esc>` 来取消选择。 |
172174
| `` <c-t> `` | 使用外部差异比较工具(git difftool) | |
175+
| `` * `` | Select commits of current branch | |
173176
| `` <enter> `` | 查看提交的文件 | |
174177
| `` w `` | 查看工作区选项 | |
175178
| `` / `` | 开始搜索 | |

Diff for: docs/keybindings/Keybindings_zh-TW.md

+3
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ _說明:`<c-b>` 表示 Ctrl+B、`<a-b>` 表示 Alt+B,`B`表示 Shift+B
132132
| `` C `` | 複製提交 (揀選) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
133133
| `` <c-r> `` | 重設選定的揀選 (複製) 提交 | |
134134
| `` <c-t> `` | 開啟外部差異工具 (git difftool) | |
135+
| `` * `` | Select commits of current branch | |
135136
| `` <enter> `` | 檢視所選項目的檔案 | |
136137
| `` w `` | 檢視工作目錄選項 | |
137138
| `` / `` | 搜尋 | |
@@ -194,6 +195,7 @@ If you would instead like to start an interactive rebase from the selected commi
194195
| `` g `` | 檢視重設選項 | View reset options (soft/mixed/hard) for resetting onto selected item. |
195196
| `` C `` | 複製提交 (揀選) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
196197
| `` <c-t> `` | 開啟外部差異工具 (git difftool) | |
198+
| `` * `` | Select commits of current branch | |
197199
| `` <enter> `` | 檢視所選項目的檔案 | |
198200
| `` w `` | 檢視工作目錄選項 | |
199201
| `` / `` | 搜尋 | |
@@ -250,6 +252,7 @@ If you would instead like to start an interactive rebase from the selected commi
250252
| `` C `` | 複製提交 (揀選) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. |
251253
| `` <c-r> `` | 重設選定的揀選 (複製) 提交 | |
252254
| `` <c-t> `` | 開啟外部差異工具 (git difftool) | |
255+
| `` * `` | Select commits of current branch | |
253256
| `` <enter> `` | 檢視提交 | |
254257
| `` w `` | 檢視工作目錄選項 | |
255258
| `` / `` | 搜尋 | |

Diff for: pkg/config/user_config.go

+2
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ type KeybindingCommitsConfig struct {
516516
OpenInBrowser string `yaml:"openInBrowser"`
517517
ViewBisectOptions string `yaml:"viewBisectOptions"`
518518
StartInteractiveRebase string `yaml:"startInteractiveRebase"`
519+
SelectCommitsOfCurrentBranch string `yaml:"selectCommitsOfCurrentBranch"`
519520
}
520521

521522
type KeybindingAmendAttributeConfig struct {
@@ -991,6 +992,7 @@ func GetDefaultConfig() *UserConfig {
991992
OpenInBrowser: "o",
992993
ViewBisectOptions: "b",
993994
StartInteractiveRebase: "i",
995+
SelectCommitsOfCurrentBranch: "*",
994996
},
995997
AmendAttribute: KeybindingAmendAttributeConfig{
996998
ResetAuthor: "a",

0 commit comments

Comments
 (0)