From bb85323f7a6ca9d5ed6acf8a6008a14d1904c8ed Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Tue, 9 Sep 2008 21:55:55 +0200 Subject: [PATCH] tg summary: Mark current branch with '>' --- README | 3 ++- tg-summary.sh | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README b/README index 9df3699..4d96dfb 100644 --- a/README +++ b/README @@ -266,7 +266,8 @@ tg remote tg summary ~~~~~~~~~~ Show overview of all TopGit-tracked topic branches and their - up-to-date status ('0' marks that it introduces no own changes, + up-to-date status ('>' marks the current topic branch, + '0' marks that it introduces no own changes, 'l'/'r' marks that it is local-only or has remote mate, 'L'/'R' marks that it is ahead/out-of-date wrt. its remote mate, 'D' marks that it is out-of-date wrt. its dependencies, diff --git a/tg-summary.sh b/tg-summary.sh index 8616d07..bb71971 100644 --- a/tg-summary.sh +++ b/tg-summary.sh @@ -11,6 +11,8 @@ if [ -n "$1" ]; then exit 1 fi +curname="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')" + ## List branches @@ -19,6 +21,8 @@ git for-each-ref refs/top-bases | name="${ref#refs/top-bases/}" missing_deps= + current=' ' + [ "$name" != "$curname" ] || current='>' nonempty=' ' ! branch_empty "$name" || nonempty='0' remote=' ' @@ -45,6 +49,6 @@ git for-each-ref refs/top-bases | subject="(No commits)" fi - printf '%s\t%-31s\t%s\n' "$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \ + printf '%s\t%-31s\t%s\n' "$current$nonempty$remote$rem_update$deps_update$deps_missing$base_update" \ "$name" "$subject" done -- 2.11.4.GIT