aboutsummaryrefslogtreecommitdiff
path: root/git/git-outofdate
blob: 83dc7d591dadfbe1c184f8feca471ac167ede788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

# git-uptodate

[ -z "$1" ] && { echo usage: $0 dir 1>&2; exit 1; }
find "$1" -type d -name .git |
while read -r dir; do
	(
		cd "$dir"/..
		git status -uno | sed -n '/^Your branch/{s///;p}' |
		while read -r s; do
			cd -
			printf '%s %s\n' "$(readlink -f "$dir"/..)" "$s"
			break
		done
	)
done |
grep -v 'up to date'