mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 13:46:41 +00:00
feat(git): add git-largest-objects helper
This commit is contained in:
13
zsh/git.zsh
Normal file
13
zsh/git.zsh
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#
|
||||||
|
# git
|
||||||
|
#
|
||||||
|
|
||||||
|
# Stolen from: https://stackoverflow.com/a/42544963
|
||||||
|
git-largest-objects() {
|
||||||
|
git rev-list --objects --all |
|
||||||
|
git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' |
|
||||||
|
sed -n 's/^blob //p' |
|
||||||
|
sort --numeric-sort --key=2 |
|
||||||
|
cut -c 1-12,41- |
|
||||||
|
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
|
||||||
|
}
|
||||||
1
zshrc
1
zshrc
@@ -136,6 +136,7 @@ source "$DOTZSH/tmux.zsh"
|
|||||||
# Development
|
# Development
|
||||||
source "$DOTZSH/containers.zsh"
|
source "$DOTZSH/containers.zsh"
|
||||||
source "$DOTZSH/golang.zsh"
|
source "$DOTZSH/golang.zsh"
|
||||||
|
source "$DOTZSH/git.zsh"
|
||||||
source "$DOTZSH/google-cloud.zsh"
|
source "$DOTZSH/google-cloud.zsh"
|
||||||
source "$DOTZSH/kubernetes.zsh"
|
source "$DOTZSH/kubernetes.zsh"
|
||||||
source "$DOTZSH/nodejs.zsh"
|
source "$DOTZSH/nodejs.zsh"
|
||||||
|
|||||||
Reference in New Issue
Block a user