Skip to content

[MRG+1] CI gratuitous optimisation of doc pushing#7887

Merged
amueller merged 1 commit intoscikit-learn:masterfrom
jnothman:fast-push-doc
Nov 16, 2016
Merged

[MRG+1] CI gratuitous optimisation of doc pushing#7887
amueller merged 1 commit intoscikit-learn:masterfrom
jnothman:fast-push-doc

Conversation

@jnothman
Copy link
Copy Markdown
Member

This is completely unnecessary, but in cloning scikit-learn.github.io, I realised how much faster that can be done with a couple of flags to git.

@NelleV NelleV changed the title CI gratuitous optimisation of doc pushing [MRG+1] CI gratuitous optimisation of doc pushing Nov 16, 2016
fi
cd $DOC_REPO
git config core.sparseCheckout true
echo $dir > .git/info/sparse-checkout
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am really surprised that this should be done manually. It seems very error prone.

Are you sure that this is the right way to do a sparse checkout?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I did it this way when the only resource to ask was man. But now that I look, it does indeed seem to be the standard way to do it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After all, why put a command interface to a newline-delimited plain text file?

@amueller
Copy link
Copy Markdown
Member

LGTM

@amueller amueller merged commit 0c7ee83 into scikit-learn:master Nov 16, 2016
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
@jnothman
Copy link
Copy Markdown
Member Author

A fancier way to make scikit-learn.github.io light is to not store any documentation in the master branch, and instead store each version in another branch, linked in via git submodules. This transition can be achieved with:

git submodule init
git checkout master
git checkout -b cheap-clone master
dirs="0.15 0.16 0.17 0.18 0.19 dev"
git rm $dirs
for v in $dirs
do
    # Copy each directory into its own branch
    git checkout cheap-clone
    git branch -d -D version-$v
    git checkout --orphan version-$v
    git rm -rf * .nojekyll
    git checkout master $v
    git mv $v/{*,.[a-z]*} .
    git commit -am "Version $v"
    git push origin version-$v:version-$v
    git checkout -f cheap-clone
    git submodule add https://github.com/scikit-learn/scikit-learn.github.io/ $v
    cd $v
    git checkout version-$v
    cd ..
    git commit -am "Add version $v as submodule"
done
git push origin cheap-clone:master

Such a change is almost entirely gratuitous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants