Skip to content

Conversation

@stefanhaller
Copy link
Collaborator

PR Description

When filtering by file path, dropping a range selection of stashes would drop the wrong ones if those stashes would be noncontiguous in the unfiltered list.

The next RangeSelectDown actually cancels the sticky range select and turns it
into a non-sticky one.
As can be seen from the test, it deletes the wrong stashes in this case, because
it assumes the selection is contiguous.
To fix the problem described in the previous commit, iterate backwards over the
stashes that we want to delete. This allows us to use their Index field.
@stefanhaller stefanhaller added the bug Something isn't working label Aug 25, 2025
@stefanhaller stefanhaller enabled auto-merge August 25, 2025 17:19
@stefanhaller stefanhaller merged commit 5a6de12 into master Aug 25, 2025
14 checks passed
@stefanhaller stefanhaller deleted the fix-dropping-range-of-filtered-stashes branch August 25, 2025 17:21
@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 1d651961 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (1d65196) Report Missing Report Missing Report Missing
Head commit (bf419ab) 57646 50096 86.90%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4849) 58 58 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 9, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.54.2` -> `v0.55.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary>

### [`v0.55.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.55.0)

[Compare Source](jesseduffield/lazygit@v0.54.2...v0.55.0)

<!-- Release notes generated using configuration in .github/release.yml at v0.55.0 -->

#### What's Changed

##### Enhancements 🔥

- Allow filtering the keybindings menu by keybinding by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4821](jesseduffield/lazygit#4821)
- Add support for suspending LazyGit with Ctrl+Z on Unix systems by [@&#8203;cowboy8625](https://github.com/cowboy8625) in [#&#8203;4757](jesseduffield/lazygit#4757)
- Add "CopyToClipboard" command to `ConfirmationController` by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4810](jesseduffield/lazygit#4810)
- Add a user config for using git's external diff command for paging by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4832](jesseduffield/lazygit#4832)
- Log the hash of dropped stashes by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4850](jesseduffield/lazygit#4850)

##### Fixes 🔧

- Fix right-alignment of divergence from base branch for branch checked out in a worktree by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4824](jesseduffield/lazygit#4824)
- Support Azure DevOps vs-ssh.visualstudio.com SSH remotes as hosting provider by [@&#8203;Kahitar](https://github.com/Kahitar) in [#&#8203;4822](jesseduffield/lazygit#4822)
- Improve display of "esc" keybinding in the keybindings status bar by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4819](jesseduffield/lazygit#4819)
- Use external diff command in stashes panel by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4836](jesseduffield/lazygit#4836)
- Remove the git.paging.useConfig option by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4837](jesseduffield/lazygit#4837)
- Don't auto-forward branches that are checked out in another worktree by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4833](jesseduffield/lazygit#4833)
- Fix dropping range selection of filtered stashes by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4849](jesseduffield/lazygit#4849)
- Fix rare crash in interactive rebase (merge command without comment) by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4872](jesseduffield/lazygit#4872)
- Make it possible to rebind the Confirm keybinding by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4860](jesseduffield/lazygit#4860)

##### Maintenance ⚙️

- Pass only Git-tracked Go files to gofumpt by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4809](jesseduffield/lazygit#4809)
- Update donation wording so that it's clear there's no strings attached by [@&#8203;jesseduffield](https://github.com/jesseduffield) in [#&#8203;4827](jesseduffield/lazygit#4827)
- Enhance MR/Issue templates readability by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4829](jesseduffield/lazygit#4829)
- Run label check workflow only on label events and open pr event by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4830](jesseduffield/lazygit#4830)

##### Docs 📖

- Add installation with gah by [@&#8203;marverix](https://github.com/marverix) in [#&#8203;4820](jesseduffield/lazygit#4820)
- docs(VISION): fix "Dicoverability" typo by [@&#8203;Rudxain](https://github.com/Rudxain) in [#&#8203;4866](jesseduffield/lazygit#4866)
- Add dev container feature as installation method to README by [@&#8203;HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) in [#&#8203;4876](jesseduffield/lazygit#4876)

##### I18n 🌎

- Update translations from Crowdin by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4873](jesseduffield/lazygit#4873)

#### New Contributors

- [@&#8203;marverix](https://github.com/marverix) made their first contribution in [#&#8203;4820](jesseduffield/lazygit#4820)
- [@&#8203;Kahitar](https://github.com/Kahitar) made their first contribution in [#&#8203;4822](jesseduffield/lazygit#4822)
- [@&#8203;cowboy8625](https://github.com/cowboy8625) made their first contribution in [#&#8203;4757](jesseduffield/lazygit#4757)
- [@&#8203;Rudxain](https://github.com/Rudxain) made their first contribution in [#&#8203;4866](jesseduffield/lazygit#4866)
- [@&#8203;HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) made their first contribution in [#&#8203;4876](jesseduffield/lazygit#4876)

**Full Changelog**: <jesseduffield/lazygit@v0.54.2...v0.55.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45Ny40IiwidXBkYXRlZEluVmVyIjoiNDEuOTcuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
karolzwolak pushed a commit to karolzwolak/lazygit that referenced this pull request Sep 27, 2025
### PR Description

When filtering by file path, dropping a range selection of stashes would
drop the wrong ones if those stashes would be noncontiguous in the
unfiltered list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant