Score:1

How to deal with config sync changing the order of lines in files causing spurious changes in source control?

fi flag

I am really enjoying Drupal 8/9's built-in config sync mechanism which allows you to export config to a directory. This makes it possible to store config in a git repo and easily deploy from dev to live from example. Amazing. Just one niggle...

When I do a config export (using drush) it often changes the order of the lines in the .yml files (in ways that don't matter) so it looks to git as though all the config has changed since the last export. This is annoying because it is hard to keep track of actual config changes in source control.

Do you have any advice on how to deal with this?

undersound avatar
lr flag
i can confirm. There is a reopened issue about this https://www.drupal.org/project/drupal/issues/3302542#comment-14800745
cn flag
Which version of drush? What platform(s)? I have had issues before when switching between Windows and macOS/linux due to line ending differences, but usually the line order shouldn't be changing-- unless you are doing a db update, which can re-arrange things, but that is a one-time thing.
ru flag
I can confirm this issue in one of my projects. Same OS, no module or code changes, and drush cim/cex between dev and stage re-arranges lines inside `filter.format.basic_html.yml` reproduceable every single time.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.