comparison .shell.d/50.git_functions.sh @ 210:0590f34b92a0

shell.d: split hg and git functions out of vcs functions
author Augie Fackler <durin42@gmail.com>
date Sun, 16 May 2010 20:43:00 -0500
parents .shell.d/50.vcs_functions.sh@9e45ac5350fd
children 0cd241f35c40
comparison
equal deleted inserted replaced
209:c28a1e2c746a 210:0590f34b92a0
1 # git utility functions
2
3 function git_next_unmerged_file() {
4 git status | egrep '(unmerged|both modified)' | head -n 1 | sed 's/.*: //'
5 }
6 alias git-next-unmerged-file=git_next_unmerged_file
7
8 function git_repack_all() {
9 for repo in $(find . | \
10 grep '/objects/pack/' | \
11 sed -e 's%\.git/objects/pack/.*%%' | \
12 sed -e 's%git/objects/pack/.*%git%' | sort | uniq) ; do
13 pushd $repo
14 git repack -ad --window 100
15 git gc --prune="`date`"
16 popd
17 done
18 }
19
20 function git_fsck_all() {
21 for repo in $(find . | \
22 grep '/objects/pack/' | \
23 sed -e 's%\.git/objects/pack/.*%%' | \
24 sed -e 's%git/objects/pack/.*%git%' | sort | uniq) ; do
25 pushd $repo
26 git fsck
27 popd
28 done
29 }