Compare commits

..
Author SHA1 Message Date
Jesse Duffield 6acac9efc2 Merge 06e0acb338 into 91cb1ff29a 2025-01-11 04:40:39 +00:00
Jesse Duffield 06e0acb338 WIP 2025-01-11 15:40:32 +11:00
Jesse Duffield 50bd95be88 WIP 2025-01-11 15:36:00 +11:00
Jesse Duffield c96b70c160 WIP 2025-01-11 15:33:40 +11:00
Jesse Duffield 8773a2b880 WIP 2025-01-11 15:22:27 +11:00
Jesse Duffield 7f8c08cd5d Automatically cut release each month 2025-01-11 15:19:30 +11:00
198 changed files with 926 additions and 5104 deletions
+20 -22
View File
@@ -1,10 +1,14 @@
name: Automated Release
on:
schedule:
# Runs at 2:00 AM UTC on the first Saturday of every month
- cron: '0 2 * * 6'
workflow_dispatch: # Allow manual triggering of the workflow
push:
branches:
- master
pull_request:
# schedule:
# # Runs at 2:00 AM UTC on the first Saturday of every month
# - cron: '0 2 * * 6'
# workflow_dispatch: # Allow manual triggering of the workflow
jobs:
check-and-release:
@@ -16,18 +20,12 @@ jobs:
with:
fetch-depth: 0
- name: Get Latest Tag
run: |
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
echo "Latest tag: $latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Check for changes since last release
run: |
if [ -z "$(git diff --name-only ${{ env.latest_tag }})" ]; then
echo "No changes detected since last release"
exit 1
fi
# - name: Check for changes since last release
# run: |
# if [ -z "$(git diff --name-only ${{ env.latest_tag }})" ]; then
# echo "No changes detected since last release"
# exit 1
# fi
- name: Check for Blocking Issues/PRs
id: check_blocks
@@ -59,19 +57,19 @@ jobs:
- name: Calculate next version
run: |
echo "Latest tag: ${{ env.latest_tag }}"
IFS='.' read -r major minor patch <<< "${{ env.latest_tag }}"
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
echo "Latest tag: $latest_tag"
IFS='.' read -r major minor patch <<< "$latest_tag"
new_minor=$((minor + 1))
new_tag="$major.$new_minor.0"
echo "New tag: $new_tag"
echo "new_tag=$new_tag" >> $GITHUB_ENV
# This will trigger a deploy via .github/workflows/cd.yml
- name: Push New Tag
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag ${{ env.new_tag }}
git push origin ${{ env.new_tag }}
git tag example-${{ env.new_tag }}
git push origin example-${{ env.new_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+3 -6
View File
File diff suppressed because one or more lines are too long
+19 -33
View File
@@ -47,10 +47,6 @@ gui:
# One of: 'margin' (default) | 'jump'
scrollOffBehavior: margin
# The number of spaces per tab; used for everything that's shown in the main view, but probably mostly relevant for diffs.
# Note that when using a pager, the pager has its own tab width setting, so you need to pass it separately in the pager command.
tabWidth: 4
# If true, capture mouse events.
# When mouse events are captured, it's a little harder to select text: e.g. requiring you to hold the option key when on macOS.
mouseEvents: true
@@ -170,7 +166,7 @@ gui:
showListFooter: true
# If true, display the files in the file views as a tree. If false, display the files as a flat list.
# This can be toggled from within Lazygit with the '`' key, but that will not change the default.
# This can be toggled from within Lazygit with the '~' key, but that will not change the default.
showFileTree: true
# If true, show the number of lines changed per file in the Files view
@@ -345,6 +341,14 @@ git:
# If true, do not allow force pushes
disableForcePushing: false
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
commitPrefix:
# pattern to match on. E.g. for 'feature/AB-123' to match on the AB-123 use "^\\w+\\/(\\w+-\\w+).*"
pattern: ""
# Replace directive. E.g. for 'feature/AB-123' to start the commit message with 'AB-123 ' use "[$1] "
replace: ""
# See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-branch-name-prefix
branchPrefix: ""
@@ -567,8 +571,6 @@ keybinding:
openMergeTool: M
openStatusFilter: <c-b>
copyFileInfoToClipboard: "y"
collapseAll: '-'
expandAll: =
branches:
createPullRequest: o
viewPullRequestOptions: O
@@ -830,17 +832,14 @@ gui:
## Custom Branch Color
You can customize the color of branches based on branch patterns (regular expressions):
You can customize the color of branches based on the branch prefix:
```yaml
gui:
branchColorPatterns:
'^docs/': '#11aaff' # use a light blue for branches beginning with 'docs/'
'ISSUE-\d+': '#ff5733' # use a bright orange for branches containing 'ISSUE-<some-number>'
branchColors:
'docs': '#11aaff' # use a light blue for branches beginning with 'docs/'
```
Note that the regular expressions are not implicitly anchored to the beginning/end of the branch name. If you want to do that, add leading `^` and/or trailing `$` as needed.
## Example Coloring
![border example](../../assets/colored-border-example.png)
@@ -918,40 +917,27 @@ Where:
## Predefined commit message prefix
In situations where certain naming pattern is used for branches and commits, pattern can be used to populate commit message with prefix that is parsed from the branch name.
If you define multiple naming patterns, they will be attempted in order until one matches.
Example hitting first match:
Example:
- Branch name: feature/AB-123
- Generated commit message prefix: [AB-123]
Example hitting second match:
- Branch name: CD-456_fix_problem
- Generated commit message prefix: (CD-456)
- Commit message: [AB-123] Adding feature
```yaml
git:
commitPrefix:
- pattern: "^\\w+\\/(\\w+-\\w+).*"
replace: '[$1] '
- pattern: "^([^_]+)_.*" # Take all text prior to the first underscore
replace: '($1) '
pattern: "^\\w+\\/(\\w+-\\w+).*"
replace: '[$1] '
```
If you want repository-specific prefixes, you can map them with `commitPrefixes`. If you have both entries in `commitPrefix` defined and an repository match in `commitPrefixes` for the current repo, the `commitPrefixes` entries will be attempted first. Repository folder names must be an exact match.
If you want repository-specific prefixes, you can map them with `commitPrefixes`. If you have both `commitPrefixes` defined and an entry in `commitPrefixes` for the current repo, the `commitPrefixes` entry is given higher precedence. Repository folder names must be an exact match.
```yaml
git:
commitPrefixes:
my_project: # This is repository folder name
- pattern: "^\\w+\\/(\\w+-\\w+).*"
replace: '[$1] '
commitPrefix:
- pattern: "^(\\w+)-.*" # A more general match for any leading word
replace : '[$1] '
- pattern: ".*" # The final fallthrough regex that copies over the whole branch name
replace : '[$0] '
pattern: "^\\w+\\/(\\w+-\\w+).*"
replace: '[$1] '
```
> [!IMPORTANT]
-6
View File
@@ -297,7 +297,6 @@ Your commands can contain placeholder strings using Go's [template syntax](https
```
SelectedCommit
SelectedCommitRange
SelectedFile
SelectedPath
SelectedLocalBranch
@@ -315,11 +314,6 @@ CheckedOutBranch
To see what fields are available on e.g. the `SelectedFile`, see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/services/custom_commands/models.go) (all the modelling lives in the same file).
We don't support accessing all elements of a range selection yet. We might add this in the future, but as a special case you can access the range of selected commits by using `SelectedCommitRange`, which has two properties `.To` and `.From` which are the hashes of the bottom and top selected commits, respectively. This is useful for passing them to a git command that operates on a range of commits. For example, to create patches for all selected commits, you might use
```yml
command: "git format-patch {{.SelectedCommitRange.From}}^..{{.SelectedCommitRange.To}}"
```
## Keybinding collisions
If your custom keybinding collides with an inbuilt keybinding that is defined for the same context, only the custom keybinding will be executed. This also applies to the global context. However, one caveat is that if you have a custom keybinding defined on the global context for some key, and there is an in-built keybinding defined for the same key and for a specific context (say the 'files' context), then the in-built keybinding will take precedence. See how to change in-built keybindings [here](https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#keybindings)
-4
View File
@@ -20,15 +20,11 @@
| `<pgup>` | Pgup |
| `<pgdown>` | Pgdn |
| `<up>` | ArrowUp |
| `<s-up>` | ShiftArrowUp |
| `<down>` | ArrowDown |
| `<s-down>` | ShiftArrowDown |
| `<left>` | ArrowLeft |
| `<right>` | ArrowRight |
| `<tab>` | Tab |
| `<backtab>` | Backtab |
| `<enter>` | Enter |
| `<a-enter>` | AltEnter |
| `<esc>` | Esc |
| `<backspace>` | Backspace |
| `<c-space>` | CtrlSpace |
-6
View File
@@ -56,7 +56,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy path to clipboard | |
| `` y `` | Copy to clipboard | |
| `` c `` | Checkout | Checkout file. This replaces the file in your working tree with the version from the selected commit. |
| `` d `` | Remove | Discard this commit's changes to this file. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes this file. |
| `` o `` | Open file | Open file in default application. |
@@ -66,8 +65,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Enter file / Toggle directory collapsed | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | Toggle file tree view | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Search the current view by text | |
## Commit summary
@@ -150,8 +147,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` <c-t> `` | Open external diff tool (git difftool) | |
| `` M `` | Open external merge tool | Run `git mergetool`. |
| `` f `` | Fetch | Fetch changes from remote. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Search the current view by text | |
## Local branches
@@ -353,7 +348,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | Checkout | Checkout the selected tag as a detached HEAD. |
| `` n `` | New tag | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | Delete | View delete options for local/remote tag. |
-6
View File
@@ -134,7 +134,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | ファイル名をクリップボードにコピー | |
| `` y `` | Copy to clipboard | |
| `` c `` | チェックアウト | Checkout file. This replaces the file in your working tree with the version from the selected commit. |
| `` d `` | Remove | Discard this commit's changes to this file. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes this file. |
| `` o `` | ファイルを開く | Open file in default application. |
@@ -144,8 +143,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Enter file / Toggle directory collapsed | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | ファイルツリーの表示を切り替え | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 検索を開始 | |
## コミットメッセージ
@@ -183,7 +180,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | チェックアウト | Checkout the selected tag as a detached HEAD. |
| `` n `` | タグを作成 | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | Delete | View delete options for local/remote tag. |
@@ -222,8 +218,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` <c-t> `` | Open external diff tool (git difftool) | |
| `` M `` | Git mergetoolを開く | Run `git mergetool`. |
| `` f `` | Fetch | Fetch changes from remote. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 検索を開始 | |
## ブランチ
+7 -13
View File
@@ -189,7 +189,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| `` <c-y> `` | 풀 리퀘스트 URL을 클립보드에 복사 | |
| `` c `` | 이름으로 체크아웃 | Checkout by name. In the input box you can enter '-' to switch to the last branch. |
| `` F `` | 강제 체크아웃 | Force checkout selected branch. This will discard all local changes in your working directory before checking out the selected branch. |
| `` d `` | 삭제 | View delete options for local/remote branch. |
| `` d `` | Delete | View delete options for local/remote branch. |
| `` r `` | 체크아웃된 브랜치를 이 브랜치에 리베이스 | Rebase the checked-out branch onto the selected branch. |
| `` M `` | 현재 브랜치에 병합 | View options for merging the selected item into the current branch (regular merge, squash merge) |
| `` f `` | Fast-forward this branch from its upstream | Fast-forward selected branch from its upstream. |
@@ -247,7 +247,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| `` n `` | 새 브랜치 생성 | |
| `` M `` | 현재 브랜치에 병합 | View options for merging the selected item into the current branch (regular merge, squash merge) |
| `` r `` | 체크아웃된 브랜치를 이 브랜치에 리베이스 | Rebase the checked-out branch onto the selected branch. |
| `` d `` | 삭제 | Delete the remote branch from the remote. |
| `` d `` | Delete | Delete the remote branch from the remote. |
| `` u `` | Set as upstream | Set the selected remote branch as the upstream of the checked-out branch. |
| `` s `` | Sort order | |
| `` g `` | View reset options | View reset options (soft/mixed/hard) for resetting onto selected item. |
@@ -263,7 +263,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| `` <c-o> `` | 커밋 해시를 클립보드에 복사 | |
| `` <c-r> `` | Reset cherry-picked (copied) commits selection | |
| `` b `` | Bisect 옵션 보기 | |
| `` s `` | 스쿼시 | Squash the selected commit into the commit below it. The selected commit's message will be appended to the commit below it. |
| `` s `` | Squash | Squash the selected commit into the commit below it. The selected commit's message will be appended to the commit below it. |
| `` f `` | Fixup | Meld the selected commit into the commit below it. Similar to squash, but the selected commit's message will be discarded. |
| `` r `` | 커밋메시지 변경 | Reword the selected commit's message. |
| `` R `` | 에디터에서 커밋메시지 수정 | |
@@ -299,7 +299,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | 파일명을 클립보드에 복사 | |
| `` y `` | 클립보드에 복사 | |
| `` c `` | 체크아웃 | Checkout file |
| `` d `` | Remove | Discard this commit's changes to this file |
| `` o `` | 파일 닫기 | Open file in default application. |
@@ -309,8 +308,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` a `` | Toggle all files included in patch | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Enter file to add selected lines to the patch (or toggle directory collapsed) | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | 파일 트리뷰로 전환 | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 검색 시작 | |
## 커밋메시지
@@ -324,12 +321,11 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | 체크아웃 | Checkout the selected tag as a detached HEAD. |
| `` n `` | 태그를 생성 | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | 삭제 | View delete options for local/remote tag. |
| `` d `` | Delete | View delete options for local/remote tag. |
| `` P `` | 태그를 push | Push the selected tag to a remote. You'll be prompted to select a remote. |
| `` g `` | 초기화 | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` <c-t> `` | Open external diff tool (git difftool) | |
| `` <enter> `` | 커밋 보기 | |
| `` w `` | View worktree options | |
@@ -342,7 +338,7 @@ If you would instead like to start an interactive rebase from the selected commi
| `` <c-o> `` | 파일명을 클립보드에 복사 | |
| `` <space> `` | Staged 전환 | Toggle staged for selected file. |
| `` <c-b> `` | 파일을 필터하기 (Staged/unstaged) | |
| `` y `` | 클립보드에 복사 | |
| `` y `` | Copy to clipboard | |
| `` c `` | 커밋 변경내용 | Commit staged changes. |
| `` w `` | Commit changes without pre-commit hook | |
| `` A `` | 마지맛 커밋 수정 | |
@@ -358,13 +354,11 @@ If you would instead like to start an interactive rebase from the selected commi
| `` <enter> `` | Stage individual hunks/lines for file, or collapse/expand for directory | If the selected item is a file, focus the staging view so you can stage individual hunks/lines. If the selected item is a directory, collapse/expand it. |
| `` d `` | View 'discard changes' options | View options for discarding changes to the selected file. |
| `` g `` | View upstream reset options | |
| `` D `` | 초기화 | View reset options for working tree (e.g. nuking the working tree). |
| `` D `` | Reset | View reset options for working tree (e.g. nuking the working tree). |
| `` ` `` | 파일 트리뷰로 전환 | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` <c-t> `` | Open external diff tool (git difftool) | |
| `` M `` | Git mergetool를 열기 | Run `git mergetool`. |
| `` f `` | Fetch | Fetch changes from remote. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 검색 시작 | |
## 확인 패널
-6
View File
@@ -79,8 +79,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| `` <c-t> `` | Open external diff tool (git difftool) | |
| `` M `` | Open external merge tool | Run `git mergetool`. |
| `` f `` | Fetch | Fetch changes from remote. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Start met zoeken | |
## Bevestigingspaneel
@@ -129,7 +127,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Kopieer de bestandsnaam naar het klembord | |
| `` y `` | Copy to clipboard | |
| `` c `` | Uitchecken | Bestand uitchecken |
| `` d `` | Remove | Uitsluit deze commit zijn veranderingen aan dit bestand |
| `` o `` | Open bestand | Open file in default application. |
@@ -139,8 +136,6 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Enter bestand om geselecteerde regels toe te voegen aan de patch | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | Toggle bestandsboom weergave | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Start met zoeken | |
## Commits
@@ -353,7 +348,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | Uitchecken | Checkout the selected tag as a detached HEAD. |
| `` n `` | Creëer tag | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | Delete | View delete options for local/remote tag. |
-6
View File
@@ -229,8 +229,6 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
| `` <c-t> `` | Otwórz zewnętrzne narzędzie różnic (git difftool) | |
| `` M `` | Otwórz zewnętrzne narzędzie scalania | Uruchom `git mergetool`. |
| `` f `` | Pobierz | Pobierz zmiany ze zdalnego serwera. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Szukaj w bieżącym widoku po tekście | |
## Pliki commita
@@ -238,7 +236,6 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Kopiuj ścieżkę do schowka | |
| `` y `` | Kopiuj do schowka | |
| `` c `` | Przełącz | Przełącz plik. Zastępuje plik w twoim drzewie roboczym wersją z wybranego commita. |
| `` d `` | Usuń | Odrzuć zmiany w tym pliku z tego commita. Uruchamia interaktywny rebase w tle, więc możesz otrzymać konflikt scalania, jeśli późniejszy commit również zmienia ten plik. |
| `` o `` | Otwórz plik | Otwórz plik w domyślnej aplikacji. |
@@ -248,8 +245,6 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
| `` a `` | Przełącz wszystkie pliki | Dodaj/usuń wszystkie pliki commita do niestandardowej łatki. Zobacz https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Wejdź do pliku / Przełącz zwiń katalog | Jeśli plik jest wybrany, wejdź do pliku, aby móc dodawać/usuwać poszczególne linie do niestandardowej łatki. Jeśli wybrany jest katalog, przełącz katalog. |
| `` ` `` | Przełącz widok drzewa plików | Przełącz widok plików między płaskim a drzewem. Płaski układ pokazuje wszystkie ścieżki plików na jednej liście, układ drzewa grupuje pliki według katalogów. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Szukaj w bieżącym widoku po tekście | |
## Podsumowanie commita
@@ -334,7 +329,6 @@ Jeśli chcesz zamiast tego rozpocząć interaktywny rebase od wybranego commita,
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | Przełącz | Przełącz wybrany tag jako odłączoną głowę (detached HEAD). |
| `` n `` | Nowy tag | Utwórz nowy tag z bieżącego commita. Zostaniesz poproszony o wprowadzenie nazwy tagu i opcjonalnego opisu. |
| `` d `` | Usuń | Wyświetl opcje usuwania lokalnego/odległego tagu. |
-379
View File
@@ -1,379 +0,0 @@
_This file is auto-generated. To update, make the changes in the pkg/i18n directory and then run `go generate ./...` from the project root._
# Lazygit Keybindings
_Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
## Combinações globais de teclas
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-r> `` | Mudar para um repositório recente | |
| `` <pgup> (fn+up/shift+k) `` | Scroll up main window | |
| `` <pgdown> (fn+down/shift+j) `` | Scroll down main window | |
| `` @ `` | View command log options | View options for the command log e.g. show/hide the command log and focus the command log. |
| `` P `` | Empurre (Push) | Faça push do branch atual para o seu branch upstream. Se nenhum upstream estiver configurado, você será solicitado a configurar um branch a montante. |
| `` p `` | Puxar (Pull) | Puxe alterações do controle remoto para o ramo atual. Se nenhum upstream estiver configurado, será solicitado configurar um ramo a montante. |
| `` ) `` | Increase rename similarity threshold | Increase the similarity threshold for a deletion and addition pair to be treated as a rename. |
| `` ( `` | Decrease rename similarity threshold | Decrease the similarity threshold for a deletion and addition pair to be treated as a rename. |
| `` } `` | Increase diff context size | Increase the amount of the context shown around changes in the diff view. |
| `` { `` | Decrease diff context size | Decrease the amount of the context shown around changes in the diff view. |
| `` : `` | Execute shell command | Bring up a prompt where you can enter a shell command to execute. |
| `` <c-p> `` | View custom patch options | |
| `` m `` | Ver opções de mesclar/rebase | Ver opções para abortar/continuar/pular o merge/rebase atual. |
| `` R `` | Atualizar | Atualize o estado do git (ou seja, execute `git status`, `git branch`, etc em segundo plano para atualizar o conteúdo de painéis). Isso não executa `git fetch`. |
| `` + `` | Next screen mode (normal/half/fullscreen) | |
| `` _ `` | Prev screen mode | |
| `` ? `` | Open keybindings menu | |
| `` <c-s> `` | View filter options | View options for filtering the commit log, so that only commits matching the filter are shown. |
| `` W `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. |
| `` <c-e> `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. |
| `` q `` | Sair | |
| `` <esc> `` | Cancel | |
| `` <c-w> `` | Toggle whitespace | Toggle whether or not whitespace changes are shown in the diff view. |
| `` z `` | Desfazer | O reflog será usado para determinar qual comando git para executar para desfazer o último comando git. Isto não inclui mudanças na árvore de trabalho; apenas compromissos são tidos em consideração. |
| `` <c-z> `` | Refazer | O reflog será usado para determinar qual comando git para executar para refazer o último comando git. Isto não inclui mudanças na árvore de trabalho; apenas compromissos são tidos em consideração. |
## List panel navigation
| Key | Action | Info |
|-----|--------|-------------|
| `` , `` | Previous page | |
| `` . `` | Next page | |
| `` < `` | Scroll to top | |
| `` > `` | Scroll to bottom | |
| `` v `` | Toggle range select | |
| `` <s-down> `` | Range select down | |
| `` <s-up> `` | Range select up | |
| `` / `` | Search the current view by text | |
| `` H `` | Scroll left | |
| `` L `` | Scroll right | |
| `` ] `` | Next tab | |
| `` [ `` | Previous tab | |
## Arquivos
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy path to clipboard | |
| `` <space> `` | Etapa | Alternar para staging para o arquivo selecionado. |
| `` <c-b> `` | Filtrar arquivos por status | |
| `` y `` | Copy to clipboard | |
| `` c `` | Commit | Submeter mudanças em staging |
| `` w `` | Commit changes without pre-commit hook | |
| `` A `` | Alterar último commit | |
| `` C `` | Enviar alteração usando um editor Git | |
| `` <c-f> `` | Encontrar commit da base para consertar | Encontre o commit em que as suas mudanças atuais estão se baseando, para alterar/consertar o commit. Isso poupa-te você de ter que olhar pelos commits da sua branch um por um para ver qual commit deve ser alterado/consertado
Veja a documentação:
<https://github.com/jesseduffield/lazygit/tree/master/docs/Fixup_Commits.md> |
| `` e `` | Editar | Abrir arquivo no editor externo. |
| `` o `` | Abrir arquivo | Abrir arquivo no aplicativo padrão. |
| `` i `` | Ignore or exclude file | |
| `` r `` | Atualizar arquivos | |
| `` s `` | Stash | Stash all changes. For other variations of stashing, use the view stash options keybinding. |
| `` S `` | View stash options | View stash options (e.g. stash all, stash staged, stash unstaged). |
| `` a `` | Stage completo | Alternar para todos os arquivos na árvore de trabalho |
| `` <enter> `` | Stage lines / Colapso diretório | Se o item selecionado for um arquivo, o foco na exibição de preparo para o estágio de cenas/linhas individuais. Se o item selecionado for um diretório, recolher/expandi-lo. |
| `` d `` | Discard | View options for discarding changes to the selected file. |
| `` g `` | View upstream reset options | |
| `` D `` | Reset | View reset options for working tree (e.g. nuking the working tree). |
| `` ` `` | Alternar exibição de árvore de arquivo | Alternar a visualização de arquivo entre layout plano e layout de árvore. Layout plano mostra todos os caminhos de arquivo em uma única lista, layout de árvore agrupa arquivos por diretório. |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` M `` | Abrir ferramenta de merge externa | Execute `git mergetool`. |
| `` f `` | Buscar | Buscar alterações do controle remoto. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Search the current view by text | |
## Branches locais
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy branch name to clipboard | |
| `` i `` | Show git-flow options | |
| `` <space> `` | Verificar | Checar item selecionado |
| `` n `` | Nova branch | |
| `` o `` | Create pull request | |
| `` O `` | View create pull request options | |
| `` <c-y> `` | Copiar URL do pull request para área de transferência | |
| `` c `` | Checar por nome | Checar por nome. Na caixa de entrada você pode inserir '-' para trocar para a última branch |
| `` F `` | Forçar checagem | Forçar checagem da branch selecionada. Isso irá descartar todas as mudanças no seu diretório de trabalho antes cheque a branch selecionada |
| `` d `` | Delete | View delete options for local/remote branch. |
| `` r `` | Refazer | Refazer a branch checada na branch selecionada |
| `` M `` | Mesclar | Ver opções para mesclar o item selecionado no branch atual (mesclar regularmente, mesclar squash) |
| `` f `` | Avanço rápido | Encaminhamento rápido de branch selecionada a partir do upstream. |
| `` T `` | New tag | |
| `` s `` | Sort order | |
| `` g `` | Reset | |
| `` R `` | Rename branch | |
| `` u `` | View upstream options | View options relating to the branch's upstream e.g. setting/unsetting the upstream and resetting to the upstream. |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <enter> `` | View commits | |
| `` w `` | View worktree options | |
| `` / `` | Filter the current view by text | |
## Branches remotos
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy branch name to clipboard | |
| `` <space> `` | Verificar | Checar a nova branch baseada na brach remota selecionada, ou a branch remota como HEAD, desanexado |
| `` n `` | Nova branch | |
| `` M `` | Mesclar | Ver opções para mesclar o item selecionado no branch atual (mesclar regularmente, mesclar squash) |
| `` r `` | Refazer | Refazer a branch checada na branch selecionada |
| `` d `` | Delete | Delete the remote branch from the remote. |
| `` u `` | Set as upstream | Set the selected remote branch as the upstream of the checked-out branch. |
| `` s `` | Sort order | |
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <enter> `` | View commits | |
| `` w `` | View worktree options | |
| `` / `` | Filter the current view by text | |
## Commit files
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy path to clipboard | |
| `` y `` | Copy to clipboard | |
| `` c `` | Verificar | Checkout file. This replaces the file in your working tree with the version from the selected commit. |
| `` d `` | Remove | Discard this commit's changes to this file. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes this file. |
| `` o `` | Abrir arquivo | Abrir arquivo no aplicativo padrão. |
| `` e `` | Editar | Abrir arquivo no editor externo. |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <space> `` | Toggle file included in patch | Toggle whether the file is included in the custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Enter file / Toggle directory collapsed | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | Alternar exibição de árvore de arquivo | Alternar a visualização de arquivo entre layout plano e layout de árvore. Layout plano mostra todos os caminhos de arquivo em uma única lista, layout de árvore agrupa arquivos por diretório. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Search the current view by text | |
## Commits
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy commit hash to clipboard | |
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
| `` b `` | View bisect options | |
| `` s `` | Squash | Squash o commit selecionado no commit abaixo dele. A mensagem do commit selecionado será anexada ao commit abaixo dele. |
| `` f `` | Fixup | Faça o commit selecionado no commit abaixo dele. Semelhante para o squash, mas a mensagem do commit selecionado será descartada. |
| `` r `` | Reword | Repetir a mensagem de submissão selecionada. |
| `` R `` | Republicar com o editor | |
| `` d `` | Descartar | Solte o commit selecionado. Isso irá remover o commit do branch através de uma rebase. Se o commit faz com que as alterações em commits posteriores dependem, você pode precisar resolver conflitos de merge. |
| `` e `` | Editar (iniciar rebase interativa) | Editar o commit selecionado. Use isto para iniciar uma rebase interativa a partir do commit selecionado. Quando já estiver no meio da reconstrução, isto irá marcar o commit selecionado para edição, o que significa que ao continuar com a reformulação. a rebase irá pausar no commit selecionado para permitir que você faça alterações. |
| `` i `` | Start interactive rebase | Start an interactive rebase for the commits on your branch. This will include all commits from the HEAD commit down to the first merge commit or main branch commit.
If you would instead like to start an interactive rebase from the selected commit, press `e`. |
| `` p `` | Escolher | Marque o commit selecionado para ser escolhido (quando meados da base). Isso significa que o commit será mantido ao continuar o rebase. |
| `` F `` | Create fixup commit | Create 'fixup!' commit for the selected commit. Later on, you can press `S` on this same commit to apply all above fixup commits. |
| `` S `` | Apply fixup commits | Squash all 'fixup!' commits, either above the selected commit, or all in current branch (autosquash). |
| `` <c-j> `` | Mover commit um para baixo | |
| `` <c-k> `` | Mover o commit um para cima | |
| `` V `` | Colar (cherry-pick) | |
| `` B `` | Mark as base commit for rebase | Select a base commit for the next rebase. When you rebase onto a branch, only commits above the base commit will be brought across. This uses the `git rebase --onto` command. |
| `` A `` | Modificar | Alterar o commit com mudanças em sted. Se o commit selecionado for o commit HEAD, ele executará o `git commit --amend`. Caso contrário, o compromisso será alterado por meio de uma base de apoio. |
| `` a `` | Alterar atributo de commit | Definir/Redefinir autor de submissão ou co-autor definido. |
| `` t `` | Reverter | Crie um commit reverter para o commit selecionado, que aplica as alterações do commit selecionado em reverso. |
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
| `` <space> `` | Verificar | Checkout the selected commit as a detached HEAD. |
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
| `` o `` | Open commit in browser | |
| `` n `` | Create new branch off of commit | |
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` 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. |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <enter> `` | View files | |
| `` w `` | View worktree options | |
| `` / `` | Search the current view by text | |
## Confirmation panel
| Key | Action | Info |
|-----|--------|-------------|
| `` <enter> `` | Confirmar | |
| `` <esc> `` | Fechar/Cancelar | |
## Etiquetas
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | Verificar | Checar a tag selecionada como um HEAD, desanexado |
| `` n `` | New tag | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | Delete | View delete options for local/remote tag. |
| `` P `` | Push tag | Push the selected tag to a remote. You'll be prompted to select a remote. |
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <enter> `` | View commits | |
| `` w `` | View worktree options | |
| `` / `` | Filter the current view by text | |
## Menu
| Key | Action | Info |
|-----|--------|-------------|
| `` <enter> `` | Executar | |
| `` <esc> `` | Fechar | |
| `` / `` | Filter the current view by text | |
## Painel Principal (Normal)
| Key | Action | Info |
|-----|--------|-------------|
| `` mouse wheel down (fn+up) `` | Scroll down | |
| `` mouse wheel up (fn+down) `` | Scroll up | |
## Painel Principal (preparação)
| Key | Action | Info |
|-----|--------|-------------|
| `` <left> `` | Go to previous hunk | |
| `` <right> `` | Go to next hunk | |
| `` v `` | Toggle range select | |
| `` a `` | Selecione o local | Ativa/desativa modo seleção de hunk |
| `` <c-o> `` | Copy selected text to clipboard | |
| `` <space> `` | Etapa | Ativar/desativar seleção em staged/unstaged |
| `` d `` | Descartar | Quando a mudança não desejada for selecionada, descarte a mudança usando `git reset`. Quando a mudança em fase é selecionada, despare a mudança. |
| `` o `` | Abrir arquivo | Abrir arquivo no aplicativo padrão. |
| `` e `` | Editar arquivo | Abrir arquivo no editor externo. |
| `` <esc> `` | Retornar ao painel de arquivos | |
| `` <tab> `` | Mudar de visão | Alternar para outra visão (staged/não processadas alterações). |
| `` E `` | Editar hunk | Editar o local selecionado no editor externo. |
| `` c `` | Commit | Submeter mudanças em staging |
| `` w `` | Commit changes without pre-commit hook | |
| `` C `` | Enviar alteração usando um editor Git | |
| `` <c-f> `` | Encontrar commit da base para consertar | Encontre o commit em que as suas mudanças atuais estão se baseando, para alterar/consertar o commit. Isso poupa-te você de ter que olhar pelos commits da sua branch um por um para ver qual commit deve ser alterado/consertado
Veja a documentação:
<https://github.com/jesseduffield/lazygit/tree/master/docs/Fixup_Commits.md> |
| `` / `` | Search the current view by text | |
## Painel principal (mesclagem)
| Key | Action | Info |
|-----|--------|-------------|
| `` <space> `` | Escolha o local | |
| `` b `` | Pegar todos os pedaços | |
| `` <up> `` | Previous hunk | |
| `` <down> `` | Next hunk | |
| `` <left> `` | Previous conflict | |
| `` <right> `` | Next conflict | |
| `` z `` | Desfazer | Desfazer resolução de conflitos de última mesclagem. |
| `` e `` | Editar arquivo | Abrir arquivo no editor externo. |
| `` o `` | Abrir arquivo | Abrir arquivo no aplicativo padrão. |
| `` M `` | Abrir ferramenta de merge externa | Execute `git mergetool`. |
| `` <esc> `` | Retornar ao painel de arquivos | |
## Painel principal (patch build)
| Key | Action | Info |
|-----|--------|-------------|
| `` <left> `` | Go to previous hunk | |
| `` <right> `` | Go to next hunk | |
| `` v `` | Toggle range select | |
| `` a `` | Selecione o local | Ativa/desativa modo seleção de hunk |
| `` <c-o> `` | Copy selected text to clipboard | |
| `` o `` | Abrir arquivo | Abrir arquivo no aplicativo padrão. |
| `` e `` | Editar arquivo | Abrir arquivo no editor externo. |
| `` <space> `` | Alternar linhas no caminho | |
| `` <esc> `` | Exit custom patch builder | |
| `` / `` | Search the current view by text | |
## Reflog
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy commit hash to clipboard | |
| `` <space> `` | Verificar | Checkout the selected commit as a detached HEAD. |
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
| `` o `` | Open commit in browser | |
| `` n `` | Create new branch off of commit | |
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` 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. |
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <enter> `` | View commits | |
| `` w `` | View worktree options | |
| `` / `` | Filter the current view by text | |
## Remotes
| Key | Action | Info |
|-----|--------|-------------|
| `` <enter> `` | View branches | |
| `` n `` | New remote | |
| `` d `` | Remove | Remove the selected remote. Any local branches tracking a remote branch from the remote will be unaffected. |
| `` e `` | Editar | Edit the selected remote's name or URL. |
| `` f `` | Buscar | Fetch updates from the remote repository. This retrieves new commits and branches without merging them into your local branches. |
| `` / `` | Filter the current view by text | |
## Stash
| Key | Action | Info |
|-----|--------|-------------|
| `` <space> `` | Aplicar | Aplique o stash no seu diretório de trabalho. |
| `` g `` | Pop | Aplique a entrada de stash no seu diretório de trabalho e remova a entrada de stash. |
| `` d `` | Descartar | Remova a entrada do stash da lista de armazenamento. |
| `` n `` | Nova branch | Criar um novo ramo a partir da entrada de lixo selecionada. Isso funciona verificando o commit do qual a entrada de lixo foi criada, criar um novo branch a partir desse commit e, em seguida, aplicar a entrada de lixo ao novo branch como um commit adicional. |
| `` r `` | Renomear o stasj | |
| `` <enter> `` | View files | |
| `` w `` | View worktree options | |
| `` / `` | Filter the current view by text | |
## Status
| Key | Action | Info |
|-----|--------|-------------|
| `` o `` | Abrir o ficheiro de config | Abrir arquivo no aplicativo padrão. |
| `` e `` | Editar arquivo de configuração | Abrir arquivo no editor externo. |
| `` u `` | Verificar atualização | |
| `` <enter> `` | Mudar para um repositório recente | |
| `` a `` | Mostrar todos os logs da branch | |
## Sub-commits
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy commit hash to clipboard | |
| `` <space> `` | Verificar | Checkout the selected commit as a detached HEAD. |
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
| `` o `` | Open commit in browser | |
| `` n `` | Create new branch off of commit | |
| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. |
| `` 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. |
| `` <c-r> `` | Reset copied (cherry-picked) commits selection | |
| `` <c-t> `` | Abrir ferramenta de diff externa (git difftool) | |
| `` <enter> `` | View files | |
| `` w `` | View worktree options | |
| `` / `` | Search the current view by text | |
## Submodules
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy submodule name to clipboard | |
| `` <enter> `` | Enter | Enter submodule. After entering the submodule, you can press `<esc>` to escape back to the parent repo. |
| `` d `` | Remove | Remove the selected submodule and its corresponding directory. |
| `` u `` | Update | Update selected submodule. |
| `` n `` | New submodule | |
| `` e `` | Update submodule URL | |
| `` i `` | Initialize | Initialize the selected submodule to prepare for fetching. You probably want to follow this up by invoking the 'update' action to fetch the submodule. |
| `` b `` | View bulk submodule options | |
| `` / `` | Filter the current view by text | |
## Sumário do commit
| Key | Action | Info |
|-----|--------|-------------|
| `` <enter> `` | Confirmar | |
| `` <esc> `` | Fechar | |
## Worktrees
| Key | Action | Info |
|-----|--------|-------------|
| `` n `` | New worktree | |
| `` <space> `` | Switch | Switch to the selected worktree. |
| `` o `` | Abrir no editor | |
| `` d `` | Remove | Remove the selected worktree. This will both delete the worktree's directory, as well as metadata about the worktree in the .git directory. |
| `` / `` | Filter the current view by text | |
-6
View File
@@ -261,7 +261,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Скопировать название файла в буфер обмена | |
| `` y `` | Copy to clipboard | |
| `` c `` | Переключить | Переключить файл |
| `` d `` | Remove | Отменить изменения коммита в этом файле |
| `` o `` | Открыть файл | Open file in default application. |
@@ -271,8 +270,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` a `` | Переключить все файлы, включённые в патч | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | Введите файл, чтобы добавить выбранные строки в патч (или свернуть каталог переключения) | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | Переключить вид дерева файлов | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Найти | |
## Статус
@@ -289,7 +286,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | Переключить | Checkout the selected tag as a detached HEAD. |
| `` n `` | Создать тег | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | Delete | View delete options for local/remote tag. |
@@ -357,8 +353,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` <c-t> `` | Open external diff tool (git difftool) | |
| `` M `` | Открыть внешний инструмент слияния (git mergetool) | Run `git mergetool`. |
| `` f `` | Получить изменения | Fetch changes from remote. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | Найти | |
## Хранилище
+2 -8
View File
@@ -12,8 +12,8 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
| `` <pgup> (fn+up/shift+k) `` | 向上滚动主面板 | |
| `` <pgdown> (fn+down/shift+j) `` | 向下滚动主面板 | |
| `` @ `` | 打开命令日志菜单 | 查看命令日志的选项,例如显示/隐藏命令日志以及聚焦命令日志 |
| `` P `` | 推送 | 推送当前分支到它的上游。如果上游未配置,你可以在弹窗中配置上游分支。 |
| `` p `` | 拉取 | 从当前分支的远程分支获取改动。如果上游未配置,你可以在弹窗中配置上游分支。 |
| `` P `` | 推送 | 推送当前分支到它的上游。如果上游为配置,你可以在弹窗中配置上游分支。 |
| `` p `` | 拉取 | 从当前分支的远程分支获取改动。如果上游为配置,你可以在弹窗中配置上游分支。 |
| `` ) `` | Increase rename similarity threshold | Increase the similarity threshold for a deletion and addition pair to be treated as a rename. |
| `` ( `` | Decrease rename similarity threshold | Decrease the similarity threshold for a deletion and addition pair to be treated as a rename. |
| `` } `` | 扩大差异视图中显示的上下文范围 | 增加diff视图中围绕更改显示的上下文数量 |
@@ -186,7 +186,6 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | 将文件名复制到剪贴板 | |
| `` y `` | 复制到剪贴板 | |
| `` c `` | 检出 | 检出文件 |
| `` d `` | 删除 | 放弃对此文件的提交变更 |
| `` o `` | 打开文件 | 使用默认程序打开该文件 |
@@ -196,8 +195,6 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
| `` a `` | 操作所有文件 | 添加或删除所有提交中的文件到自定义的补丁中。请参阅 https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches。 |
| `` <enter> `` | 输入文件以将所选行添加到补丁中(或切换目录折叠) | 如果已选择一个文件,则Enter进入该文件,以便您可以向自定义补丁添加/删除单独的行。如果选择了目录,则切换目录。 |
| `` ` `` | 切换文件树视图 | 在平铺部署与树布局之间切换文件视图。平铺布局在一个列表中展示所有文件路径,树布局则根据目录分组展示。 |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 开始搜索 | |
## 文件
@@ -228,8 +225,6 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
| `` <c-t> `` | 使用外部差异比较工具(git difftool) | |
| `` M `` | 打开外部合并工具(git mergetool) | 执行 `git mergetool`. |
| `` f `` | 抓取 | 从远程获取变更 |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 开始搜索 | |
## 构建补丁中
@@ -251,7 +246,6 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | 检出 | 检出选择的标签作为分离的HEAD |
| `` n `` | 创建标签 | 基于当前提交创建一个新标签。你将在弹窗中输入标签名称和描述(可选)。 |
| `` d `` | 删除 | 查看本地/远程标签的删除选项 |
-6
View File
@@ -210,7 +210,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | 複製檔案名稱到剪貼簿 | |
| `` y `` | 複製到剪貼簿 | |
| `` c `` | 檢出 | 檢出檔案 |
| `` d `` | Remove | Discard this commit's changes to this file. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes this file. |
| `` o `` | 開啟檔案 | 使用預設軟體開啟 |
@@ -220,8 +219,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` a `` | 切換所有檔案是否包含在補丁中 | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. |
| `` <enter> `` | 輸入檔案以將選定的行添加至補丁(或切換目錄折疊) | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. |
| `` ` `` | 顯示檔案樹狀視圖 | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 搜尋 | |
## 收藏 (Stash)
@@ -285,7 +282,6 @@ If you would instead like to start an interactive rebase from the selected commi
| Key | Action | Info |
|-----|--------|-------------|
| `` <c-o> `` | Copy tag to clipboard | |
| `` <space> `` | 檢出 | Checkout the selected tag as a detached HEAD. |
| `` n `` | 建立標籤 | Create new tag from current commit. You'll be prompted to enter a tag name and optional description. |
| `` d `` | 刪除 | View delete options for local/remote tag. |
@@ -324,8 +320,6 @@ If you would instead like to start an interactive rebase from the selected commi
| `` <c-t> `` | 開啟外部差異工具 (git difftool) | |
| `` M `` | 開啟外部合併工具 | 執行 `git mergetool`。 |
| `` f `` | 擷取 | 同步遠端異動 |
| `` - `` | Collapse all files | Collapse all directories in the files tree |
| `` = `` | Expand all files | Expand all directories in the file tree |
| `` / `` | 搜尋 | |
## 狀態
+9 -8
View File
@@ -8,7 +8,7 @@ require (
github.com/aybabtme/humanlog v0.4.1
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/creack/pty v1.1.11
github.com/gdamore/tcell/v2 v2.8.1
github.com/gdamore/tcell/v2 v2.7.4
github.com/go-errors/errors v1.5.1
github.com/gookit/color v1.4.2
github.com/iancoleman/orderedmap v0.3.0
@@ -16,7 +16,7 @@ require (
github.com/integrii/flaggy v1.4.0
github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68
github.com/jesseduffield/go-git/v5 v5.1.2-0.20221018185014-fdd53fef665d
github.com/jesseduffield/gocui v0.3.1-0.20250220081214-b376cb0857ac
github.com/jesseduffield/gocui v0.3.1-0.20250107151125-716b1eb82fb4
github.com/jesseduffield/kill v0.0.0-20250101124109-e216ddbe133a
github.com/jesseduffield/lazycore v0.0.0-20221012050358-03d2e40243c5
github.com/jesseduffield/minimal/gitignore v0.3.3-0.20211018110810-9cde264e6b1e
@@ -30,7 +30,7 @@ require (
github.com/sahilm/fuzzy v0.1.0
github.com/samber/lo v1.31.0
github.com/sanity-io/litter v1.5.2
github.com/sasha-s/go-deadlock v0.3.5
github.com/sasha-s/go-deadlock v0.3.1
github.com/sirupsen/logrus v1.4.2
github.com/spf13/afero v1.9.5
github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad
@@ -38,7 +38,7 @@ require (
github.com/stretchr/testify v1.8.1
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778
golang.org/x/exp v0.0.0-20220318154914-8dddf5d87bd8
golang.org/x/sync v0.11.0
golang.org/x/sync v0.10.0
gopkg.in/ozeidan/fuzzy-patricia.v3 v3.0.0
gopkg.in/yaml.v3 v3.0.1
)
@@ -54,6 +54,7 @@ require (
github.com/go-git/go-billy/v5 v5.0.0 // indirect
github.com/go-logfmt/logfmt v0.5.0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/invopop/jsonschema v0.10.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
@@ -66,7 +67,7 @@ require (
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/onsi/ginkgo v1.10.3 // indirect
github.com/onsi/gomega v1.7.1 // indirect
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
@@ -74,8 +75,8 @@ require (
github.com/xanzy/ssh-agent v0.2.1 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
+16 -44
View File
@@ -85,11 +85,11 @@ github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw=
github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo=
github.com/gdamore/tcell/v2 v2.8.0/go.mod h1:bj8ori1BG3OYMjmb3IklZVWfZUJ1UBQt9JXrOCOhGWw=
github.com/gdamore/tcell/v2 v2.8.1 h1:KPNxyqclpWpWQlPLx6Xui1pMk8S+7+R37h3g07997NU=
github.com/gdamore/tcell/v2 v2.8.1/go.mod h1:bj8ori1BG3OYMjmb3IklZVWfZUJ1UBQt9JXrOCOhGWw=
github.com/gdamore/tcell/v2 v2.7.4 h1:sg6/UnTM9jGpZU+oFYAsDahfchWAFW8Xx2yFinNSAYU=
github.com/gdamore/tcell/v2 v2.7.4/go.mod h1:dSXtXTSK0VsW1biw65DZLZ2NKr7j0qP/0J7ONmsraWg=
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=
@@ -145,8 +145,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -188,8 +188,8 @@ github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68 h1:EQP2Tv8T
github.com/jesseduffield/generics v0.0.0-20220320043834-727e535cbe68/go.mod h1:+LLj9/WUPAP8LqCchs7P+7X0R98HiFujVFANdNaxhGk=
github.com/jesseduffield/go-git/v5 v5.1.2-0.20221018185014-fdd53fef665d h1:bO+OmbreIv91rCe8NmscRwhFSqkDJtzWCPV4Y+SQuXE=
github.com/jesseduffield/go-git/v5 v5.1.2-0.20221018185014-fdd53fef665d/go.mod h1:nGNEErzf+NRznT+N2SWqmHnDnF9aLgANB1CUNEan09o=
github.com/jesseduffield/gocui v0.3.1-0.20250220081214-b376cb0857ac h1:vUNTiVEB9Bz16pTJ5kNgb/1HhnWdSA1P0GfFLUJeITI=
github.com/jesseduffield/gocui v0.3.1-0.20250220081214-b376cb0857ac/go.mod h1:sLIyZ2J42R6idGdtemZzsiR3xY5EF0KsvYEGh3dQv3s=
github.com/jesseduffield/gocui v0.3.1-0.20250107151125-716b1eb82fb4 h1:hSAimLVb4b5ktU3uJRtBsZW0P2dtXECReTcsHYfOy58=
github.com/jesseduffield/gocui v0.3.1-0.20250107151125-716b1eb82fb4/go.mod h1:XtEbqCbn45keRXEu+OMZkjN5gw6AEob59afsgHjokZ8=
github.com/jesseduffield/kill v0.0.0-20250101124109-e216ddbe133a h1:UDeJ3EBk04bXDLOPvuqM3on8HvyJfISw0+UMqW+0a4g=
github.com/jesseduffield/kill v0.0.0-20250101124109-e216ddbe133a/go.mod h1:FSWDLKT0NQpntbDd1H3lbz51fhCVlMzy/J0S6nM727Q=
github.com/jesseduffield/lazycore v0.0.0-20221012050358-03d2e40243c5 h1:CDuQmfOjAtb1Gms6a1p5L2P8RhbLUq5t8aL7PiQd2uY=
@@ -235,6 +235,7 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mgutz/str v1.2.0 h1:4IzWSdIz9qPQWLfKZ0rJcV0jcUDpxvP4JVZ4GXQyvSw=
@@ -250,8 +251,8 @@ github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw=
github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -271,8 +272,8 @@ github.com/samber/lo v1.31.0 h1:Sfa+/064Tdo4SvlohQUQzBhgSer9v/coGvKQI/XLWAM=
github.com/samber/lo v1.31.0/go.mod h1:HLeWcJRRyLKp3+/XBJvOrerCQn9mhdKMHyd7IRlgeQ8=
github.com/sanity-io/litter v1.5.2 h1:AnC8s9BMORWH5a4atZ4D6FPVvKGzHcnc5/IVTa87myw=
github.com/sanity-io/litter v1.5.2/go.mod h1:5Z71SvaYy5kcGtyglXOC9rrUi3c1E8CamFWjQsazTh0=
github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU=
github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U=
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
@@ -327,9 +328,6 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -369,9 +367,6 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -407,10 +402,6 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
@@ -434,12 +425,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -488,24 +475,15 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -515,13 +493,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -574,8 +548,6 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-1
View File
@@ -275,7 +275,6 @@ func (self *BranchCommands) IsBranchMerged(branch *models.Branch, mainBranches *
Arg(lo.Map(branchesToCheckAgainst, func(branch string, _ int) string {
return fmt.Sprintf("^%s", branch)
})...).
Arg("--").
ToArgv()
stdout, _, err := self.cmd.New(cmdArgs).RunWithOutputs()
+1 -5
View File
@@ -32,17 +32,13 @@ func NewFileLoader(gitCommon *GitCommon, cmd oscommands.ICmdObjBuilder, config F
type GetStatusFileOptions struct {
NoRenames bool
// If true, we'll show untracked files even if the user has set the config to hide them.
// This is useful for users with bare repos for dotfiles who default to hiding untracked files,
// but want to occasionally see them to `git add` a new file.
ForceShowUntracked bool
}
func (self *FileLoader) GetStatusFiles(opts GetStatusFileOptions) []*models.File {
// check if config wants us ignoring untracked files
untrackedFilesSetting := self.config.GetShowUntrackedFiles()
if opts.ForceShowUntracked || untrackedFilesSetting == "" {
if untrackedFilesSetting == "" {
untrackedFilesSetting = "all"
}
untrackedFilesArg := fmt.Sprintf("--untracked-files=%s", untrackedFilesSetting)
-2
View File
@@ -81,11 +81,9 @@ func (self *StashCommands) Hash(index int) (string, error) {
}
func (self *StashCommands) ShowStashEntryCmdObj(index int) oscommands.ICmdObj {
// "-u" is the same as "--include-untracked", but the latter fails in older git versions for some reason
cmdArgs := NewGitCmd("stash").Arg("show").
Arg("-p").
Arg("--stat").
Arg("-u").
Arg(fmt.Sprintf("--color=%s", self.UserConfig().Git.Paging.ColorArg)).
Arg(fmt.Sprintf("--unified=%d", self.AppState.DiffContextSize)).
ArgIf(self.AppState.IgnoreWhitespaceInDiffView, "--ignore-all-space").
+4 -4
View File
@@ -113,7 +113,7 @@ func TestStashStashEntryCmdObj(t *testing.T) {
contextSize: 3,
similarityThreshold: 50,
ignoreWhitespace: false,
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "-u", "--color=always", "--unified=3", "--find-renames=50%", "stash@{5}"},
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "--color=always", "--unified=3", "--find-renames=50%", "stash@{5}"},
},
{
testName: "Show diff with custom context size",
@@ -121,7 +121,7 @@ func TestStashStashEntryCmdObj(t *testing.T) {
contextSize: 77,
similarityThreshold: 50,
ignoreWhitespace: false,
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "-u", "--color=always", "--unified=77", "--find-renames=50%", "stash@{5}"},
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "--color=always", "--unified=77", "--find-renames=50%", "stash@{5}"},
},
{
testName: "Show diff with custom similarity threshold",
@@ -129,7 +129,7 @@ func TestStashStashEntryCmdObj(t *testing.T) {
contextSize: 3,
similarityThreshold: 33,
ignoreWhitespace: false,
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "-u", "--color=always", "--unified=3", "--find-renames=33%", "stash@{5}"},
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "--color=always", "--unified=3", "--find-renames=33%", "stash@{5}"},
},
{
testName: "Default case",
@@ -137,7 +137,7 @@ func TestStashStashEntryCmdObj(t *testing.T) {
contextSize: 3,
similarityThreshold: 50,
ignoreWhitespace: true,
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "-u", "--color=always", "--unified=3", "--ignore-all-space", "--find-renames=50%", "stash@{5}"},
expected: []string{"git", "-C", "/path/to/worktree", "stash", "show", "-p", "--stat", "--color=always", "--unified=3", "--ignore-all-space", "--find-renames=50%", "stash@{5}"},
},
}
+1 -4
View File
@@ -1,8 +1,6 @@
package git_commands
import (
"fmt"
"github.com/go-errors/errors"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
@@ -22,7 +20,6 @@ func NewSyncCommands(gitCommon *GitCommon) *SyncCommands {
type PushOpts struct {
Force bool
ForceWithLease bool
CurrentBranch string
UpstreamRemote string
UpstreamBranch string
SetUpstream bool
@@ -38,7 +35,7 @@ func (self *SyncCommands) PushCmdObj(task gocui.Task, opts PushOpts) (oscommands
ArgIf(opts.ForceWithLease, "--force-with-lease").
ArgIf(opts.SetUpstream, "--set-upstream").
ArgIf(opts.UpstreamRemote != "", opts.UpstreamRemote).
ArgIf(opts.UpstreamBranch != "", fmt.Sprintf("refs/heads/%s:%s", opts.CurrentBranch, opts.UpstreamBranch)).
ArgIf(opts.UpstreamBranch != "", "HEAD:"+opts.UpstreamBranch).
ToArgv()
cmdObj := self.cmd.New(cmdArgs).PromptOnCredentialRequest(task)
+3 -6
View File
@@ -44,12 +44,11 @@ func TestSyncPush(t *testing.T) {
testName: "Push with force disabled, upstream supplied",
opts: PushOpts{
ForceWithLease: false,
CurrentBranch: "master",
UpstreamRemote: "origin",
UpstreamBranch: "master",
},
test: func(cmdObj oscommands.ICmdObj, err error) {
assert.Equal(t, cmdObj.Args(), []string{"git", "push", "origin", "refs/heads/master:master"})
assert.Equal(t, cmdObj.Args(), []string{"git", "push", "origin", "HEAD:master"})
assert.NoError(t, err)
},
},
@@ -57,13 +56,12 @@ func TestSyncPush(t *testing.T) {
testName: "Push with force disabled, setting upstream",
opts: PushOpts{
ForceWithLease: false,
CurrentBranch: "master-local",
UpstreamRemote: "origin",
UpstreamBranch: "master",
SetUpstream: true,
},
test: func(cmdObj oscommands.ICmdObj, err error) {
assert.Equal(t, cmdObj.Args(), []string{"git", "push", "--set-upstream", "origin", "refs/heads/master-local:master"})
assert.Equal(t, cmdObj.Args(), []string{"git", "push", "--set-upstream", "origin", "HEAD:master"})
assert.NoError(t, err)
},
},
@@ -71,13 +69,12 @@ func TestSyncPush(t *testing.T) {
testName: "Push with force-with-lease enabled, setting upstream",
opts: PushOpts{
ForceWithLease: true,
CurrentBranch: "master",
UpstreamRemote: "origin",
UpstreamBranch: "master",
SetUpstream: true,
},
test: func(cmdObj oscommands.ICmdObj, err error) {
assert.Equal(t, cmdObj.Args(), []string{"git", "push", "--force-with-lease", "--set-upstream", "origin", "refs/heads/master:master"})
assert.Equal(t, cmdObj.Args(), []string{"git", "push", "--force-with-lease", "--set-upstream", "origin", "HEAD:master"})
assert.NoError(t, err)
},
},
+9 -70
View File
@@ -217,26 +217,6 @@ func loadUserConfig(configFiles []*ConfigFile, base *UserConfig) (*UserConfig, e
// from one container to another, or changing the type of a key (e.g. from bool
// to an enum).
func migrateUserConfig(path string, content []byte) ([]byte, error) {
changedContent, err := computeMigratedConfig(path, content)
if err != nil {
return nil, err
}
// Write config back if changed
if string(changedContent) != string(content) {
fmt.Println("Provided user config is deprecated but auto-fixable. Attempting to write fixed version back to file...")
if err := os.WriteFile(path, changedContent, 0o644); err != nil {
return nil, fmt.Errorf("While attempting to write back fixed user config to %s, an error occurred: %s", path, err)
}
fmt.Printf("Success. New config written to %s\n", path)
return changedContent, nil
}
return content, nil
}
// A pure function helper for testing purposes
func computeMigratedConfig(path string, content []byte) ([]byte, error) {
changedContent := content
pathsToReplace := []struct {
@@ -261,18 +241,17 @@ func computeMigratedConfig(path string, content []byte) ([]byte, error) {
return nil, fmt.Errorf("Couldn't migrate config file at `%s`: %s", path, err)
}
changedContent, err = changeElementToSequence(changedContent, []string{"git", "commitPrefix"})
if err != nil {
return nil, fmt.Errorf("Couldn't migrate config file at `%s`: %s", path, err)
}
changedContent, err = changeCommitPrefixesMap(changedContent)
if err != nil {
return nil, fmt.Errorf("Couldn't migrate config file at `%s`: %s", path, err)
}
// Add more migrations here...
return changedContent, nil
// Write config back if changed
if string(changedContent) != string(content) {
if err := os.WriteFile(path, changedContent, 0o644); err != nil {
return nil, fmt.Errorf("Couldn't write migrated config back to `%s`: %s", path, err)
}
return changedContent, nil
}
return content, nil
}
func changeNullKeybindingsToDisabled(changedContent []byte) ([]byte, error) {
@@ -286,46 +265,6 @@ func changeNullKeybindingsToDisabled(changedContent []byte) ([]byte, error) {
})
}
func changeElementToSequence(changedContent []byte, path []string) ([]byte, error) {
return yaml_utils.TransformNode(changedContent, path, func(node *yaml.Node) (bool, error) {
if node.Kind == yaml.MappingNode {
nodeContentCopy := node.Content
node.Kind = yaml.SequenceNode
node.Value = ""
node.Tag = "!!seq"
node.Content = []*yaml.Node{{
Kind: yaml.MappingNode,
Content: nodeContentCopy,
}}
return true, nil
}
return false, nil
})
}
func changeCommitPrefixesMap(changedContent []byte) ([]byte, error) {
return yaml_utils.TransformNode(changedContent, []string{"git", "commitPrefixes"}, func(prefixesNode *yaml.Node) (bool, error) {
if prefixesNode.Kind == yaml.MappingNode {
for _, contentNode := range prefixesNode.Content {
if contentNode.Kind == yaml.MappingNode {
nodeContentCopy := contentNode.Content
contentNode.Kind = yaml.SequenceNode
contentNode.Value = ""
contentNode.Tag = "!!seq"
contentNode.Content = []*yaml.Node{{
Kind: yaml.MappingNode,
Content: nodeContentCopy,
}}
}
}
return true, nil
}
return false, nil
})
}
func (c *AppConfig) GetDebug() bool {
return c.debug
}
-78
View File
@@ -1,78 +0,0 @@
package config
import (
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)
func TestCommitPrefixMigrations(t *testing.T) {
scenarios := []struct {
name string
input string
expected string
}{
{
"Empty String",
"",
"",
}, {
"Single CommitPrefix Rename",
`
git:
commitPrefix:
pattern: "^\\w+-\\w+.*"
replace: '[JIRA $0] '`,
`
git:
commitPrefix:
- pattern: "^\\w+-\\w+.*"
replace: '[JIRA $0] '`,
}, {
"Complicated CommitPrefixes Rename",
`
git:
commitPrefixes:
foo:
pattern: "^\\w+-\\w+.*"
replace: '[OTHER $0] '
CrazyName!@#$^*&)_-)[[}{f{[]:
pattern: "^foo.bar*"
replace: '[FUN $0] '`,
`
git:
commitPrefixes:
foo:
- pattern: "^\\w+-\\w+.*"
replace: '[OTHER $0] '
CrazyName!@#$^*&)_-)[[}{f{[]:
- pattern: "^foo.bar*"
replace: '[FUN $0] '`,
}, {
"Incomplete Configuration",
"git:",
"git:",
},
}
for _, s := range scenarios {
t.Run(s.name, func(t *testing.T) {
expectedConfig := GetDefaultConfig()
err := yaml.Unmarshal([]byte(s.expected), expectedConfig)
if err != nil {
t.Error(err)
}
actual, err := computeMigratedConfig("path doesn't matter", []byte(s.input))
if err != nil {
t.Error(err)
}
actualConfig := GetDefaultConfig()
err = yaml.Unmarshal(actual, actualConfig)
if err != nil {
t.Error(err)
}
assert.Equal(t, expectedConfig, actualConfig)
})
}
}
-93
View File
@@ -1,93 +0,0 @@
package config
import (
"strings"
"unicode/utf8"
"github.com/jesseduffield/gocui"
"github.com/samber/lo"
)
// NOTE: if you make changes to this table, be sure to update
// docs/keybindings/Custom_Keybindings.md as well
var LabelByKey = map[gocui.Key]string{
gocui.KeyF1: "<f1>",
gocui.KeyF2: "<f2>",
gocui.KeyF3: "<f3>",
gocui.KeyF4: "<f4>",
gocui.KeyF5: "<f5>",
gocui.KeyF6: "<f6>",
gocui.KeyF7: "<f7>",
gocui.KeyF8: "<f8>",
gocui.KeyF9: "<f9>",
gocui.KeyF10: "<f10>",
gocui.KeyF11: "<f11>",
gocui.KeyF12: "<f12>",
gocui.KeyInsert: "<insert>",
gocui.KeyDelete: "<delete>",
gocui.KeyHome: "<home>",
gocui.KeyEnd: "<end>",
gocui.KeyPgup: "<pgup>",
gocui.KeyPgdn: "<pgdown>",
gocui.KeyArrowUp: "<up>",
gocui.KeyShiftArrowUp: "<s-up>",
gocui.KeyArrowDown: "<down>",
gocui.KeyShiftArrowDown: "<s-down>",
gocui.KeyArrowLeft: "<left>",
gocui.KeyArrowRight: "<right>",
gocui.KeyTab: "<tab>", // <c-i>
gocui.KeyBacktab: "<backtab>",
gocui.KeyEnter: "<enter>", // <c-m>
gocui.KeyAltEnter: "<a-enter>",
gocui.KeyEsc: "<esc>", // <c-[>, <c-3>
gocui.KeyBackspace: "<backspace>", // <c-h>
gocui.KeyCtrlSpace: "<c-space>", // <c-~>, <c-2>
gocui.KeyCtrlSlash: "<c-/>", // <c-_>
gocui.KeySpace: "<space>",
gocui.KeyCtrlA: "<c-a>",
gocui.KeyCtrlB: "<c-b>",
gocui.KeyCtrlC: "<c-c>",
gocui.KeyCtrlD: "<c-d>",
gocui.KeyCtrlE: "<c-e>",
gocui.KeyCtrlF: "<c-f>",
gocui.KeyCtrlG: "<c-g>",
gocui.KeyCtrlJ: "<c-j>",
gocui.KeyCtrlK: "<c-k>",
gocui.KeyCtrlL: "<c-l>",
gocui.KeyCtrlN: "<c-n>",
gocui.KeyCtrlO: "<c-o>",
gocui.KeyCtrlP: "<c-p>",
gocui.KeyCtrlQ: "<c-q>",
gocui.KeyCtrlR: "<c-r>",
gocui.KeyCtrlS: "<c-s>",
gocui.KeyCtrlT: "<c-t>",
gocui.KeyCtrlU: "<c-u>",
gocui.KeyCtrlV: "<c-v>",
gocui.KeyCtrlW: "<c-w>",
gocui.KeyCtrlX: "<c-x>",
gocui.KeyCtrlY: "<c-y>",
gocui.KeyCtrlZ: "<c-z>",
gocui.KeyCtrl4: "<c-4>", // <c-\>
gocui.KeyCtrl5: "<c-5>", // <c-]>
gocui.KeyCtrl6: "<c-6>",
gocui.KeyCtrl8: "<c-8>",
gocui.MouseWheelUp: "mouse wheel up",
gocui.MouseWheelDown: "mouse wheel down",
}
var KeyByLabel = lo.Invert(LabelByKey)
func isValidKeybindingKey(key string) bool {
runeCount := utf8.RuneCountInString(key)
if key == "<disabled>" {
return true
}
if runeCount > 1 {
_, ok := KeyByLabel[strings.ToLower(key)]
return ok
}
return true
}
+6 -17
View File
@@ -52,10 +52,7 @@ type GuiConfig struct {
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-author-color
AuthorColors map[string]string `yaml:"authorColors"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
// Deprecated: use branchColorPatterns instead
BranchColors map[string]string `yaml:"branchColors"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-branch-color
BranchColorPatterns map[string]string `yaml:"branchColorPatterns"`
// The number of lines you scroll by when scrolling the main window
ScrollHeight int `yaml:"scrollHeight" jsonschema:"minimum=1"`
// If true, allow scrolling past the bottom of the content in the main window
@@ -64,9 +61,6 @@ type GuiConfig struct {
ScrollOffMargin int `yaml:"scrollOffMargin"`
// One of: 'margin' (default) | 'jump'
ScrollOffBehavior string `yaml:"scrollOffBehavior"`
// The number of spaces per tab; used for everything that's shown in the main view, but probably mostly relevant for diffs.
// Note that when using a pager, the pager has its own tab width setting, so you need to pass it separately in the pager command.
TabWidth int `yaml:"tabWidth" jsonschema:"minimum=1"`
// If true, capture mouse events.
// When mouse events are captured, it's a little harder to select text: e.g. requiring you to hold the option key when on macOS.
MouseEvents bool `yaml:"mouseEvents"`
@@ -117,7 +111,7 @@ type GuiConfig struct {
// If true, show the '5 of 20' footer at the bottom of list views
ShowListFooter bool `yaml:"showListFooter"`
// If true, display the files in the file views as a tree. If false, display the files as a flat list.
// This can be toggled from within Lazygit with the '`' key, but that will not change the default.
// This can be toggled from within Lazygit with the '~' key, but that will not change the default.
ShowFileTree bool `yaml:"showFileTree"`
// If true, show the number of lines changed per file in the Files view
ShowNumstatInFilesView bool `yaml:"showNumstatInFilesView"`
@@ -259,9 +253,9 @@ type GitConfig struct {
// If true, do not allow force pushes
DisableForcePushing bool `yaml:"disableForcePushing"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
CommitPrefix []CommitPrefixConfig `yaml:"commitPrefix"`
CommitPrefix *CommitPrefixConfig `yaml:"commitPrefix"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-commit-message-prefix
CommitPrefixes map[string][]CommitPrefixConfig `yaml:"commitPrefixes"`
CommitPrefixes map[string]CommitPrefixConfig `yaml:"commitPrefixes"`
// See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#predefined-branch-name-prefix
BranchPrefix string `yaml:"branchPrefix"`
// If true, parse emoji strings in commit messages e.g. render :rocket: as 🚀
@@ -459,8 +453,6 @@ type KeybindingFilesConfig struct {
OpenMergeTool string `yaml:"openMergeTool"`
OpenStatusFilter string `yaml:"openStatusFilter"`
CopyFileInfoToClipboard string `yaml:"copyFileInfoToClipboard"`
CollapseAll string `yaml:"collapseAll"`
ExpandAll string `yaml:"expandAll"`
}
type KeybindingBranchesConfig struct {
@@ -614,8 +606,8 @@ type CustomCommandAfterHook struct {
type CustomCommand struct {
// The key to trigger the command. Use a single letter or one of the values from https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md
Key string `yaml:"key"`
// The context in which to listen for the key. Valid values are: status, files, worktrees, localBranches, remotes, remoteBranches, tags, commits, reflogCommits, subCommits, commitFiles, stash, and global. Multiple contexts separated by comma are allowed; most useful for "commits, subCommits" or "files, commitFiles".
Context string `yaml:"context" jsonschema:"example=status,example=files,example=worktrees,example=localBranches,example=remotes,example=remoteBranches,example=tags,example=commits,example=reflogCommits,example=subCommits,example=commitFiles,example=stash,example=global"`
// The context in which to listen for the key
Context string `yaml:"context" jsonschema:"enum=status,enum=files,enum=worktrees,enum=localBranches,enum=remotes,enum=remoteBranches,enum=tags,enum=commits,enum=reflogCommits,enum=subCommits,enum=commitFiles,enum=stash,enum=global"`
// The command to run (using Go template syntax for placeholder values)
Command string `yaml:"command" jsonschema:"example=git fetch {{.Form.Remote}} {{.Form.Branch}} && git checkout FETCH_HEAD"`
// If true, run the command in a subprocess (e.g. if the command requires user input)
@@ -696,7 +688,6 @@ func GetDefaultConfig() *UserConfig {
ScrollPastBottom: true,
ScrollOffMargin: 2,
ScrollOffBehavior: "margin",
TabWidth: 4,
MouseEvents: true,
SkipDiscardChangeWarning: false,
SkipStashWarning: false,
@@ -788,7 +779,7 @@ func GetDefaultConfig() *UserConfig {
BranchLogCmd: "git log --graph --color=always --abbrev-commit --decorate --date=relative --pretty=medium {{branchName}} --",
AllBranchesLogCmd: "git log --graph --all --color=always --abbrev-commit --decorate --date=relative --pretty=medium",
DisableForcePushing: false,
CommitPrefixes: map[string][]CommitPrefixConfig(nil),
CommitPrefixes: map[string]CommitPrefixConfig(nil),
BranchPrefix: "",
ParseEmoji: false,
TruncateCopiedCommitHashesTo: 12,
@@ -904,8 +895,6 @@ func GetDefaultConfig() *UserConfig {
OpenStatusFilter: "<c-b>",
ConfirmDiscard: "x",
CopyFileInfoToClipboard: "y",
CollapseAll: "-",
ExpandAll: "=",
},
Branches: KeybindingBranchesConfig{
CopyPullRequestURL: "<c-y>",
-74
View File
@@ -2,12 +2,8 @@ package config
import (
"fmt"
"log"
"reflect"
"slices"
"strings"
"github.com/jesseduffield/lazygit/pkg/constants"
)
func (config *UserConfig) Validate() error {
@@ -19,12 +15,6 @@ func (config *UserConfig) Validate() error {
[]string{"none", "onlyArrow", "arrowAndNumber"}); err != nil {
return err
}
if err := validateKeybindings(config.Keybinding); err != nil {
return err
}
if err := validateCustomCommands(config.CustomCommands); err != nil {
return err
}
return nil
}
@@ -35,67 +25,3 @@ func validateEnum(name string, value string, allowedValues []string) error {
allowedValuesStr := strings.Join(allowedValues, ", ")
return fmt.Errorf("Unexpected value '%s' for '%s'. Allowed values: %s", value, name, allowedValuesStr)
}
func validateKeybindingsRecurse(path string, node any) error {
value := reflect.ValueOf(node)
if value.Kind() == reflect.Struct {
for _, field := range reflect.VisibleFields(reflect.TypeOf(node)) {
var newPath string
if len(path) == 0 {
newPath = field.Name
} else {
newPath = fmt.Sprintf("%s.%s", path, field.Name)
}
if err := validateKeybindingsRecurse(newPath,
value.FieldByName(field.Name).Interface()); err != nil {
return err
}
}
} else if value.Kind() == reflect.Slice {
for i := 0; i < value.Len(); i++ {
if err := validateKeybindingsRecurse(
fmt.Sprintf("%s[%d]", path, i), value.Index(i).Interface()); err != nil {
return err
}
}
} else if value.Kind() == reflect.String {
key := node.(string)
if !isValidKeybindingKey(key) {
return fmt.Errorf("Unrecognized key '%s' for keybinding '%s'. For permitted values see %s",
key, path, constants.Links.Docs.CustomKeybindings)
}
} else {
log.Fatalf("Unexpected type for property '%s': %s", path, value.Kind())
}
return nil
}
func validateKeybindings(keybindingConfig KeybindingConfig) error {
if err := validateKeybindingsRecurse("", keybindingConfig); err != nil {
return err
}
if len(keybindingConfig.Universal.JumpToBlock) != 5 {
return fmt.Errorf("keybinding.universal.jumpToBlock must have 5 elements; found %d.",
len(keybindingConfig.Universal.JumpToBlock))
}
return nil
}
func validateCustomCommandKey(key string) error {
if !isValidKeybindingKey(key) {
return fmt.Errorf("Unrecognized key '%s' for custom command. For permitted values see %s",
key, constants.Links.Docs.CustomKeybindings)
}
return nil
}
func validateCustomCommands(customCommands []CustomCommand) error {
for _, customCommand := range customCommands {
if err := validateCustomCommandKey(customCommand.Key); err != nil {
return err
}
}
return nil
}
-45
View File
@@ -1,7 +1,6 @@
package config
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
@@ -30,50 +29,6 @@ func TestUserConfigValidate_enums(t *testing.T) {
{value: "invalid_value", valid: false},
},
},
{
name: "Keybindings",
setup: func(config *UserConfig, value string) {
config.Keybinding.Universal.Quit = value
},
testCases: []testCase{
{value: "", valid: true},
{value: "<disabled>", valid: true},
{value: "q", valid: true},
{value: "<c-c>", valid: true},
{value: "invalid_value", valid: false},
},
},
{
name: "JumpToBlock keybinding",
setup: func(config *UserConfig, value string) {
config.Keybinding.Universal.JumpToBlock = strings.Split(value, ",")
},
testCases: []testCase{
{value: "", valid: false},
{value: "1,2,3", valid: false},
{value: "1,2,3,4,5", valid: true},
{value: "1,2,3,4,invalid", valid: false},
{value: "1,2,3,4,5,6", valid: false},
},
},
{
name: "Custom command keybinding",
setup: func(config *UserConfig, value string) {
config.CustomCommands = []CustomCommand{
{
Key: value,
Command: "echo 'hello'",
},
}
},
testCases: []testCase{
{value: "", valid: true},
{value: "<disabled>", valid: true},
{value: "q", valid: true},
{value: "<c-c>", valid: true},
{value: "invalid_value", valid: false},
},
},
}
for _, s := range scenarios {
+3 -3
View File
@@ -76,9 +76,9 @@ func (self *BackgroundRoutineMgr) startBackgroundFetch() {
self.gui.waitForIntro.Wait()
fetch := func() error {
return self.gui.helpers.AppStatus.WithWaitingStatusImpl(self.gui.Tr.FetchingStatus, func(gocui.Task) error {
return self.backgroundFetch()
}, nil)
err := self.backgroundFetch()
self.gui.c.Render()
return err
}
// We want an immediate fetch at startup, and since goEvery starts by
+6 -44
View File
@@ -1,8 +1,6 @@
package context
import (
"os"
"path/filepath"
"strconv"
"strings"
@@ -10,11 +8,8 @@ import (
"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
"github.com/spf13/afero"
)
const PreservedCommitMessageFileName = "LAZYGIT_PENDING_COMMIT"
type CommitMessageContext struct {
c *ContextCommon
types.Context
@@ -38,6 +33,8 @@ type CommitMessageViewModel struct {
// we remember the initial message so that we can tell whether we should preserve
// the message; if it's still identical to the initial message, we don't
initialMessage string
// the full preserved message (combined summary and description)
preservedMessage string
// invoked when pressing enter in the commit message panel
onConfirm func(string, string) error
// invoked when pressing the switch-to-editor key binding
@@ -78,51 +75,16 @@ func (self *CommitMessageContext) GetSelectedIndex() int {
return self.viewModel.selectedindex
}
func (self *CommitMessageContext) GetPreservedMessagePath() string {
return filepath.Join(self.c.Git().RepoPaths.WorktreeGitDirPath(), PreservedCommitMessageFileName)
}
func (self *CommitMessageContext) GetPreserveMessage() bool {
return self.viewModel.preserveMessage
}
func (self *CommitMessageContext) getPreservedMessage() (string, error) {
buf, err := afero.ReadFile(self.c.Fs, self.GetPreservedMessagePath())
if os.IsNotExist(err) {
return "", nil
}
if err != nil {
return "", err
}
return string(buf), nil
func (self *CommitMessageContext) GetPreservedMessage() string {
return self.viewModel.preservedMessage
}
func (self *CommitMessageContext) GetPreservedMessageAndLogError() string {
msg, err := self.getPreservedMessage()
if err != nil {
self.c.Log.Errorf("error when retrieving persisted commit message: %v", err)
}
return msg
}
func (self *CommitMessageContext) setPreservedMessage(message string) error {
preservedFilePath := self.GetPreservedMessagePath()
if len(message) == 0 {
err := self.c.Fs.Remove(preservedFilePath)
if os.IsNotExist(err) {
return nil
}
return err
}
return afero.WriteFile(self.c.Fs, preservedFilePath, []byte(message), 0o644)
}
func (self *CommitMessageContext) SetPreservedMessageAndLogError(message string) {
if err := self.setPreservedMessage(message); err != nil {
self.c.Log.Errorf("error when persisting commit message: %v", err)
}
func (self *CommitMessageContext) SetPreservedMessage(message string) {
self.viewModel.preservedMessage = message
}
func (self *CommitMessageContext) GetInitialMessage() string {
+43 -107
View File
@@ -3,7 +3,6 @@ package controllers
import (
"errors"
"fmt"
"strings"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@@ -122,93 +121,52 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [
return bindings
}
func (self *BasicCommitsController) getCommitMessageBody(hash string) string {
commitMessageBody, err := self.c.Git().Commit.GetCommitMessage(hash)
if err != nil {
return ""
}
_, body := self.c.Helpers().Commits.SplitCommitMessageAndDescription(commitMessageBody)
return body
}
func (self *BasicCommitsController) copyCommitAttribute(commit *models.Commit) error {
commitMessageBody := self.getCommitMessageBody(commit.Hash)
var commitMessageBodyDisabled *types.DisabledReason
if commitMessageBody == "" {
commitMessageBodyDisabled = &types.DisabledReason{
Text: self.c.Tr.CommitHasNoMessageBody,
}
}
items := []*types.MenuItem{
{
Label: self.c.Tr.CommitHash,
OnPress: func() error {
return self.copyCommitHashToClipboard(commit)
},
},
{
Label: self.c.Tr.CommitSubject,
OnPress: func() error {
return self.copyCommitSubjectToClipboard(commit)
},
Key: 's',
},
{
Label: self.c.Tr.CommitMessage,
OnPress: func() error {
return self.copyCommitMessageToClipboard(commit)
},
Key: 'm',
},
{
Label: self.c.Tr.CommitMessageBody,
DisabledReason: commitMessageBodyDisabled,
OnPress: func() error {
return self.copyCommitMessageBodyToClipboard(commitMessageBody)
},
Key: 'b',
},
{
Label: self.c.Tr.CommitURL,
OnPress: func() error {
return self.copyCommitURLToClipboard(commit)
},
Key: 'u',
},
{
Label: self.c.Tr.CommitDiff,
OnPress: func() error {
return self.copyCommitDiffToClipboard(commit)
},
Key: 'd',
},
{
Label: self.c.Tr.CommitAuthor,
OnPress: func() error {
return self.copyAuthorToClipboard(commit)
},
Key: 'a',
},
}
commitTagsItem := types.MenuItem{
Label: self.c.Tr.CommitTags,
OnPress: func() error {
return self.copyCommitTagsToClipboard(commit)
},
Key: 't',
}
if len(commit.Tags) == 0 {
commitTagsItem.DisabledReason = &types.DisabledReason{Text: self.c.Tr.CommitHasNoTags}
}
items = append(items, &commitTagsItem)
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.Actions.CopyCommitAttributeToClipboard,
Items: items,
Items: []*types.MenuItem{
{
Label: self.c.Tr.CommitHash,
OnPress: func() error {
return self.copyCommitHashToClipboard(commit)
},
},
{
Label: self.c.Tr.CommitSubject,
OnPress: func() error {
return self.copyCommitSubjectToClipboard(commit)
},
Key: 's',
},
{
Label: self.c.Tr.CommitMessage,
OnPress: func() error {
return self.copyCommitMessageToClipboard(commit)
},
Key: 'm',
},
{
Label: self.c.Tr.CommitURL,
OnPress: func() error {
return self.copyCommitURLToClipboard(commit)
},
Key: 'u',
},
{
Label: self.c.Tr.CommitDiff,
OnPress: func() error {
return self.copyCommitDiffToClipboard(commit)
},
Key: 'd',
},
{
Label: self.c.Tr.CommitAuthor,
OnPress: func() error {
return self.copyAuthorToClipboard(commit)
},
Key: 'a',
},
},
})
}
@@ -284,16 +242,6 @@ func (self *BasicCommitsController) copyCommitMessageToClipboard(commit *models.
return nil
}
func (self *BasicCommitsController) copyCommitMessageBodyToClipboard(commitMessageBody string) error {
self.c.LogAction(self.c.Tr.Actions.CopyCommitMessageBodyToClipboard)
if err := self.c.OS().CopyToClipboard(commitMessageBody); err != nil {
return err
}
self.c.Toast(self.c.Tr.CommitMessageBodyCopiedToClipboard)
return nil
}
func (self *BasicCommitsController) copyCommitSubjectToClipboard(commit *models.Commit) error {
message, err := self.c.Git().Commit.GetCommitSubject(commit.Hash)
if err != nil {
@@ -309,18 +257,6 @@ func (self *BasicCommitsController) copyCommitSubjectToClipboard(commit *models.
return nil
}
func (self *BasicCommitsController) copyCommitTagsToClipboard(commit *models.Commit) error {
message := strings.Join(commit.Tags, "\n")
self.c.LogAction(self.c.Tr.Actions.CopyCommitTagsToClipboard)
if err := self.c.OS().CopyToClipboard(message); err != nil {
return err
}
self.c.Toast(self.c.Tr.CommitTagsCopiedToClipboard)
return nil
}
func (self *BasicCommitsController) openInBrowser(commit *models.Commit) error {
url, err := self.c.Helpers().Host.GetCommitURL(commit.Hash)
if err != nil {
@@ -28,7 +28,7 @@ func (self *CommitDescriptionController) GetKeybindings(opts types.KeybindingsOp
bindings := []*types.Binding{
{
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: self.handleTogglePanel,
Handler: self.switchToCommitMessage,
},
{
Key: opts.GetKey(opts.Config.Universal.Return),
@@ -75,32 +75,6 @@ func (self *CommitDescriptionController) switchToCommitMessage() error {
return nil
}
func (self *CommitDescriptionController) handleTogglePanel() error {
// The default keybinding for this action is "<tab>", which means that we
// also get here when pasting multi-line text that contains tabs. In that
// case we don't want to toggle the panel, but insert the tab as a character
// (somehow, see below).
//
// Only do this if the TogglePanel command is actually mapped to "<tab>"
// (the default). If it's not, we can only hope that it's mapped to some
// ctrl key or fn key, which is unlikely to occur in pasted text. And if
// they mapped some *other* command to "<tab>", then we're totally out of
// luck.
if self.c.GocuiGui().IsPasting && self.c.UserConfig().Keybinding.Universal.TogglePanel == "<tab>" {
// Handling tabs in pasted commit messages is not optimal, but hopefully
// good enough for now. We simply insert 4 spaces without worrying about
// column alignment. This works well enough for leading indentation,
// which is common in pasted code snippets.
view := self.Context().GetView()
for range 4 {
view.Editor.Edit(view, gocui.KeySpace, ' ', 0)
}
return nil
}
return self.switchToCommitMessage()
}
func (self *CommitDescriptionController) close() error {
self.c.Helpers().Commits.CloseCommitMessagePanel()
return nil
@@ -48,7 +48,7 @@ func (self *CommitMessageController) GetKeybindings(opts types.KeybindingsOpts)
},
{
Key: opts.GetKey(opts.Config.Universal.TogglePanel),
Handler: self.handleTogglePanel,
Handler: self.switchToCommitDescription,
},
{
Key: opts.GetKey(opts.Config.CommitMessage.CommitMenu),
@@ -105,32 +105,6 @@ func (self *CommitMessageController) switchToCommitDescription() error {
return nil
}
func (self *CommitMessageController) handleTogglePanel() error {
// The default keybinding for this action is "<tab>", which means that we
// also get here when pasting multi-line text that contains tabs. In that
// case we don't want to toggle the panel, but insert the tab as a character
// (somehow, see below).
//
// Only do this if the TogglePanel command is actually mapped to "<tab>"
// (the default). If it's not, we can only hope that it's mapped to some
// ctrl key or fn key, which is unlikely to occur in pasted text. And if
// they mapped some *other* command to "<tab>", then we're totally out of
// luck.
if self.c.GocuiGui().IsPasting && self.c.UserConfig().Keybinding.Universal.TogglePanel == "<tab>" {
// It is unlikely that a pasted commit message contains a tab in the
// subject line, so it shouldn't matter too much how we handle it.
// Simply insert 4 spaces instead; all that matters is that we don't
// switch to the description panel.
view := self.context().GetView()
for range 4 {
view.Editor.Edit(view, gocui.KeySpace, ' ', 0)
}
return nil
}
return self.switchToCommitDescription()
}
func (self *CommitMessageController) handleCommitIndexChange(value int) error {
currentIndex := self.context().GetSelectedIndex()
newIndex := currentIndex + value
@@ -166,20 +140,6 @@ func (self *CommitMessageController) setCommitMessageAtIndex(index int) (bool, e
}
func (self *CommitMessageController) confirm() error {
// The default keybinding for this action is "<enter>", which means that we
// also get here when pasting multi-line text that contains newlines. In
// that case we don't want to confirm the commit, but switch to the
// description panel instead so that the rest of the pasted text goes there.
//
// Only do this if the SubmitEditorText command is actually mapped to
// "<enter>" (the default). If it's not, we can only hope that it's mapped
// to some ctrl key or fn key, which is unlikely to occur in pasted text.
// And if they mapped some *other* command to "<enter>", then we're totally
// out of luck.
if self.c.GocuiGui().IsPasting && self.c.UserConfig().Keybinding.Universal.SubmitEditorText == "<enter>" {
return self.switchToCommitDescription()
}
return self.c.Helpers().Commits.HandleCommitConfirm()
}
@@ -41,12 +41,6 @@ func NewCommitFilesController(
func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
bindings := []*types.Binding{
{
Key: opts.GetKey(opts.Config.Files.CopyFileInfoToClipboard),
Handler: self.openCopyMenu,
Description: self.c.Tr.CopyToClipboardMenu,
OpensMenu: true,
},
{
Key: opts.GetKey(opts.Config.CommitFiles.CheckoutCommitFile),
Handler: self.withItem(self.checkout),
@@ -115,20 +109,6 @@ func (self *CommitFilesController) GetKeybindings(opts types.KeybindingsOpts) []
Description: self.c.Tr.ToggleTreeView,
Tooltip: self.c.Tr.ToggleTreeViewTooltip,
},
{
Key: opts.GetKey(opts.Config.Files.CollapseAll),
Handler: self.collapseAll,
Description: self.c.Tr.CollapseAll,
Tooltip: self.c.Tr.CollapseAllTooltip,
GetDisabledReason: self.require(self.isInTreeMode),
},
{
Key: opts.GetKey(opts.Config.Files.ExpandAll),
Handler: self.expandAll,
Description: self.c.Tr.ExpandAll,
Tooltip: self.c.Tr.ExpandAllTooltip,
GetDisabledReason: self.require(self.isInTreeMode),
},
}
return bindings
@@ -187,77 +167,6 @@ func (self *CommitFilesController) onClickMain(opts gocui.ViewMouseBindingOpts)
return self.enterCommitFile(node, types.OnFocusOpts{ClickedWindowName: "main", ClickedViewLineIdx: opts.Y})
}
func (self *CommitFilesController) copyDiffToClipboard(path string, toastMessage string) error {
from, to := self.context().GetFromAndToForDiff()
from, reverse := self.c.Modes().Diffing.GetFromAndReverseArgsForDiff(from)
cmdObj := self.c.Git().WorkingTree.ShowFileDiffCmdObj(from, to, reverse, path, true)
diff, err := cmdObj.RunWithOutput()
if err != nil {
return err
}
if err := self.c.OS().CopyToClipboard(diff); err != nil {
return err
}
self.c.Toast(toastMessage)
return nil
}
func (self *CommitFilesController) openCopyMenu() error {
node := self.context().GetSelected()
copyNameItem := &types.MenuItem{
Label: self.c.Tr.CopyFileName,
OnPress: func() error {
if err := self.c.OS().CopyToClipboard(node.Name()); err != nil {
return err
}
self.c.Toast(self.c.Tr.FileNameCopiedToast)
return nil
},
DisabledReason: self.require(self.singleItemSelected())(),
Key: 'n',
}
copyPathItem := &types.MenuItem{
Label: self.c.Tr.CopyFilePath,
OnPress: func() error {
if err := self.c.OS().CopyToClipboard(node.Path); err != nil {
return err
}
self.c.Toast(self.c.Tr.FilePathCopiedToast)
return nil
},
DisabledReason: self.require(self.singleItemSelected())(),
Key: 'p',
}
copyFileDiffItem := &types.MenuItem{
Label: self.c.Tr.CopySelectedDiff,
OnPress: func() error {
return self.copyDiffToClipboard(node.GetPath(), self.c.Tr.FileDiffCopiedToast)
},
DisabledReason: self.require(self.singleItemSelected())(),
Key: 's',
}
copyAllDiff := &types.MenuItem{
Label: self.c.Tr.CopyAllFilesDiff,
OnPress: func() error {
return self.copyDiffToClipboard(".", self.c.Tr.AllFilesDiffCopiedToast)
},
DisabledReason: self.require(self.itemsSelected())(),
Key: 'a',
}
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.CopyToClipboardMenu,
Items: []*types.MenuItem{
copyNameItem,
copyPathItem,
copyFileDiffItem,
copyAllDiff,
},
})
}
func (self *CommitFilesController) checkout(node *filetree.CommitFileNode) error {
self.c.LogAction(self.c.Tr.Actions.CheckoutFile)
if err := self.c.Git().WorkingTree.CheckoutFile(self.context().GetRef().RefName(), node.GetPath()); err != nil {
@@ -492,22 +401,6 @@ func (self *CommitFilesController) toggleTreeView() error {
return nil
}
func (self *CommitFilesController) collapseAll() error {
self.context().CommitFileTreeViewModel.CollapseAll()
self.c.PostRefreshUpdate(self.context())
return nil
}
func (self *CommitFilesController) expandAll() error {
self.context().CommitFileTreeViewModel.ExpandAll()
self.c.PostRefreshUpdate(self.context())
return nil
}
// NOTE: these functions are identical to those in files_controller.go (except for types) and
// could also be cleaned up with some generics
func normalisedSelectedCommitFileNodes(selectedNodes []*filetree.CommitFileNode) []*filetree.CommitFileNode {
@@ -527,11 +420,3 @@ func isDescendentOfSelectedCommitFileNodes(node *filetree.CommitFileNode, select
}
return false
}
func (self *CommitFilesController) isInTreeMode() *types.DisabledReason {
if !self.context().CommitFileTreeViewModel.InTreeMode() {
return &types.DisabledReason{Text: self.c.Tr.DisabledInFlatView}
}
return nil
}
+19 -146
View File
@@ -2,7 +2,6 @@ package controllers
import (
"errors"
"fmt"
"strings"
"github.com/jesseduffield/gocui"
@@ -187,20 +186,6 @@ func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types
Description: self.c.Tr.Fetch,
Tooltip: self.c.Tr.FetchTooltip,
},
{
Key: opts.GetKey(opts.Config.Files.CollapseAll),
Handler: self.collapseAll,
Description: self.c.Tr.CollapseAll,
Tooltip: self.c.Tr.CollapseAllTooltip,
GetDisabledReason: self.require(self.isInTreeMode),
},
{
Key: opts.GetKey(opts.Config.Files.ExpandAll),
Handler: self.expandAll,
Description: self.c.Tr.ExpandAll,
Tooltip: self.c.Tr.ExpandAllTooltip,
GetDisabledReason: self.require(self.isInTreeMode),
},
}
}
@@ -493,22 +478,6 @@ func (self *FilesController) enter() error {
return self.EnterFile(types.OnFocusOpts{ClickedWindowName: "", ClickedViewLineIdx: -1})
}
func (self *FilesController) collapseAll() error {
self.context().FileTreeViewModel.CollapseAll()
self.c.PostRefreshUpdate(self.context())
return nil
}
func (self *FilesController) expandAll() error {
self.context().FileTreeViewModel.ExpandAll()
self.c.PostRefreshUpdate(self.context())
return nil
}
func (self *FilesController) EnterFile(opts types.OnFocusOpts) error {
node := self.context().GetSelected()
if node == nil {
@@ -691,70 +660,24 @@ func (self *FilesController) refresh() error {
}
func (self *FilesController) handleAmendCommitPress() error {
doAmend := func() error {
return self.c.Helpers().WorkingTree.WithEnsureCommittableFiles(func() error {
if len(self.c.Model().Commits) == 0 {
return errors.New(self.c.Tr.NoCommitToAmend)
}
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.AmendLastCommitTitle,
Prompt: self.c.Tr.SureToAmend,
HandleConfirm: func() error {
return self.c.Helpers().WorkingTree.WithEnsureCommittableFiles(func() error {
if len(self.c.Model().Commits) == 0 {
return errors.New(self.c.Tr.NoCommitToAmend)
}
return self.c.Helpers().AmendHelper.AmendHead()
})
}
if self.isResolvingConflicts() {
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.AmendCommitTitle,
Prompt: self.c.Tr.AmendCommitWithConflictsMenuPrompt,
HideCancel: true, // We want the cancel item first, so we add one manually
Items: []*types.MenuItem{
{
Label: self.c.Tr.Cancel,
OnPress: func() error {
return nil
},
},
{
Label: self.c.Tr.AmendCommitWithConflictsContinue,
OnPress: func() error {
return self.c.Helpers().MergeAndRebase.ContinueRebase()
},
},
{
Label: self.c.Tr.AmendCommitWithConflictsAmend,
OnPress: func() error {
return doAmend()
},
},
},
})
} else {
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.AmendLastCommitTitle,
Prompt: self.c.Tr.SureToAmend,
HandleConfirm: func() error {
return doAmend()
},
})
}
return self.c.Helpers().AmendHelper.AmendHead()
})
},
})
return nil
}
func (self *FilesController) isResolvingConflicts() bool {
commits := self.c.Model().Commits
for _, c := range commits {
if c.Status != models.StatusRebasing {
break
}
if c.Action == models.ActionConflict {
return true
}
}
return false
}
func (self *FilesController) handleStatusFilterPressed() error {
currentFilter := self.context().GetFilter()
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.FilteringMenuTitle,
Items: []*types.MenuItem{
@@ -763,79 +686,37 @@ func (self *FilesController) handleStatusFilterPressed() error {
OnPress: func() error {
return self.setStatusFiltering(filetree.DisplayStaged)
},
Key: 's',
Widget: types.MakeMenuRadioButton(currentFilter == filetree.DisplayStaged),
Key: 's',
},
{
Label: self.c.Tr.FilterUnstagedFiles,
OnPress: func() error {
return self.setStatusFiltering(filetree.DisplayUnstaged)
},
Key: 'u',
Widget: types.MakeMenuRadioButton(currentFilter == filetree.DisplayUnstaged),
Key: 'u',
},
{
Label: self.c.Tr.FilterTrackedFiles,
OnPress: func() error {
return self.setStatusFiltering(filetree.DisplayTracked)
},
Key: 't',
Widget: types.MakeMenuRadioButton(currentFilter == filetree.DisplayTracked),
Key: 't',
},
{
Label: self.c.Tr.FilterUntrackedFiles,
OnPress: func() error {
return self.setStatusFiltering(filetree.DisplayUntracked)
},
Key: 'T',
Widget: types.MakeMenuRadioButton(currentFilter == filetree.DisplayUntracked),
},
{
Label: self.c.Tr.NoFilter,
Label: self.c.Tr.ResetFilter,
OnPress: func() error {
return self.setStatusFiltering(filetree.DisplayAll)
},
Key: 'r',
Widget: types.MakeMenuRadioButton(currentFilter == filetree.DisplayAll),
Key: 'r',
},
},
})
}
func (self *FilesController) filteringLabel(filter filetree.FileTreeDisplayFilter) string {
switch filter {
case filetree.DisplayAll:
return ""
case filetree.DisplayStaged:
return self.c.Tr.FilterLabelStagedFiles
case filetree.DisplayUnstaged:
return self.c.Tr.FilterLabelUnstagedFiles
case filetree.DisplayTracked:
return self.c.Tr.FilterLabelTrackedFiles
case filetree.DisplayUntracked:
return self.c.Tr.FilterLabelUntrackedFiles
case filetree.DisplayConflicted:
return self.c.Tr.FilterLabelConflictingFiles
}
panic(fmt.Sprintf("Unexpected files display filter: %d", filter))
}
func (self *FilesController) setStatusFiltering(filter filetree.FileTreeDisplayFilter) error {
previousFilter := self.context().GetFilter()
self.context().FileTreeViewModel.SetStatusFilter(filter)
self.c.Contexts().Files.GetView().Subtitle = self.filteringLabel(filter)
// Whenever we switch between untracked and other filters, we need to refresh the files view
// because the untracked files filter applies when running `git status`.
if previousFilter != filter && (previousFilter == filetree.DisplayUntracked || filter == filetree.DisplayUntracked) {
return self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.FILES}, Mode: types.ASYNC})
} else {
self.c.PostRefreshUpdate(self.context())
return nil
}
self.c.PostRefreshUpdate(self.context())
return nil
}
func (self *FilesController) edit(nodes []*filetree.FileNode) error {
@@ -1300,11 +1181,3 @@ func (self *FilesController) formattedPaths(nodes []*filetree.FileNode) string {
return node.GetPath()
}))
}
func (self *FilesController) isInTreeMode() *types.DisabledReason {
if !self.context().FileTreeViewModel.InTreeMode() {
return &types.DisabledReason{Text: self.c.Tr.DisabledInFlatView}
}
return nil
}
@@ -60,13 +60,9 @@ func (self appStatusHelperTask) Continue() {
// withWaitingStatus wraps a function and shows a waiting status while the function is still executing
func (self *AppStatusHelper) WithWaitingStatus(message string, f func(gocui.Task) error) {
self.c.OnWorker(func(task gocui.Task) error {
return self.WithWaitingStatusImpl(message, f, task)
})
}
func (self *AppStatusHelper) WithWaitingStatusImpl(message string, f func(gocui.Task) error, task gocui.Task) error {
return self.statusMgr().WithWaitingStatus(message, self.renderAppStatus, func(waitingStatusHandle *status.WaitingStatusHandle) error {
return f(appStatusHelperTask{task, waitingStatusHandle})
return self.statusMgr().WithWaitingStatus(message, self.renderAppStatus, func(waitingStatusHandle *status.WaitingStatusHandle) error {
return f(appStatusHelperTask{task, waitingStatusHandle})
})
})
}
@@ -113,7 +113,7 @@ func (self *CommitsHelper) UpdateCommitPanelView(message string) {
}
if self.c.Contexts().CommitMessage.GetPreserveMessage() {
preservedMessage := self.c.Contexts().CommitMessage.GetPreservedMessageAndLogError()
preservedMessage := self.c.Contexts().CommitMessage.GetPreservedMessage()
self.SetMessageAndDescriptionInView(preservedMessage)
return
}
@@ -156,7 +156,7 @@ func (self *CommitsHelper) OpenCommitMessagePanel(opts *OpenCommitMessagePanelOp
func (self *CommitsHelper) OnCommitSuccess() {
// if we have a preserved message we want to clear it on success
if self.c.Contexts().CommitMessage.GetPreserveMessage() {
self.c.Contexts().CommitMessage.SetPreservedMessageAndLogError("")
self.c.Contexts().CommitMessage.SetPreservedMessage("")
}
}
@@ -179,7 +179,7 @@ func (self *CommitsHelper) CloseCommitMessagePanel() {
if self.c.Contexts().CommitMessage.GetPreserveMessage() {
message := self.JoinCommitMessageAndUnwrappedDescription()
if message != self.c.Contexts().CommitMessage.GetInitialMessage() {
self.c.Contexts().CommitMessage.SetPreservedMessageAndLogError(message)
self.c.Contexts().CommitMessage.SetPreservedMessage(message)
}
} else {
self.SetMessageAndDescriptionInView("")
@@ -56,8 +56,8 @@ func (self *ConfirmationHelper) DeactivateConfirmationPrompt() {
self.clearConfirmationViewKeyBindings()
}
func getMessageHeight(wrap bool, editable bool, message string, width int, tabWidth int) int {
wrappedLines, _, _ := utils.WrapViewLinesToWidth(wrap, editable, message, width, tabWidth)
func getMessageHeight(wrap bool, message string, width int) int {
wrappedLines, _, _ := utils.WrapViewLinesToWidth(wrap, message, width)
return len(wrappedLines)
}
@@ -265,7 +265,7 @@ func (self *ConfirmationHelper) resizeMenu(parentPopupContext types.Context) {
if selectedItem != nil {
tooltip = self.TooltipForMenuItem(selectedItem)
}
tooltipHeight := getMessageHeight(true, false, tooltip, contentWidth, self.c.Views().Menu.TabWidth) + 2 // plus 2 for the frame
tooltipHeight := getMessageHeight(true, tooltip, contentWidth) + 2 // plus 2 for the frame
_, _ = self.c.GocuiGui().SetView(self.c.Views().Tooltip.Name(), x0, tooltipTop, x1, tooltipTop+tooltipHeight-1, 0)
}
@@ -276,7 +276,7 @@ func (self *ConfirmationHelper) layoutMenuPrompt(contentWidth int) int {
var promptLines []string
prompt := self.c.Contexts().Menu.GetPrompt()
if len(prompt) > 0 {
promptLines, _, _ = utils.WrapViewLinesToWidth(true, false, prompt, contentWidth, self.c.Views().Menu.TabWidth)
promptLines, _, _ = utils.WrapViewLinesToWidth(true, prompt, contentWidth)
promptLines = append(promptLines, "")
}
self.c.Contexts().Menu.SetPromptLines(promptLines)
@@ -305,18 +305,16 @@ func (self *ConfirmationHelper) resizeConfirmationPanel(parentPopupContext types
}
panelWidth := self.getPopupPanelWidth()
contentWidth := panelWidth - 2 // minus 2 for the frame
confirmationView := self.c.Views().Confirmation
prompt := confirmationView.Buffer()
prompt := self.c.Views().Confirmation.Buffer()
wrap := true
editable := confirmationView.Editable
if editable {
prompt = confirmationView.TextArea.GetContent()
if self.c.Views().Confirmation.Editable {
prompt = self.c.Views().Confirmation.TextArea.GetContent()
wrap = false
}
panelHeight := getMessageHeight(wrap, editable, prompt, contentWidth, confirmationView.TabWidth) + suggestionsViewHeight
panelHeight := getMessageHeight(wrap, prompt, contentWidth) + suggestionsViewHeight
x0, y0, x1, y1 := self.getPopupPanelDimensionsAux(panelWidth, panelHeight, parentPopupContext)
confirmationViewBottom := y1 - suggestionsViewHeight
_, _ = self.c.GocuiGui().SetView(confirmationView.Name(), x0, y0, x1, confirmationViewBottom, 0)
_, _ = self.c.GocuiGui().SetView(self.c.Views().Confirmation.Name(), x0, y0, x1, confirmationViewBottom, 0)
suggestionsViewTop := confirmationViewBottom + 1
_, _ = self.c.GocuiGui().SetView(self.c.Views().Suggestions.Name(), x0, suggestionsViewTop, x1, suggestionsViewTop+suggestionsViewHeight, 0)
@@ -326,7 +324,7 @@ func (self *ConfirmationHelper) ResizeCommitMessagePanels(parentPopupContext typ
panelWidth := self.getPopupPanelWidth()
content := self.c.Views().CommitDescription.TextArea.GetContent()
summaryViewHeight := 3
panelHeight := getMessageHeight(false, true, content, panelWidth, self.c.Views().CommitDescription.TabWidth)
panelHeight := getMessageHeight(false, content, panelWidth)
minHeight := 7
if panelHeight < minHeight {
panelHeight = minHeight
@@ -77,10 +77,6 @@ func (self *MergeAndRebaseHelper) CreateRebaseOptionsMenu() error {
return self.c.Menu(types.CreateMenuOptions{Title: title, Items: menuItems})
}
func (self *MergeAndRebaseHelper) ContinueRebase() error {
return self.genericMergeCommand(REBASE_OPTION_CONTINUE)
}
func (self *MergeAndRebaseHelper) genericMergeCommand(command string) error {
status := self.c.Git().Status.WorkingTreeState()
@@ -490,8 +490,6 @@ func (self *RefreshHelper) refreshBranches(refreshWorktrees bool, keepBranchSele
self.refreshView(self.c.Contexts().Worktrees)
}
self.refreshView(self.c.Contexts().Branches)
if !keepBranchSelectionIndex && prevSelectedBranch != nil {
_, idx, found := lo.FindIndexOf(self.c.Contexts().Branches.GetItems(),
func(b *models.Branch) bool { return b.Name == prevSelectedBranch.Name })
@@ -500,6 +498,8 @@ func (self *RefreshHelper) refreshBranches(refreshWorktrees bool, keepBranchSele
}
}
self.refreshView(self.c.Contexts().Branches)
// Need to re-render the commits view because the visualization of local
// branch heads might have changed
self.c.Mutexes().LocalCommitsMutex.Lock()
@@ -570,9 +570,7 @@ func (self *RefreshHelper) refreshStateFiles() error {
}
files := self.c.Git().Loaders.FileLoader.
GetStatusFiles(git_commands.GetStatusFileOptions{
ForceShowUntracked: self.c.Contexts().Files.ForceShowUntracked(),
})
GetStatusFiles(git_commands.GetStatusFileOptions{})
conflictFileCount := 0
for _, file := range files {
@@ -588,14 +586,16 @@ func (self *RefreshHelper) refreshStateFiles() error {
fileTreeViewModel.RWMutex.Lock()
// only taking over the filter if it hasn't already been set by the user.
if conflictFileCount > 0 && prevConflictFileCount == 0 {
// Though this does make it impossible for the user to actually say they want to display all if
// conflicts are currently being shown. Hmm. Worth it I reckon. If we need to add some
// extra state here to see if the user's set the filter themselves we can do that, but
// I'd prefer to maintain as little state as possible.
if conflictFileCount > 0 {
if fileTreeViewModel.GetFilter() == filetree.DisplayAll {
fileTreeViewModel.SetStatusFilter(filetree.DisplayConflicted)
self.c.Contexts().Files.GetView().Subtitle = self.c.Tr.FilterLabelConflictingFiles
}
} else if conflictFileCount == 0 && fileTreeViewModel.GetFilter() == filetree.DisplayConflicted {
} else if fileTreeViewModel.GetFilter() == filetree.DisplayConflicted {
fileTreeViewModel.SetStatusFilter(filetree.DisplayAll)
self.c.Contexts().Files.GetView().Subtitle = ""
}
self.c.Model().Files = files
+10 -11
View File
@@ -278,17 +278,7 @@ func (self *RefsHelper) CreateCheckoutMenu(commit *models.Commit) error {
})
hash := commit.Hash
menuItems := []*types.MenuItem{
{
LabelColumns: []string{fmt.Sprintf(self.c.Tr.Actions.CheckoutCommitAsDetachedHead, utils.ShortHash(hash))},
OnPress: func() error {
self.c.LogAction(self.c.Tr.Actions.CheckoutCommit)
return self.CheckoutRef(hash, types.CheckoutRefOptions{})
},
Key: 'd',
},
}
var menuItems []*types.MenuItem
if len(branches) > 0 {
menuItems = append(menuItems, lo.Map(branches, func(branch *models.Branch, index int) *types.MenuItem {
@@ -314,6 +304,15 @@ func (self *RefsHelper) CreateCheckoutMenu(commit *models.Commit) error {
})
}
menuItems = append(menuItems, &types.MenuItem{
LabelColumns: []string{fmt.Sprintf(self.c.Tr.Actions.CheckoutCommitAsDetachedHead, utils.ShortHash(hash))},
OnPress: func() error {
self.c.LogAction(self.c.Tr.Actions.CheckoutCommit)
return self.CheckoutRef(hash, types.CheckoutRefOptions{})
},
Key: 'd',
})
return self.c.Menu(types.CreateMenuOptions{
Title: self.c.Tr.Actions.CheckoutBranchOrCommit,
Items: menuItems,
@@ -149,11 +149,11 @@ func (self *WorkingTreeHelper) HandleWIPCommitPress() error {
}
func (self *WorkingTreeHelper) HandleCommitPress() error {
message := self.c.Contexts().CommitMessage.GetPreservedMessageAndLogError()
message := self.c.Contexts().CommitMessage.GetPreservedMessage()
if message == "" {
commitPrefixConfigs := self.commitPrefixConfigsForRepo()
for _, commitPrefixConfig := range commitPrefixConfigs {
commitPrefixConfig := self.commitPrefixConfigForRepo()
if commitPrefixConfig != nil {
prefixPattern := commitPrefixConfig.Pattern
prefixReplace := commitPrefixConfig.Replace
branchName := self.refHelper.GetCheckedOutRef().Name
@@ -165,7 +165,6 @@ func (self *WorkingTreeHelper) HandleCommitPress() error {
if rgx.MatchString(branchName) {
prefix := rgx.ReplaceAllString(branchName, prefixReplace)
message = prefix
break
}
}
}
@@ -229,11 +228,11 @@ func (self *WorkingTreeHelper) prepareFilesForCommit() error {
return nil
}
func (self *WorkingTreeHelper) commitPrefixConfigsForRepo() []config.CommitPrefixConfig {
func (self *WorkingTreeHelper) commitPrefixConfigForRepo() *config.CommitPrefixConfig {
cfg, ok := self.c.UserConfig().Git.CommitPrefixes[self.c.Git().RepoPaths.RepoName()]
if ok {
return append(cfg, self.c.UserConfig().Git.CommitPrefix...)
} else {
return self.c.UserConfig().Git.CommitPrefix
return &cfg
}
return self.c.UserConfig().Git.CommitPrefix
}
-12
View File
@@ -1,13 +1,11 @@
package controllers
import (
"fmt"
"strings"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/commands/patch"
"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
@@ -187,20 +185,10 @@ func (self *StagingController) TogglePanel() error {
}
func (self *StagingController) ToggleStaged() error {
if self.c.AppState.DiffContextSize == 0 {
return fmt.Errorf(self.c.Tr.Actions.NotEnoughContextToStage,
keybindings.Label(self.c.UserConfig().Keybinding.Universal.IncreaseContextInDiffView))
}
return self.applySelectionAndRefresh(self.staged)
}
func (self *StagingController) DiscardSelection() error {
if self.c.AppState.DiffContextSize == 0 {
return fmt.Errorf(self.c.Tr.Actions.NotEnoughContextToDiscard,
keybindings.Label(self.c.UserConfig().Keybinding.Universal.IncreaseContextInDiffView))
}
reset := func() error { return self.applySelectionAndRefresh(true) }
if !self.staged && !self.c.UserConfig().Gui.SkipDiscardChangeWarning {
+2 -2
View File
@@ -201,13 +201,13 @@ func (self *StashController) handleRenameStashEntry(stashEntry *models.StashEntr
HandleConfirm: func(response string) error {
self.c.LogAction(self.c.Tr.Actions.RenameStash)
err := self.c.Git().Stash.Rename(stashEntry.Index, response)
_ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
if err != nil {
_ = self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
return err
}
self.context().SetSelection(0) // Select the renamed stash
self.context().FocusLine()
return self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
return nil
},
})
-1
View File
@@ -200,7 +200,6 @@ func (self *SyncController) pushAux(currentBranch *models.Branch, opts pushOpts)
git_commands.PushOpts{
Force: opts.force,
ForceWithLease: opts.forceWithLease,
CurrentBranch: currentBranch.Name,
UpstreamRemote: opts.upstreamRemote,
UpstreamBranch: opts.upstreamBranch,
SetUpstream: opts.setUpstream,
-61
View File
@@ -177,59 +177,6 @@ func (self *TagsController) remoteDelete(tag *models.Tag) error {
return nil
}
func (self *TagsController) localAndRemoteDelete(tag *models.Tag) error {
title := utils.ResolvePlaceholderString(
self.c.Tr.SelectRemoteTagUpstream,
map[string]string{
"tagName": tag.Name,
},
)
self.c.Prompt(types.PromptOpts{
Title: title,
InitialContent: "origin",
FindSuggestionsFunc: self.c.Helpers().Suggestions.GetRemoteSuggestionsFunc(),
HandleConfirm: func(upstream string) error {
confirmTitle := utils.ResolvePlaceholderString(
self.c.Tr.DeleteTagTitle,
map[string]string{
"tagName": tag.Name,
},
)
confirmPrompt := utils.ResolvePlaceholderString(
self.c.Tr.DeleteLocalAndRemoteTagPrompt,
map[string]string{
"tagName": tag.Name,
"upstream": upstream,
},
)
self.c.Confirm(types.ConfirmOpts{
Title: confirmTitle,
Prompt: confirmPrompt,
HandleConfirm: func() error {
return self.c.WithInlineStatus(tag, types.ItemOperationDeleting, context.TAGS_CONTEXT_KEY, func(task gocui.Task) error {
self.c.LogAction(self.c.Tr.Actions.DeleteRemoteTag)
if err := self.c.Git().Remote.DeleteRemoteTag(task, upstream, tag.Name); err != nil {
return err
}
self.c.LogAction(self.c.Tr.Actions.DeleteLocalTag)
if err := self.c.Git().Tag.LocalDelete(tag.Name); err != nil {
return err
}
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.COMMITS, types.TAGS}})
})
},
})
return nil
},
})
return nil
}
func (self *TagsController) delete(tag *models.Tag) error {
menuTitle := utils.ResolvePlaceholderString(
self.c.Tr.DeleteTagTitle,
@@ -254,14 +201,6 @@ func (self *TagsController) delete(tag *models.Tag) error {
return self.remoteDelete(tag)
},
},
{
Label: self.c.Tr.DeleteLocalAndRemoteTag,
Key: 'b',
OpensMenu: true,
OnPress: func() error {
return self.localAndRemoteDelete(tag)
},
},
}
return self.c.Menu(types.CreateMenuOptions{
+24 -29
View File
@@ -88,20 +88,7 @@ func (self *UndoController) reflogUndo() error {
}
switch action.kind {
case COMMIT:
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Undo,
Prompt: fmt.Sprintf(self.c.Tr.SoftResetPrompt, action.from),
HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.Undo)
return self.c.WithWaitingStatus(undoingStatus, func(gocui.Task) error {
return self.c.Helpers().Refs.ResetToRef(action.from, "soft", undoEnvVars)
})
},
})
return true, nil
case REBASE:
case COMMIT, REBASE:
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Undo,
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, action.from),
@@ -118,7 +105,7 @@ func (self *UndoController) reflogUndo() error {
case CHECKOUT:
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Undo,
Prompt: fmt.Sprintf(self.c.Tr.CheckoutAutostashPrompt, action.from),
Prompt: fmt.Sprintf(self.c.Tr.CheckoutPrompt, action.from),
HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.Undo)
return self.c.Helpers().Refs.CheckoutRef(action.from, types.CheckoutRefOptions{
@@ -172,7 +159,7 @@ func (self *UndoController) reflogRedo() error {
case CHECKOUT:
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Actions.Redo,
Prompt: fmt.Sprintf(self.c.Tr.CheckoutAutostashPrompt, action.to),
Prompt: fmt.Sprintf(self.c.Tr.CheckoutPrompt, action.to),
HandleConfirm: func() error {
self.c.LogAction(self.c.Tr.Actions.Redo)
return self.c.Helpers().Refs.CheckoutRef(action.to, types.CheckoutRefOptions{
@@ -257,23 +244,31 @@ func (self *UndoController) hardResetWithAutoStash(commitHash string, options ha
return self.c.Helpers().Refs.ResetToRef(commitHash, "hard", options.EnvVars)
}
// if we have any modified tracked files we need to auto-stash
// if we have any modified tracked files we need to ask the user if they want us to stash for them
dirtyWorkingTree := self.c.Helpers().WorkingTree.IsWorkingTreeDirty()
if dirtyWorkingTree {
return self.c.WithWaitingStatus(options.WaitingStatus, func(gocui.Task) error {
if err := self.c.Git().Stash.Push(self.c.Tr.StashPrefix + commitHash); err != nil {
return err
}
if err := reset(); err != nil {
return err
}
// offer to autostash changes
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.AutoStashTitle,
Prompt: self.c.Tr.AutoStashPrompt,
HandleConfirm: func() error {
return self.c.WithWaitingStatus(options.WaitingStatus, func(gocui.Task) error {
if err := self.c.Git().Stash.Push(self.c.Tr.StashPrefix + commitHash); err != nil {
return err
}
if err := reset(); err != nil {
return err
}
err := self.c.Git().Stash.Pop(0)
if err != nil {
return err
}
return self.c.Refresh(types.RefreshOptions{})
err := self.c.Git().Stash.Pop(0)
if err != nil {
return err
}
return self.c.Refresh(types.RefreshOptions{})
})
},
})
return nil
}
return self.c.WithWaitingStatus(options.WaitingStatus, func(gocui.Task) error {
-5
View File
@@ -36,8 +36,3 @@ func (self *CollapsedPaths) ToggleCollapsed(path string) {
self.collapsedPaths.Add(path)
}
}
func (self *CollapsedPaths) ExpandAll() {
// Could be cleaner if Set had a Clear() method...
self.collapsedPaths.RemoveSlice(self.collapsedPaths.ToSlice())
}
-14
View File
@@ -25,20 +25,6 @@ type CommitFileTree struct {
collapsedPaths *CollapsedPaths
}
func (self *CommitFileTree) CollapseAll() {
dirPaths := lo.FilterMap(self.GetAllItems(), func(file *CommitFileNode, index int) (string, bool) {
return file.Path, !file.IsFile()
})
for _, path := range dirPaths {
self.collapsedPaths.Collapse(path)
}
}
func (self *CommitFileTree) ExpandAll() {
self.collapsedPaths.ExpandAll()
}
var _ ICommitFileTree = &CommitFileTree{}
func NewCommitFileTree(getFiles func() []*models.CommitFile, log *logrus.Entry, showTree bool) *CommitFileTree {
@@ -1,7 +1,6 @@
package filetree
import (
"strings"
"sync"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@@ -161,33 +160,3 @@ func (self *CommitFileTreeViewModel) ToggleShowTree() {
self.SetSelection(index)
}
}
func (self *CommitFileTreeViewModel) CollapseAll() {
selectedNode := self.GetSelected()
self.ICommitFileTree.CollapseAll()
if selectedNode == nil {
return
}
topLevelPath := strings.Split(selectedNode.Path, "/")[0]
index, found := self.GetIndexForPath(topLevelPath)
if found {
self.SetSelectedLineIdx(index)
}
}
func (self *CommitFileTreeViewModel) ExpandAll() {
selectedNode := self.GetSelected()
self.ICommitFileTree.ExpandAll()
if selectedNode == nil {
return
}
index, found := self.GetIndexForPath(selectedNode.Path)
if found {
self.SetSelectedLineIdx(index)
}
}
-24
View File
@@ -16,7 +16,6 @@ const (
DisplayStaged
DisplayUnstaged
DisplayTracked
DisplayUntracked
// this shows files with merge conflicts
DisplayConflicted
)
@@ -32,8 +31,6 @@ type ITree[T any] interface {
IsCollapsed(path string) bool
ToggleCollapsed(path string)
CollapsedPaths() *CollapsedPaths
CollapseAll()
ExpandAll()
}
type IFileTree interface {
@@ -41,7 +38,6 @@ type IFileTree interface {
FilterFiles(test func(*models.File) bool) []*models.File
SetStatusFilter(filter FileTreeDisplayFilter)
ForceShowUntracked() bool
Get(index int) *FileNode
GetFile(path string) *models.File
GetAllItems() []*FileNode
@@ -89,8 +85,6 @@ func (self *FileTree) getFilesForDisplay() []*models.File {
return self.FilterFiles(func(file *models.File) bool { return file.HasUnstagedChanges })
case DisplayTracked:
return self.FilterFiles(func(file *models.File) bool { return file.Tracked })
case DisplayUntracked:
return self.FilterFiles(func(file *models.File) bool { return !file.Tracked })
case DisplayConflicted:
return self.FilterFiles(func(file *models.File) bool { return file.HasMergeConflicts })
default:
@@ -98,10 +92,6 @@ func (self *FileTree) getFilesForDisplay() []*models.File {
}
}
func (self *FileTree) ForceShowUntracked() bool {
return self.filter == DisplayUntracked
}
func (self *FileTree) FilterFiles(test func(*models.File) bool) []*models.File {
return lo.Filter(self.getFiles(), func(file *models.File, _ int) bool { return test(file) })
}
@@ -181,20 +171,6 @@ func (self *FileTree) ToggleCollapsed(path string) {
self.collapsedPaths.ToggleCollapsed(path)
}
func (self *FileTree) CollapseAll() {
dirPaths := lo.FilterMap(self.GetAllItems(), func(file *FileNode, index int) (string, bool) {
return file.Path, !file.IsFile()
})
for _, path := range dirPaths {
self.collapsedPaths.Collapse(path)
}
}
func (self *FileTree) ExpandAll() {
self.collapsedPaths.ExpandAll()
}
func (self *FileTree) Tree() *FileNode {
return NewFileNode(self.tree)
}
-31
View File
@@ -1,7 +1,6 @@
package filetree
import (
"strings"
"sync"
"github.com/jesseduffield/lazygit/pkg/commands/models"
@@ -191,33 +190,3 @@ func (self *FileTreeViewModel) ToggleShowTree() {
self.SetSelectedLineIdx(index)
}
}
func (self *FileTreeViewModel) CollapseAll() {
selectedNode := self.GetSelected()
self.IFileTree.CollapseAll()
if selectedNode == nil {
return
}
topLevelPath := strings.Split(selectedNode.Path, "/")[0]
index, found := self.GetIndexForPath(topLevelPath)
if found {
self.SetSelectedLineIdx(index)
}
}
func (self *FileTreeViewModel) ExpandAll() {
selectedNode := self.GetSelected()
self.IFileTree.ExpandAll()
if selectedNode == nil {
return
}
index, found := self.GetIndexForPath(selectedNode.Path)
if found {
self.SetSelectedLineIdx(index)
}
}
+1 -7
View File
@@ -455,13 +455,7 @@ func (gui *Gui) onUserConfigLoaded() error {
} else if userConfig.Gui.ShowIcons {
icons.SetNerdFontsVersion("2")
}
if len(userConfig.Gui.BranchColorPatterns) > 0 {
presentation.SetCustomBranches(userConfig.Gui.BranchColorPatterns, true)
} else {
// Fall back to the deprecated branchColors config
presentation.SetCustomBranches(userConfig.Gui.BranchColors, false)
}
presentation.SetCustomBranches(userConfig.Gui.BranchColors)
return nil
}
-7
View File
@@ -145,13 +145,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
GetDisabledReason: self.getCopySelectedSideContextItemToClipboardDisabledReason,
Description: self.c.Tr.CopyBranchNameToClipboard,
},
{
ViewName: "tags",
Key: opts.GetKey(opts.Config.Universal.CopyToClipboard),
Handler: self.handleCopySelectedSideContextItemToClipboard,
GetDisabledReason: self.getCopySelectedSideContextItemToClipboardDisabledReason,
Description: self.c.Tr.CopyTagToClipboard,
},
{
ViewName: "commits",
Key: opts.GetKey(opts.Config.Universal.CopyToClipboard),
+70 -3
View File
@@ -7,11 +7,78 @@ import (
"unicode/utf8"
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/constants"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/samber/lo"
)
var labelByKey = map[gocui.Key]string{
gocui.KeyF1: "<f1>",
gocui.KeyF2: "<f2>",
gocui.KeyF3: "<f3>",
gocui.KeyF4: "<f4>",
gocui.KeyF5: "<f5>",
gocui.KeyF6: "<f6>",
gocui.KeyF7: "<f7>",
gocui.KeyF8: "<f8>",
gocui.KeyF9: "<f9>",
gocui.KeyF10: "<f10>",
gocui.KeyF11: "<f11>",
gocui.KeyF12: "<f12>",
gocui.KeyInsert: "<insert>",
gocui.KeyDelete: "<delete>",
gocui.KeyHome: "<home>",
gocui.KeyEnd: "<end>",
gocui.KeyPgup: "<pgup>",
gocui.KeyPgdn: "<pgdown>",
gocui.KeyArrowUp: "<up>",
gocui.KeyShiftArrowUp: "<s-up>",
gocui.KeyArrowDown: "<down>",
gocui.KeyShiftArrowDown: "<s-down>",
gocui.KeyArrowLeft: "<left>",
gocui.KeyArrowRight: "<right>",
gocui.KeyTab: "<tab>", // <c-i>
gocui.KeyBacktab: "<backtab>",
gocui.KeyEnter: "<enter>", // <c-m>
gocui.KeyAltEnter: "<a-enter>",
gocui.KeyEsc: "<esc>", // <c-[>, <c-3>
gocui.KeyBackspace: "<backspace>", // <c-h>
gocui.KeyCtrlSpace: "<c-space>", // <c-~>, <c-2>
gocui.KeyCtrlSlash: "<c-/>", // <c-_>
gocui.KeySpace: "<space>",
gocui.KeyCtrlA: "<c-a>",
gocui.KeyCtrlB: "<c-b>",
gocui.KeyCtrlC: "<c-c>",
gocui.KeyCtrlD: "<c-d>",
gocui.KeyCtrlE: "<c-e>",
gocui.KeyCtrlF: "<c-f>",
gocui.KeyCtrlG: "<c-g>",
gocui.KeyCtrlJ: "<c-j>",
gocui.KeyCtrlK: "<c-k>",
gocui.KeyCtrlL: "<c-l>",
gocui.KeyCtrlN: "<c-n>",
gocui.KeyCtrlO: "<c-o>",
gocui.KeyCtrlP: "<c-p>",
gocui.KeyCtrlQ: "<c-q>",
gocui.KeyCtrlR: "<c-r>",
gocui.KeyCtrlS: "<c-s>",
gocui.KeyCtrlT: "<c-t>",
gocui.KeyCtrlU: "<c-u>",
gocui.KeyCtrlV: "<c-v>",
gocui.KeyCtrlW: "<c-w>",
gocui.KeyCtrlX: "<c-x>",
gocui.KeyCtrlY: "<c-y>",
gocui.KeyCtrlZ: "<c-z>",
gocui.KeyCtrl4: "<c-4>", // <c-\>
gocui.KeyCtrl5: "<c-5>", // <c-]>
gocui.KeyCtrl6: "<c-6>",
gocui.KeyCtrl8: "<c-8>",
gocui.MouseWheelUp: "mouse wheel up",
gocui.MouseWheelDown: "mouse wheel down",
}
var keyByLabel = lo.Invert(labelByKey)
func Label(name string) string {
return LabelFromKey(GetKey(name))
}
@@ -23,7 +90,7 @@ func LabelFromKey(key types.Key) string {
case rune:
keyInt = int(key)
case gocui.Key:
value, ok := config.LabelByKey[key]
value, ok := labelByKey[key]
if ok {
return value
}
@@ -38,7 +105,7 @@ func GetKey(key string) types.Key {
if key == "<disabled>" {
return nil
} else if runeCount > 1 {
binding, ok := config.KeyByLabel[strings.ToLower(key)]
binding, ok := keyByLabel[strings.ToLower(key)]
if !ok {
log.Fatalf("Unrecognized key %s for keybinding. For permitted values see %s", strings.ToLower(key), constants.Links.Docs.CustomKeybindings)
} else {
+1 -1
View File
@@ -323,6 +323,6 @@ func (s *State) CalculateOrigin(currentOrigin int, bufferHeight int, numLines in
func wrapPatchLines(diff string, view *gocui.View) ([]int, []int) {
_, viewLineIndices, patchLineIndices := utils.WrapViewLinesToWidth(
view.Wrap, view.Editable, strings.TrimSuffix(diff, "\n"), view.InnerWidth(), view.TabWidth)
view.Wrap, strings.TrimSuffix(diff, "\n"), view.InnerWidth())
return viewLineIndices, patchLineIndices
}
+16 -32
View File
@@ -2,7 +2,6 @@ package presentation
import (
"fmt"
"regexp"
"strings"
"time"
@@ -19,12 +18,7 @@ import (
"github.com/samber/lo"
)
type colorMatcher struct {
patterns map[string]style.TextStyle
isRegex bool // NOTE: this value is needed only until the deprecated branchColors config is removed and only regex color patterns are used
}
var colorPatterns *colorMatcher
var branchPrefixColorCache = make(map[string]style.TextStyle)
func GetBranchListDisplayStrings(
branches []*models.Branch,
@@ -131,29 +125,22 @@ func getBranchDisplayStrings(
// GetBranchTextStyle branch color
func GetBranchTextStyle(name string) style.TextStyle {
if style, ok := colorPatterns.match(name); ok {
return *style
branchType := strings.Split(name, "/")[0]
if value, ok := branchPrefixColorCache[branchType]; ok {
return value
}
return theme.DefaultTextColor
}
func (m *colorMatcher) match(name string) (*style.TextStyle, bool) {
if m.isRegex {
for pattern, style := range m.patterns {
if matched, _ := regexp.MatchString(pattern, name); matched {
return &style, true
}
}
} else {
// old behavior using the deprecated branchColors behavior matching on branch type
branchType := strings.Split(name, "/")[0]
if value, ok := m.patterns[branchType]; ok {
return &value, true
}
switch branchType {
case "feature":
return style.FgGreen
case "bugfix":
return style.FgYellow
case "hotfix":
return style.FgRed
default:
return theme.DefaultTextColor
}
return nil, false
}
func BranchStatus(
@@ -202,9 +189,6 @@ func BranchStatus(
return result
}
func SetCustomBranches(customBranchColors map[string]string, isRegex bool) {
colorPatterns = &colorMatcher{
patterns: utils.SetCustomColors(customBranchColors),
isRegex: isRegex,
}
func SetCustomBranches(customBranchColors map[string]string) {
branchPrefixColorCache = utils.SetCustomColors(customBranchColors)
}
-1
View File
@@ -321,7 +321,6 @@ func Test_getBranchDisplayStrings(t *testing.T) {
defer color.ForceSetColorLevel(oldColorLevel)
c := utils.NewDummyCommon()
SetCustomBranches(c.UserConfig().Gui.BranchColorPatterns, true)
for i, s := range scenarios {
icons.SetNerdFontsVersion(lo.Ternary(s.useIcons, "3", ""))
+2 -3
View File
@@ -82,7 +82,7 @@ var nameIconMap = map[string]IconProperties{
"bin": {Icon: "\U000f12a7", Color: "#25A79A"}, // 󱊧
"brewfile": {Icon: "\ue791", Color: "#701516"}, // 
"bspwmrc": {Icon: "\uf355", Color: "#2F2F2F"}, // 
"BUILD": {Icon: "\ue63a", Color: "#89E051"}, // 
"build": {Icon: "\ue63a", Color: "#89E051"}, // 
"build.gradle": {Icon: "\ue660", Color: "#005F87"}, // 
"build.zig.zon": {Icon: "\ue6a9", Color: "#F69A1B"}, // 
"bun.lockb": {Icon: "\ue76f", Color: "#EADCD1"}, // 
@@ -207,8 +207,7 @@ var nameIconMap = map[string]IconProperties{
"vlcrc": {Icon: "\U000f057c", Color: "#E85E00"}, // 󰕼
"webpack": {Icon: "\U000f072b", Color: "#519ABA"}, // 󰜫
"weston.ini": {Icon: "\uf367", Color: "#FFBB01"}, // 
"WORKSPACE": {Icon: "\ue63a", Color: "#89E051"}, // 
"WORKSPACE.bzlmod": {Icon: "\ue63a", Color: "#89E051"}, // 
"workspace": {Icon: "\ue63a", Color: "#89E051"}, // 
"xmobarrc": {Icon: "\uf35e", Color: "#FD4D5D"}, // 
"xmobarrc.hs": {Icon: "\uf35e", Color: "#FD4D5D"}, // 
"xmonad.hs": {Icon: "\uf35e", Color: "#FD4D5D"}, // 
@@ -162,29 +162,12 @@ func worktreeShimFromModelRemote(worktree *models.Worktree) *Worktree {
}
}
type CommitRange struct {
From string
To string
}
func makeCommitRange(commits []*models.Commit, _ int, _ int) *CommitRange {
if len(commits) == 0 {
return nil
}
return &CommitRange{
From: commits[len(commits)-1].Hash,
To: commits[0].Hash,
}
}
// SessionState captures the current state of the application for use in custom commands
type SessionState struct {
SelectedLocalCommit *Commit // deprecated, use SelectedCommit
SelectedReflogCommit *Commit // deprecated, use SelectedCommit
SelectedSubCommit *Commit // deprecated, use SelectedCommit
SelectedCommit *Commit
SelectedCommitRange *CommitRange
SelectedFile *File
SelectedPath string
SelectedLocalBranch *Branch
@@ -200,20 +183,14 @@ type SessionState struct {
func (self *SessionStateLoader) call() *SessionState {
selectedLocalCommit := commitShimFromModelCommit(self.c.Contexts().LocalCommits.GetSelected())
selectedLocalCommitRange := makeCommitRange(self.c.Contexts().LocalCommits.GetSelectedItems())
selectedReflogCommit := commitShimFromModelCommit(self.c.Contexts().ReflogCommits.GetSelected())
selectedReflogCommitRange := makeCommitRange(self.c.Contexts().ReflogCommits.GetSelectedItems())
selectedSubCommit := commitShimFromModelCommit(self.c.Contexts().SubCommits.GetSelected())
selectedSubCommitRange := makeCommitRange(self.c.Contexts().SubCommits.GetSelectedItems())
selectedCommit := selectedLocalCommit
selectedCommitRange := selectedLocalCommitRange
if self.c.Context().IsCurrentOrParent(self.c.Contexts().ReflogCommits) {
selectedCommit = selectedReflogCommit
selectedCommitRange = selectedReflogCommitRange
} else if self.c.Context().IsCurrentOrParent(self.c.Contexts().SubCommits) {
selectedCommit = selectedSubCommit
selectedCommitRange = selectedSubCommitRange
}
selectedPath := self.c.Contexts().Files.GetSelectedPath()
@@ -230,7 +207,6 @@ func (self *SessionStateLoader) call() *SessionState {
SelectedReflogCommit: selectedReflogCommit,
SelectedSubCommit: selectedSubCommit,
SelectedCommit: selectedCommit,
SelectedCommitRange: selectedCommitRange,
SelectedLocalBranch: branchShimFromModelBranch(self.c.Contexts().Branches.GetSelected()),
SelectedRemoteBranch: remoteBranchShimFromModelRemoteBranch(self.c.Contexts().RemoteBranches.GetSelected()),
SelectedRemote: remoteShimFromModelRemote(self.c.Contexts().Remotes.GetSelected()),
-1
View File
@@ -203,7 +203,6 @@ func (gui *Gui) configureViewProperties() {
for _, view := range []*gocui.View{gui.Views.Main, gui.Views.Secondary, gui.Views.Staging, gui.Views.StagingSecondary, gui.Views.PatchBuilding, gui.Views.PatchBuildingSecondary, gui.Views.MergeConflicts} {
view.CanScrollPastBottom = gui.c.UserConfig().Gui.ScrollPastBottom
view.TabWidth = gui.c.UserConfig().Gui.TabWidth
}
gui.Views.CommitDescription.FgColor = theme.GocuiDefaultTextColor
+46 -104
View File
@@ -88,13 +88,7 @@ type TranslationSet struct {
FilterStagedFiles string
FilterUnstagedFiles string
FilterTrackedFiles string
FilterUntrackedFiles string
NoFilter string
FilterLabelStagedFiles string
FilterLabelUnstagedFiles string
FilterLabelTrackedFiles string
FilterLabelUntrackedFiles string
FilterLabelConflictingFiles string
ResetFilter string
MergeConflictsTitle string
Checkout string
CheckoutTooltip string
@@ -262,11 +256,6 @@ type TranslationSet struct {
NoBranchOnRemote string
Fetch string
FetchTooltip string
CollapseAll string
CollapseAllTooltip string
ExpandAll string
ExpandAllTooltip string
DisabledInFlatView string
FileEnter string
FileEnterTooltip string
FileStagingRequirements string
@@ -359,9 +348,6 @@ type TranslationSet struct {
ScrollDownMainWindow string
AmendCommitTitle string
AmendCommitPrompt string
AmendCommitWithConflictsMenuPrompt string
AmendCommitWithConflictsContinue string
AmendCommitWithConflictsAmend string
DropCommitTitle string
DropCommitPrompt string
DropUpdateRefPrompt string
@@ -527,10 +513,8 @@ type TranslationSet struct {
DeleteTagTitle string
DeleteLocalTag string
DeleteRemoteTag string
DeleteLocalAndRemoteTag string
SelectRemoteTagUpstream string
DeleteRemoteTagPrompt string
DeleteLocalAndRemoteTagPrompt string
RemoteTagDeletedMessage string
PushTagTitle string
PushTag string
@@ -621,14 +605,11 @@ type TranslationSet struct {
PasteCommitMessageFromClipboard string
SurePasteCommitMessage string
CommitMessage string
CommitMessageBody string
CommitSubject string
CommitAuthor string
CommitTags string
CopyCommitAttributeToClipboard string
CopyCommitAttributeToClipboardTooltip string
CopyBranchNameToClipboard string
CopyTagToClipboard string
CopyPathToClipboard string
CommitPrefixPatternError string
CopySelectedTextToClipboard string
@@ -686,12 +667,8 @@ type TranslationSet struct {
CommitDiffCopiedToClipboard string
CommitURLCopiedToClipboard string
CommitMessageCopiedToClipboard string
CommitMessageBodyCopiedToClipboard string
CommitSubjectCopiedToClipboard string
CommitAuthorCopiedToClipboard string
CommitTagsCopiedToClipboard string
CommitHasNoTags string
CommitHasNoMessageBody string
PatchCopiedToClipboard string
CopiedToClipboard string
ErrCannotEditDirectory string
@@ -750,9 +727,8 @@ type TranslationSet struct {
ConfirmRevertCommit string
RewordInEditorTitle string
RewordInEditorPrompt string
CheckoutAutostashPrompt string
CheckoutPrompt string
HardResetAutostashPrompt string
SoftResetPrompt string
UpstreamGone string
NukeDescription string
DiscardStagedChangesDescription string
@@ -917,14 +893,12 @@ type Actions struct {
MoveCommitUp string
MoveCommitDown string
CopyCommitMessageToClipboard string
CopyCommitMessageBodyToClipboard string
CopyCommitSubjectToClipboard string
CopyCommitDiffToClipboard string
CopyCommitHashToClipboard string
CopyCommitURLToClipboard string
CopyCommitAuthorToClipboard string
CopyCommitAttributeToClipboard string
CopyCommitTagsToClipboard string
CopyPatchToClipboard string
CustomCommand string
DiscardAllChangesInDirectory string
@@ -936,8 +910,6 @@ type Actions struct {
UnstageFile string
UnstageAllFiles string
StageAllFiles string
NotEnoughContextToStage string
NotEnoughContextToDiscard string
IgnoreExcludeFile string
IgnoreFileErr string
ExcludeFile string
@@ -1123,13 +1095,7 @@ func EnglishTranslationSet() *TranslationSet {
FilterStagedFiles: "Show only staged files",
FilterUnstagedFiles: "Show only unstaged files",
FilterTrackedFiles: "Show only tracked files",
FilterUntrackedFiles: "Show only untracked files",
NoFilter: "No filter",
FilterLabelStagedFiles: "(only staged)",
FilterLabelUnstagedFiles: "(only unstaged)",
FilterLabelTrackedFiles: "(only tracked)",
FilterLabelUntrackedFiles: "(only untracked)",
FilterLabelConflictingFiles: "(only conflicting)",
ResetFilter: "Reset filter",
NoChangedFiles: "No changed files",
SoftReset: "Soft reset",
AlreadyCheckedOutBranch: "You have already checked out this branch",
@@ -1292,11 +1258,6 @@ func EnglishTranslationSet() *TranslationSet {
NoBranchOnRemote: `This branch doesn't exist on remote. You need to push it to remote first.`,
Fetch: `Fetch`,
FetchTooltip: "Fetch changes from remote.",
CollapseAll: "Collapse all files",
CollapseAllTooltip: "Collapse all directories in the files tree",
ExpandAll: "Expand all files",
ExpandAllTooltip: "Expand all directories in the file tree",
DisabledInFlatView: "Not available in flat view",
FileEnter: `Stage lines / Collapse directory`,
FileEnterTooltip: "If the selected item is a file, focus the staging view so you can stage individual hunks/lines. If the selected item is a directory, collapse/expand it.",
FileStagingRequirements: `Can only stage individual lines for tracked files`,
@@ -1396,9 +1357,6 @@ func EnglishTranslationSet() *TranslationSet {
ScrollDownMainWindow: "Scroll down main window",
AmendCommitTitle: "Amend commit",
AmendCommitPrompt: "Are you sure you want to amend this commit with your staged files?",
AmendCommitWithConflictsMenuPrompt: "WARNING: you are about to amend the last finished commit with your resolved conflicts. This is very unlikely to be what you want at this point. More likely, you simply want to continue the rebase instead.\n\nDo you still want to amend the previous commit?",
AmendCommitWithConflictsContinue: "No, continue rebase",
AmendCommitWithConflictsAmend: "Yes, amend previous commit",
DropCommitTitle: "Drop commit",
DropCommitPrompt: "Are you sure you want to drop the selected commit(s)?",
DropMergeCommitPrompt: "Are you sure you want to drop the selected merge commit? Note that it will also drop all the commits that were merged in by it.",
@@ -1565,11 +1523,9 @@ func EnglishTranslationSet() *TranslationSet {
DeleteTagTitle: "Delete tag '{{.tagName}}'?",
DeleteLocalTag: "Delete local tag",
DeleteRemoteTag: "Delete remote tag",
DeleteLocalAndRemoteTag: "Delete local and remote tag",
RemoteTagDeletedMessage: "Remote tag deleted",
SelectRemoteTagUpstream: "Remote from which to remove tag '{{.tagName}}':",
DeleteRemoteTagPrompt: "Are you sure you want to delete the remote tag '{{.tagName}}' from '{{.upstream}}'?",
DeleteLocalAndRemoteTagPrompt: "Are you sure you want to delete '{{.tagName}}' from both your machine and from '{{.upstream}}'?",
PushTagTitle: "Remote to push tag '{{.tagName}}' to:",
// Using 'push tag' rather than just 'push' to disambiguate from a global push
PushTag: "Push tag",
@@ -1657,15 +1613,12 @@ func EnglishTranslationSet() *TranslationSet {
CopyCommitMessageToClipboard: "Copy commit message to clipboard",
PasteCommitMessageFromClipboard: "Paste commit message from clipboard",
SurePasteCommitMessage: "Pasting will overwrite the current commit message, continue?",
CommitMessage: "Commit message (subject and body)",
CommitMessageBody: "Commit message body",
CommitMessage: "Commit message",
CommitSubject: "Commit subject",
CommitAuthor: "Commit author",
CommitTags: "Commit tags",
CopyCommitAttributeToClipboard: "Copy commit attribute to clipboard",
CopyCommitAttributeToClipboardTooltip: "Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author).",
CopyBranchNameToClipboard: "Copy branch name to clipboard",
CopyTagToClipboard: "Copy tag to clipboard",
CopyPathToClipboard: "Copy path to clipboard",
CopySelectedTextToClipboard: "Copy selected text to clipboard",
CommitPrefixPatternError: "Error in commitPrefix pattern",
@@ -1722,12 +1675,8 @@ func EnglishTranslationSet() *TranslationSet {
CommitDiffCopiedToClipboard: "Commit diff copied to clipboard",
CommitURLCopiedToClipboard: "Commit URL copied to clipboard",
CommitMessageCopiedToClipboard: "Commit message copied to clipboard",
CommitMessageBodyCopiedToClipboard: "Commit message body copied to clipboard",
CommitSubjectCopiedToClipboard: "Commit subject copied to clipboard",
CommitAuthorCopiedToClipboard: "Commit author copied to clipboard",
CommitTagsCopiedToClipboard: "Commit tags copied to clipboard",
CommitHasNoTags: "Commit has no tags",
CommitHasNoMessageBody: "Commit has no message body",
PatchCopiedToClipboard: "Patch copied to clipboard",
CopiedToClipboard: "copied to clipboard",
ErrCannotEditDirectory: "Cannot edit directories: you can only edit individual files",
@@ -1786,8 +1735,7 @@ func EnglishTranslationSet() *TranslationSet {
RewordInEditorTitle: "Reword in editor",
RewordInEditorPrompt: "Are you sure you want to reword this commit in your editor?",
HardResetAutostashPrompt: "Are you sure you want to hard reset to '%s'? An auto-stash will be performed if necessary.",
SoftResetPrompt: "Are you sure you want to soft reset to '%s'?",
CheckoutAutostashPrompt: "Are you sure you want to checkout '%s'? An auto-stash will be performed if necessary.",
CheckoutPrompt: "Are you sure you want to checkout '%s'?",
UpstreamGone: "(upstream gone)",
NukeDescription: "If you want to make all the changes in the worktree go away, this is the way to do it. If there are dirty submodule changes this will stash those changes in the submodule(s).",
DiscardStagedChangesDescription: "This will create a new stash entry containing only staged files and then drop it, so that the working tree is left with only unstaged changes",
@@ -1880,49 +1828,47 @@ func EnglishTranslationSet() *TranslationSet {
Actions: Actions{
// TODO: combine this with the original keybinding descriptions (those are all in lowercase atm)
CheckoutCommit: "Checkout commit",
CheckoutBranchAtCommit: "Checkout branch '%s'",
CheckoutCommitAsDetachedHead: "Checkout commit %s as detached head",
CheckoutTag: "Checkout tag",
CheckoutBranch: "Checkout branch",
ForceCheckoutBranch: "Force checkout branch",
CheckoutBranchOrCommit: "Checkout branch or commit",
DeleteLocalBranch: "Delete local branch",
Merge: "Merge",
SquashMerge: "Squash merge",
RebaseBranch: "Rebase branch",
RenameBranch: "Rename branch",
CreateBranch: "Create branch",
CherryPick: "(Cherry-pick) paste commits",
CheckoutFile: "Checkout file",
DiscardOldFileChange: "Discard old file change",
SquashCommitDown: "Squash commit down",
FixupCommit: "Fixup commit",
RewordCommit: "Reword commit",
DropCommit: "Drop commit",
EditCommit: "Edit commit",
AmendCommit: "Amend commit",
ResetCommitAuthor: "Reset commit author",
SetCommitAuthor: "Set commit author",
AddCommitCoAuthor: "Add commit co-author",
RevertCommit: "Revert commit",
CreateFixupCommit: "Create fixup commit",
SquashAllAboveFixupCommits: "Squash all above fixup commits",
CreateLightweightTag: "Create lightweight tag",
CreateAnnotatedTag: "Create annotated tag",
CopyCommitMessageToClipboard: "Copy commit message to clipboard",
CopyCommitMessageBodyToClipboard: "Copy commit message body to clipboard",
CopyCommitSubjectToClipboard: "Copy commit subject to clipboard",
CopyCommitTagsToClipboard: "Copy commit tags to clipboard",
CopyCommitDiffToClipboard: "Copy commit diff to clipboard",
CopyCommitHashToClipboard: "Copy full commit hash to clipboard",
CopyCommitURLToClipboard: "Copy commit URL to clipboard",
CopyCommitAuthorToClipboard: "Copy commit author to clipboard",
CopyCommitAttributeToClipboard: "Copy to clipboard",
CopyPatchToClipboard: "Copy patch to clipboard",
MoveCommitUp: "Move commit up",
MoveCommitDown: "Move commit down",
CustomCommand: "Custom command",
CheckoutCommit: "Checkout commit",
CheckoutBranchAtCommit: "Checkout branch '%s'",
CheckoutCommitAsDetachedHead: "Checkout commit %s as detached head",
CheckoutTag: "Checkout tag",
CheckoutBranch: "Checkout branch",
ForceCheckoutBranch: "Force checkout branch",
CheckoutBranchOrCommit: "Checkout branch or commit",
DeleteLocalBranch: "Delete local branch",
Merge: "Merge",
SquashMerge: "Squash merge",
RebaseBranch: "Rebase branch",
RenameBranch: "Rename branch",
CreateBranch: "Create branch",
CherryPick: "(Cherry-pick) paste commits",
CheckoutFile: "Checkout file",
DiscardOldFileChange: "Discard old file change",
SquashCommitDown: "Squash commit down",
FixupCommit: "Fixup commit",
RewordCommit: "Reword commit",
DropCommit: "Drop commit",
EditCommit: "Edit commit",
AmendCommit: "Amend commit",
ResetCommitAuthor: "Reset commit author",
SetCommitAuthor: "Set commit author",
AddCommitCoAuthor: "Add commit co-author",
RevertCommit: "Revert commit",
CreateFixupCommit: "Create fixup commit",
SquashAllAboveFixupCommits: "Squash all above fixup commits",
CreateLightweightTag: "Create lightweight tag",
CreateAnnotatedTag: "Create annotated tag",
CopyCommitMessageToClipboard: "Copy commit message to clipboard",
CopyCommitSubjectToClipboard: "Copy commit subject to clipboard",
CopyCommitDiffToClipboard: "Copy commit diff to clipboard",
CopyCommitHashToClipboard: "Copy full commit hash to clipboard",
CopyCommitURLToClipboard: "Copy commit URL to clipboard",
CopyCommitAuthorToClipboard: "Copy commit author to clipboard",
CopyCommitAttributeToClipboard: "Copy to clipboard",
CopyPatchToClipboard: "Copy patch to clipboard",
MoveCommitUp: "Move commit up",
MoveCommitDown: "Move commit down",
CustomCommand: "Custom command",
// TODO: remove
DiscardAllChangesInDirectory: "Discard all changes in directory",
@@ -1935,8 +1881,6 @@ func EnglishTranslationSet() *TranslationSet {
UnstageFile: "Unstage file",
UnstageAllFiles: "Unstage all files",
StageAllFiles: "Stage all files",
NotEnoughContextToStage: "Staging or unstaging changes is not possible with a diff context size of 0. Increase the context using '%s'.",
NotEnoughContextToDiscard: "Discarding changes is not possible with a diff context size of 0. Increase the context using '%s'.",
IgnoreExcludeFile: "Ignore or exclude file",
IgnoreFileErr: "Cannot ignore .gitignore",
ExcludeFile: "Exclude file",
@@ -2062,8 +2006,6 @@ keybinding:
gui:
filterMode: 'fuzzy'
`,
"0.44.0": `- The gui.branchColors config option is deprecated; it will be removed in a future version. Please use gui.branchColorPatterns instead.
- The automatic coloring of branches starting with "feature/", "bugfix/", or "hotfix/" has been removed; if you want this, it's easy to set up using the new gui.branchColorPatterns option.`,
},
}
}
-16
View File
@@ -1,19 +1,3 @@
The JSON files in this directory are machine-generated; please do not edit.
Translating lazygit happens at https://crowdin.com/project/lazygit/.
# Updating translations from Crowdin
We regularly need to pull changes from Crowdin and integrate them here. This is
done by downloading a zip file of the translations from Crowdin, unzipping it,
and calling `scripts/update_language_files.sh` with the unzipped directory as an
argument.
# Uploading the English file to Crowdin
The English version of all the texts is still maintained in
`pkg/i18n/english.go`; it needs to be uploaded to Crowdin regularly. To do this,
call `go run cmd/i18n/main.go`; this will create an unversioned file `en.json`
in the root of the repository. Upload this to
`https://crowdin.com/project/lazygit/sources/files` and delete it from the
working copy again.
-22
View File
@@ -1,23 +1,19 @@
{
"NotEnoughSpace": "패널을 렌더링 할 공간이 부족합니다.",
"DiffTitle": "변경점",
"FilesTitle": "파일",
"BranchesTitle": "브랜치",
"CommitsTitle": "커밋",
"EasterEgg": "이스터 에그",
"UnstagedChanges": "Staged되지 않은 변경 내용",
"StagedChanges": "Staged된 변경 내용",
"MainTitle": "메인",
"StagingTitle": "메인 패널 (Staging)",
"MergingTitle": "메인 패널 (Merging)",
"SquashMergeCommittedTitle": "스쿼시 병합 및 커밋",
"NormalTitle": "메인 패널 (Normal)",
"LogTitle": "로그",
"CommitSummary": "커밋 메시지",
"CredentialsUsername": "사용자 이름",
"CredentialsPassword": "패스워드",
"CredentialsPassphrase": "SSH키의 passphrase 입력",
"CredentialsPIN": "SSH키\u001d의 PIN\u001d을 입력",
"PassUnameWrong": "패스워드, passphrase 또는 사용자 이름이 잘못되었습니다.",
"Commit": "커밋 변경내용",
"AmendLastCommit": "마지맛 커밋 수정",
@@ -38,16 +34,6 @@
"Pull": "업데이트",
"Scroll": "스크롤",
"FileFilter": "파일을 필터하기 (Staged/unstaged)",
"CopyToClipboardMenu": "클립보드에 복사",
"CopyFileName": "파일명",
"CopyFilePath": "경로",
"CopySelectedDiff": "선택한 파일의 변경점",
"CopyAllFilesDiff": "모든 파일의 변경점",
"NoContentToCopyError": "복사 대상이 없습니다",
"FileNameCopiedToast": "파일명을 클립보드에 복사했습니다.",
"FilePathCopiedToast": "파일경로를 클립보드에 복사했습니다.",
"FileDiffCopiedToast": "파일의 변경점을 클립보드에 복사했습니다.",
"AllFilesDiffCopiedToast": "모든 파일의 변경점을 클립보드에 복사했습니다.",
"FilterStagedFiles": "Staged된 파일만 표시",
"FilterUnstagedFiles": "Stage되지 않은 파일만 표시",
"ResetFilter": "필터 리셋",
@@ -61,10 +47,6 @@
"BranchName": "브랜치 이름",
"NewBranchNameBranchOff": "새 브랜치 이름 (branch is off of '{{.branchName}}')",
"CantDeleteCheckOutBranch": "체크아웃하는 브랜치는 삭제할 수 없습니다!",
"DeleteBranchTitle": "'{{.selectedBranchName}}' 브랜치를 삭제하시겠습니까?",
"DeleteLocalBranch": "로컬 브랜치를 삭제",
"DeleteRemoteBranchOption": "원격 브랜치를 삭제",
"ForceDeleteBranchTitle": "브랜치를 강제 삭제",
"ForceDeleteBranchMessage": "'{{.selectedBranchName}}'는 완전히 병합되지 않았습니다. 정말 삭제하시겠습니까?",
"RebaseBranch": "체크아웃된 브랜치를 이 브랜치에 리베이스",
"CantRebaseOntoSelf": "브랜치를 자기 자신에게 리베이스할 수는 없습니다.",
@@ -80,8 +62,6 @@
"Quit": "종료",
"SureFixupThisCommit": "Are you sure you want to 'fixup' this commit? It will be merged into the commit below",
"SureSquashThisCommit": "Are you sure you want to squash this commit into the commit below?",
"Squash": "스쿼시",
"SquashMerge": "스쿼시 병합",
"PickCommitTooltip": "Pick commit (when mid-rebase)",
"RevertCommit": "커밋 되돌리기",
"Reword": "커밋메시지 변경",
@@ -201,8 +181,6 @@
"Discard": "View 'discard changes' options",
"Cancel": "취소",
"DiscardAllChanges": "모든 변경사항 버리기",
"Delete": "삭제",
"Reset": "초기화",
"ViewResetOptions": "View reset options",
"CreateFixupCommitTooltip": "Create fixup commit for this commit",
"SquashAboveCommitsTooltip": "Squash all 'fixup!' commits above selected commit (autosquash)",
-316
View File
@@ -1,316 +0,0 @@
{
"NotEnoughSpace": "Espaço insuficiente para renderizar painéis",
"DiffTitle": "Diff",
"FilesTitle": "Arquivos",
"BranchesTitle": "Branches",
"CommitsTitle": "Commits",
"StashTitle": "Stash",
"SnakeTitle": "Snake",
"EasterEgg": "Easter Egg",
"UnstagedChanges": "Alterações não preparadas",
"StagedChanges": "Alterações preparadas",
"MainTitle": "Main",
"StagingTitle": "Painel Principal (preparação)",
"MergingTitle": "Painel principal (mesclagem)",
"SquashMergeUncommittedTitle": "Mesclar Squash e sair sem commit",
"SquashMergeCommittedTitle": "Mesclar Squash e commit",
"SquashMergeUncommitted": "Mesclar Squash '{{.selectedBranch}}' na árvore de trabalho",
"SquashMergeCommitted": "Mesclar Squash '{{.selectedBranch}}' em '{{.checkedOutBranch}}' como um único commit.",
"RegularMergeTooltip": "Mesclar '{{.selectedBranch}}' em '{{.checkedOutBranch}}'.",
"NormalTitle": "Painel Principal (Normal)",
"LogTitle": "Log",
"CommitSummary": "Sumário do commit",
"CredentialsUsername": "Nome de usuário",
"CredentialsPassword": "Senha",
"CredentialsPassphrase": "Digite a senha para a chave SSH",
"CredentialsPIN": "Digite o PIN para a chave SSH",
"PassUnameWrong": "Senha, palavra-chave e/ou nome de usuário incorreto",
"Commit": "Commit",
"CommitTooltip": "Submeter mudanças em staging",
"AmendLastCommit": "Alterar último commit",
"AmendLastCommitTitle": "Alterar último commit",
"SureToAmend": "Está certo de querer alterar o último commit? Posteriormente, pode alterar a mensagem do commit do painel de commits",
"NoCommitToAmend": "Não há commit para alterar.",
"CommitChangesWithEditor": "Enviar alteração usando um editor Git",
"FindBaseCommitForFixup": "Encontrar commit da base para consertar",
"FindBaseCommitForFixupTooltip": "Encontre o commit em que as suas mudanças atuais estão se baseando, para alterar/consertar o commit. Isso poupa-te você de ter que olhar pelos commits da sua branch um por um para ver qual commit deve ser alterado/consertado\nVeja a documentação:\n<https://github.com/jesseduffield/lazygit/tree/master/docs/Fixup_Commits.md>",
"NoBaseCommitsFound": "Nenhum commit base encontrado",
"MultipleBaseCommitsFoundStaged": "Múltiplos commits da base encontrados.",
"MultipleBaseCommitsFoundUnstaged": "Múltiplos commits da base encontrados. (Tente preparar alguma dessas mudanças)",
"BaseCommitIsAlreadyOnMainBranch": "O commit da base para está mudança já está na branch main",
"BaseCommitIsNotInCurrentView": "O commit da base não está na visão atual",
"HunksWithOnlyAddedLinesWarning": "Existem intervalos apenas de linhas adicionadas no diff; tenha cuidado para verificar se elas pertencem ao commit base encontrado.\n\nProceder?",
"StatusTitle": "Status",
"GlobalTitle": "Combinações globais de teclas",
"Menu": "Menu",
"Execute": "Executar",
"Stage": "Etapa",
"StageTooltip": "Alternar para staging para o arquivo selecionado.",
"ToggleStagedAll": "Stage completo",
"ToggleStagedAllTooltip": "Alternar para todos os arquivos na árvore de trabalho",
"ToggleTreeView": "Alternar exibição de árvore de arquivo",
"ToggleTreeViewTooltip": "Alternar a visualização de arquivo entre layout plano e layout de árvore. Layout plano mostra todos os caminhos de arquivo em uma única lista, layout de árvore agrupa arquivos por diretório.",
"OpenDiffTool": "Abrir ferramenta de diff externa (git difftool)",
"OpenMergeTool": "Abrir ferramenta de merge externa",
"OpenMergeToolTooltip": "Execute `git mergetool`.",
"Refresh": "Atualizar",
"RefreshTooltip": "Atualize o estado do git (ou seja, execute `git status`, `git branch`, etc em segundo plano para atualizar o conteúdo de painéis). Isso não executa `git fetch`.",
"Push": "Empurre (Push)",
"Pull": "Puxar (Pull)",
"PushTooltip": "Faça push do branch atual para o seu branch upstream. Se nenhum upstream estiver configurado, você será solicitado a configurar um branch a montante.",
"PullTooltip": "Puxe alterações do controle remoto para o ramo atual. Se nenhum upstream estiver configurado, será solicitado configurar um ramo a montante.",
"Scroll": "Navegar",
"FileFilter": "Filtrar arquivos por status",
"CopyFileName": "Nome do arquivo",
"CopyFilePath": "Caminho",
"CopyFileDiffTooltip": "Se existirem itens preparados, este comando considera apenas eles",
"CopySelectedDiff": "Diferença do arquivo selecionado",
"CopyAllFilesDiff": "Diferença de todos os arquivos",
"NoContentToCopyError": "Nada para copiar",
"FileNameCopiedToast": "No do arquivo copiado para a área de transferência",
"FilePathCopiedToast": "Caminho do arquivo copiado para a área de transferência",
"FileDiffCopiedToast": "Diferença do arquivo copiado para a área de transferência ",
"AllFilesDiffCopiedToast": "Todos os arquivos diferentes foram copiados para a área de transferência",
"FilterStagedFiles": "Mostrar somente os arquivos em staging",
"FilterUnstagedFiles": "Mostrar somente arquivos que não estão em staging",
"ResetFilter": "Resetar filtro",
"MergeConflictsTitle": "Mesclar conflitos",
"Checkout": "Verificar",
"CheckoutTooltip": "Checar item selecionado",
"CantCheckoutBranchWhilePulling": "Você não pode hecar outra branch enquanto puxa a branch atual",
"TagCheckoutTooltip": "Checar a tag selecionada como um HEAD, desanexado",
"RemoteBranchCheckoutTooltip": "Checar a nova branch baseada na brach remota selecionada, ou a branch remota como HEAD, desanexado",
"CantPullOrPushSameBranchTwice": "Você não pode empurar ou puxar uma branch enquanto ele já está a ser puxado ou empurrado",
"NoChangedFiles": "Arquivos não alterados",
"SoftReset": "Reiniciar suave",
"AlreadyCheckedOutBranch": "Você já tem uma checagem dessa branch",
"SureForceCheckout": "Você está certo de que quer forçar uma checagem? Você perdera todos as mudanças locais",
"ForceCheckoutBranch": "Forçar checagem de branch",
"BranchName": "Nome da Branch",
"NewBranchNameBranchOff": "Novo nome da branch (branch está fora de '{{.branchName}}')",
"CantDeleteCheckOutBranch": "Você não pode excluir a branch checada",
"DeleteBranchTitle": "Deletar branch '{{.selectedBranchName}}'?",
"DeleteLocalBranch": "Deletar branch local",
"DeleteRemoteBranchOption": "Deletar branch remota",
"DeleteRemoteBranchPrompt": "Você está certo de que quer deletar a branch remota '{{.selectedBranchName}}' de '{{.upstream}}'?",
"ForceDeleteBranchTitle": "Forçar deleção de branch",
"ForceDeleteBranchMessage": "{{.selectedBranchName}} não está completamente mesclada. Você está certo que quer deletar ela?",
"RebaseBranch": "Refazer",
"RebaseBranchTooltip": "Refazer a branch checada na branch selecionada",
"CantRebaseOntoSelf": "Você não pode refazer a branch nela mesma",
"CantMergeBranchIntoItself": "Você não pode mesclar a branch em si mesmo",
"ForceCheckout": "Forçar checagem",
"ForceCheckoutTooltip": "Forçar checagem da branch selecionada. Isso irá descartar todas as mudanças no seu diretório de trabalho antes cheque a branch selecionada ",
"CheckoutByName": "Checar por nome",
"CheckoutByNameTooltip": "Checar por nome. Na caixa de entrada você pode inserir '-' para trocar para a última branch ",
"RemoteBranchCheckoutTitle": "Checar {{.branchName}}",
"RemoteBranchCheckoutPrompt": "Como você gostaria de checar essa branch?",
"CheckoutTypeNewBranch": "Nova branch local",
"CheckoutTypeNewBranchTooltip": "Checar a branch remota como a branch local, rastreando a branch remota",
"CheckoutTypeDetachedHead": "HEAD desanexado",
"CheckoutTypeDetachedHeadTooltip": "Checar a branch remota como um HEAD desanexado, que pode ser útil se você apenas quer para testar a branch, mas não trabalha nela você mesmo. Você ainda pode criar um branch remoto a partir dela depois",
"NewBranch": "Nova branch",
"NewBranchFromStashTooltip": "Criar um novo ramo a partir da entrada de lixo selecionada. Isso funciona verificando o commit do qual a entrada de lixo foi criada, criar um novo branch a partir desse commit e, em seguida, aplicar a entrada de lixo ao novo branch como um commit adicional.",
"NoBranchesThisRepo": "Nenhuma branch para esse repositório",
"CommitWithoutMessageErr": "Você não pode dar commit sem uma mensagem de commit",
"Close": "Fechar",
"CloseCancel": "Fechar/Cancelar",
"Confirm": "Confirmar",
"Quit": "Sair",
"SquashTooltip": "Squash o commit selecionado no commit abaixo dele. A mensagem do commit selecionado será anexada ao commit abaixo dele.",
"CannotSquashOrFixupFirstCommit": "Não há commit abaixo para squash em",
"Fixup": "Fixup",
"FixupTooltip": "Faça o commit selecionado no commit abaixo dele. Semelhante para o squash, mas a mensagem do commit selecionado será descartada.",
"SureFixupThisCommit": "Tem certeza que deseja 'corrigir' o(s) commit(s) selecionado(s) no commit abaixo?",
"SureSquashThisCommit": "Tem certeza que deseja esmagar o(s) commit(s) selecionado(s) no commit abaixo?",
"Squash": "Squash",
"SquashMerge": "Mesclar Squash",
"PickCommitTooltip": "Marque o commit selecionado para ser escolhido (quando meados da base). Isso significa que o commit será mantido ao continuar o rebase.",
"Pick": "Escolher",
"CantPickDisabledReason": "Não é possível escolher um commit quando não estiver no centro da rebase",
"Edit": "Editar",
"RevertCommit": "Reverter commit",
"Revert": "Reverter",
"RevertCommitTooltip": "Crie um commit reverter para o commit selecionado, que aplica as alterações do commit selecionado em reverso.",
"Reword": "Reword",
"CommitRewordTooltip": "Repetir a mensagem de submissão selecionada.",
"DropCommit": "Descartar",
"DropCommitTooltip": "Solte o commit selecionado. Isso irá remover o commit do branch através de uma rebase. Se o commit faz com que as alterações em commits posteriores dependem, você pode precisar resolver conflitos de merge.",
"MoveDownCommit": "Mover commit um para baixo",
"MoveUpCommit": "Mover o commit um para cima",
"CannotMoveAnyFurther": "Não é possível mover mais",
"EditCommit": "Editar (iniciar rebase interativa)",
"EditCommitTooltip": "Editar o commit selecionado. Use isto para iniciar uma rebase interativa a partir do commit selecionado. Quando já estiver no meio da reconstrução, isto irá marcar o commit selecionado para edição, o que significa que ao continuar com a reformulação. a rebase irá pausar no commit selecionado para permitir que você faça alterações.",
"AmendCommitTooltip": "Alterar o commit com mudanças em sted. Se o commit selecionado for o commit HEAD, ele executará o `git commit --amend`. Caso contrário, o compromisso será alterado por meio de uma base de apoio.",
"Amend": "Modificar",
"ResetAuthor": "Redefinir autor",
"ResetAuthorTooltip": "Redefinir o autor do commit para o usuário atualmente configurado. Isto também irá renovar o timestamp do autor",
"SetAuthor": "Definir autor",
"SetAuthorTooltip": "Definir o autor baseado em um prompt",
"AddCoAuthor": "Adicionar co-autor",
"AmendCommitAttribute": "Alterar atributo de commit",
"AmendCommitAttributeTooltip": "Definir/Redefinir autor de submissão ou co-autor definido.",
"SetAuthorPromptTitle": "Configura autor (deve se parecer com 'Nome <Email>')",
"AddCoAuthorPromptTitle": "Adicionar co-autor (deve se parecer com 'Nome <Email>')",
"AddCoAuthorTooltip": "Adicione um coautor usando o Github/Gitlab metadata co-produzido por.",
"SureResetCommitAuthor": "O campo autor deste commit será atualizado para corresponder ao usuário configurado. Isso também renova o timestamp do autor. Continuar?",
"RewordCommitEditor": "Republicar com o editor",
"NoCommitsThisBranch": "Não há commits para este branch",
"UpdateRefHere": "Atualizar branch '{{.ref}}' aqui",
"ExecCommandHere": "Execute o seguinte comando aqui:",
"Error": "Erro",
"Undo": "Desfazer",
"UndoReflog": "Desfazer",
"RedoReflog": "Refazer",
"UndoTooltip": "O reflog será usado para determinar qual comando git para executar para desfazer o último comando git. Isto não inclui mudanças na árvore de trabalho; apenas compromissos são tidos em consideração.",
"RedoTooltip": "O reflog será usado para determinar qual comando git para executar para refazer o último comando git. Isto não inclui mudanças na árvore de trabalho; apenas compromissos são tidos em consideração.",
"UndoMergeResolveTooltip": "Desfazer resolução de conflitos de última mesclagem.",
"DiscardAllTooltip": "Descartar mudanças agendadas e não preparadas em '{{.path}}'.",
"DiscardUnstagedTooltip": "Descartar mudanças não preparadas em '{{.path}}'.",
"DiscardUnstagedDisabled": "Os itens selecionados não possuem mudanças staging e não preparados.",
"Pop": "Pop",
"StashPopTooltip": "Aplique a entrada de stash no seu diretório de trabalho e remova a entrada de stash.",
"Drop": "Descartar",
"StashDropTooltip": "Remova a entrada do stash da lista de armazenamento.",
"Apply": "Aplicar",
"StashApplyTooltip": "Aplique o stash no seu diretório de trabalho.",
"NoStashEntries": "Sem itens no stash",
"StashDrop": "Remover stash",
"SureDropStashEntry": "Tem certeza de que deseja remover esta entrada de stash?",
"StashPop": "Remover Stash ",
"SurePopStashEntry": "Tem certeza de que deseja exibir esta entrada de stash?",
"StashApply": "Aplica o Stash",
"SureApplyStashEntry": "Tem certeza que deseja aplicar esta entrada de stash?",
"NoTrackedStagedFilesStash": "Você não tem arquivos rastreados/staging para armazenar",
"NoFilesToStash": "Você não tem arquivos para armazenar",
"StashChanges": "Alterações preparadas",
"RenameStash": "Renomear o stasj",
"RenameStashPrompt": "Renomear o estoque: {{.stashName}}",
"OpenConfig": "Abrir o ficheiro de config",
"EditConfig": "Editar arquivo de configuração",
"ForcePush": "Forçar push",
"ForcePushPrompt": "Seu branch divergiu do branch remoto. Pressione {{.cancelKey}} para cancelar, ou {{.confirmKey}} para forçar a push.",
"ForcePushDisabled": "Seu branch divergiu do branch remoto e você desabilitou o push forçado forçado",
"UpdatesRejected": "Atualizações foram rejeitadas. Por favor, busque e examine as alterações remotas antes de enviar novamente.",
"UpdatesRejectedAndForcePushDisabled": "Atualizações foram rejeitadas e você desativou o push de força",
"CheckForUpdate": "Verificar atualização",
"CheckingForUpdates": "A verificar por actualização…",
"UpdateAvailableTitle": "Atualização disponível!",
"UpdateAvailable": "Baixar e instalar a versão {{.newVersion}}?",
"UpdateInProgressWaitingStatus": "Atualizando",
"UpdateCompletedTitle": "Atualização concluída!",
"UpdateCompleted": "A atualização foi instalada com sucesso. Reinicie o lazygit para que tenha efeito.",
"FailedToRetrieveLatestVersionErr": "Falha ao recuperar informações da versão",
"OnLatestVersionErr": "Você já tem a versão mais recente!",
"MajorVersionErr": "Nova versão ({{.newVersion}}) tem mudanças não compatíveis com as versões anteriores comparadas com a versão atual ({{.currentVersion}})",
"CouldNotFindBinaryErr": "Não foi possível encontrar nenhum binário em {{.url}}",
"UpdateFailedErr": "Falha na atualização: {{.errMessage}}",
"ConfirmQuitDuringUpdateTitle": "Atualmente atualizando",
"ConfirmQuitDuringUpdate": "Uma atualização está em andamento. Tem certeza que deseja sair?",
"MergeToolTitle": "Ferramenta de mesclagem",
"MergeToolPrompt": "Tem certeza de que deseja abrir o `git mergetool`?",
"IntroPopupMessage": "\nObrigado por usar lazygit! Sério, você rock. Três coisas para compartilhar com você:\n\n 1) Se quiser aprender sobre os recursos do lazygit, assista a este vid:\n https://youtu. e/CPLdltN7wgE\n\n 2) Não deixe de ler as últimas notas de lançamento em:\n https://github. um/jesseduffield/lazygit/releases\n\n 3) Se você estiver usando um git, isso o torna um programador! Com a sua ajuda, podemos fazer\n lazygit melhor, então considere se tornar um colaborador e se junte à diversão no\n https://github. om/jesseduffield/lazygit\n Você também pode me patrocinar e me dizer no que trabalhar clicando no botão\n de doar na parte inferior direita.\n Ou até mesmo apenas adicionar estrela no repositório para compartilhar o amor!\n",
"DeprecatedEditConfigWarning": "\n### Aviso de configuração obsoleto ###\n\nAs seguintes configurações são descontinuadas e serão removidas em uma futura versão\ndo A:\n{{configs}}\n\nPor favor, consulte\n\n https://github. om/jesseduffield/lazygit/blob/master/docs/Config.md#configuring-file-editor\n\npara informações atualizadas como configurar seu editor.\n\n",
"GitconfigParseErr": "Gogit falhou ao analisar seu arquivo gitconfig devido à presença de caracteres '\\' não citados. Removendo-os deve corrigir o problema.",
"EditFile": "Editar arquivo",
"EditFileTooltip": "Abrir arquivo no editor externo.",
"OpenFile": "Abrir arquivo",
"OpenFileTooltip": "Abrir arquivo no aplicativo padrão.",
"OpenInEditor": "Abrir no editor",
"IgnoreFile": "Adicionar ao .gitignore",
"ExcludeFile": "Adicionar ao .git/info/exclui",
"RefreshFiles": "Atualizar arquivos",
"Merge": "Mesclar",
"RegularMerge": "Mesclagem regular",
"MergeBranchTooltip": "Ver opções para mesclar o item selecionado no branch atual (mesclar regularmente, mesclar squash)",
"ConfirmQuit": "Tem a certeza de que pretende sair?",
"SwitchRepo": "Mudar para um repositório recente",
"AllBranchesLogGraph": "Mostrar todos os logs da branch",
"UnsupportedGitService": "Serviço git não suportado",
"CopyPullRequestURL": "Copiar URL do pull request para área de transferência",
"NoBranchOnRemote": "Este branch não existe no remoto. Primeiro, você precisa fazer push para o remoto.",
"Fetch": "Buscar",
"FetchTooltip": "Buscar alterações do controle remoto.",
"NoAutomaticGitFetchTitle": "Sem busca automática no git",
"NoAutomaticGitFetchBody": "Lazygit não pode usar \"git fetch\" em um repositório privado; use 'f' no painel de arquivos para executar \"git fetch\" manualmente",
"FileEnter": "Stage lines / Colapso diretório",
"FileEnterTooltip": "Se o item selecionado for um arquivo, o foco na exibição de preparo para o estágio de cenas/linhas individuais. Se o item selecionado for um diretório, recolher/expandi-lo.",
"FileStagingRequirements": "Só pode stage linhas individuais para arquivos rastreados",
"StageSelectionTooltip": "Ativar/desativar seleção em staged/unstaged",
"DiscardSelection": "Descartar",
"DiscardSelectionTooltip": "Quando a mudança não desejada for selecionada, descarte a mudança usando `git reset`. Quando a mudança em fase é selecionada, despare a mudança.",
"ToggleSelectHunk": "Selecione o local",
"ToggleSelectHunkTooltip": "Ativa/desativa modo seleção de hunk ",
"ToggleSelectionForPatch": "Alternar linhas no caminho",
"EditHunk": "Editar hunk",
"EditHunkTooltip": "Editar o local selecionado no editor externo.",
"ToggleStagingView": "Mudar de visão",
"ToggleStagingViewTooltip": "Alternar para outra visão (staged/não processadas alterações).",
"ReturnToFilesPanel": "Retornar ao painel de arquivos",
"FastForward": "Avanço rápido",
"FastForwardTooltip": "Encaminhamento rápido de branch selecionada a partir do upstream.",
"FastForwarding": "Encaminhamento rápido",
"FoundConflictsTitle": "Conflitos!",
"ViewConflictsMenuItem": "Visualizar conflitos",
"AbortMenuItem": "Abortar %s",
"PickHunk": "Escolha o local",
"PickAllHunks": "Pegar todos os pedaços",
"ViewMergeRebaseOptions": "Ver opções de mesclar/rebase",
"ViewMergeRebaseOptionsTooltip": "Ver opções para abortar/continuar/pular o merge/rebase atual.",
"ViewMergeOptions": "Visualizar opções de merge",
"ViewRebaseOptions": "Ver opções de rebase",
"NotMergingOrRebasing": "Você não está atualmente nem rebasing nem mesclando",
"AlreadyRebasing": "Não é possível executar esta ação durante uma rebase",
"RecentRepos": "Repositórios recentes",
"MergeOptionsTitle": "Opções de mesclagem",
"RebaseOptionsTitle": "Opções de rebase",
"CommitSummaryTitle": "Sumário do commit",
"CommitDescriptionTitle": "Descrição de Commit",
"CommitDescriptionSubTitle": "Pressione {{.togglePanelKeyBinding}} para alternar o foco, {{.commitMenuKeybinding}} para abrir o menu",
"LocalBranchesTitle": "Branches locais",
"SearchTitle": "Procurar",
"TagsTitle": "Etiquetas",
"MenuTitle": "Menu",
"CommitMenuTitle": "Menu de Commit",
"RemotesTitle": "Remotes",
"RemoteBranchesTitle": "Branches remotos",
"PatchBuildingTitle": "Painel principal (patch build)",
"InformationTitle": "Informações",
"SecondaryTitle": "Secundário",
"ReflogCommitsTitle": "Reflog",
"ConflictsResolved": "Todos os conflitos de merge resolvidos. Continuar?",
"Continue": "Continuar",
"RebasingTitle": "Rebase '{{.checkedOutBranch}}'",
"RebasingFromBaseCommitTitle": "Rebase '{{.checkedOutBranch}}' de uma base marcada",
"SimpleRebase": "Rebase simples para '{{.ref}}'",
"InteractiveRebase": "Rebase interativa em '{{.ref}}'",
"RebaseOntoBaseBranch": "Rebase no ramo base ({{.baseBranch}})",
"InteractiveRebaseTooltip": "Comece uma rebase interativa com uma pausa no início, então você pode atualizar os commits TODO antes de continuar.",
"RebaseOntoBaseBranchTooltip": "Rebase o branch check-out em seu ramo base (ou seja, o ramo principal mais próximo).",
"MustSelectTodoCommits": "Ao rebaste, esta ação só funciona numa seleção de commits do TODO.",
"FwdNoUpstream": "Não é possível encaminhar rapidamente um branch sem upstream",
"FwdNoLocalUpstream": "Não é possível encaminhar rapidamente um branch cujo controle remoto não está registrado localmente",
"FwdCommitsToPush": "Não é possível encaminhar um branch com commits para fazer push",
"PullRequestNoUpstream": "Não é possível abrir uma pull request para um branch sem upstream",
"ErrorOccurred": "Ocorreu um erro! Por favor, crie um problema em",
"NoRoom": "Sala insuficiente",
"YouAreHere": "VOCÊ ESTÁ AQUI",
"YouDied": "VOCÊ MORREU!",
"RewordNotSupported": "Reredacção de commits enquanto rebasing interativamente não é suportado atualmente",
"ChangingThisActionIsNotAllowed": "Não é permitido alterar este tipo de rebase de tarefas",
"CherryPickCopy": "Copiar (cherry-pick)",
"CherryPickCopyTooltip": "Marcar commit como copiado. Então, dentro da visualização local de commits, você pode pressionar `{{.paste}}` para colar (cherry-pick) o(s) commit(s) copiado(s) em seu branch de check-out. A qualquer momento você pode pressionar `{{.escape}}` para cancelar a seleção.",
"CherryPickCopyRangeTooltip": "Marcar commits como copiados do último commit copiado para o commit selecionado.",
"PasteCommits": "Colar (cherry-pick)",
"SureCherryPick": "Tem certeza que deseja escolher os commits copiados nesse branch?",
"CherryPick": "cherry-pick",
"CannotCherryPickNonCommit": "Não é possível escolher este tipo de item de tarefa",
"CannotCherryPickMergeCommit": "Commits de merge Cherry-picking não são suportados",
"Donate": "Doar",
"AskQuestion": "Faça perguntas",
"PrevLine": "Selecione a linha anterior",
"Actions": {},
"Bisect": {},
"Log": {},
"BreakingChangesByVersion": {}
}
+3 -3
View File
@@ -57,8 +57,8 @@
"RefreshTooltip": "刷新git状态(即在后台上运行`git status`,`git branch`等命令以更新面板内容) 不会运行`git fetch`",
"Push": "推送",
"Pull": "拉取",
"PushTooltip": "推送当前分支到它的上游。如果上游未配置,你可以在弹窗中配置上游分支。",
"PullTooltip": "从当前分支的远程分支获取改动。如果上游未配置,你可以在弹窗中配置上游分支。",
"PushTooltip": "推送当前分支到它的上游。如果上游为配置,你可以在弹窗中配置上游分支。",
"PullTooltip": "从当前分支的远程分支获取改动。如果上游为配置,你可以在弹窗中配置上游分支。",
"Scroll": "滚动",
"FileFilter": "通过状态过滤文件",
"CopyToClipboardMenu": "复制到剪贴板",
@@ -253,7 +253,7 @@
"FastForwarding": "抓取并快进",
"FoundConflictsTitle": "自动合并失败",
"ViewConflictsMenuItem": "查看冲突",
"AbortMenuItem": "中止 %s",
"AbortMenuItem": "关于 %s",
"PickHunk": "选中区块",
"PickAllHunks": "选中所有区块",
"ViewMergeRebaseOptions": "查看 合并/变基 选项",
+1 -1
View File
@@ -199,7 +199,7 @@
"FastForwarding": "的擷取和快進中",
"FoundConflictsTitle": "自動合併失敗",
"ViewConflictsMenuItem": "檢視衝突",
"AbortMenuItem": "中止%s",
"AbortMenuItem": "關於%s",
"PickHunk": "挑選程式碼片段",
"PickAllHunks": "挑選所有程式碼片段",
"ViewMergeRebaseOptions": "查看合併/變基選項",
@@ -52,11 +52,6 @@ func (self *CommitDescriptionPanelDriver) AddCoAuthor(author string) *CommitDesc
return self
}
func (self *CommitDescriptionPanelDriver) Clear() *CommitDescriptionPanelDriver {
self.getViewDriver().Clear()
return self
}
func (self *CommitDescriptionPanelDriver) Title(expected *TextMatcher) *CommitDescriptionPanelDriver {
self.getViewDriver().Title(expected)
@@ -39,7 +39,20 @@ func (self *CommitMessagePanelDriver) SwitchToDescription() *CommitDescriptionPa
}
func (self *CommitMessagePanelDriver) Clear() *CommitMessagePanelDriver {
self.getViewDriver().Clear()
// clearing multiple times in case there's multiple lines
// (the clear button only clears a single line at a time)
maxAttempts := 100
for i := 0; i < maxAttempts+1; i++ {
if self.getViewDriver().getView().Buffer() == "" {
break
}
self.t.press(ClearKey)
if i == maxAttempts {
panic("failed to clear commit message panel")
}
}
return self
}
-8
View File
@@ -174,10 +174,6 @@ func (self *Shell) EmptyCommit(message string) *Shell {
return self.RunCommand([]string{"git", "commit", "--allow-empty", "-m", message})
}
func (self *Shell) EmptyCommitWithBody(subject string, body string) *Shell {
return self.RunCommand([]string{"git", "commit", "--allow-empty", "-m", subject, "-m", body})
}
func (self *Shell) EmptyCommitDaysAgo(message string, daysAgo int) *Shell {
return self.RunCommand([]string{"git", "commit", "--allow-empty", "--date", fmt.Sprintf("%d days ago", daysAgo), "-m", message})
}
@@ -194,10 +190,6 @@ func (self *Shell) Revert(ref string) *Shell {
return self.RunCommand([]string{"git", "revert", ref})
}
func (self *Shell) AssertRemoteTagNotFound(upstream, name string) *Shell {
return self.RunCommandExpectError([]string{"git", "ls-remote", "--exit-code", upstream, fmt.Sprintf("refs/tags/%s", name)})
}
func (self *Shell) CreateLightweightTag(name string, ref string) *Shell {
return self.RunCommand([]string{"git", "tag", name, ref})
}
-18
View File
@@ -40,24 +40,6 @@ func (self *ViewDriver) Title(expected *TextMatcher) *ViewDriver {
return self
}
func (self *ViewDriver) Clear() *ViewDriver {
// clearing multiple times in case there's multiple lines
// (the clear button only clears a single line at a time)
maxAttempts := 100
for i := 0; i < maxAttempts+1; i++ {
if self.getView().Buffer() == "" {
break
}
self.t.press(ClearKey)
if i == maxAttempts {
panic("failed to clear view buffer")
}
}
return self
}
// asserts that the view has lines matching the given matchers. One matcher must be passed for each line.
// If you only care about the top n lines, use the TopLines method instead.
// If you only care about a subset of lines, use the ContainsLines method instead.
@@ -1,49 +0,0 @@
package branch
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
// Regression test for deleting the last branch in the unfiltered list while
// filtering is on. This used to cause a segfault.
var DeleteWhileFiltering = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Delete a local branch while there's a filter in the branches panel",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetAppState().LocalBranchSortOrder = "alphabetic"
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
shell.NewBranch("branch1")
shell.NewBranch("branch2")
shell.Checkout("master")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Branches().
Focus().
Lines(
Contains("master").IsSelected(),
Contains("branch1"),
Contains("branch2"),
).
FilterOrSearch("branch").
Lines(
Contains("branch1").IsSelected(),
Contains("branch2"),
).
SelectNextItem().
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectPopup().
Menu().
Title(Equals("Delete branch 'branch2'?")).
Select(Contains("Delete local branch")).
Confirm()
}).
Lines(
Contains("branch1").IsSelected(),
)
},
})
@@ -1,41 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var AmendWhenThereAreConflictsAndAmend = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Amends the last commit from the files panel while a rebase is stopped due to conflicts, and amends the commit",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
setupForAmendTests(shell)
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
doTheRebaseForAmendTests(t, keys)
t.Views().Files().
Press(keys.Commits.AmendToCommit)
t.ExpectPopup().Menu().
Title(Equals("Amend commit")).
Select(Equals("Yes, amend previous commit")).
Confirm()
t.Views().Files().IsEmpty()
t.Views().Commits().
Focus().
Lines(
Contains("pick").Contains("commit three"),
Contains("conflict").Contains("<-- YOU ARE HERE --- file1 changed in branch"),
Contains("commit two"),
Contains("file1 changed in master"),
Contains("base commit"),
)
checkCommitContainsChange(t, "commit two", "+branch")
},
})
@@ -1,43 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var AmendWhenThereAreConflictsAndCancel = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Amends the last commit from the files panel while a rebase is stopped due to conflicts, and cancels the confirmation",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
setupForAmendTests(shell)
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
doTheRebaseForAmendTests(t, keys)
t.Views().Files().
Press(keys.Commits.AmendToCommit)
t.ExpectPopup().Menu().
Title(Equals("Amend commit")).
Select(Equals("Cancel")).
Confirm()
// Check that nothing happened:
t.Views().Files().
Lines(
Contains("M file1"),
)
t.Views().Commits().
Focus().
Lines(
Contains("pick").Contains("commit three"),
Contains("conflict").Contains("<-- YOU ARE HERE --- file1 changed in branch"),
Contains("commit two"),
Contains("file1 changed in master"),
Contains("base commit"),
)
},
})
@@ -1,41 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var AmendWhenThereAreConflictsAndContinue = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Amends the last commit from the files panel while a rebase is stopped due to conflicts, and continues the rebase",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
setupForAmendTests(shell)
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
doTheRebaseForAmendTests(t, keys)
t.Views().Files().
Press(keys.Commits.AmendToCommit)
t.ExpectPopup().Menu().
Title(Equals("Amend commit")).
Select(Equals("No, continue rebase")).
Confirm()
t.Views().Files().IsEmpty()
t.Views().Commits().
Focus().
Lines(
Contains("commit three"),
Contains("file1 changed in branch"),
Contains("commit two"),
Contains("file1 changed in master"),
Contains("base commit"),
)
checkCommitContainsChange(t, "file1 changed in branch", "+branch")
},
})
+4 -5
View File
@@ -32,11 +32,10 @@ var Checkout = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Menu().
Title(Contains("Checkout branch or commit")).
Lines(
MatchesRegexp("Checkout commit [a-f0-9]+ as detached head").IsSelected(),
Contains("Checkout branch"),
Contains("Checkout branch").IsSelected(),
MatchesRegexp("Checkout commit [a-f0-9]+ as detached head"),
Contains("Cancel"),
).
Select(Contains("Checkout branch")).
Tooltip(Contains("Disabled: No branches found at selected commit.")).
Select(MatchesRegexp("Checkout commit [a-f0-9]+ as detached head")).
Confirm()
@@ -54,9 +53,9 @@ var Checkout = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Menu().
Title(Contains("Checkout branch or commit")).
Lines(
MatchesRegexp("Checkout commit [a-f0-9]+ as detached head").IsSelected(),
Contains("Checkout branch 'branch1'"),
Contains("Checkout branch 'branch1'").IsSelected(),
Contains("Checkout branch 'master'"),
MatchesRegexp("Checkout commit [a-f0-9]+ as detached head"),
Contains("Cancel"),
).
Select(Contains("Checkout branch 'master'")).
@@ -10,7 +10,7 @@ var CommitWipWithPrefix = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefixes = map[string][]config.CommitPrefixConfig{"repo": {{Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}}
cfg.GetUserConfig().Git.CommitPrefixes = map[string]config.CommitPrefixConfig{"repo": {Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("feature/TEST-002")
@@ -1,53 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var CommitWithFallthroughPrefix = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Commit with multiple CommitPrefixConfig",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefix = []config.CommitPrefixConfig{
{Pattern: "^doesntmatch-(\\w+).*", Replace: "[BAD $1]: "},
{Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[GOOD $1]: "},
}
cfg.GetUserConfig().Git.CommitPrefixes = map[string][]config.CommitPrefixConfig{
"DifferentProject": {{Pattern: "^otherthatdoesn'tmatch-(\\w+).*", Replace: "[BAD $1]: "}},
}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("feature/TEST-001")
shell.CreateFile("test-commit-prefix", "This is foo bar")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
IsEmpty()
t.Views().Files().
IsFocused().
PressPrimaryAction().
Press(keys.Files.CommitChanges)
t.ExpectPopup().CommitMessagePanel().
Title(Equals("Commit summary")).
InitialText(Equals("[GOOD TEST-001]: ")).
Type("my commit message").
Cancel()
t.Views().Files().
IsFocused().
Press(keys.Files.CommitChanges)
t.ExpectPopup().CommitMessagePanel().
Title(Equals("Commit summary")).
InitialText(Equals("[GOOD TEST-001]: my commit message")).
Type(". Added something else").
Confirm()
t.Views().Commits().Focus()
t.Views().Main().Content(Contains("[GOOD TEST-001]: my commit message. Added something else"))
},
})
@@ -10,7 +10,7 @@ var CommitWithGlobalPrefix = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefix = []config.CommitPrefixConfig{{Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}}
cfg.GetUserConfig().Git.CommitPrefix = &config.CommitPrefixConfig{Pattern: "^\\w+\\/(\\w+-\\w+).*", Replace: "[$1]: "}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("feature/TEST-001")
@@ -10,10 +10,10 @@ var CommitWithNonMatchingBranchName = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefix = []config.CommitPrefixConfig{{
cfg.GetUserConfig().Git.CommitPrefix = &config.CommitPrefixConfig{
Pattern: "^\\w+\\/(\\w+-\\w+).*",
Replace: "[$1]: ",
}}
}
},
SetupRepo: func(shell *Shell) {
shell.NewBranch("branchnomatch")
@@ -10,11 +10,11 @@ var CommitWithPrefix = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.CommitPrefixes = map[string][]config.CommitPrefixConfig{
"repo": {{
cfg.GetUserConfig().Git.CommitPrefixes = map[string]config.CommitPrefixConfig{
"repo": {
Pattern: `^\w+/(\w+-\w+).*`,
Replace: "[$1]: ",
}},
},
}
},
SetupRepo: func(shell *Shell) {
@@ -12,7 +12,8 @@ var CopyAuthorToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
// Include delimiters around the text so that we can assert on the entire content
config.GetUserConfig().OS.CopyToClipboardCmd = "echo /{{text}}/ > clipboard"
},
SetupRepo: func(shell *Shell) {
@@ -35,6 +36,13 @@ var CopyAuthorToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Equals("Commit author copied to clipboard"))
t.FileSystem().FileContent("clipboard", Equals("John Doe <john@doe.com>"))
t.Views().Files().
Focus().
Press(keys.Files.RefreshFiles).
Lines(
Contains("clipboard").IsSelected(),
)
t.Views().Main().Content(Contains("/John Doe <john@doe.com>/"))
},
})
@@ -1,39 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
// We're emulating the clipboard by writing to a file called clipboard
var CopyMessageBodyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Copy a commit message body to the clipboard",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommitWithBody("My Subject", "My awesome commit message body")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("My Subject").IsSelected(),
).
Press(keys.Commits.CopyCommitAttributeToClipboard)
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Commit message body")).
Confirm()
t.ExpectToast(Equals("Commit message body copied to clipboard"))
t.FileSystem().FileContent("clipboard", Equals("My awesome commit message body"))
},
})
@@ -1,42 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
// We're emulating the clipboard by writing to a file called clipboard
var CopyTagToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Copy a commit tag to the clipboard",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {
shell.SetAuthor("John Doe", "john@doe.com")
shell.EmptyCommit("commit")
shell.CreateLightweightTag("tag1", "HEAD")
shell.CreateLightweightTag("tag2", "HEAD")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("commit").IsSelected(),
).
Press(keys.Commits.CopyCommitAttributeToClipboard)
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Commit tags")).
Confirm()
t.ExpectToast(Equals("Commit tags copied to clipboard"))
t.FileSystem().FileContent("clipboard", Equals("tag2\ntag1"))
},
})
@@ -1,33 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DisableCopyCommitMessageBody = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Disables copy commit message body when there is no body",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("commit")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("commit").IsSelected(),
).
Press(keys.Commits.CopyCommitAttributeToClipboard)
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Commit message body")).
Confirm()
t.ExpectToast(Equals("Disabled: Commit has no message body"))
},
})
@@ -10,7 +10,7 @@ var PasteCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > ../clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > ../clipboard"
config.GetUserConfig().OS.ReadFromClipboardCmd = "cat ../clipboard"
},
SetupRepo: func(shell *Shell) {
@@ -26,7 +26,7 @@ var PasteCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Commits.CopyCommitAttributeToClipboard)
t.ExpectPopup().Menu().Title(Equals("Copy to clipboard")).
Select(Contains("Commit message (subject and body)")).Confirm()
Select(Contains("Commit message")).Confirm()
t.ExpectToast(Equals("Commit message copied to clipboard"))
@@ -10,7 +10,7 @@ var PasteCommitMessageOverExisting = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > ../clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > ../clipboard"
config.GetUserConfig().OS.ReadFromClipboardCmd = "cat ../clipboard"
},
SetupRepo: func(shell *Shell) {
@@ -26,7 +26,7 @@ var PasteCommitMessageOverExisting = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Commits.CopyCommitAttributeToClipboard)
t.ExpectPopup().Menu().Title(Equals("Copy to clipboard")).
Select(Contains("Commit message (subject and body)")).Confirm()
Select(Contains("Commit message")).Confirm()
t.ExpectToast(Equals("Commit message copied to clipboard"))
@@ -28,8 +28,6 @@ var PreserveCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
Type("second paragraph").
Cancel()
t.FileSystem().PathPresent(".git/LAZYGIT_PENDING_COMMIT")
t.Views().Files().
IsFocused().
Press(keys.Files.CommitChanges)
@@ -37,22 +35,6 @@ var PreserveCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().CommitMessagePanel().
Content(Equals("my commit message")).
SwitchToDescription().
Content(Equals("first paragraph\n\nsecond paragraph")).
Clear().
SwitchToSummary().
Clear().
Cancel()
t.FileSystem().PathNotPresent(".git/LAZYGIT_PENDING_COMMIT")
t.Views().Files().
IsFocused().
Press(keys.Files.CommitChanges)
t.ExpectPopup().CommitMessagePanel().
Type("my new commit message").
Confirm()
t.FileSystem().PathNotPresent(".git/LAZYGIT_PENDING_COMMIT")
Content(Equals("first paragraph\n\nsecond paragraph"))
},
})
-74
View File
@@ -1,74 +0,0 @@
package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
func setupForAmendTests(shell *Shell) {
shell.EmptyCommit("base commit")
shell.NewBranch("branch")
shell.Checkout("master")
shell.CreateFileAndAdd("file1", "master")
shell.Commit("file1 changed in master")
shell.Checkout("branch")
shell.UpdateFileAndAdd("file2", "two")
shell.Commit("commit two")
shell.CreateFileAndAdd("file1", "branch")
shell.Commit("file1 changed in branch")
shell.UpdateFileAndAdd("file3", "three")
shell.Commit("commit three")
}
func doTheRebaseForAmendTests(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("commit three").IsSelected(),
Contains("file1 changed in branch"),
Contains("commit two"),
Contains("base commit"),
)
t.Views().Branches().
Focus().
NavigateToLine(Contains("master")).
Press(keys.Branches.RebaseBranch).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Rebase 'branch'")).
Select(Contains("Simple rebase")).
Confirm()
t.Common().AcknowledgeConflicts()
})
t.Views().Commits().
Lines(
Contains("pick").Contains("commit three"),
Contains("conflict").Contains("<-- YOU ARE HERE --- file1 changed in branch"),
Contains("commit two"),
Contains("file1 changed in master"),
Contains("base commit"),
)
t.Views().Files().
Focus().
PressEnter()
t.Views().MergeConflicts().
IsFocused().
SelectNextItem(). // choose "incoming"
PressPrimaryAction()
t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
Cancel()
}
func checkCommitContainsChange(t *TestDriver, commitSubject string, change string) {
t.Views().Commits().
Focus().
NavigateToLine(Contains(commitSubject))
t.Views().Main().
Content(Contains(change))
}
+1 -1
View File
@@ -25,7 +25,7 @@ var Filter = NewIntegrationTest(NewIntegrationTestArgs{
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Filtering")).
Select(Contains("No filter")).
Select(Contains("Reset filter")).
Confirm()
}).
Lines(
@@ -1,41 +0,0 @@
package custom_commands
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var SelectedCommitRange = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Use the {{ .SelectedCommitRange }} template variable",
ExtraCmdArgs: []string{},
Skip: false,
SetupRepo: func(shell *Shell) {
shell.CreateNCommits(3)
},
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
{
Key: "X",
Context: "global",
Command: `git log --format="%s" {{.SelectedCommitRange.From}}^..{{.SelectedCommitRange.To}} > file.txt`,
},
}
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().Focus().
Lines(
Contains("commit 03").IsSelected(),
Contains("commit 02"),
Contains("commit 01"),
)
t.GlobalPress("X")
t.FileSystem().FileContent("file.txt", Equals("commit 03\n"))
t.Views().Commits().Focus().
Press(keys.Universal.RangeSelectDown)
t.GlobalPress("X")
t.FileSystem().FileContent("file.txt", Equals("commit 03\ncommit 02\n"))
},
})
@@ -1,123 +0,0 @@
package diff
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
// note: this is required to simulate the clipboard during CI
func expectClipboard(t *TestDriver, matcher *TextMatcher) {
defer t.Shell().DeleteFile("clipboard")
t.FileSystem().FileContent("clipboard", matcher)
}
var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
Description: "The copy menu allows to copy name and diff of selected/all files",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {
shell.CreateDir("dir")
shell.CreateFileAndAdd("dir/file1", "1st line\n")
shell.Commit("1")
shell.CreateFileAndAdd("dir/file1", "1st line\n2nd line\n")
shell.CreateFileAndAdd("dir/file2", "file2\n")
shell.Commit("2")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("2").IsSelected(),
Contains("1"),
).
PressEnter()
t.Views().CommitFiles().
IsFocused().
Lines(
Contains("dir").IsSelected(),
Contains("file1"),
Contains("file2"),
).
NavigateToLine(Contains("file1")).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("File name")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("File name copied to clipboard"))
expectClipboard(t, Equals("file1"))
})
}).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Path")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("File path copied to clipboard"))
expectClipboard(t, Equals("dir/file1"))
})
}).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Diff of selected file")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("File diff copied to clipboard"))
expectClipboard(t,
Contains("diff --git a/dir/file1 b/dir/file1").Contains("+2nd line").DoesNotContain("+1st line").
DoesNotContain("diff --git a/dir/file2 b/dir/file2").DoesNotContain("+file2"))
})
}).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Diff of all files")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("All files diff copied to clipboard"))
expectClipboard(t,
Contains("diff --git a/dir/file1 b/dir/file1").Contains("+2nd line").DoesNotContain("+1st line").
Contains("diff --git a/dir/file2 b/dir/file2").Contains("+file2"))
})
})
t.Views().Commits().
Focus().
// Select both commits
Press(keys.Universal.RangeSelectDown).
PressEnter()
t.Views().CommitFiles().
IsFocused().
Lines(
Contains("dir").IsSelected(),
Contains("file1"),
Contains("file2"),
).
NavigateToLine(Contains("file1")).
Press(keys.Files.CopyFileInfoToClipboard).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Copy to clipboard")).
Select(Contains("Diff of selected file")).
Confirm().
Tap(func() {
t.ExpectToast(Equals("File diff copied to clipboard"))
expectClipboard(t,
Contains("diff --git a/dir/file1 b/dir/file1").Contains("+1st line").Contains("+2nd line"))
})
})
},
})
@@ -1,46 +0,0 @@
package file
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var CollapseExpand = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Collapsing and expanding all files in the file tree",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
},
SetupRepo: func(shell *Shell) {
shell.CreateDir("dir")
shell.CreateFile("dir/file-one", "original content\n")
shell.CreateDir("dir2")
shell.CreateFile("dir2/file-two", "original content\n")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
IsFocused().
Lines(
Contains("dir").IsSelected(),
Contains("??").Contains("file-one"),
Contains("dir2"),
Contains("??").Contains("file-two"),
)
t.Views().Files().
Press(keys.Files.CollapseAll).
Lines(
Contains("dir"),
Contains("dir2"),
)
t.Views().Files().
Press(keys.Files.ExpandAll).
Lines(
Contains("dir").IsSelected(),
Contains("??").Contains("file-one"),
Contains("dir2"),
Contains("??").Contains("file-two"),
)
},
})
+3 -3
View File
@@ -17,7 +17,7 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
@@ -100,7 +100,7 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Equals("File name copied to clipboard"))
expectClipboard(t, Equals("1-unstaged_file"))
expectClipboard(t, Contains("unstaged_file"))
})
// Copy file path
@@ -114,7 +114,7 @@ var CopyMenu = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectToast(Equals("File path copied to clipboard"))
expectClipboard(t, Equals("dir/1-unstaged_file"))
expectClipboard(t, Contains("dir/1-unstaged_file"))
})
// Selected path diff on a single (unstaged) file
@@ -1,62 +0,0 @@
package filter_and_search
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var FilterByFileStatus = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Filtering to show untracked files in repo that hides them by default",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
},
SetupRepo: func(shell *Shell) {
// need to set untracked files to not be displayed in git config
shell.SetConfig("status.showUntrackedFiles", "no")
shell.CreateFileAndAdd("file-tracked", "foo")
shell.Commit("first commit")
shell.CreateFile("file-untracked", "bar")
shell.UpdateFile("file-tracked", "baz")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
Focus().
Lines(
Contains(`file-tracked`).IsSelected(),
).
Press(keys.Files.OpenStatusFilter).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Filtering")).
Select(Contains("Show only untracked files")).
Confirm()
}).
Lines(
Contains(`file-untracked`).IsSelected(),
).
Press(keys.Files.OpenStatusFilter).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Filtering")).
Select(Contains("Show only tracked files")).
Confirm()
}).
Lines(
Contains(`file-tracked`).IsSelected(),
).
Press(keys.Files.OpenStatusFilter).
Tap(func() {
t.ExpectPopup().Menu().
Title(Equals("Filtering")).
Select(Contains("No filter")).
Confirm()
}).
Lines(
Contains(`file-tracked`).IsSelected(),
)
},
})
@@ -12,7 +12,7 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
config.GetUserConfig().OS.CopyToClipboardCmd = "echo {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {
@@ -34,6 +34,13 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
t.GlobalPress(keys.Files.RefreshFiles)
t.FileSystem().FileContent("clipboard", Equals("branch-a"))
// Expect to see the clipboard file with contents
t.Views().Files().
IsFocused().
Lines(
Contains("clipboard").IsSelected(),
)
t.Views().Main().Content(Contains("branch-a"))
},
})
-2
View File
@@ -31,7 +31,5 @@ var Rename = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Prompt().Title(Equals("Rename stash: stash@{1}")).Type(" baz").Confirm()
}).
SelectedLine(Contains("On master: foo baz"))
t.Views().Main().Content(Contains("file-1"))
},
})
@@ -1,31 +0,0 @@
package tag
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Copy the tag to the clipboard",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().OS.CopyToClipboardCmd = "printf '%s' {{text}} > clipboard"
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
shell.CreateLightweightTag("super.l000ongtag", "HEAD")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Tags().
Focus().
Lines(
Contains("tag").IsSelected(),
).
Press(keys.Universal.CopyToClipboard)
t.ExpectToast(Equals("'super.l000ongtag' copied to clipboard"))
t.FileSystem().FileContent("clipboard", Equals("super.l000ongtag"))
},
})
@@ -1,75 +0,0 @@
package tag
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DeleteLocalAndRemote = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Create and delete both local and remote annotated tag",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("initial commit")
shell.CloneIntoRemote("origin")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Tags().
Focus().
IsEmpty().
Press(keys.Universal.New).
Tap(func() {
t.ExpectPopup().CommitMessagePanel().
Title(Equals("Tag name")).
Type("new-tag").
SwitchToDescription().
Title(Equals("Tag description")).
Type("message").
SwitchToSummary().
Confirm()
}).
Lines(
MatchesRegexp(`new-tag.*message`).IsSelected(),
).
Press(keys.Universal.Push).
Tap(func() {
t.ExpectPopup().Prompt().
Title(Equals("Remote to push tag 'new-tag' to:")).
InitialText(Equals("origin")).
SuggestionLines(
Contains("origin"),
).
Confirm()
}).
Press(keys.Universal.Remove).
Tap(func() {
t.ExpectPopup().
Menu().
Title(Equals("Delete tag 'new-tag'?")).
Select(Contains("Delete local and remote tag")).
Confirm()
}).
Tap(func() {
t.ExpectPopup().Prompt().
Title(Equals("Remote from which to remove tag 'new-tag':")).
InitialText(Equals("origin")).
SuggestionLines(
Contains("origin"),
).
Confirm()
}).
Tap(func() {
t.ExpectPopup().
Confirmation().
Title(Equals("Delete tag 'new-tag'?")).
Content(Equals("Are you sure you want to delete 'new-tag' from both your machine and from 'origin'?")).
Confirm()
}).
IsEmpty().
Press(keys.Universal.New).
Tap(func() {
t.Shell().AssertRemoteTagNotFound("origin", "new-tag")
})
},
})
-15
View File
@@ -45,7 +45,6 @@ var tests = []*components.IntegrationTest{
branch.DeleteMultiple,
branch.DeleteRemoteBranchWithCredentialPrompt,
branch.DeleteRemoteBranchWithDifferentName,
branch.DeleteWhileFiltering,
branch.DetachedHead,
branch.NewBranchAutostash,
branch.NewBranchFromRemoteTrackingDifferentName,
@@ -84,26 +83,19 @@ var tests = []*components.IntegrationTest{
commit.AddCoAuthorRange,
commit.AddCoAuthorWhileCommitting,
commit.Amend,
commit.AmendWhenThereAreConflictsAndAmend,
commit.AmendWhenThereAreConflictsAndCancel,
commit.AmendWhenThereAreConflictsAndContinue,
commit.AutoWrapMessage,
commit.Checkout,
commit.Commit,
commit.CommitMultiline,
commit.CommitSwitchToEditor,
commit.CommitWipWithPrefix,
commit.CommitWithFallthroughPrefix,
commit.CommitWithGlobalPrefix,
commit.CommitWithNonMatchingBranchName,
commit.CommitWithPrefix,
commit.CopyAuthorToClipboard,
commit.CopyMessageBodyToClipboard,
commit.CopyTagToClipboard,
commit.CreateAmendCommit,
commit.CreateFixupCommitInBranchStack,
commit.CreateTag,
commit.DisableCopyCommitMessageBody,
commit.DiscardOldFileChanges,
commit.FindBaseCommitForFixup,
commit.FindBaseCommitForFixupDisregardMainBranch,
@@ -147,7 +139,6 @@ var tests = []*components.IntegrationTest{
custom_commands.MultipleContexts,
custom_commands.MultiplePrompts,
custom_commands.SelectedCommit,
custom_commands.SelectedCommitRange,
custom_commands.SelectedPath,
custom_commands.ShowOutputInPanel,
custom_commands.SuggestionsCommand,
@@ -167,14 +158,12 @@ var tests = []*components.IntegrationTest{
demo.StageLines,
demo.Undo,
demo.WorktreeCreateFromBranches,
diff.CopyToClipboard,
diff.Diff,
diff.DiffAndApplyPatch,
diff.DiffCommits,
diff.DiffNonStickyRange,
diff.IgnoreWhitespace,
diff.RenameSimilarityThresholdChange,
file.CollapseExpand,
file.CopyMenu,
file.DirWithUntrackedFile,
file.DiscardAllDirChanges,
@@ -191,7 +180,6 @@ var tests = []*components.IntegrationTest{
file.StageChildrenRangeSelect,
file.StageDeletedRangeSelect,
file.StageRangeSelect,
filter_and_search.FilterByFileStatus,
filter_and_search.FilterCommitFiles,
filter_and_search.FilterFiles,
filter_and_search.FilterFuzzy,
@@ -361,11 +349,9 @@ var tests = []*components.IntegrationTest{
sync.RenameBranchAndPull,
tag.Checkout,
tag.CheckoutWhenBranchWithSameNameExists,
tag.CopyToClipboard,
tag.CreateWhileCommitting,
tag.CrudAnnotated,
tag.CrudLightweight,
tag.DeleteLocalAndRemote,
tag.ForceTagAnnotated,
tag.ForceTagLightweight,
tag.Reset,
@@ -380,7 +366,6 @@ var tests = []*components.IntegrationTest{
ui.SwitchTabFromMenu,
ui.SwitchTabWithPanelJumpKeys,
undo.UndoCheckoutAndDrop,
undo.UndoCommit,
undo.UndoDrop,
worktree.AddFromBranch,
worktree.AddFromBranchDetached,

Some files were not shown because too many files have changed in this diff Show More