threads / patch / 8883

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

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

## tl;dr

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

replies: 2people: 2as markdown or json

Alex Riesen· Jul 5, 2007, 21:57 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>
---

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

 git-remote.perl |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Show changes to git-remote.perl +6 −1
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
Alex Riesen· Jul 5, 2007, 22:02 UTC · re: Alex Riesen · lore

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

Alex Riesen, Thu, Jul 05, 2007 23:57:30 +0200:
> +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.
Junio C Hamano· Jul 5, 2007, 22:10 UTC · re: Alex Riesen · lore

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

Alex Riesen <raa.lkml@gmail.com> writes:
Show 6 quoted lines
> Alex Riesen, Thu, Jul 05, 2007 23:57:30 +0200:
>> +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 ;-).

← back to recent threads