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

[Bug] error: cannot pull with rebase: You have unstaged changes. #3692

Closed
miniyou opened this issue Jun 21, 2022 · 4 comments · Fixed by #3693
Closed

[Bug] error: cannot pull with rebase: You have unstaged changes. #3692

miniyou opened this issue Jun 21, 2022 · 4 comments · Fixed by #3693
Labels
bug Something isn't working

Comments

@miniyou
Copy link

miniyou commented Jun 21, 2022

Bug Report

Current Behavior

Sometimes, there will be some change in the working directory of a bucket repository. That blocks bucket updates.

Furthermore, the green text says Scoop was updated successfully! which I'm not sure I agree with.

Expected Behavior

As I understand it, the bucket repositories aren't meant for interaction so updating should be more forceful and discard local changes without asking.

Additional context/output

It can look like this (don't mind the “unsafe repository” stuff):

image

In this case, it was caused by these files:

image

But I think I've seen others as well previously.

Possible Solution

  • git reset --hard first. I think there are edge cases where this is still problematic, like when there are path name collisions due to case insensitivity on Windows.
  • use git fetch && git checkout -f origin/master or similar (relies on knowing which branch we want though)

System details

Windows version: 10

OS architecture: 64bit

PowerShell version: 7.2.4

Additional software: git version 2.36.1.windows.1

Scoop Configuration

{
  "lastupdate": "2022-06-21T08:15:59.0239435+02:00",
  "SCOOP_REPO": "https://github.com/lukesampson/scoop",
  "SCOOP_BRANCH": "master",
  "show_update_log": false
}
@miniyou miniyou added the bug Something isn't working label Jun 21, 2022
@rashil2000 rashil2000 transferred this issue from ScoopInstaller/Scoop Jun 21, 2022
@rashil2000
Copy link
Member

Pushed a fix for this. Please run this:

scoop bucket rm main
scoop bucket add main

@miniyou
Copy link
Author

miniyou commented Jun 21, 2022

  1. Do you think it would make sense to clean all changes from the worktree to prevent the issue altogether? Is there a reason against it, or did you just prefer the current fix?

I prefer the current fix, it would be a lot of work to rebase all commits in the repo

  1. Do you have a comment on Scoop was updated successfully! despite failure to update the bucket? That doesn't seem to be working as intended to me 🤔

That message is for Scoop itself - it doesn't indicate about buckets

@miniyou
Copy link
Author

miniyou commented Jun 23, 2022

@rashil2000

  1. Do you think it would make sense to clean all changes from the worktree to prevent the issue altogether? Is there a reason against it, or did you just prefer the current fix?

I prefer the current fix, it would be a lot of work to rebase all commits in the repo

Hmm, I don't think we're on the same page. See my suggestion in the OP: let the installer git reset --hard or similar when updating a bucket. That would prevent the entire class of issues across all buckets.

  1. Do you have a comment on Scoop was updated successfully! despite failure to update the bucket? That doesn't seem to be working as intended to me 🤔

That message is for Scoop itself - it doesn't indicate about buckets

I see. As a user, I find it a bit confusing. The bucket updates look like intermediate steps to a single successful update, so it's unexpected to see a success message right under an error message.

I think such an error can easily go undetected by a user, do you agree? Especially if they use the default where the error may be several pages up before a bunch of git log output (from other buckets).

I'm not trying to be difficult here; I'm just striving for great UX so I'm curious about the stance of the maintainers 🙂

@rashil2000
Copy link
Member

Hmm, I don't think we're on the same page. See my suggestion in the OP: let the installer git reset --hard or similar when updating a bucket. That would prevent the entire class of issues across all buckets.

I hear you, but we don't see this problem very often. If there are more reports, we will see if git reset can be used (otherwise the command overhead would not be justified).

I see. As a user, I find it a bit confusing. The bucket updates look like intermediate steps to a single successful update, so it's unexpected to see a success message right under an error message.

I think such an error can easily go undetected by a user, do you agree? Especially if they use the default where the error may be several pages up before a bunch of git log output (from other buckets).

I'm not trying to be difficult here; I'm just striving for great UX so I'm curious about the stance of the maintainers 🙂

Could you please post your feedback here in this discussion? - ScoopInstaller/Scoop#4675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants