-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Repository is not clean after cli/core update #14600
Comments
This is expected and intentional. The git repository has uncommitted changes. If the changes aren’t committed before the update then there would be a risk that the update may fail (or succeed but leave the application in a broken state) and there may be no easy way to revert the bad changes introduced by the update. |
FYI, there is an
|
@rodlourenco The next patch release will account for your use case and only consider files inside the Angular workspace. |
This doesn't seem to exist anymore in 8.0.0, although it's still in their documentation, |
@cjonasw it was only introduced in |
It’s also in 8.0.1+. |
I just updated to 8.1.1 from 7 and this message and stopping the update is a huge pain. Please make the need for --allow-dirty to go away. A simple message with y/n is good enough. Actually, the whole update process this time has been a train wreak of crashing updates. Not the place for that discussion here but it hasn't been this bad since RC days. |
Why is this issue closed when it's not fixed? I do not understand. |
@dcolakchile it's unclear what you mean. #14600 (comment) details how this is intended. It would be nice if there was an |
Or instead of saying "Please commit or stash any changes before updating."...which is untrue because I have nothing to commit or stash... display either how to actually resolve the issue (--allow-dirty) or where to go to find the correct information. p.s. when using --allow-dirty, it suggested I need to use --force. When --allow-dirty is used, it correctly suggests how to resolve any blockers. |
@clydin can we please reopen this and get information about the It would also be nice to add a workspace option to always allow dirty with |
The option is intentionally not mentioned as it is not the correct step to remedy the situation and should only be used in extreme situations. The proper remedy is already specified within the error message ( As to the check itself, it is based on a call to |
I have not yet encountered a situation where I want to make a commit for each migration. I generally have to run Encouraging a behavior that is an opinion of correctness is fine, but forcing a behavior that people do not want to follow is ... unfortunate. There are more than one "right" way to do most things. |
I think half the issue with this message, from what I can tell, is the use of
In my situation, there are no files to commit or stash, as all the files are untracked:
What's more, there are no untracked files (let alone modified files) in the Angular application directory. |
The check is a call to “git status —porcelain” and a filter of any files that are outside the workspace root. If git status says the repository is dirty then it is considered not clean. Doing any kind of major change in such a state is not recommended. https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitglossary.html#def_dirty |
@clydin from your link:
The working tree doesn't contain any modifications, just untracked files. Also, this doesn't really address the logic behind requiring no untracked files anywhere within the git working tree, if the Angular project is under a subdirectory. Surely the update can be performed without considering anything outside the Angular project? |
@clydin in case you were interested, this is the method I used to get the directory structure above, and to illustrate the state that the repository is in:
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
No, this issue only applies to updating from version 7 to 8.Description
I'm unable to update
@angular/material
when following the update instructions for a basic application. After updating the project withng update @angular/cli @angular/core
, I'm receiving an error when attempting to runng update @angular/material
.🔬 Minimal Reproduction
ng new update-test --routing --style scss
cd
into the app's root directory and add angular materialng add @angular/material
ng update @angular/cli @angular/core
ng update @angular/material
The error should appear after entering the command in step 5 and before the schematic executes.
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
I was able to reproduce on both Windows 10 and OS X.
The text was updated successfully, but these errors were encountered: