gitclone: allow to create symlink in repository after clone or pull
Add option to create symlink in repository folder after clone. This can be useful to link git submodules files/folder in their good location.
[repository-test] recipe = slapos.recipe.build:gitclone repository = https://lab.nexedi.com/nexedi/erp5.git link-list = doc-bt5/erp5_slapos_tutorial bt5/erp5_slapos_tutorial doc-bt5/erp5_slapos_tutorial_data bt5/erp5_slapos_tutorial_data
After the repository is cloned with submodule in
doc-bt5, a symlink will be created to
repository_location/bt5/erp5_slapos_tutorial in order to place
doc-bt5 business templates into
After the repository part is installed,
$ cd $repository $ git status On branch master Your branch is up to date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) bt5/erp5_slapos_tutorial bt5/erp5_slapos_tutorial_data
Why not commit the symlinks to erp5.git ?
It will not break the
bt5folder if the submodule is not pulled (in case the symlink source doesn't exists) ?
How does it break ? (just curious)
I just checked with genbt5list it's not failing to generate
bt5listif symlink source is not present. I'll commit directly the symlink to erp5.git so.
closedToggle commit list
To conclude, 2 things:
- if anything else breaks because of broken symlinks, then we should rather fix ERP5
- if we wanted this MR, .git/info/exclude should be altered to not leave such untracked files