Skip to content

Instantly share code, notes, and snippets.

@Enlik
Created September 25, 2011 16:26
Show Gist options
  • Save Enlik/1240794 to your computer and use it in GitHub Desktop.
Save Enlik/1240794 to your computer and use it in GitHub Desktop.
idea of a helper script for Sabayon overlay splitting
#!/bin/bash
# What to remove from sabayon-distro overlay?
# Stuff useful for Gentoo users listed here.
# Remove Sabayon modified ebuilds from this list.
# <slawomir.nizio at sabayon.org>
what=(
app-admin
# etc
x11-plugins
x11-themes/cairo-dock-themes
x11-themes/equinox-themes
x11-wm
)
# Usage of "${what[*]}" is correct here.
_echo_exec() { echo -n "execute: "; printf '[%s]' "$@"; echo; }
_echo_exec git filter-branch --prune-empty --index-filter "git rm --cached --ignore-unmatch -r ${what[*]}" HEAD
echo press enter if ok
read x
git filter-branch --prune-empty --index-filter "git rm --cached --ignore-unmatch -r ${what[*]}" HEAD
echo cleanup, rm ref? press enter twice if ok
read x
read x
set -x
git remote rm origin
git update-ref -d refs/original/refs/heads/master
git reflog expire --expire=now --all
git gc --prune=now
set +x
echo end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment