Skip to content

fix(@angular/cli): disable update commit creation by default #16105

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

Merged
merged 1 commit into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/angular/cli/commands/update-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
packageName,
migrations,
migrationRange,
!options.skipCommits,
options.createCommits,
);

return success ? 0 : 1;
Expand Down Expand Up @@ -539,7 +539,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
migrateExternal: true,
});

if (success && !options.skipCommits) {
if (success && options.createCommits) {
this.createCommit('Angular CLI update\n' + packagesToUpdate.join('\n'), []);
}

Expand All @@ -558,7 +558,7 @@ export class UpdateCommand extends Command<UpdateCommandSchema> {
migration.package,
migration.collection,
new semver.Range('>' + migration.from + ' <=' + migration.to),
!options.skipCommits,
options.createCommits,
);

if (!result) {
Expand Down
4 changes: 2 additions & 2 deletions packages/angular/cli/commands/update.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"type": "boolean",
"default": false
},
"skipCommits": {
"description": "Do not create source control commits for updates and migrations.",
"createCommits": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer commitUpdates or commitChanges as I think that is more descriptive since it includes a hint at what is in the commits.

I guess the current version does hint at the fact that it might create more than a single commit.

However, as a user, I feel like 'createCommits' is more vague and will confuse many developers.

"description": "Create source control commits for updates and migrations.",
"type": "boolean",
"default": false,
"aliases": ["C"]
Expand Down