* [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
* Re: [PATCH] Add -v|--verbose to git remote to show remote url
2007-07-05 21:57 [PATCH] Add -v|--verbose to git remote to show remote url Alex Riesen
@ 2007-07-05 22:02 ` Alex Riesen
2007-07-05 22:10 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Alex Riesen @ 2007-07-05 22:02 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [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
* Re: [PATCH] Add -v|--verbose to git remote to show remote url
2007-07-05 22:02 ` Alex Riesen
@ 2007-07-05 22:10 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2007-07-05 22:10 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
Alex Riesen <raa.lkml@gmail.com> writes:
> 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 ;-).
^ permalink raw reply [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 21:57 [PATCH] Add -v|--verbose to git remote to show remote url Alex Riesen
2007-07-05 22:02 ` Alex Riesen
2007-07-05 22:10 ` Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2007-07-05 22:06 Alex Riesen
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).