Skip to content
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

fix(git): local plugin fixes #1624

Merged
merged 2 commits into from
Jul 7, 2024
Merged

Conversation

AThePeanut4
Copy link
Contributor

Description

As I described in #1512 (comment), this makes it so that local plugins will only show as needing updates if the local branch is behind the upstream branch. This is done by checking the output of the git log command, and only setting plugin._.updates if the output is not empty.

This seems to solve my issue where local plugins with unpushed changes always show as needing updates, but if there's a easier/better way of doing it then please feel free to edit/close this. Or if you don't agree that the current behaviour is a bug, then that's also fine - it's not a big deal and I can easily just ignore the "updates available" notice.

I also came across a minor issue where the plugin diff view (press d) compares the wrong commits for local plugins, because lua/lazy/view/init.lua always uses get_target. I fixed this by moving get_local_target into get_target - I think this is simpler and more straightforward than the alternative of adding a ternary everywhere get_target is called.

This second bugfix is a very small change, so I've just included it here, but I'm happy to make a second PR if you'd like.

Related Issue(s)

Related PR: #1512

@folke folke merged commit 72c0dc9 into folke:main Jul 7, 2024
9 checks passed
@folke
Copy link
Owner

folke commented Jul 7, 2024

That's a better way indeed. ty!

@AThePeanut4 AThePeanut4 deleted the local-plugin-updates branch July 7, 2024 15:30
folke pushed a commit that referenced this pull request Jul 7, 2024
🤖 I have created a release *beep* *boop*
---


##
[11.10.3](v11.10.2...v11.10.3)
(2024-07-07)


### Bug Fixes

* **git:** local plugin fixes
([#1624](#1624))
([72c0dc9](72c0dc9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants