Drupal 8.8.0 introduces the Scaffold Plugin, which is used to manage files such as index.php, robots.txt and .htaccess in a Composer-managed site. The Scaffold Plugin allows for these files to be overridden or appended to using configuration in an individual Drupal site's composer.json file. However, users who are unfamiliar with these new paradigms may make modifications directly to these files. These modifications are then in danger of being overwritten the next time the scaffold operation runs, for example, after a composer install.
The Scaffold Plugin now maintains a list of all files that were scaffolded, along with a hash value of each files' contents. Prior to overwriting existing files, the Scaffold Plugin will detect modifications and warn the user of the pending action. The user is prompted and offered to either allow the files to be overwritten, or temporarily preserve the contents of the modified files, or to keep the modifications indefinitely.
As an example, if the user has modified the robots.txt file, the warning and prompt would appear as shown below:
The following managed scaffold files have been modified:
- [web-root]/robots.txt
Discard changes [y,n,k,a,?]? ?
y - discard changes and rewrite scaffold files
n - keep modified files in their current state; ask again the next time Composer runs
k - keep modified files and modify composer.json to avoid being asked again
a - abort scaffold operation
For information on how to manage scaffold modifications, see:
https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold
Discard changes [y,n,k,a,?]?
If the user selects "keep modified files", then the files thereby preserved will no longer be updated with any new changes that may be made to these files in future versions of Drupal. It will be up to the user to track and manually apply any such updates.