drupal-contributions
drupal-contributions copied to clipboard
After 'lando rebuild -y' git status shows changes
Hello. I've been trying out this tool and I notice that when I go to the web
directory after lando rebuild -y
and run git status
, that I am seeing the following output:
modified: composer.json
modified: composer.lock
modified: composer/Metapackage/CoreRecommended/composer.json
modified: composer/Metapackage/PinnedDevDependencies/composer.json
If you are careful with running your git commands you can avoid any issues, but it also makes it more likely that someone (me) is going to make a mistake by running git -am
at some point.
I'm just wondering if it is possible to resolve this? Thanks!
It's because Drush is added with Composer and composer run-script drupal-phpunit-upgrade
is run: https://github.com/thinktandem/drupal-contributions/blob/9.x/.lando.yml#L16
See also #35.
I have created a PR (#41) which removes composer run-script drupal-phpunit-upgrade
in Drupal 9, since it is not necessary. If you remove Drush, Git is back at the starting point.
To try it out, pull down and check out the PR :
$ git clone [email protected]:thinktandem/drupal-contributions.git && cd drupal-contributions
$ git fetch origin pull/41/head:testing_pr_41
$ git checkout testing_pr_41
$ lando rebuild -y
Remove Drush and see that Git status is unchanged:
$ cd web
$ composer remove drush/drush
[...]
$ git status
On branch 9.2.x
Your branch is up to date with 'origin/9.2.x'.
nothing to commit, working tree clean
Although #41 was merged this still seems to be happening. I set up this project yesterday following the README instructions and still end up with those modifications --
> git status
On branch 9.3.x
Your branch is up to date with 'origin/9.3.x'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: composer.json
modified: composer.lock
modified: composer/Metapackage/CoreRecommended/composer.json
modified: composer/Metapackage/PinnedDevDependencies/composer.json
The composer run-script drupal-phpunit-upgrade
command added a lot of extra changes in composer.json
and composer.lock
, and #41 took care of that bit.
However, you still need to remove Drush as outlined above, to get to a clean Git status.
Got it. Thanks, @gitressa. That worked. 👍
Sounds good @cdubz, feel free to also check out #35, where the Git issue might get figured out -- or perhaps in this issue?
It would be great if Drush could get added, without touching the four .json
and .lock
files, I wonder if that's possible?
@pyrello @gitressa @cdubz I didn't test this, but maybe here: https://github.com/thinktandem/drupal-contributions/blob/9.x/.lando.yml#L14
we could:
run:
- cd /app/web && composer require drush/drush && composer install
- git checkout composer.json composer.lock
- mkdir -p private/browsertest_output
- yarn install --non-interactive --cwd /app/web/core
i think drush would still work and the git tree would be clean, but I did not test it.
I've recently opened a MR with your solution @serundeputy, testing here it looks like it fixes, it would be nice to have a review there. #58