-
Notifications
You must be signed in to change notification settings - Fork 946
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
Remove .git folder from modules and themes development branches #223
Comments
Actually you shouldn't commit these contrib modules (thats why they are inside the .gitignore). If you really need them, you could implement a post-update-command for your project, but I don't think it should be the default. |
Unfortunately, some hosting providers (like Acquia) seem to require git deployments. Because of the git metadata, those packages can't be added for the deployment, even with For our Composer-managed, Acquia-hosted projects, we're removing the folders only on our CI server. |
@PatrickBauer Ah your right. I noticed this in a project where we deviated from the default behaviour and actually committed all composer dependencies. That case looks like @fafnirical with Acquia, because a Composer deployment isn't supported. So I am with @PatrickBauer that this feature-request should not be default. How do you think about this? |
Quick question what workflow is 'ideal' in regards custom modules /
themes. most shops / projects in the past just keep everything in one
huge repo. With divesting of contrib libraries / projects, is it better
to keep those custom projects in smaller repos with a central one that
references them via composer or ?
…On 12/1/16 4:43 PM, Niels de Feyter wrote:
@PatrickBauer <https://github.com/PatrickBauer> Ah your right. I
noticed this in a project where we deviated from the default behaviour
and actually committed all composer dependencies.
That case looks like @fafnirical <https://github.com/fafnirical> with
Acquia, because a Composer deployment isn't supported.
We remove the .git directories for submodules manually before committing.
So I am with @PatrickBauer <https://github.com/PatrickBauer> that this
feature-request should not be default.
Additionally; if we do create this feature, I guess it should be
extended to all composer dependencies, not limited the drupal
modules/themes.
How do you think about this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#223 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACA0jSPElbfgBwzb0OWCQixCReIJzd6Wks5rDoiYgaJpZM4LAMOE>.
|
@cmcintosh Hard to say if there is an 'ideal' workflow. But I guess it is safe to say that a lot of projects are moving from 'one big file dump' (ftp) to 'big file dump in version control' (git) to 'only saving meta-data about dependencies'. In Drupal-land the latter was previously managed with 'drush make', and that is going towards 'composer'. A big plus for this workflow is that the dependency-management tool (composer, npm, bundler) takes care of updating your dependencies and patches. It makes maintenance easier when a project evolves. In reality, as @fafnirical said, not all hosting providers support all workflows. So that is something to consider too. |
We're currently wedded to a monolithic repo method so to handle development modules with git directories we just remove them with an additional function in scripts/composer/ScriptHandler.php
This gets called in our composer.json in
It's a bit brutal but it works. One side effect is that when you composer update a development module it will complain but you can just hit return to force update it. |
The snippet looks good, thanks for sharing. 👍 |
Thank you :) 👍 using .... |
Another way to bypass that warning is to add --no-interaction option. |
👍 |
You do not need to create a function and call it to remove the .git folder.
|
When requiring a development branch of a Drupal module or theme, the repository will be downloaded as git repository.
Example
composer require drupal/paragraphs:1.x-dev
composer install
Result
web/modules/contrib/paragraphs/.git/...
web/modules/contrib/paragraphs/paragraphs.info.yml
Can we add a post-install-cmd and post-update-cmd event that removes these .git folders?
The text was updated successfully, but these errors were encountered: