Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292452

Add gitignore(s) to composer-ready project templates

$
0
0

Problem/Motivation

The composer-ready project templates nearly shipped with a .gitignore that would have caused all the composer-managed files to be excluded from any git repository the owner of the new project might set up. Discussion late in #2982680: Add composer-ready project templates to Drupal core revealed that there are established and opposing schools of thought about whether vendored files should be a part of one's git repository. That .gitignore was deemed too opinionated for core, and it was just removed entirely with the creation of this follow-on issue to find a more helpful solution.

Excluding any .gitignore from the official composer-built drupal/recommended-project project template is very likely to create an immediate chore for users of it, to figure out what is an appropriate .gitignore for Drupal and get it added to their project.

We would like to provide a .gitignore starting point in our project templates for these two personas:
a) People who deploy site updates using only git, and so require all code to exist in git.
b) People who do not want large quantities of vendored code in their git repository, and develop advanced CI/build artifact systems to deploy site updates.

Proposed resolution

There is currently agreement that there are just two different .gitignore possibilities to consider, a minimal one similar to the current ./example.gitignore that excludes things like sites/*/files (but does include composer-added files), and the comprehensive .gitignore that was removed in #2982680.111.

How we provide the user with these starting-point files exactly is TBD.
We should agree on one of the below high-level resolutions and then nuance that one.

  1. Add interactivity to our composer create-project, such that users are prompted to select the .gitignore appropriate to their persona, or opt out of a .gitignore completely.
  2. Have two differently-named example.thisorthat.gitignore files, neither of which is called .gitignore at the project's starting state.
  3. Create more template project variants differentiated by this, e.g. drupal/recommended-ci-deployed-project.
  4. Have one well-documented .gitignore with a big commented-out section covering persona b)

Remaining tasks

  1. Determine high-level solution to use
  2. Do that one.
  3. We should probably also remove the extraneous ./web/example.gitignore file that currently exists in the drupal/recommended-project template as part of this .gitignore refinement work.

Viewing all articles
Browse latest Browse all 292452

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>