Skip to content

Commit cc2bd24

Browse files
authored
Merge branch 'master' into add-confirmation-dialogs-destructive-actions
2 parents 9d976bc + 38dd035 commit cc2bd24

30 files changed

+963
-212
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ jobs:
6565
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
6666
6767
- name: Check for changes since last release
68+
env:
69+
LATEST_TAG: ${{ env.latest_tag }}
6870
run: |
69-
if [ -z "$(git diff --name-only ${{ env.latest_tag }})" ]; then
71+
if [ -z "$(git diff --name-only "$LATEST_TAG")" ]; then
7072
echo "No changes detected since last release"
7173
exit 1
7274
fi
@@ -110,12 +112,16 @@ jobs:
110112
GITHUB_TOKEN: ${{ secrets.LAZYGIT_RELEASE_PAT }}
111113

112114
- name: Calculate next version
115+
env:
116+
LATEST_TAG: ${{ env.latest_tag }}
117+
EVENT_NAME: ${{ github.event_name }}
118+
VERSION_BUMP: ${{ inputs.version_bump }}
113119
run: |
114-
echo "Latest tag: ${{ env.latest_tag }}"
115-
IFS='.' read -r major minor patch <<< "${{ env.latest_tag }}"
120+
echo "Latest tag: $LATEST_TAG"
121+
IFS='.' read -r major minor patch <<< "$LATEST_TAG"
116122
117-
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
118-
if [[ "${{ inputs.version_bump }}" == "patch" ]]; then
123+
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
124+
if [[ "$VERSION_BUMP" == "patch" ]]; then
119125
patch=$((patch + 1))
120126
else
121127
minor=$((minor + 1))
@@ -138,13 +144,14 @@ jobs:
138144
echo "new_tag=$new_tag" >> $GITHUB_ENV
139145
140146
- name: Create and Push Tag
147+
env:
148+
NEW_TAG: ${{ env.new_tag }}
149+
GITHUB_TOKEN: ${{ secrets.LAZYGIT_RELEASE_PAT }}
141150
run: |
142151
git config user.name "github-actions[bot]"
143152
git config user.email "github-actions[bot]@users.noreply.github.com"
144-
git tag ${{ env.new_tag }} -a -m "Release ${{ env.new_tag }}"
145-
git push origin ${{ env.new_tag }}
146-
env:
147-
GITHUB_TOKEN: ${{ secrets.LAZYGIT_RELEASE_PAT }}
153+
git tag "$NEW_TAG" -a -m "Release $NEW_TAG"
154+
git push origin "$NEW_TAG"
148155
149156
- name: Setup Go
150157
uses: actions/setup-go@v6

docs-master/Custom_Command_Keybindings.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ These fields are applicable to all prompts.
102102
| type | One of 'input', 'confirm', 'menu', 'menuFromCommand' | yes |
103103
| title | The title to display in the popup panel | no |
104104
| key | Used to reference the entered value from within the custom command. E.g. a prompt with `key: 'Branch'` can be referred to as `{{.Form.Branch}}` in the command | yes |
105+
| condition | A Go template expression; if it resolves to empty string or `false`, the prompt is skipped. See [Conditional prompts](#conditional-prompts) | no |
105106

106107
### Input
107108

@@ -319,6 +320,41 @@ Here's an example using a command but not specifying anything else: so each line
319320
command: 'ls'
320321
```
321322

323+
### Conditional prompts
324+
325+
Here's an example of a conditional prompt:
326+
327+
```yml
328+
customCommands:
329+
- key: 'a'
330+
context: 'localBranches'
331+
prompts:
332+
- type: 'menu'
333+
title: 'How do you want to create the branch?'
334+
key: 'Method'
335+
options:
336+
- value: 'simple'
337+
name: 'Simple'
338+
description: 'just a branch name'
339+
- value: 'prefix'
340+
name: 'With prefix'
341+
description: 'with a category prefix'
342+
- type: 'menu'
343+
title: 'Branch prefix'
344+
key: 'Prefix'
345+
condition: '{{ eq .Form.Method "prefix" }}'
346+
options:
347+
- value: 'feature/'
348+
- value: 'hotfix/'
349+
- value: 'release/'
350+
- type: 'input'
351+
title: 'Branch name'
352+
key: 'Name'
353+
command: "git checkout -b '{{.Form.Prefix}}{{.Form.Name}}'"
354+
```
355+
356+
In this example the 'Branch prefix' menu only appears if the user chose 'With prefix'. Otherwise it is skipped and `.Form.Prefix` defaults to empty string.
357+
322358
## Placeholder values
323359

324360
Your commands can contain placeholder strings using Go's [template syntax](https://jan.newmarch.name/golang/template/chapter-template.html). The template syntax is pretty powerful, letting you do things like conditionals if you want, but for the most part you'll simply want to be accessing the fields on the following objects:

docs-master/keybindings/Keybindings_pt.md

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

docs/Config.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ gui:
222222
# item at top level.
223223
showRootItemInFileTree: true
224224

225+
# How to sort files and directories in the file tree.
226+
# One of: 'mixed' (default) | 'filesFirst' | 'foldersFirst'
227+
fileTreeSortOrder: mixed
228+
229+
# If true (default), sort the file tree case-sensitively.
230+
fileTreeSortCaseSensitive: true
231+
225232
# If true, show the number of lines changed per file in the Files view
226233
showNumstatInFilesView: false
227234

@@ -291,6 +298,16 @@ gui:
291298
# One of 'auto' (default) | 'always' | 'never'
292299
portraitMode: auto
293300

301+
# In 'auto' mode, portrait mode will be used if the window width is less than or
302+
# equal to portraitModeAutoMaxWidth and the window height is greater than or
303+
# equal to portraitModeAutoMinHeight. Unused when portraitMode is not 'auto'.
304+
portraitModeAutoMaxWidth: 84
305+
306+
# In 'auto' mode, portrait mode will be used if the window width is less than or
307+
# equal to portraitModeAutoMaxWidth and the window height is greater than or
308+
# equal to portraitModeAutoMinHeight. Unused when portraitMode is not 'auto'.
309+
portraitModeAutoMinHeight: 46
310+
294311
# How things are filtered when typing '/'.
295312
# One of 'substring' (default) | 'fuzzy'
296313
filterMode: substring
@@ -690,6 +707,7 @@ keybinding:
690707
branches:
691708
createPullRequest: o
692709
viewPullRequestOptions: O
710+
openPullRequestInBrowser: G
693711
copyPullRequestURL: <c-y>
694712
checkoutBranchByName: c
695713
forceCheckoutBranch: F
@@ -732,6 +750,7 @@ keybinding:
732750
copyCommitAttributeToClipboard: "y"
733751
openLogMenu: <c-l>
734752
openInBrowser: o
753+
openPullRequestInBrowser: G
735754
viewBisectOptions: b
736755
startInteractiveRebase: i
737756
selectCommitsOfCurrentBranch: '*'

docs/Custom_Command_Keybindings.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ These fields are applicable to all prompts.
102102
| type | One of 'input', 'confirm', 'menu', 'menuFromCommand' | yes |
103103
| title | The title to display in the popup panel | no |
104104
| key | Used to reference the entered value from within the custom command. E.g. a prompt with `key: 'Branch'` can be referred to as `{{.Form.Branch}}` in the command | yes |
105+
| condition | A Go template expression; if it resolves to empty string or `false`, the prompt is skipped. See [Conditional prompts](#conditional-prompts) | no |
105106

106107
### Input
107108

@@ -319,6 +320,41 @@ Here's an example using a command but not specifying anything else: so each line
319320
command: 'ls'
320321
```
321322

323+
### Conditional prompts
324+
325+
Here's an example of a conditional prompt:
326+
327+
```yml
328+
customCommands:
329+
- key: 'a'
330+
context: 'localBranches'
331+
prompts:
332+
- type: 'menu'
333+
title: 'How do you want to create the branch?'
334+
key: 'Method'
335+
options:
336+
- value: 'simple'
337+
name: 'Simple'
338+
description: 'just a branch name'
339+
- value: 'prefix'
340+
name: 'With prefix'
341+
description: 'with a category prefix'
342+
- type: 'menu'
343+
title: 'Branch prefix'
344+
key: 'Prefix'
345+
condition: '{{ eq .Form.Method "prefix" }}'
346+
options:
347+
- value: 'feature/'
348+
- value: 'hotfix/'
349+
- value: 'release/'
350+
- type: 'input'
351+
title: 'Branch name'
352+
key: 'Name'
353+
command: "git checkout -b '{{.Form.Prefix}}{{.Form.Name}}'"
354+
```
355+
356+
In this example the 'Branch prefix' menu only appears if the user chose 'With prefix'. Otherwise it is skipped and `.Form.Prefix` defaults to empty string.
357+
322358
## Placeholder values
323359

324360
Your commands can contain placeholder strings using Go's [template syntax](https://jan.newmarch.name/golang/template/chapter-template.html). The template syntax is pretty powerful, letting you do things like conditionals if you want, but for the most part you'll simply want to be accessing the fields on the following objects:

docs/keybindings/Keybindings_en.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
107107
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
108108
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
109109
| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
110+
| `` G `` | Open pull request in browser | |
110111
| `` <space> `` | Checkout | Checkout the selected commit as a detached HEAD. |
111112
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
112113
| `` o `` | Open commit in browser | |
@@ -180,6 +181,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
180181
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
181182
| `` o `` | Create pull request | |
182183
| `` O `` | View create pull request options | |
184+
| `` G `` | Open pull request in browser | |
183185
| `` <c-y> `` | Copy pull request URL to clipboard | |
184186
| `` c `` | Checkout by name | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
185187
| `` - `` | Checkout previous branch | |

docs/keybindings/Keybindings_ja.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ _凡例:`<c-b>` はctrl+b、`<a-b>` はalt+b、`B` はshift+bを意味
8787
| `` t `` | リバート | 選択したコミットの変更を逆に適用する、リバートコミットを作成します。 |
8888
| `` T `` | コミットにタグを付ける | 選択したコミットを指すタグを新規作成します。タグ名とオプションの説明を入力するよう促されます。 |
8989
| `` <c-l> `` | ログオプションを表示 | コミットログのオプションを表示します(例:並び順の変更、Gitグラフの非表示、Gitグラフ全体の表示)。 |
90+
| `` G `` | Open pull request in browser | |
9091
| `` <space> `` | チェックアウト(ブランチの切り替え) | 選択したコミットをデタッチドヘッド(特定のブランチに属さない状態)としてチェックアウトします。 |
9192
| `` y `` | コミット属性をクリップボードにコピー | コミット属性をクリップボードにコピーします(例:ハッシュ、URL、差分、メッセージ、作者)。 |
9293
| `` o `` | ブラウザでコミットを開く | |
@@ -379,6 +380,7 @@ _凡例:`<c-b>` はctrl+b、`<a-b>` はalt+b、`B` はshift+bを意味
379380
| `` N `` | コミットを新しいブランチに移動 | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
380381
| `` o `` | プルリクエストを作成 | |
381382
| `` O `` | プルリクエスト作成オプションを表示 | |
383+
| `` G `` | Open pull request in browser | |
382384
| `` <c-y> `` | プルリクエストURLをクリップボードにコピー | |
383385
| `` c `` | 名前でチェックアウト | 名前でチェックアウトします。入力ボックスに「-」を入力すると、最後のブランチをチェックアウトすることができます。 |
384386
| `` - `` | 直前のブランチにチェックアウト | |

docs/keybindings/Keybindings_ko.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
215215
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
216216
| `` o `` | 풀 리퀘스트 생성 | |
217217
| `` O `` | 풀 리퀘스트 생성 옵션 | |
218+
| `` G `` | Open pull request in browser | |
218219
| `` <c-y> `` | 풀 리퀘스트 URL을 클립보드에 복사 | |
219220
| `` c `` | 이름으로 체크아웃 | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
220221
| `` - `` | Checkout previous branch | |
@@ -318,6 +319,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
318319
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
319320
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
320321
| `` <c-l> `` | 로그 메뉴 열기 | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
322+
| `` G `` | Open pull request in browser | |
321323
| `` <space> `` | 체크아웃 | Checkout the selected commit as a detached HEAD. |
322324
| `` y `` | 커밋 attribute 복사 | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
323325
| `` o `` | 브라우저에서 커밋 열기 | |

docs/keybindings/Keybindings_nl.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
105105
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
106106
| `` o `` | Maak een pull-request | |
107107
| `` O `` | Bekijk opties voor pull-aanvraag | |
108+
| `` G `` | Open pull request in browser | |
108109
| `` <c-y> `` | Kopieer de URL van het pull-verzoek naar het klembord | |
109110
| `` c `` | Uitchecken bij naam | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
110111
| `` - `` | Checkout previous branch | |
@@ -178,6 +179,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
178179
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
179180
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
180181
| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
182+
| `` G `` | Open pull request in browser | |
181183
| `` <space> `` | Uitchecken | Checkout the selected commit as a detached HEAD. |
182184
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
183185
| `` o `` | Open commit in browser | |

docs/keybindings/Keybindings_pl.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
8080
| `` t `` | Cofnij | Utwórz commit cofający dla wybranego commita, który stosuje zmiany wybranego commita w odwrotnej kolejności. |
8181
| `` T `` | Otaguj commit | Utwórz nowy tag wskazujący na wybrany commit. Zostaniesz poproszony o wprowadzenie nazwy tagu i opcjonalnego opisu. |
8282
| `` <c-l> `` | Zobacz opcje logów | Zobacz opcje dla logów commitów, np. zmiana kolejności sortowania, ukrywanie grafu gita, pokazywanie całego grafu gita. |
83+
| `` G `` | Open pull request in browser | |
8384
| `` <space> `` | Przełącz | Przełącz wybrany commit jako odłączoną HEAD. |
8485
| `` y `` | Kopiuj atrybut commita do schowka | Kopiuj atrybut commita do schowka (np. hash, URL, różnice, wiadomość, autor). |
8586
| `` o `` | Otwórz commit w przeglądarce | |
@@ -146,6 +147,7 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
146147
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
147148
| `` o `` | Utwórz żądanie ściągnięcia | |
148149
| `` O `` | Zobacz opcje tworzenia pull requesta | |
150+
| `` G `` | Open pull request in browser | |
149151
| `` <c-y> `` | Kopiuj adres URL żądania ściągnięcia do schowka | |
150152
| `` c `` | Przełącz według nazwy | Przełącz według nazwy. W polu wprowadzania możesz wpisać '-' aby przełączyć się na ostatnią gałąź. |
151153
| `` - `` | Checkout previous branch | |

0 commit comments

Comments
 (0)