Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code used to extract history from BinaryBuilder.jl #1

Closed
giordano opened this issue Jun 9, 2020 · 0 comments
Closed

Code used to extract history from BinaryBuilder.jl #1

giordano opened this issue Jun 9, 2020 · 0 comments

Comments

@giordano
Copy link
Member

giordano commented Jun 9, 2020

Similarly to https://github.com/JuliaLang/Statistics.jl/issues/1, this is the script I used to extract the history of the relevant files in BinaryBuilder.jl:

#!/bin/sh

NEWPACKAGE="BinaryBuilderBase"

git clone -b master --single-branch --no-tags BinaryBuilder "${NEWPACKAGE}"
cd "${NEWPACKAGE}"

# https://ptc-it.de/move-files-to-new-repo-in-git/#
git filter-branch --prune-empty --index-filter \
    'git ls-tree -r -z --name-only --full-tree ${GIT_COMMIT} | \
     grep -z -v "Artifacts.toml" | \
     grep -z -v "src/compat.jl" | \
     grep -z -v "src/Sources.jl" | \
     grep -z -v "src/Dependencies.jl" | \
     grep -z -v "src/Prefix.jl" | \
     grep -z -v "src/Products.jl" | \
     grep -z -v "src/Platforms.jl" | \
     grep -z -v "src/Runner.jl" | \
     grep -z -v "src/Rootfs.jl" | \
     grep -z -v "src/squashfs_utils.jl" | \
     grep -z -v "src/UserNSRunner.jl" | \
     grep -z -v "src/DockerRunner.jl" | \
     grep -z -v "test/runtests.jl" | \
     grep -z -v "test/basic.jl" | \
     xargs -0 -r git rm --cached -r' -f -- --all

# https://stackoverflow.com/questions/9803294/prune-empty-merge-commits-from-history-in-git-repository
git filter-branch --prune-empty --parent-filter \
    'sed "s/-p //g" | xargs -r git show-branch --independent | sed "s/\</-p /g"'

# Squeeze repository size
# https://help.github.com/en/github/authenticating-to-github/removing-sensitive-data-from-a-repository
git for-each-ref --format="delete %(refname)" refs/original | git update-ref --stdin && \
    git reflog expire --all --expire=now && \
    git gc --prune=now --aggressive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant