Show worktree name next to branch in branches list#5340
Show worktree name next to branch in branches list#5340stefanhaller merged 1 commit intojesseduffield:masterfrom
Conversation
2c7fe1f to
2079706
Compare
2079706 to
c4bea3f
Compare
|
I pushed a fixup (c4bea3f) to implement the suggestion I made above, including the heuristic to omit the worktree name if it is the same as the branch name. I'd be mostly happy with this, but there's one problem left: if the window is so narrow that the whole branch name plus worktree name doesn't fit, then we truncate only the branch name, but leave the worktree name at full length. This doesn't make much sense; the logic did make some sense when the worktree icon was only one character, but now we should truncate the worktree name first (and maybe omit it entirely if it doesn't fit), and only then truncate the branch name too. This make the whole thing a bit more complicated. |
|
Thanks. Can't we auto hide this worktree name when there isn't enough space? |
c4bea3f to
9e4f8fd
Compare
Yes, that's basically what I meant, it's just not totally trivial (requires moving code around a bit). I tried this in 9e4f8fd; please have a look and test it thoroughly. I'd like to cut a release tomorrow, would be nice if we could include this PR together with the other worktree change. |
|
I'll have a look tomorrow afternoon. Thanks! |
|
I tested it and it works great! Also switched to nerd fonts, which makes it 😍 |
When a branch is checked out by another worktree, show the worktree name in the label, e.g. "(worktree cosmos2)" instead of just "(worktree)", so you can immediately see which worktree holds it.
9e4f8fd to
6ad56d5
Compare
|
I fixed up your commits into mine, and rebased with main. |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.59.0` → `v0.60.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.60.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.60.0) [Compare Source](jesseduffield/lazygit@v0.59.0...v0.60.0) <!-- Release notes generated using configuration in .github/release.yml at v0.60.0 --> #### What's Changed ##### Enhancements 🔥 - Rename "Copy commit hash to clipboard" to mention it's an abbreviated hash by [@​stefanhaller](https://github.com/stefanhaller) in [#​5331](jesseduffield/lazygit#5331) - Hide the "Fetching..." status of the auto-fetch when bottom line is hidden by [@​stefanhaller](https://github.com/stefanhaller) in [#​5321](jesseduffield/lazygit#5321) - Allow removing lines from patch directly by [@​jesseduffield](https://github.com/jesseduffield) in [#​5277](jesseduffield/lazygit#5277) - Filter file views rather than search by [@​jesseduffield](https://github.com/jesseduffield) in [#​5273](jesseduffield/lazygit#5273) - Show branch name and detached HEAD in worktrees tab by [@​ruudk](https://github.com/ruudk) in [#​5339](jesseduffield/lazygit#5339) - Add backward cycling support for log view (using `<shift>-a` on status page) by [@​zaakiy](https://github.com/zaakiy) in [#​5346](jesseduffield/lazygit#5346) - Show worktree name next to branch in branches list by [@​ruudk](https://github.com/ruudk) in [#​5340](jesseduffield/lazygit#5340) ##### Fixes 🔧 - Fix matching of lazygit-edit URLs without line numbers by [@​danielwe](https://github.com/danielwe) in [#​5311](jesseduffield/lazygit#5311) - Fix [#​5302](jesseduffield/lazygit#5302): Create .git/info directory before writing exclude file by [@​cobyfrombrooklyn-bot](https://github.com/cobyfrombrooklyn-bot) in [#​5325](jesseduffield/lazygit#5325) - Fix off-by-one error when calculating popup panel dimensions by [@​stefanhaller](https://github.com/stefanhaller) in [#​5312](jesseduffield/lazygit#5312) - Properly disable clicks in inactive views behind popups by [@​stefanhaller](https://github.com/stefanhaller) in [#​5313](jesseduffield/lazygit#5313) - Enable `{` and `}` to change diff context size in branches and tags panels in diffing mode by [@​stefanhaller](https://github.com/stefanhaller) in [#​5258](jesseduffield/lazygit#5258) - Fix diff display of custom pagers after screen mode change by [@​stefanhaller](https://github.com/stefanhaller) in [#​5349](jesseduffield/lazygit#5349) ##### Maintenance ⚙️ - Bump github.com/cloudflare/circl from 1.6.1 to 1.6.3 by [@​dependabot](https://github.com/dependabot)\[bot] in [#​5323](jesseduffield/lazygit#5323) ##### Docs 📖 - Fix typo: MacOS to macOS by [@​04cb](https://github.com/04cb) in [#​5335](jesseduffield/lazygit#5335) ##### I18n 🌎 - Update translations from Crowdin by [@​stefanhaller](https://github.com/stefanhaller) in [#​5352](jesseduffield/lazygit#5352) ##### Other Changes - Add Terra as an alternative Fedora install method by [@​Owen-sz](https://github.com/Owen-sz) in [#​5281](jesseduffield/lazygit#5281) #### New Contributors - [@​Owen-sz](https://github.com/Owen-sz) made their first contribution in [#​5281](jesseduffield/lazygit#5281) - [@​danielwe](https://github.com/danielwe) made their first contribution in [#​5311](jesseduffield/lazygit#5311) - [@​cobyfrombrooklyn-bot](https://github.com/cobyfrombrooklyn-bot) made their first contribution in [#​5325](jesseduffield/lazygit#5325) - [@​04cb](https://github.com/04cb) made their first contribution in [#​5335](jesseduffield/lazygit#5335) - [@​zaakiy](https://github.com/zaakiy) made their first contribution in [#​5346](jesseduffield/lazygit#5346) **Full Changelog**: <jesseduffield/lazygit@v0.59.0...v0.60.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:eyJjcmVhdGVkSW5WZXIiOiI0My42MS43IiwidXBkYXRlZEluVmVyIjoiNDMuNjEuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
PR Description
When a branch is checked out by another worktree, show the worktree name in the label, e.g. "(worktree cosmos2)" instead of just "(worktree)", so you can immediately see which worktree holds it.
Please check if the PR fulfills these requirements
go generate ./...)