Closed stefanhaller closed 4 months ago
Coverage variation | Diff coverage |
---|---|
Report missing for 7492521829114b935c91a4eab856a554160122bd[^1] | :white_check_mark: 93.36% |
Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more [^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.
I'm happy with the code, but I'm getting a bug when testing:
Each branch is reported as being behind the base branch, but that includes master, which is definitely not behind origin/master!
The issue went away after I removed my assets worktree (which was attached to the assets branch) and then restarted lazygit, but I don't know if simply restarting lazygit is what fixed it. I can't re-create the issue.
Each branch is reported as being behind the base branch, but that includes master, which is definitely not behind origin/master!
Wow, that's bad. I have no idea how that could happen; would have been good to debug it on your machine when it was still there. Now that it's not recreatable, I'm not sure what to do about it...
I'm not too fussed: given it's an opt-in feature I'm happy for us to merge and I'll just dig deeper next time (if) it happens
I played around with the feature and I like it. Is there any way I can get it to update after rebasing without having to restart lazygit?
https://github.com/jesseduffield/lazygit/assets/94621779/44f28005-74a5-445b-b6b3-63568956edd5
Is there any way I can get it to update after rebasing without having to restart lazygit?
If it doesn't do that automatically, that would be a bug of course. It does for me, so it would be important to figure out under what conditions it doesn't. Maybe it is related to the problem Jesse was seeing.
I'll hold off merging for now, until we know more about this. If you can do more testing and somehow narrow it down, that would be awesome.
Coverage variation | Diff coverage |
---|---|
Report missing for 7c51ec21bf0f787c6f2d0079e920f3d5f566c9f0[^1] | :white_check_mark: 93.77% |
Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more [^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.
@karimkhaleel I'd like to make progress on this, but I don't know how. From your video above, it looks like the "behind base branch" indicators are correct right after startup, but then never update again, neither when you make commits nor when you rebase a branch. Is that true, and is that always the behavior you see, or only sometimes? In all repos, or only in certain ones?
Maybe I need to add some more logging so that we can get to the bottom of this, but I'm not even sure which conditions to look for.
I did a little bit of testing, and so far I haven't been able to get it to behave correctly.
showDivergenceFromBaseBranch: arrowAndNumber
under gui
.I did some more testing, and I am seeing the same behavior again.
go version go1.22.3 linux/amd64
commit=cb0a9a732cb023f86f8fc294ca27a69cdd8cc7c5, build date=2024-06-01T17:57:24Z, build source=unknown, version=cb0a9a73, os=linux, arch=amd64, git version=2.34.1
gui:
showDivergenceFromBaseBranch: arrowAndNumber
https://github.com/jesseduffield/lazygit/assets/94621779/51945072-9649-446a-b355-ab9cf9ac0afb
Any other things I can try?
@karimkhaleel Thanks for testing again.
What a stupid bug, updating the counts just didn't work at all when local branches are sorted by recency. Since I sort my branches by date, I didn't notice.
aaa457889337 should fix it, could you test again?
@jesseduffield I'm pretty sure this was also the reason for the bug you reported above.
https://github.com/jesseduffield/lazygit/commit/aaa457889337a1eba13a4a96417761b8c065a437 should fix it, could you test again?
It works! Awesome!
I really liked this, tks for coding it
Add a new config option
showDivergenceFromBaseBranch
; if not "none", it indicates in the branches view for each branch if it has fallen behind its base branch, and optionally by how much. If set to "onlyArrow", it will append↓
after the branch status; if set to "arrowAndNumber", it appends↓17
, where the count indicates how many commits it is behind the base branch. These are colored in blue, and go after the existing yellow↓3↑7
indication of divergence from the upstream.The option is off by default, since we are afraid that people may find this too noisy. We may reconsider this choice in the future if the response is positive.
Please check if the PR fulfills these requirements
[x] Cheatsheets are up-to-date (run
go generate ./...
)[x] Code has been formatted (see here)
[x] Tests have been added/updated (see here for the integration test guide)
[x] Text is internationalised (see here)
[x] Docs have been updated if necessary
[x] You've read through your own file changes for silly mistakes etc