diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2022-12-20 13:18:57 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2022-12-20 13:18:57 -0500 |
| commit | 06b36d81048a9f2a4c104cdeea64063cc0bd0b73 (patch) | |
| tree | d998f8ad5add06ef72a899d1658907fedf2d4572 | |
| parent | 27bea698bd1cd2d094301f6cd061d51b9cdae14f (diff) | |
| download | dotfiles-06b36d81048a9f2a4c104cdeea64063cc0bd0b73.tar.gz dotfiles-06b36d81048a9f2a4c104cdeea64063cc0bd0b73.tar.xz | |
Add a shell function to scan for git repos with changes
| -rw-r--r-- | kshrc | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -483,6 +483,20 @@ eval _tmux_session -s "\$session" -w "\$working_directory" -n "main" \ } +scangit() { + ref="origin/master" + while [ $# -gt 0 ] ; do case $1 in + -r) ref="$2"; shift ; shift ;; + --) break ;; + *) echo "bad option '$1' usage: scangit [-r <ref>] -- <paths>" ; return ;; + esac ; done + find "$@" -iname '.git' -type d 2>/dev/null \ + | while read -r d ; do + cd "$(dirname "$d")" + git diff-index --quiet "$ref" 2>/dev/null \ + || echo "$(dirname "$d")" + done +} gitdate() { date="" while [ $# -gt 0 ] ; do case $1 in |
