Skip to contentSkip to conversation

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

PATCH In review Alex Riesen 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add -v|--verbose to git remote to show remote url

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

---

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

 git-remote.perl |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
git-remote.perl +6 -1
index b59cafd..449d97b 100755
@@ -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') {
Signature · 1 line
1.5.3.rc0.56.g6b87
#1 lore raw

Alex Riesen, Thu, Jul 05, 2007 23:57:30 +0200:

git-remote.perl sub add_usage { · line 324

Quoted 3 lines
git-remote.perl +3 -0
+local $VERBOSE = 0;
+@ARGV = grep { $VERBOSE=1,0 if $_ eq '-v' or $_ eq '--verbose' } @ARGV;
+

Do NOT apply: this filters out _all_ of command line.

#2 lore raw
Quoted 6 lines · Alex Riesen

Alex Riesen, Thu, Jul 05, 2007 23:57:30 +0200:

git-remote.perl sub add_usage { · line 324

Quoted 3 lines
git-remote.perl +3 -0
+local $VERBOSE = 0;
+@ARGV = grep { $VERBOSE=1,0 if $_ eq '-v' or $_ eq '--verbose' } @ARGV;
+

Do NOT apply: this filters out _all_ of command line.

Heh, I was wondering what you were smoking ;-).