-
-
Save TeaDrivenDev/5244fe6811bf21a39492f4f5e192dc0a to your computer and use it in GitHub Desktop.
Shell script that runs the given Git command and then `git status` except for certain cases where it's not useful
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
args=("$@") | |
git "$@" | |
if [ $# -gt 0 ] | |
then | |
first=${args[0]} | |
if ([ -d .git ] | git rev-parse --git-dir > /dev/null 2>&1) && \ | |
[ ${first} != "help" ] && \ | |
[ ${first} != "status" ] && \ | |
[ ${first} != "log" ] && \ | |
([[ ${first} != "stash" ]] || [[ ${args[1]} != "pop" ]] && [[ ${args[1]} != "apply" ]]) | |
then | |
git status | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment