Skip to content

Commit

Permalink
adding git-find-large script
Browse files Browse the repository at this point in the history
  • Loading branch information
shapeshed committed Sep 1, 2011
1 parent 16986d5 commit 4ca6409
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bin/git-find-large
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

m http://mid.gmane.org/20090710114316.GA6880@atjola.homenet
#

usage() {
echo "usage: `basename $0` [<limit>]"
exit 1
}

limit=10
if test $# -gt 1
then
usage
elif test $# -eq 1
then
limit=$1
fi

git rev-list --all --objects |
sed -n $(git rev-list --objects --all |
cut -f1 -d' ' | git cat-file --batch-check | grep blob |
sort -n -k3 | tail -n$limit | while read hash type size;
do
echo -n "-e s/$hash/$size/p ";
done) |
sort -n -k1
8 changes: 8 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/shar
# Load other zsh config
for zsh_file ($HOME/.zsh/*.zsh) source $zsh_file

if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ]
then
STARTED_TMUX=1; export STARTED_TMUX
sleep 1
( (tmux has-session -t `hostname -s` && tmux attach-session -t `hostname-s`) || (tmux new-session -s `hostname -s`) ) && exit 0
echo "tmux failed to start"
fi

0 comments on commit 4ca6409

Please sign in to comment.