Git filter testing demo

This commit is contained in:
ziembla
2017-11-30 12:59:26 +01:00
parent 8d16b3061d
commit 8586120c3d
2 changed files with 57 additions and 7 deletions

View File

@@ -40,9 +40,9 @@ RUN jupyter nbextension enable toc2/main
# from notebook.auth import passwd
# passwd()
# and take the hash from the output
RUN mkdir -p ${HOME}/.jupyter && \
echo 'c.NotebookApp.password = u"sha1:c6bbcba2d04b:f969e403db876dcfbe26f47affe41909bd53392e"' \
>> ${HOME}/.jupyter/jupyter_notebook_config.py
#RUN mkdir -p ${HOME}/.jupyter && \
# echo 'c.NotebookApp.password = u"sha1:c6bbcba2d04b:f969e403db876dcfbe26f47affe41909bd53392e"' \
# >> ${HOME}/.jupyter/jupyter_notebook_config.py
## INFO: Uncomment the RUN command below to disable git diff paging
RUN git config --global core.pager ''
@@ -65,13 +65,11 @@ RUN git-nbdiffdriver config --enable --global
## INFO: Optionally uncomment any (one) of the following RUN commands below to ignore either
# metadata or details in nbdiff within git diff
#RUN git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff --ignore-metadata'
RUN git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff --ignore-details'
#RUN git config --global diff.jupyternotebook.command 'git-nbdiffdriver diff --ignore-details'
##
RUN ls -l /tmp/
# INFO: Dirty nbdime patching
COPY docker/nbdime-*.patch /tmp/
RUN ls -l /tmp/
USER root
WORKDIR /
RUN patch -d /opt/conda/lib/python3.6/site-packages -p1 --forward --reject-file=- < \
@@ -86,3 +84,13 @@ WORKDIR ${workdir}
COPY docker/bashrc /tmp/bashrc
RUN cat /tmp/bashrc >> ${HOME}/.bashrc
RUN sudo rm /tmp/bashrc
# INFO: Git filter testing
COPY docker/ipynb_cleaner.py /usr/bin/ipynb_cleaner
RUN mkdir -p ~/.config/git \
&& echo '*.ipynb filter=clean_ipynb' >> ~/.config/git/attributes \
&& git config --global filter.clean_ipynb.clean ipynb_cleaner \
&& git config --global filter.clean_ipynb.smudge cat
# && git config --global filter.clean_ipynb.clean 'ipynb_cleaner %f'