From db77743667b715e7324726d8ad02843a740c0118 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 28 Dec 2020 15:49:08 +0300 Subject: [PATCH] Refactor(ls-not-packed): Split into `-recursive` and `-repos` --- ls-not-packed | 12 ++---------- ls-not-packed-recursive | 8 ++++++++ ls-not-packed-repos | 7 +++++++ 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100755 ls-not-packed-recursive create mode 100755 ls-not-packed-repos diff --git a/ls-not-packed b/ls-not-packed index d01a953..f186f58 100755 --- a/ls-not-packed +++ b/ls-not-packed @@ -1,12 +1,4 @@ #! /bin/sh -COUNT_OBJ_PRG="git count-objects -v | grep ^count: | cut -c 8-" -export COUNT_OBJ_PRG - -exec "`dirname \"$0\"`"/do-all \ - 'cd "$d" && count_obj=`eval $COUNT_OBJ_PRG`; ' \ - 'if [ "$d" != "$g" ]; then' \ - 'for c in `eval git submodule foreach $COUNT_OBJ_PRG`;' \ - 'do count_obj=`expr $count_obj + $c`; done; ' \ - 'fi; ' \ - 'test $count_obj -gt 1 && echo "$d"' \ +count_obj=`git count-objects -v | grep ^count: | cut -c 8-` +echo $count_obj diff --git a/ls-not-packed-recursive b/ls-not-packed-recursive new file mode 100755 index 0000000..289bb6a --- /dev/null +++ b/ls-not-packed-recursive @@ -0,0 +1,8 @@ +#! /bin/sh + +prog_dir="`dirname \"$0\"`" && +count_obj=0 +for repo_count_obj in `"$prog_dir"/run-recursive "$prog_dir"/ls-not-packed`; do + count_obj=`expr $count_obj + $repo_count_obj` +done +if [ $count_obj -ge 1 ]; then pwd; fi diff --git a/ls-not-packed-repos b/ls-not-packed-repos new file mode 100755 index 0000000..110a702 --- /dev/null +++ b/ls-not-packed-repos @@ -0,0 +1,7 @@ +#! /bin/sh + +cd "`dirname \"$0\"`" && +prog_dir="`pwd`" && +export prog_dir + +exec "$prog_dir"/run-repos "$prog_dir"/ls-not-packed-recursive -- 2.39.2