chiark / gitweb /
tg info: Show information about remote branches
[topgit.git] / tg-info.sh
index 21b69dc488893a4c7f4f2b2cf98f3cf39e6f4f74..72091694d89b238f21b4af8a18cf5addcc82928a 100644 (file)
@@ -38,10 +38,18 @@ echo "Base: $base_rev"
 branch_contains "$name" "$base_rev" ||
        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."
+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" || :
 if [ -n "$missing_deps" ]; then