-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualize local branch heads in commits panel, 2nd approach #2775
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, left some comments.
One thing I don't get is why when I pull down your branch I'm seeing this:
What's special about b61ca21?
I think it's gonna be important to have documentation that captures why we have this feature, what logic it follows, etc, because admittedly due to not using stacked branches myself I'm not fully grokking the logic.
EDIT: wait I think I get it now: that commit is the head of another branch. I mistakenly thought we'd only show branches which we had explicitly rebased onto (which is impossible to know). This still makes me wonder about why we're excluding certain branches (main branches for example). Like it would be much easier to explain the feature if we just said 'we'll show a marker for any commits that are the head of a local branch'.
If this feature is only for people using stacked branches (which would currently be a minority of users), I'm leaning towards making this configurable again.
pkg/gui/presentation/commits.go
Outdated
@@ -99,6 101,14 @@ func GetCommitListDisplayStrings( | |||
getGraphLine = func(idx int) string { return "" } | |||
} | |||
|
|||
branchHeadsToVisualize := lo.FilterMap(branches, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this a set for fast access (especially given how many commits we currently iterate through here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 12f4151.
pkg/gui/presentation/commits_test.go
Outdated
@@ -72,6 74,54 @@ func TestGetCommitListDisplayStrings(t *testing.T) { | |||
sha2 commit2 | |||
`), | |||
}, | |||
{ | |||
testName: "show local branch head", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be more explicit about what's being tested here. Am I right in saying we're testing to ensure we don't get the marker on a main branch or on the head commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes; I changed the title in 1032a05.
sha3 commit3 | ||
`), | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a test for the git bisect case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that the bisect logic has moved to local_commits_context.go
, no we can't. But the bisect/basic.go
integration test covers this.
Something that just occurred to me: if nerd icons are enabled, we should show a branch icon instead of |
Thanks for all the feedback; it's so much that I need to find a good way to respond to it. Let me address the fundamental ones first:
To sum it up: I'm trying to make it so that only people who use stacked branches will ever see these new markers (and they will not be confused about it). If a marker ever shows up in a situation where there's no stack of branches, it's a bug and should be fixed. I'd also hope that when we do it like this, we don't need user documentation for it, because there will never be a reason for confusion. (Maybe I'm wrong about this.) |
Fair points. Lemme try to state some assumptions (tell my if you disagree) behind going with your approach:
After thinking about this for a bit, I think these are sensible assumptions, or at least assumptions worth testing by releasing this as default behaviour. As for users who aren't using nerdfonts, I don't feel great about the As for my proposed approach of showing all local branches the upstream of the current branch, I'm still interested in this because:
But my proposed approach will definitely have more noise. I'm going to continue playing with my approach locally before raising it again. So in conclusion let's go ahead with this PR's approach. |
I would go so far as to replace "rarely" with "never".
I don't understand how you can coincidentally end up with a stack of branches by cherry-picking, can you elaborate on that? The only other situation I can imagine where you would see the marker is when you make a copy of a branch. For example, create a new branch off of the tip of an existing one in order to rebase the new one onto "develop" but keep the old one on "master". In that case you would see the marker for either branch as long as both are pointing to the same commit. I could imagine filtering this out too, i.e. never show the marker for a tip commit.
I would replace "work out" by "be delighted that this is finally visualized". 😄
I would prefer a symbol over a letter. I can imagine just Still unhappy with the color though. Magenta works ok for |
Sorry, I was basically saying the same thing as you i.e. you're just duplicating a branch (whether by branching off of a branch or cherry-picking its one and only commit across). Cherry picking came to mind but branching off is the more typical case.
Yep that's a good idea, and relevant when we're showing the commits of a branch via the branch view (which currently shows the marker on the top commit)
Touche haha
An asterisk on its own sounds fine to me. The colour I used was bold red (looks orangish thanks to my theme). |
Ah, good point about the branch view. This is all wrong now, and needs to be solved differently. Damn. The thing is that currently I filter out the currently checked-out branch, which is just wrong in the branch view; it needs to filter out the branch that was expanded. So a scenario that shows wrong information now is: you have branch B stacked on top of branch A. Looking at branch B in the branch view while branch A is checked out shows a marker for B's head but not for A's, which is wrong. I'll see if I can find an easy way to fix this, but I think relying on never showing a marker for the tip is not the right way to fix it. |
ff7f7b2
to
1032a05
Compare
I pushed a rebased version that takes a slightly different approach. It passes the name of the current branch into |
// Need to refresh the commits view because the visualization of local | ||
// branch heads might have changed | ||
if err := self.c.PostRefreshUpdate(self.c.Contexts().LocalCommits); err != nil { | ||
self.c.Log.Error(err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a problem. It causes the main panel to flicker whenever we refresh branches; for example, this happens for every background fetch, every 60s. Sometimes this even causes the main view to scroll back to the top, which is super annoying when you're in the middle of reviewing a branch. Not always though, sometimes it just flickers, which is bad enough though.
@jesseduffield Any suggestions how to do this differently so that it doesn't have this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this an existing problem e.g. does this already happen every 60 seconds if the branches view is focused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't (neither on master nor in this branch). But this is a refresh of the local commits view, so it's not surprising that this doesn't flicker when the branches panel is focused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The solution is to just call HandleRender
instead of PostRefreshUpdate
; see f1dd64e.
I added one more fixup (48f85ec) that is needed to prevent |
@@ -39,9 41,32 @@ func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext { | |||
|
|||
showYouAreHereLabel := c.Model().WorkingTreeStateAtLastCommitRefresh == enums.REBASE_MODE_REBASING | |||
|
|||
currentBranchName := "" | |||
if rebasedBranch := c.Model().BranchBeingRebased; rebasedBranch != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been working on worktrees lately and I've had a similar need to know what branch a worktree is on, even if it's rebasing or in the middle of a git bisect, because in those cases the branch is considered to be 'owned' by the worktree, even if git worktree list
just reports it as having a detached head. For example, you can't check out a branch that's checked out by another worktree, even if that worktree is in a rebase operation with that branch.
So I think we should have a c.Model().CheckedOutBranch
to capture all of the stuff that you've added here. That way, I'll be able to update that to support worktrees on my end. Given we're not using BranchBeingRebased anywhere else, we can remove that.
What do you think?
EDIT: would also be good to standardise on a naming convention e.g. 'checked out branch' for the checked out branch which includes when you're mid rebase/bisect, and 'current branch' for the checked out branch excluding rebase/bisect, where nil/blank means you're on a detached head.
EDIT 2: git rev-parse --abbrev-ref HEAD
is good for getting the 'current branch' (under the above naming convention), in case it's awkward having to depend on the model for the branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introducing c.Model().CheckedOutBranch
makes sense to me, but I wasn't entirely sure how. Here's one version: c05719b. In this case, I still set the member at the end of refreshCommitsWithLimit()
like I did before with BranchBeingRebased
. Not sure this is the best place to do that. Also, I can't use the other model members in the implementation like I did before (BisectInfo
and Branches
) because I can't be sure they have been set at this point, so I'm reading the information again here.
An alternative could have been to store branchBeingRebased
in Model like I did before (but maybe as a private field), and then have an accessor function for CheckedOutBranch()
that computes the result based on that and the other model fields, similar to what I did before in local_commits_context.go
. It would be a bit unusual because Model doesn't have any methods right now.
Let me know what your preference is!
48f85ec
to
c713c08
Compare
return strings.TrimPrefix(rebasedBranch, "refs/heads/") | ||
} | ||
|
||
if bisectedBranch := self.c.Git().Bisect.GetInfo().GetStartSha(); bisectedBranch != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that the StartSha is already set right after the first b g
or b b
, before we're actually on a detached head. I think we also need to check either Started()
or Bisecting()
but I'm not sure which one (I don't really get the difference).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use Bisecting()
because it's only in the bisecting phase where we have a detached head. Started()
is for when you've marked one commit as good/bad but you haven't marked the other commit yet, meaning git hasn't started jumping to different commits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, changed in 182b5a8
// checked out. Note that if we're on a detached head (for reasons other | ||
// than rebasing or bisecting, i.e. it was explicitly checked out), then | ||
// this will return its sha. | ||
if branchInfo, err := self.c.Git().Branch.CurrentBranchInfo(); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm calling CurrentBranchInfo
here because it exists already. It does more than we need though, so I could add a function that calls git rev-parse --abbrev-ref HEAD
like you suggested. (CurrentBranchName()
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, having that as its own function makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See e531aac
I'm happy for this to get postponed to after the release, just in case you were wondering. It would feel a bit rushed to try to get it in before. |
Going to squash the fixups now to tidy up the branch a bit; the individual fixups are linked from the comments above, so you can still look at them if you want. We still have the problem that the reflog subcommits view doesn't use the right value for |
990c255
to
baaad2f
Compare
@stefanhaller I would just add a flag for the subcommits view that says whether or not you want to show markers and set it to false for the reflog view: I don't expect anybody would need or want the functionality from there |
Tried to do this in feedef9; not sure that's the most elegant way to do it. Do you think we need a test for the reflogs subcommits? |
I went ahead and added an integration test both for the reflog subcommits view and for the branches subcommits view: 3afa29d. It's in the |
pkg/gui/presentation/commits.go
Outdated
// that are not the current branch, and not any of the main branches. The | ||
// goal is to visualize stacks of local branches, so anything that doesn't | ||
// contribute to a branch stack shouldn't show a marker. | ||
branchHeadsToVisualize := lo.SliceToMap(lo.FilterMap(branches, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also use the Set type from my generics package via set.NewFromSlice(...)
and then later on go:
} else if branchHeadsToVisualize.Includes(commit.Sha) &&
Up to you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I forgot about that. Changed in e531245
pkg/gui/presentation/commits.go
Outdated
@@ -289,8 311,9 @@ func displayCommit( | |||
} else { | |||
if len(commit.Tags) > 0 { | |||
tagString = theme.DiffTerminalColor.SetBold().Sprint(strings.Join(commit.Tags, " ")) " " | |||
} else if common.UserConfig.Gui.ExperimentalShowBranchHeads && commit.ExtraInfo != "" { | |||
tagString = style.FgMagenta.SetBold().Sprint("(*)") " " | |||
} else if _, found := branchHeadsToVisualize[commit.Sha]; found && commit.Status != models.StatusMerged { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should show the asterisk before any tags rather than it be an either-or situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. ab58efc
@@ -249,6 249,32 @@ func (self *RefreshHelper) refreshCommits() { | |||
wg.Wait() | |||
} | |||
|
|||
func (self *RefreshHelper) determineCheckoutBranchName() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't depend on anything outside the git_commands package so I'd move it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs several different git command objects though, so self
would have to be *GitCommands
, I guess. We don't have precedence for that yet. Should this go into a new file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see why not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't go in the git_commands
package, because GitCommands
is defined in commands
, not git_commands
. Unless we import commands
from this new file in git_commands
, which doesn't seem right to me.
I'm happy to move it somewhere if you make a more concrete suggestion where it should go, I can't figure this out myself. Personally I'd just keep it as a local helper in refresh_helper.go.
Hmm that is interesting. This would be solved if stacked branches was a first-class concept in git where you could say 'I'm making a stacked branch here' and then that branch would be updated upon rebases. But alas. So it sounds like you indeed would want that marker there for the sake of consistency. It is a shame though: for those who aren't using a stacked branches workflow, it will be strange to see that asterisk show up every time you create a new branch off a non-main branch (such as in the examples you describe in that mailing list). Given this conundrum, what are your thoughts on adding a config option so that users can opt-out of seeing the markers? |
No, not for the sake of consistency. I want it because it hints at a real problem that you need to take care to work around: create a second branch off of an existing one, then try to rebase it away from the first one; this doesn't do what you want, the first one will follow. I want the marker as a reminder that I am in this situation. (Side note: there are no good ways to solve this from within lazygit right now, you need to drop to the command line to do what you want. One way to solve this is to do an interactive rebase, and then allow deleting the update-ref todo command, which is currently not possible. When I'm in this situation, I use Hm, thinking about it, it will only be a problem for people having the
I would really, really like to avoid needing a config for this. An opt-out config wouldn't really help; opt-out configs are useful for things that people are annoyed by, but not for things that people are confused about because they don't understand them. That marker for the head commit is really not annoying, just confusing. And opt-in configs are not discoverable, so people won't know there's a useful feature that they are missing. |
I think that's a great idea.
I think the rebase.updatRefs config option is the way to go for this situation but I'll respond in the abstract:
|
7a817a0
to
068fbf3
Compare
I added 068fbf3 to do that, please take a look. |
068fbf3
to
b565817
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Doesn't need to be in this PR but it would be good to have an entry about this in the docs explaining what the cyan asterisk represents
Happy to add that, but I'm having trouble deciding where it should go. Any suggestions? It doesn't look like we have an existing file in docs where it would fit, so it seems we need to add a new file. One option would be to add a file about working with stacked branches; explaining the rebase.updateRefs option and some general workflows. Another option might be to add a file listing useful git options that people may want to set (e.g. "commit.verbose", "push.useForceIfIncludes", "rebase.updateRef"), and then the paragraph about updateRef could explain the asterisk. Any preference? |
I prefer the first option: have a file specific to stacked branches. The important thing is that we include the term 'cyan asterisk' so that it's searchable! |
b565817
to
ebbe005
Compare
I added some documentation in ebbe005. There's a lot more to be said about stacked branches, but I kept it brief for now. |
If you could have a look at #2845 next, that would be appreciated; it's a prerequisite for merging this one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great work
We are going to replace it with a better one later in this branch.
This test not only tests the correct handling and display of the updateRef command, but also the visualization of branch heads in the commits panel. Since we are about to change the behavior here, extend the test so that a master commit is added (we don't want this to be visualized as a branch head), and then a stack of two non-main branches. At the end of this branch we only want to visualize the head commit of the first.
This allow us to check not only whether a given commit has the branch head marker, but also that other commits _don't_ have it, which is important.
- check out a non-main branch before we start - add authors to expected commits so that we can see whether the commits show an asterisk - explicitly check what the top line displays after bisecting has started This shows that the detached head shows an asterisk, which we don't want. We'll fix that in the next commit.
The model will be used for logic, so the full hash is needed there; a shortened hash of 8 characters might be too short to be unique in very large repos. If some view wants to display a shortened hash, it should truncate it at presentation time.
We want to mark all local branch heads with a "*" in the local commits panel, to make it easier to see how branches are stacked onto each other. In order to not confuse users with "*" markers that they don't understand, do this only for the case where users actually use stacked branches; those users are likely not going to be confused by the display. This means we want to filter out a few branch heads that shouldn't get the marker: the current branch, any main branch, and any old branch that has been merged to master already.
It's tricky to get this right for reflog commits wrt what's the current branch for each one; so just disable it entirely here, it's probably not something anybody needs here.
ebbe005
to
94daf7b
Compare
@stefanhaller I'm seeing cyan asterisks when I run: go run cmd/integration_test/main.go cli --slow pkg/integration/tests/branch/rebase_and_drop.go But there's nothing in that test configuring to use updateRefs. Bug? |
No, that's not a bug. The logic to depend on the updateRef config for showing asterisks was only put in for the head commit. For other commits we always show the asterisk, because it should be useful even for people who don't use |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [GoogleContainerTools/skaffold](https://togithub.com/GoogleContainerTools/skaffold) | patch | `v2.6.2` -> `v2.6.3` | | [ajeetdsouza/zoxide](https://togithub.com/ajeetdsouza/zoxide) | patch | `v0.9.1` -> `v0.9.2` | | [aquaproj/aqua-registry](https://togithub.com/aquaproj/aqua-registry) | patch | `v4.32.0` -> `v4.32.2` | | [jesseduffield/lazygit](https://togithub.com/jesseduffield/lazygit) | minor | `v0.39.4` -> `v0.40.0` | | [weaveworks/eksctl](https://togithub.com/weaveworks/eksctl) | minor | `v0.150.0` -> `v0.151.0` | --- ### Release Notes <details> <summary>GoogleContainerTools/skaffold (GoogleContainerTools/skaffold)</summary> ### [`v2.6.3`](https://togithub.com/GoogleContainerTools/skaffold/releases/tag/v2.6.3): Release [Compare Source](https://togithub.com/GoogleContainerTools/skaffold/compare/v2.6.2...v2.6.3) ##### v2.6.3 Release - 2023-08-04 **Linux amd64** `curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.6.3/skaffold-linux-amd64 && chmod x skaffold && sudo mv skaffold /usr/local/bin` **Linux arm64** `curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.6.3/skaffold-linux-arm64 && chmod x skaffold && sudo mv skaffold /usr/local/bin` **macOS amd64** `curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.6.3/skaffold-darwin-amd64 && chmod x skaffold && sudo mv skaffold /usr/local/bin` **macOS arm64** `curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/v2.6.3/skaffold-darwin-arm64 && chmod x skaffold && sudo mv skaffold /usr/local/bin` **Windows** https://storage.googleapis.com/skaffold/releases/v2.6.3/skaffold-windows-amd64.exe **Docker image** `gcr.io/k8s-skaffold/skaffold:v2.6.3` **Full Changelog**: GoogleContainerTools/skaffold@v2.6.2...v2.6.3 </details> <details> <summary>ajeetdsouza/zoxide (ajeetdsouza/zoxide)</summary> ### [`v0.9.2`](https://togithub.com/ajeetdsouza/zoxide/releases/tag/v0.9.2): 0.9.2 [Compare Source](https://togithub.com/ajeetdsouza/zoxide/compare/v0.9.1...v0.9.2) ##### Added - Short option `-a` for `zoxide query --all`. ##### Fixed - PowerShell: use `global` scope for variables / functions. </details> <details> <summary>aquaproj/aqua-registry (aquaproj/aqua-registry)</summary> ### [`v4.32.2`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.32.2) [Compare Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.32.1...v4.32.2) [Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is:issue milestone:v4.32.2) | [Pull Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is:pr milestone:v4.32.2) | aquaproj/aqua-registry@v4.32.1...v4.32.2 ##### Fixes [#​14327](https://togithub.com/aquaproj/aqua-registry/issues/14327) Rename kyleconroy/sqlc to sqlc-dev/sqlc as of repository migration [@​ichizero](https://togithub.com/ichizero) [#​14339](https://togithub.com/aquaproj/aqua-registry/issues/14339) sqlc-dev/sqlc: Support old versions ### [`v4.32.1`](https://togithub.com/aquaproj/aqua-registry/releases/tag/v4.32.1) [Compare Source](https://togithub.com/aquaproj/aqua-registry/compare/v4.32.0...v4.32.1) [Issues](https://togithub.com/aquaproj/aqua-registry/issues?q=is:issue milestone:v4.32.1) | [Pull Requests](https://togithub.com/aquaproj/aqua-registry/pulls?q=is:pr milestone:v4.32.1) | aquaproj/aqua-registry@v4.32.0...v4.32.1 #### Fixes [#​14275](https://togithub.com/aquaproj/aqua-registry/issues/14275) [#​14276](https://togithub.com/aquaproj/aqua-registry/issues/14276) [#​14277](https://togithub.com/aquaproj/aqua-registry/issues/14277) [#​14278](https://togithub.com/aquaproj/aqua-registry/issues/14278) [domoritz/arrow-tools/{csv2arrow,csv2parquet,json2arrow,json2parquet}](https://togithub.com/domoritz/arrow-tools): Follow up changes of asset names </details> <details> <summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary> ### [`v0.40.0`](https://togithub.com/jesseduffield/lazygit/releases/tag/v0.40.0) [Compare Source](https://togithub.com/jesseduffield/lazygit/compare/v0.39.4...v0.40.0) <!-- Release notes generated using configuration in .github/release.yml at v0.40.0 --> ### 🎉 LAZYGIT FIVE YEAR ANNIVERSARY EDITION 🎉 Holy moly, has it really been 5 years since Lazygit's birth? Time flies when you're having fun. I've written a post celebrating the anniversary [here](https://jesseduffield.com/Lazygit-5-Years-On). As for this release, we've got some great features here. ##### Worktrees We now have a worktrees view so you can easily create worktrees and switch to them and so on. I'm not a big worktrees user myself so please raise an issue if you can think of places to improve the UX. ![worktree_create_from_branches-compressed](https://togithub.com/jesseduffield/lazygit/assets/8456633/3ef0b085-e9d0-42de-af58-16cbae581d34) ##### Rebase --onto Rebasing onto a marked base commit is a very useful feature that we've been sorely lacking for a while (demo coming soon) ##### Auto-refresh on window focus Auto-refresh on window activation is a complete game-changer. No more having to manually press shift R when you come back from your editor. ##### Nuking the worktree We also have a fun enhancement in this release: showing an explosion animation when you nuke the working tree. ![nuke-gif](https://togithub.com/jesseduffield/lazygit/assets/8456633/32b3f91c-fea3-474d-8997-1de2f5e4f5d4) You'll also notice in the readme we've got some updated demo gifs to showoff Lazygit's features. More of those to come. #### What's Changed ##### Features ✨ - Add worktrees view by [@​jesseduffield](https://togithub.com/jesseduffield) (with help from [@​kadaan](https://togithub.com/kadaan)) in [https://github.com/jesseduffield/lazygit/pull/2147](https://togithub.com/jesseduffield/lazygit/pull/2147) - Rebase onto branch from a marked base commit by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2835](https://togithub.com/jesseduffield/lazygit/pull/2835) - Auto-refresh on window activation by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2854](https://togithub.com/jesseduffield/lazygit/pull/2854) ##### Enhancements 🔥 - Faster refresh by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2841](https://togithub.com/jesseduffield/lazygit/pull/2841) - feat: add os.copyToClipboardCmd to allow for a custom command [#​1055](https://togithub.com/jesseduffield/lazygit/issues/1055) by [@​redstreet](https://togithub.com/redstreet) in [https://github.com/jesseduffield/lazygit/pull/2784](https://togithub.com/jesseduffield/lazygit/pull/2784) - Add bisect menu entry that lets you choose bisect terms by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2838](https://togithub.com/jesseduffield/lazygit/pull/2838) - When bisecting, always mark the current commit as good/bad, not the selected by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2837](https://togithub.com/jesseduffield/lazygit/pull/2837) - Visualize local branch heads in commits panel, 2nd approach by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2775](https://togithub.com/jesseduffield/lazygit/pull/2775) - Allow force-tagging if tag exists by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2827](https://togithub.com/jesseduffield/lazygit/pull/2827) - Save IgnoreWhitespaceInDiffView in state.yml by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2830](https://togithub.com/jesseduffield/lazygit/pull/2830) - Show loader when rebasing by [@​KarlHeitmann](https://togithub.com/KarlHeitmann) in [https://github.com/jesseduffield/lazygit/pull/2851](https://togithub.com/jesseduffield/lazygit/pull/2851) - Internationalise logging of commands by [@​KarlHeitmann](https://togithub.com/KarlHeitmann) in [https://github.com/jesseduffield/lazygit/pull/2852](https://togithub.com/jesseduffield/lazygit/pull/2852) - Show visual explosion effect when nuking worktree by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2861](https://togithub.com/jesseduffield/lazygit/pull/2861) ##### Fixes 🔧 - Fix issue where using `null` to un-map a keybinding was ignored by [@​hatredholder](https://togithub.com/hatredholder) in [https://github.com/jesseduffield/lazygit/pull/2832](https://togithub.com/jesseduffield/lazygit/pull/2832) - Show error when trying to open patch menu with an empty patch by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2829](https://togithub.com/jesseduffield/lazygit/pull/2829) - Fix merge status for update-ref command by [@​stefanhaller](https://togithub.com/stefanhaller) in [https://github.com/jesseduffield/lazygit/pull/2845](https://togithub.com/jesseduffield/lazygit/pull/2845) - Stop worktrees view from stealing the window by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2863](https://togithub.com/jesseduffield/lazygit/pull/2863) - Fix confirmation view sizing by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2879](https://togithub.com/jesseduffield/lazygit/pull/2879) ##### Maintenance ⚙️ - Standardise on using lo for slice functions by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2846](https://togithub.com/jesseduffield/lazygit/pull/2846) - Remove redundant secureexec package by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2847](https://togithub.com/jesseduffield/lazygit/pull/2847) - Add automated demo recordings by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2853](https://togithub.com/jesseduffield/lazygit/pull/2853) - Remove file watcher code by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2865](https://togithub.com/jesseduffield/lazygit/pull/2865) - Add more demos to the README by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2866](https://togithub.com/jesseduffield/lazygit/pull/2866) - Move features to top of readme by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2867](https://togithub.com/jesseduffield/lazygit/pull/2867) - Add more demos by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2874](https://togithub.com/jesseduffield/lazygit/pull/2874) ##### Other Changes - Create demo output dir if it doesn't already exist by [@​jesseduffield](https://togithub.com/jesseduffield) in [https://github.com/jesseduffield/lazygit/pull/2857](https://togithub.com/jesseduffield/lazygit/pull/2857) #### New Contributors - [@​hatredholder](https://togithub.com/hatredholder) made their first contribution in [https://github.com/jesseduffield/lazygit/pull/2832](https://togithub.com/jesseduffield/lazygit/pull/2832) - [@​redstreet](https://togithub.com/redstreet) made their first contribution in [https://github.com/jesseduffield/lazygit/pull/2784](https://togithub.com/jesseduffield/lazygit/pull/2784) - [@​kadaan](https://togithub.com/kadaan) made their first contribution in [https://github.com/jesseduffield/lazygit/pull/2147](https://togithub.com/jesseduffield/lazygit/pull/2147) - [@​KarlHeitmann](https://togithub.com/KarlHeitmann) made their first contribution in [https://github.com/jesseduffield/lazygit/pull/2851](https://togithub.com/jesseduffield/lazygit/pull/2851) **Full Changelog**: jesseduffield/lazygit@v0.39.4...v0.40.0 </details> <details> <summary>weaveworks/eksctl (weaveworks/eksctl)</summary> ### [`v0.151.0`](https://togithub.com/eksctl-io/eksctl/releases/tag/v0.151.0): eksctl 0.151.0 (permalink) [Compare Source](https://togithub.com/weaveworks/eksctl/compare/0.150.0...0.151.0) ### Release v0.151.0 #### 🚀 Features - Support custom AMIs for self-managed Windows nodegroups ([#​6804](https://togithub.com/weaveworks/eksctl/issues/6804)) - Support custom Ubuntu AMIs for EKS-managed nodegroups ([#​6850](https://togithub.com/weaveworks/eksctl/issues/6850)) #### 🎯 Improvements - Remove support for EKS 1.22 ([#​6704](https://togithub.com/weaveworks/eksctl/issues/6704)) #### 🐛 Bug Fixes - Fix error with tar in `Post Cache go-build and mod` step ([#​6840](https://togithub.com/weaveworks/eksctl/issues/6840)) - Fix setting link-time variables for release version ([#​6841](https://togithub.com/weaveworks/eksctl/issues/6841)) - Select one subnet for AZs where multiple are present and no VPC config provided ([#​6814](https://togithub.com/weaveworks/eksctl/issues/6814)) - Paginate instance type offerings response ([#​6832](https://togithub.com/weaveworks/eksctl/issues/6832)) #### 🧰 Maintenance - Bump dependencies ([#​6852](https://togithub.com/weaveworks/eksctl/issues/6852), [#​6859](https://togithub.com/weaveworks/eksctl/issues/6859)) - Cleanup Flux Integration ([#​6836](https://togithub.com/weaveworks/eksctl/issues/6836)) #### Acknowledgments Weaveworks would like to sincerely thank: [@​watany-dev](https://togithub.com/watany-dev) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on thursday" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/scottames/dots). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNy4xIiwidXBkYXRlZEluVmVyIjoiMzYuMjcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614 renovate[bot]@users.noreply.github.com>
Visualize stacked branches in the commits panel by showing a
(*)
marker for commits that are the heads of any local branches (except for the current branch, and for main branches). Since we now only do this in case the user actually creates a stack of branches, I'm hoping that it won't be confusing and we don't need a config for it.New approach based on the suggestion in #2737 (comment).
go run scripts/cheatsheet/main.go generate
)docs/Config.md
) have been updated if necessary