-
Notifications
You must be signed in to change notification settings - Fork 23
Merging Easydata Changes into a Generated Project
Hackalog edited this page Mar 2, 2020
·
9 revisions
To update the cookiecutter while preserving our local changes, we need to have a branch that tracks the bare easydata template.
Usually, we create this branch when we first create the environment; e.g.
make create_environment
conda activate ${PROJECT_NAME}
git init
git add .
git commit -m 'initial import'
git branch easydata # branch for future easydata upgrades
If we didn't do this, it can still be created after the fact:
To verify that your branch does (or doesn't exist), obtain is SHA-1 hash via:
git rev-parse -q --verify easydata
If no output is given from the above , we will need to create this branch. To do so:
git branch easydata `git rev-list --max-parents=0 HEAD`
Merge the easydata changes into the easydata branch:
git checkout easydata # or git workdir ...
cd .. && cookiecutter --config-file project_dir/.cookiecutter-easydata.yml cookiecutter-easydata -f --no-input
git add -A .
git commit -m "update from cookiecutter-easydata"
Finally, merge the changes into your working branch
git checkout master
git merge easydata
This idea has been implemented in code a few different ways:
- Cookiecutter PR#1173
- https://github.com/senseyeio/cupper (based on the below)
-
https://github.com/aroig/cookiecutter-latex-paper/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/make/cookiecutter-update.py (uses
update-template target, below) -
https://github.com/aroig/cookiecutter-latex-paper/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/Makefile (see
update-templatetarget)
And see also the discussion here: https://github.com/cookiecutter/cookiecutter/issues/784