When working on a mono-repo where one repo contains many projects, having Flex create the .git directory is annoying as we don't need one. I think before creating the .git repo, we need to check that there no .git directory in parent directories up to the root dir. /cc @nicolas-grekas
Flex does not create the git project. Composer does.
hmm, no, I'm wrong. That's not part of the create-project logic but part of the symfony/flex recipe.
We might want to change that to run an actual git init (and have some conditions for that) instead of copying the empty git repo using the recipe.
We can but we need to figure out where to put this logic.
Right now, there is no specific logic, this is provided by a plain standard recipe.
and the drawback of this standard recipe is that this breaks the git features allowing to extend git init on your system (you can configure git to automatically enable some hooks in all repos you init for instance), because it does not init a repo but instead copies a repo which was initialized on your computer.
So I think it might be a good idea to change this to a proper git init
Maybe a new post-install-commands configurator could be used in Flex to execute some commands right after a recipe is installed, then Flex would simply have this kind of recipe:
{
"post-install-commands": [
"git init"
]
}
The only drawback is that it's not cross-platform, so we can't do something like command -v git && git init 馃槙
WDYT?
I propose to remove the creation of the Git repository. It's not worth the effort IMHO.
Most helpful comment
I propose to remove the creation of the Git repository. It's not worth the effort IMHO.