diff --git a/gitconfig b/gitconfig index 23734b5..8480ec6 100644 --- a/gitconfig +++ b/gitconfig @@ -16,3 +16,4 @@ gpgsign = true [alias] pushf = push --force-with-lease + lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit diff --git a/local/bin/gitfetcher b/local/bin/gitfetcher index 0b875cf..ac4d3e1 100755 --- a/local/bin/gitfetcher +++ b/local/bin/gitfetcher @@ -2,16 +2,23 @@ wd="$(pwd)" temp="$(mktemp)" +name="$(basename "$0")" find /data -name '.git' -exec dirname \{\} \; | while read gitrepo; do cd "$gitrepo" - echo "$gitrepo" - - git remote | while read remote; do - git fetch --prune "$remote" - done 2>&1 | sed 's/^/ /' - - git status | grep behind | sed 's/^/ /' + case "$name" in + "gitfetcher") + echo "$gitrepo" + git remote | while read remote; do + git fetch --prune "$remote" + done 2>&1 | sed 's/^/ /' + ;; + "gitlister") + if git status | grep -q behind; then + echo "$gitrepo" + fi + ;; + esac done cd "$wd" diff --git a/local/bin/gitlister b/local/bin/gitlister new file mode 120000 index 0000000..a4fa5b1 --- /dev/null +++ b/local/bin/gitlister @@ -0,0 +1 @@ +gitfetcher \ No newline at end of file