Skip to content

Commit f14d986

Browse files
authored
Document faster operations for staging changes after running migrations. (#7560)
This has significant speed improvements on large codebases by reducing the files scanned to just those with changes.
1 parent 924e9e5 commit f14d986

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

polaris-migrator/README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,23 @@ polaris-migrator: Unable to migrate the following expression. Please upgrade man
363363
After applying a migration, it might be helpful to commit the changes that do not need a manual check from those that do. You can do this a few different ways, but we suggest staging all your changes, then unstaging those that include the manual check comment:
364364

365365
```sh
366-
# Stage all modified files
366+
# Stash files with "polaris-migrator:" comments
367+
git stash push $(grep -r -l "polaris-migrator:" $(git ls-files -m))
368+
369+
# Stage all files without "polaris-migrator:" comments
367370
git add .
368371

369-
# Unstage those that contain the manual check comment prefixed with "polaris-migrator:"
370-
git reset $(grep -r -l "polaris-migrator:")
372+
# Bring back the change with "polaris-migrator:" comments
373+
git stash pop
374+
375+
# (optional) if there a files that have both "polaris-migrator:" comments
376+
# _and_ complete fixes, add the complete fixes now
377+
git add -p
378+
379+
# Commit all the complete fixes:
380+
git commit
381+
382+
# Now you're left with changes that have "polaris-migrator:" comments only
371383
```
372384

373385
### Resources

0 commit comments

Comments
 (0)