leftwm / leftwm-theme

A tool to help manage themes for LeftWM
BSD 3-Clause "New" or "Revised" License
120 stars 12 forks source link

Upgrade doesn't upgrade if upstream changes, but install does. #15

Closed mautamu closed 2 years ago

mautamu commented 3 years ago

You might actually be right. The submodule in the repository is always a little behind, but leftwm-theme install actually seems to pull from main, though upgrade doesn't seem to do anything.

Originally posted by @taylor85345 in https://github.com/leftwm/leftwm-community-themes/issues/21#issuecomment-886152923

taylor85345 commented 3 years ago

For context, I installed version 0.0.1 of my Garden theme on a second laptop about a week ago. I have since bumped to version 0.0.3, and when I ran leftwm-theme-upgrade it reported success but no files were upgraded.

Deleting the theme folder and re-running leftwm-theme install Garden pulled the new version of the theme.

arcolinuxz commented 3 years ago

I want to confirm this issue.

I have created now a few themes upgrade

We use an alias to upgrade the themes by the way.

The message looks promising but the new code has not been downloaded.

When I do a "git pull" in the theme directory I get my new code in.

I am assuming "upgrade" is going to do just that - a git pull.

pull

mautamu commented 2 years ago

What method do we want to use for pulls with conflicting files? It appears what's going on is closer to a git fetch than a git pull. One thing we could do I suppose is if there have been changes then just install to a new folder, or drop the user to a merge shell...

arcolinuxz commented 2 years ago

Choose a simple solution. Renaming the theme "theme(1)" is something a user recognizes. Easy for you to check. If he pulls again it will become theme(2). A small message saying you could not git pull due to conflict and the rest is up to the user. I would fire up meld and compare the two folders and merge them.

VentGrey commented 2 years ago

A good approach would be to prefer user's changes and fallback to: git pull -s recursive -X ours seems the more sensible solution for users who heavily customize their themes or create derivatives, their changes will be preserved in case there are any conflicts if they want upstream changes they can cherrypick or port them by hand, themes aren't very complicated (for now) and their codebase isn't huge.

Another thing I can think of is to ask the user before upgrading like apt does in debian (without the complicated parts ofc): image

arcolinuxz commented 2 years ago

Am I correct that leftwm-theme upgrade does not work yet? That would be now very handy with all these changes to our themes?

arcolinuxz commented 2 years ago

ArcoLinux-2022-01-15_07-55 Is this good advice? Is this correct? https://www.arcolinuxd.com/7-leftwm-code-change-of-january-2022/

mautamu commented 2 years ago

Apologies for not getting to this sooner. I think that’s the workaround for now.

I have been trying to get ventgray’s proposed behavior to work, but so far no dice.