X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=tg-info.sh;h=b5b92f654116c852ddae266cbacb08765a914dfb;hb=459c340fd5ac765ff1e5d82895b59b53b028aaca;hp=c95677f2440a90c4a945d734b977abf06cee872b;hpb=58eccfa3f1f94f5b288a561bdb5fd482471737c0;p=topgit.git diff --git a/tg-info.sh b/tg-info.sh index c95677f..b5b92f6 100644 --- a/tg-info.sh +++ b/tg-info.sh @@ -12,7 +12,7 @@ while [ -n "$1" ]; do arg="$1"; shift case "$arg" in -*) - echo "Usage: tg info [NAME]" >&2 + echo "Usage: tg [...] info [NAME]" >&2 exit 1;; *) [ -z "$name" ] || die "name already specified ($name)" @@ -28,7 +28,7 @@ measure="$(measure_branch "$name" "$base_rev")" echo "Topic Branch: $name ($measure)" if [ "$(git rev-parse --short "$name")" = "$base_rev" ]; then - echo "No commits." + echo "* No commits." exit 0 fi @@ -36,14 +36,24 @@ git cat-file blob "$name:.topmsg" | grep ^Subject: echo "Base: $base_rev" branch_contains "$name" "$base_rev" || - echo "Base is newer than head! Please run \`tg update\`." + echo "* Base is newer than head! Please run \`$tg update\`." -deps="$(git cat-file blob "$name:.topdeps" | paste -s -d' ')" -echo "Depends: $deps" +if has_remote "$name"; then + echo "Remote Mate: $base_remote/$name" + branch_contains "$base_rev" "refs/remotes/$base_remote/top-bases/$name" || + echo "* Local base is out of date wrt. the remote base." + branch_contains "$name" "refs/remotes/$base_remote/$name" || + echo "* Local head is out of date wrt. the remote head." + branch_contains "refs/remotes/$base_remote/$name" "$name" || + echo "* Local head is ahead of the remote head." +fi + +git cat-file blob "$name:.topdeps" | + sed '1{ s/^/Depends: /; n; }; s/^/ /;' -depcheck="$(mktemp)" +depcheck="$(mktemp -t tg-depcheck.XXXXXX)" missing_deps= -needs_update "$name" >"$depcheck" +needs_update "$name" >"$depcheck" || : if [ -n "$missing_deps" ]; then echo "MISSING: $missing_deps" fi