[TopGit PATCH] tg-info: pretty print dependencies

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[TopGit PATCH] tg-info: pretty print dependencies

Bert Wesarg
Print one dependency per line in tg-info output.

Signed-off-by: Bert Wesarg <[hidden email]>
---
 tg-info.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tg-info.sh b/tg-info.sh
index ce99809..9e09039 100644
--- a/tg-info.sh
+++ b/tg-info.sh
@@ -38,8 +38,13 @@ 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")"
-echo "Depends: $deps"
+prefix="Depends:"
+prefixlen=${#prefix}
+git cat-file blob "$name:.topdeps" 2>/dev/null |
+ while read _dep; do
+ printf "%-*s %s\n" $prefixlen "$prefix" "$_dep"
+ prefix=""
+ done
 
 depcheck="$(mktemp)"
 needs_update "$name" >"$depcheck"
--
1.5.5.GIT

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html