diff --git a/dotfiles/shell/aliases b/dotfiles/shell/aliases index 1a326e1..13e55b5 100644 --- a/dotfiles/shell/aliases +++ b/dotfiles/shell/aliases @@ -117,6 +117,19 @@ pull_from_repos() { cd "$start_dir" || exit 1 } +check_unpushed() { + local start_dir="$PWD" + local git_repos=($(find ~ -name .git -type d -not -path '*/.vim/*' -and -not -path '*/.local/*' -and -not -path '*/builds/*' -exec dirname {} \;)) + for repo in "${git_repos[@]}"; do + cd "$repo" || exit 1 + local unpushed=$(git log --pretty=format:'%h' '@{u}..' | wc -c) + if [ "$unpushed" -ne 0 ]; then + echo "Unpushed changes in $repo" + fi + done + cd "$start_dir" || exit 1 +} + hello() { if command -v protonvpn >/dev/null 2>&1; then sudo protonvpn c --cc NL