installed_progs.t: Python checks stdout too, 150 ok
[sunny256-utils.git] / git-listbundle
blob97327f6efd069d79e9866599590e8c2ce883835a
1 #!/usr/bin/env bash
3 #=======================================================================
4 # git-listbundle
5 # File ID: 8ae2b66c-fcd1-11e0-a4c9-65862771f905
6 # List all heads that the required heads of a bundle are members of.
7 # License: GNU General Public License version 2 or later.
8 #=======================================================================
10 progname=git-listbundle
11 bundle=$1
12 grepfilter=
14 listbundle() {
15 for f in $(LC_ALL=C git bundle verify $bundle | grep -$1 9999999 "^The bundle requires these" | grep -E "^[0-9a-f]{40} " | cut -f 1 -d ' '); do
16 git log -1 --format="=== %H%n %d%n %s" $f | cat
17 if test -n "$grepfilter"; then
18 git lc $f | grep $grepfilter;
19 else
20 git lc $f
22 done
25 test -z "$bundle" && { echo "Syntax: $progname bundlefile [grepfilter [...]]"; exit 1; }
26 if test -n "$2"; then
27 shift
28 for f in $*; do
29 grepfilter="$grepfilter -e $f"
30 done
32 echo ======== Included refs:
33 listbundle B
34 echo
35 echo ======== Required refs:
36 listbundle A