Skip to contentSkip to conversation

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

PATCH New Alex Riesen 1 participant 1 message 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.

---

Fixed and tested. Being used.

 git-remote.perl |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
git-remote.perl +13 -1
index b59cafd..e13d7b9 100755
@@ -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') {
Signature · 1 line
1.5.3.rc0.56.g6b87