Skip to content

Instantly share code, notes, and snippets.

@jirikuncar
Last active January 15, 2020 10:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jirikuncar/654560a5e4f5498ffa4f to your computer and use it in GitHub Desktop.
Save jirikuncar/654560a5e4f5498ffa4f to your computer and use it in GitHub Desktop.
Module separation
git clone https://github.com/inveniosoftware/invenio-$PACKAGE
cd invenio-$PACKAGE/
git remote add invenio https://github.com/inveniosoftware/invenio
git fetch invenio
git checkout -b master invenio/master
git log --follow invenio/modules/$PACKAGE/models.py
git log --stat --follow invenio/modules/$PACKAGE/models.py
git checkout -b rename fe01274ee7afa8025ae5bfea88eb231dd299637a
git checkout -b pre-rename rename~
git filter-branch -f --subdirectory-filter modules/$LEGACY/
mkdir .git/info
echo `git rev-parse rename` `git rev-parse pre-rename` > .git/info/grafts
git checkout master
git filter-branch -f --subdirectory-filter invenio/modules/$PACKAGE/ master ^pre-rename
# use Cookie Cutter to generate new module `invenio-$PACKAGE`
mkdir invenio_$PACKAGE
git mv *.py invenio_$PACKAGE/
git mv templates invenio_$PACKAGE/
git mv upgrades invenio_$PACKAGE/
git mv static invenio_$PACKAGE/
git mv testsuite/ tests
git rm -rf tests/__init__.py
git log --format='- %an <%ae>' | sort -u >> AUTHORS.rst
git add AUTHORS.rst
for t in `git tag -l`; do git tag -d $t; done
mkdir invenio_$PACKAGE/translations
python setup.py extract_messages
python setup.py init_catalog -l es
python setup.py init_catalog -l it
python setup.py init_catalog -l fr
python setup.py init_catalog -l de
check-manifest -c
git add MANIFEST.in
git commit -a -m 'global: initial package separation' -s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment