|
22 | 22 | --throttle SEC Wait SEC seconds between each 'git fetch' (-f option) |
23 | 23 | -c Force color output (preserve colors when using pipes) |
24 | 24 | -d, --depth=2 Scan this many directories deep |
| 25 | + --no-depth Do not recurse into directories (incompatible with -d) |
25 | 26 | --flatten Show only one status per line |
26 | 27 |
|
27 | 28 | You can limit output with the following options: |
@@ -49,6 +50,7 @@ NO_UPSTREAM=0 |
49 | 50 | NO_UNCOMMITTED=0 |
50 | 51 | NO_UNTRACKED=0 |
51 | 52 | NO_STASHES=0 |
| 53 | +NO_DEPTH=0 |
52 | 54 | THROTTLE=0 |
53 | 55 | DEPTH=2 |
54 | 56 |
|
@@ -101,6 +103,10 @@ while [ -n "$1" ]; do |
101 | 103 | # Same as -e, but -e violates the principle of least astonishment. |
102 | 104 | EXCLUDE_OK=1 |
103 | 105 | fi |
| 106 | + if [ "$1" = "--no-depth" ]; then |
| 107 | + # Same as -e, but -e violates the principle of least astonishment. |
| 108 | + NO_DEPTH=1 |
| 109 | + fi |
104 | 110 | if [ "$1" = "--throttle" ]; then |
105 | 111 | THROTTLE="$2" |
106 | 112 | echo "$THROTTLE" | grep -E "^[0-9]+$" > /dev/null 2>&1 |
@@ -158,6 +164,13 @@ FIND_OPTS="" |
158 | 164 | if [ "$DEPTH" -ne 0 ]; then |
159 | 165 | FIND_OPTS="$FIND_OPTS -maxdepth $DEPTH" |
160 | 166 | fi |
| 167 | +if [ "$NO_DEPTH" -eq 1 ]; then |
| 168 | + # Do not recurse at all. Really, this should have been the '-d 0' option, |
| 169 | + # but that's already used for infinite recursion, and we don't want to |
| 170 | + # break backwards compatibility. |
| 171 | + FIND_OPTS="$FIND_OPTS -maxdepth 0" |
| 172 | +fi |
| 173 | + |
161 | 174 |
|
162 | 175 | # Go through positional arguments (DIRs) or '.' if no argumnets are given |
163 | 176 | for DIR in "${@:-"."}"; do |
|
0 commit comments