git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
Cc: git@vger.kernel.org, pasky@suse.cz,
	martin f krafft <madduck@madduck.net>,
	Bert Wesarg <bert.wesarg@googlemail.com>
Subject: [TopGit PATCH 3/4] tg-prev/tg-next: --all option
Date: Tue,  5 Oct 2010 00:28:19 +0200	[thread overview]
Message-ID: <1286231300-29268-3-git-send-email-bert.wesarg@googlemail.com> (raw)
In-Reply-To: <1286231300-29268-2-git-send-email-bert.wesarg@googlemail.com>

This adds an --all option to tg-prev and tg-next, to show all offenders.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>


---

Note the dependency on bw/tred is only historical, it depends only bw/fan-in-out.

 README                     |    2 ++
 contrib/tg-completion.bash |    2 ++
 tg-next.sh                 |   11 ++++++++++-
 tg-prev.sh                 |   11 ++++++++++-
 4 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 49f7b10..b1dc45a 100644 README
--- a/README
+++ b/README
@@ -573,6 +573,7 @@ tg prev
 	Options:
 	  -i		show dependencies based on index instead of branch
 	  -w		show dependencies based on working tree instead of branch
+	 --all		show not only the direct but all dependencies
 
 tg next
 ~~~~~~~
@@ -582,6 +583,7 @@ tg next
 	Options:
 	  -i		show dependencies based on index instead of branch
 	  -w		show dependencies based on working tree instead of branch
+	 --all		show not only the direct but all dependencies
 
 TODO: tg rename
 
diff --git a/contrib/tg-completion.bash b/contrib/tg-completion.bash
index d319828..d18f564 100755 contrib/tg-completion.bash
--- a/contrib/tg-completion.bash
+++ b/contrib/tg-completion.bash
@@ -475,6 +475,7 @@ _tg_next ()
 	case "$cur" in
 	-*)
 		__tgcomp "
+			--all
 			-i
 			-w
 		"
@@ -491,6 +492,7 @@ _tg_prev ()
 	case "$cur" in
 	-*)
 		__tgcomp "
+			--all
 			-i
 			-w
 		"
diff --git a/tg-next.sh b/tg-next.sh
index 9b352b3..abb9a53 100644 tg-next.sh
--- a/tg-next.sh
+++ b/tg-next.sh
@@ -5,6 +5,7 @@
 # GPLv2
 
 name=
+all=false
 head_deps=
 
 
@@ -17,8 +18,10 @@ while [ -n "$1" ]; do
 		head_deps='(i)';;
 	-w)
 		head_deps='(w)';;
+	--all)
+		all=true;;
 	-*)
-		echo "Usage: tg next [-i | -w] [NAME]" >&2
+		echo "Usage: tg next [--all] [-i | -w] [NAME]" >&2
 		exit 1;;
 	*)
 		[ -z "$name" ] || die "name already specified ($name)"
@@ -29,6 +32,12 @@ done
 head="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
 [ -n "$name" ] || name=$head
 
+if $all; then
+	# ignore first line, which is $name
+	list_fan_in "$name" $head_deps | tail --lines=+2
+	exit $?
+fi
+
 git for-each-ref --format='%(refname)' refs/top-bases |
 	while read ref; do
 		parent="${ref#refs/top-bases/}"
diff --git a/tg-prev.sh b/tg-prev.sh
index efef410..63f71bd 100644 tg-prev.sh
--- a/tg-prev.sh
+++ b/tg-prev.sh
@@ -5,6 +5,7 @@
 # GPLv2
 
 name=
+all=false
 head_deps=
 
 
@@ -17,8 +18,10 @@ while [ -n "$1" ]; do
 		head_deps='(i)';;
 	-w)
 		head_deps='(w)';;
+	--all)
+		all=true;;
 	-*)
-		echo "Usage: tg next [-i | -w] [NAME]" >&2
+		echo "Usage: tg next [--all] [-i | -w] [NAME]" >&2
 		exit 1;;
 	*)
 		[ -z "$name" ] || die "name already specified ($name)"
@@ -31,6 +34,12 @@ head="$(git symbolic-ref HEAD | sed 's#^refs/\(heads\|top-bases\)/##')"
 base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
 	die "not a TopGit-controlled branch"
 
+if $all; then
+	# ignore first line, which is $name
+	list_fan_out "$name" $head_deps | tail --lines=+2
+	exit $?
+fi
+
 deps_src=$name
 # select .topdeps source for HEAD branch
 [ "x$name" = "x$head" -a -n "$head_deps" ] &&
-- 
tg: (bf1dfaa..) bw/next-prev (depends on: bw/tred bw/next-prev-base)

  reply	other threads:[~2010-10-04 22:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 22:28 [TopGit PATCH 1/4] provide fan-in and -out traversal interface Bert Wesarg
2010-10-04 22:28 ` [TopGit PATCH 2/4] tg-depend: reduce: apply transitive reduction to the dependecies Bert Wesarg
2010-10-04 22:28   ` Bert Wesarg [this message]
2010-10-04 22:28     ` [TopGit PATCH v4 4/4] tg-graph: print dependency graph like git log --graph Bert Wesarg
2010-10-05  7:13 ` [TopGit PATCH 1/4] provide fan-in and -out traversal interface Uwe Kleine-König
2010-10-05  7:54   ` Bert Wesarg
2010-10-05 19:31     ` [TopGit PATCH v2] " Bert Wesarg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286231300-29268-3-git-send-email-bert.wesarg@googlemail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=madduck@madduck.net \
    --cc=pasky@suse.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).