# [PATCH] git-svn: don't output git commits in quiet mode

6 messages from 2009-03-29 to 2009-04-02. Participants: Simon Arlott, Eric Wong, Junio C Hamano.
Thread: https://gitlist.dev/t/18619

## Simon Arlott, 2009-03-29 19:34

Subject: [PATCH] git-svn: don't output git commits in quiet mode
Message-ID: <49CFCD5A.1080801@simon.arlott.org.uk>
URL: https://gitlist.dev/e/49CFCD5A.1080801%40simon.arlott.org.uk

```
Ideally only errors should be output in this mode so fetch
can be run from cron and normally produce no output. Without
this change it would output a single line on each git commit,
e.g.
r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
 git-svn.perl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 8be6be0..e100b69 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2331,13 +2331,13 @@ sub do_git_commit {
 
 	$self->{last_rev} = $log_entry->{revision};
 	$self->{last_commit} = $commit;
-	print "r$log_entry->{revision}";
+	print "r$log_entry->{revision}" unless $::_q;
 	if (defined $log_entry->{svm_revision}) {
-		 print " (\@$log_entry->{svm_revision})";
+		 print " (\@$log_entry->{svm_revision})" unless $::_q;
 		 $self->rev_map_set($log_entry->{svm_revision}, $commit,
 		                   0, $self->svm_uuid);
 	}
-	print " = $commit ($self->{ref_id})\n";
+	print " = $commit ($self->{ref_id})\n" unless $::_q;
 	if (--$_gc_nr == 0) {
 		$_gc_nr = $_gc_period;
 		gc();
-- 
1.6.2

-- 
Simon Arlott

```

## Eric Wong, 2009-03-29 22:43

Subject: Re: [PATCH] git-svn: don't output git commits in quiet mode
Message-ID: <20090329224324.GB20675@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20090329224324.GB20675%40dcvr.yhbt.net
In-Reply-To: <49CFCD5A.1080801@simon.arlott.org.uk>

```
Simon Arlott <simon@fire.lp0.eu> wrote:
> Ideally only errors should be output in this mode so fetch
> can be run from cron and normally produce no output. Without
> this change it would output a single line on each git commit,
> e.g.
> r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)
> 
> Signed-off-by: Simon Arlott <simon@fire.lp0.eu>

Thanks Simon,

Acked-by: Eric Wong <normalperson@yhbt.net>

and pushed to git://git.bogomips.org/git-svn

> ---
>  git-svn.perl |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 8be6be0..e100b69 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -2331,13 +2331,13 @@ sub do_git_commit {
>  
>  	$self->{last_rev} = $log_entry->{revision};
>  	$self->{last_commit} = $commit;
> -	print "r$log_entry->{revision}";
> +	print "r$log_entry->{revision}" unless $::_q;
>  	if (defined $log_entry->{svm_revision}) {
> -		 print " (\@$log_entry->{svm_revision})";
> +		 print " (\@$log_entry->{svm_revision})" unless $::_q;
>  		 $self->rev_map_set($log_entry->{svm_revision}, $commit,
>  		                   0, $self->svm_uuid);
>  	}
> -	print " = $commit ($self->{ref_id})\n";
> +	print " = $commit ($self->{ref_id})\n" unless $::_q;
>  	if (--$_gc_nr == 0) {
>  		$_gc_nr = $_gc_period;
>  		gc();
> -- 
> 1.6.2

```

## Junio C Hamano, 2009-03-30 06:44

Subject: Re: [PATCH] git-svn: don't output git commits in quiet mode
Message-ID: <7vvdprjyrc.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vvdprjyrc.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20090329224324.GB20675@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

> Simon Arlott <simon@fire.lp0.eu> wrote:
>> Ideally only errors should be output in this mode so fetch
>> can be run from cron and normally produce no output. Without
>> this change it would output a single line on each git commit,
>> e.g.
>> r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)
>> 
>> Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
>
> Thanks Simon,
>
> Acked-by: Eric Wong <normalperson@yhbt.net>
>
> and pushed to git://git.bogomips.org/git-svn

... and pulled from there.  Thanks, both.

```

## Simon Arlott, 2009-03-30 18:31

Subject: [PATCH] git-svn: add a double quiet option to hide git commits
Message-ID: <49D1100D.8010206@simon.arlott.org.uk>
URL: https://gitlist.dev/e/49D1100D.8010206%40simon.arlott.org.uk
In-Reply-To: <7vvdprjyrc.fsf@gitster.siamese.dyndns.org>

```
People may expect/prefer -q to still show git commits,
so this change allows a second -q to hide them.

Signed-off-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
---
On 30/03/09 07:44, Junio C Hamano wrote:
> Eric Wong <normalperson@yhbt.net> writes:
>> Simon Arlott <simon@fire.lp0.eu> wrote:
>>> Ideally only errors should be output in this mode so fetch
>>> can be run from cron and normally produce no output. Without
>>> this change it would output a single line on each git commit,
>>> e.g.
>>> r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)

 Documentation/git-svn.txt |    3 ++-
 git-svn.perl              |    9 +++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index cda3389..8163a19 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -385,7 +385,8 @@ config key: svn.authorsfile
 
 -q::
 --quiet::
-	Make 'git-svn' less verbose.
+	Make 'git-svn' less verbose. Specify a second time to make it
+	even less verbose.
 
 --repack[=<n>]::
 --repack-flags=<flags>::
diff --git a/git-svn.perl b/git-svn.perl
index e5c3dfe..d919798 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -68,6 +68,7 @@ my ($_stdin, $_help, $_edit,
 	$_prefix, $_no_checkout, $_url, $_verbose,
 	$_git_format, $_commit_url, $_tag);
 $Git::SVN::_follow_parent = 1;
+$_q ||= 0;
 my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
                     'config-dir=s' => \$Git::SVN::Ra::config_dir,
                     'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
@@ -80,7 +81,7 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
 		'useSvnsyncProps' => \$Git::SVN::_use_svnsync_props,
 		'log-window-size=i' => \$Git::SVN::Ra::_log_window_size,
 		'no-checkout' => \$_no_checkout,
-		'quiet|q' => \$_q,
+		'quiet|q+' => \$_q,
 		'repack-flags|repack-args|repack-opts=s' =>
 		   \$Git::SVN::_repack_flags,
 		'use-log-author' => \$Git::SVN::_use_log_author,
@@ -2331,13 +2332,13 @@ sub do_git_commit {
 
 	$self->{last_rev} = $log_entry->{revision};
 	$self->{last_commit} = $commit;
-	print "r$log_entry->{revision}" unless $::_q;
+	print "r$log_entry->{revision}" unless $::_q > 1;
 	if (defined $log_entry->{svm_revision}) {
-		 print " (\@$log_entry->{svm_revision})" unless $::_q;
+		 print " (\@$log_entry->{svm_revision})" unless $::_q > 1;
 		 $self->rev_map_set($log_entry->{svm_revision}, $commit,
 		                   0, $self->svm_uuid);
 	}
-	print " = $commit ($self->{ref_id})\n" unless $::_q;
+	print " = $commit ($self->{ref_id})\n" unless $::_q > 1;
 	if (--$_gc_nr == 0) {
 		$_gc_nr = $_gc_period;
 		gc();
-- 
1.6.2
-- 
Simon Arlott

```

## Eric Wong, 2009-03-31 06:52

Subject: Re: [PATCH] git-svn: add a double quiet option to hide git commits
Message-ID: <20090331065231.GA32142@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20090331065231.GA32142%40dcvr.yhbt.net
In-Reply-To: <49D1100D.8010206@simon.arlott.org.uk>

```
Simon Arlott <simon@fire.lp0.eu> wrote:
> People may expect/prefer -q to still show git commits,
> so this change allows a second -q to hide them.
> 
> Signed-off-by: Michael Poole <mdpoole@troilus.org>
> Signed-off-by: Simon Arlott <simon@fire.lp0.eu>

Thanks,
  Acked-by: Eric Wong <normalperson@yhbt.net>
and pushed out to git://git.bogomips.org/git-svn

> ---
> On 30/03/09 07:44, Junio C Hamano wrote:
> > Eric Wong <normalperson@yhbt.net> writes:
> >> Simon Arlott <simon@fire.lp0.eu> wrote:
> >>> Ideally only errors should be output in this mode so fetch
> >>> can be run from cron and normally produce no output. Without
> >>> this change it would output a single line on each git commit,
> >>> e.g.
> >>> r1909 = 32ef87860662526d4a62f903949ed21e0341079e (u2_10_12_branch)
> 
>  Documentation/git-svn.txt |    3 ++-
>  git-svn.perl              |    9 +++++----
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index cda3389..8163a19 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -385,7 +385,8 @@ config key: svn.authorsfile
>  
>  -q::
>  --quiet::
> -	Make 'git-svn' less verbose.
> +	Make 'git-svn' less verbose. Specify a second time to make it
> +	even less verbose.
>  
>  --repack[=<n>]::
>  --repack-flags=<flags>::
> diff --git a/git-svn.perl b/git-svn.perl
> index e5c3dfe..d919798 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -68,6 +68,7 @@ my ($_stdin, $_help, $_edit,
>  	$_prefix, $_no_checkout, $_url, $_verbose,
>  	$_git_format, $_commit_url, $_tag);
>  $Git::SVN::_follow_parent = 1;
> +$_q ||= 0;
>  my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
>                      'config-dir=s' => \$Git::SVN::Ra::config_dir,
>                      'no-auth-cache' => \$Git::SVN::Prompt::_no_auth_cache,
> @@ -80,7 +81,7 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
>  		'useSvnsyncProps' => \$Git::SVN::_use_svnsync_props,
>  		'log-window-size=i' => \$Git::SVN::Ra::_log_window_size,
>  		'no-checkout' => \$_no_checkout,
> -		'quiet|q' => \$_q,
> +		'quiet|q+' => \$_q,
>  		'repack-flags|repack-args|repack-opts=s' =>
>  		   \$Git::SVN::_repack_flags,
>  		'use-log-author' => \$Git::SVN::_use_log_author,
> @@ -2331,13 +2332,13 @@ sub do_git_commit {
>  
>  	$self->{last_rev} = $log_entry->{revision};
>  	$self->{last_commit} = $commit;
> -	print "r$log_entry->{revision}" unless $::_q;
> +	print "r$log_entry->{revision}" unless $::_q > 1;
>  	if (defined $log_entry->{svm_revision}) {
> -		 print " (\@$log_entry->{svm_revision})" unless $::_q;
> +		 print " (\@$log_entry->{svm_revision})" unless $::_q > 1;
>  		 $self->rev_map_set($log_entry->{svm_revision}, $commit,
>  		                   0, $self->svm_uuid);
>  	}
> -	print " = $commit ($self->{ref_id})\n" unless $::_q;
> +	print " = $commit ($self->{ref_id})\n" unless $::_q > 1;
>  	if (--$_gc_nr == 0) {
>  		$_gc_nr = $_gc_period;
>  		gc();
> -- 
> 1.6.2
> -- 
> Simon Arlott

```

## Junio C Hamano, 2009-04-02 05:24

Subject: Re: [PATCH] git-svn: add a double quiet option to hide git commits
Message-ID: <7vk563k4pk.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vk563k4pk.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20090331065231.GA32142@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

> Simon Arlott <simon@fire.lp0.eu> wrote:
>> People may expect/prefer -q to still show git commits,
>> so this change allows a second -q to hide them.
>> 
>> Signed-off-by: Michael Poole <mdpoole@troilus.org>
>> Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
>
> Thanks,
>   Acked-by: Eric Wong <normalperson@yhbt.net>
> and pushed out to git://git.bogomips.org/git-svn

Thanks, and pulled.

```
