git: allow for creating inclusive gitignore files

This commit is contained in:
Oliver Davies 2024-02-04 23:43:42 +00:00
parent e3362270f4
commit 30942b2d95
2 changed files with 18 additions and 1 deletions

View file

@ -116,6 +116,10 @@ final class ConfigDto
new Assert\Type('bool'),
]),
'createInclusiveGitIgnoreFile' => new Assert\Optional([
new Assert\Type('bool'),
]),
'createTmuxStartupFile' => new Assert\Optional([
new Assert\Type('bool'),
]),

View file

@ -1,5 +1,6 @@
# {{ managedText|raw }}
{% if not experimental.createInclusiveGitIgnoreFile %}
.editorconfig
.env
.gitattributes
@ -44,7 +45,19 @@ docker-compose.override.yaml
{% if flake is defined %}
.dir-env/
{% endif %}
{% else %}
# Ignore everything.
*
{% for path in git.ignore %}
# Include these things:
!/{{ drupal.docroot }}/*/custom/**
{% endif %}
{% for path in git.ignore|sort %}
{{ path }}
{% endfor %}
{% if experimental.createInclusiveGitIgnoreFile %}
# Even if they are in sub-directories.
!*/
{% endif %}