git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add -v|--verbose to git remote to show remote url
@ 2007-07-05 22:06 Alex Riesen
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Riesen @ 2007-07-05 22:06 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Many other commands already have such an option, and I find it
practical to see where all the remotes actually come from.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

Fixed and tested. Being used.

 git-remote.perl |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index b59cafd..e13d7b9 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -319,9 +319,21 @@ sub add_usage {
 	exit(1);
 }
 
+local $VERBOSE = 0;
+@ARGV = grep {
+	if ($_ eq '-v' or $_ eq '--verbose') {
+		$VERBOSE=1;
+		0
+	} else {
+		1
+	}
+} @ARGV;
+
 if (!@ARGV) {
 	for (sort keys %$remote) {
-		print "$_\n";
+		print "$_";
+		print "\t$remote->{$_}->{URL}" if $VERBOSE;
+		print "\n";
 	}
 }
 elsif ($ARGV[0] eq 'show') {
-- 
1.5.3.rc0.56.g6b87

^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] Add -v|--verbose to git remote to show remote url
@ 2007-07-05 21:57 Alex Riesen
  2007-07-05 22:02 ` Alex Riesen
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Riesen @ 2007-07-05 21:57 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

Many other commands already have such an option, and I find it
practical to see where all the remotes actually come from.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

The $VERBOSE may be even used by some of the subcommands
later.

 git-remote.perl |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/git-remote.perl b/git-remote.perl
index b59cafd..449d97b 100755
--- a/git-remote.perl
+++ b/git-remote.perl
@@ -319,9 +319,14 @@ sub add_usage {
 	exit(1);
 }
 
+local $VERBOSE = 0;
+@ARGV = grep { $VERBOSE=1,0 if $_ eq '-v' or $_ eq '--verbose' } @ARGV;
+
 if (!@ARGV) {
 	for (sort keys %$remote) {
-		print "$_\n";
+		print "$_";
+		print "\t$remote->{$_}->{URL}" if $VERBOSE;
+		print "\n";
 	}
 }
 elsif ($ARGV[0] eq 'show') {
-- 
1.5.3.rc0.56.g6b87

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-05 22:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-05 22:06 [PATCH] Add -v|--verbose to git remote to show remote url Alex Riesen
  -- strict thread matches above, loose matches on Subject: below --
2007-07-05 21:57 Alex Riesen
2007-07-05 22:02 ` Alex Riesen
2007-07-05 22:10   ` Junio C Hamano

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 NNTP newsgroup(s).