threads / patch / 8884

patchAdd -v|--verbose to git remote to show remote url

Subject: [PATCH] Add -v|--verbose to git remote to show remote url

## tl;dr

One message between Jul 5, 2007 and Jul 5, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Alex Riesen· Jul 5, 2007, 22:06 UTC · lore

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(-)
Show changes to git-remote.perl +13 −1
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

← back to recent threads