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

feat(scoop-update): Stash uncommitted changes before update #5091

Merged
merged 6 commits into from
Aug 11, 2022

Conversation

niheaven
Copy link
Member

@niheaven niheaven commented Aug 7, 2022

Description

Auto stash uncommitted changes of scoop before update.

Now the action is done in scoop core, should this be applied to buckets too?

Motivation and Context

How Has This Been Tested?

image

And this could be tested by checking out this PR, adding some dummy files in scoop dir and running scoop update.

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

@rashil2000
Copy link
Member

I think you missed the -C $currentdir flag.

But on a second note, stashing changes is an unexpected behaviour for users. I think it is just better to fail the update (and Git automatically shows the reason why the update failed). It is important to let users know they have uncommitted changes, fail gracefully, and then let the user decide whether to stash the changes themselves.

Now the action is done in scoop core, should this be applied to buckets too?

Bucket update sometimes fail due to EOL conflicts, this change will create multiple stashes there and somewhat pollute the working tree.

@niheaven
Copy link
Member Author

niheaven commented Aug 7, 2022

I'll add a config option to control it: stash, prompt, cancel.

Bucket update sometimes fail due to EOL conflicts, this change will create multiple stashes there and somewhat pollute the working tree.

Sometimes the stashes should be removed easily then git reset and bucket rm/add lol

@niheaven
Copy link
Member Author

niheaven commented Aug 8, 2022

image

Done.

libexec/scoop-update.ps1 Outdated Show resolved Hide resolved
niheaven and others added 2 commits August 8, 2022 16:36
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
@niheaven
Copy link
Member Author

Any other comments? This should be merged now.

rashil2000
rashil2000 previously approved these changes Aug 11, 2022
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