Mercurial > dotfiles
view .shell.d/50.git_functions.sh @ 262:3350b219b653
wcroot: use git to directly find repo root.
git cleverly hides this under git-rev-parse, which isn't a place I'd
have ever thought to look. Thanks to Jacob Lee for the tip.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Fri, 17 Jun 2011 09:46:17 -0500 |
parents | 0cd241f35c40 |
children |
line wrap: on
line source
# git utility functions function git_next_unmerged_file() { git status | egrep '(unmerged|both modified)' | head -n 1 | sed 's/.*: //' } alias git-next-unmerged-file=git_next_unmerged_file function git_repack_all() { for repo in $(find . | \ grep '/objects/pack/' | \ sed -e 's%\.git/objects/pack/.*%%' | \ sed -e 's%git/objects/pack/.*%git%' | sort | uniq) ; do pushd $repo git repack -ad --window 100 git gc --prune="`date`" popd done } alias git-repack-all=git_repack_all function git_fsck_all() { for repo in $(find . | \ grep '/objects/pack/' | \ sed -e 's%\.git/objects/pack/.*%%' | \ sed -e 's%git/objects/pack/.*%git%' | sort | uniq) ; do pushd $repo git fsck popd done } alias git-fsck-all=git_fsck_all