git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git gc logs to standard error
@ 2009-12-14 14:45 Richard Rossel
  2009-12-14 15:55 ` Johan Herland
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Rossel @ 2009-12-14 14:45 UTC (permalink / raw)
  To: git

Hi,
I have a question related to the output of git gc logs. Let me explain,

I have a git commands in crontab (for redmine purpose) doing this stuff:
' git fetch -q origin && git reset -q --soft refs/remotes/origin/master '
for each project.

The problem is that am getting mail from crontab each time that somebody
do a push to the central server. Its really annoying. I try to avoid 
those messages
redirecting the standard output with no results, then adding a quiet 
option  and no results.
This is the kind of mails that am receiving:


remote: Counting objects: 6, done.
remote: Compressing objects:  25% (1/4)
remote: Compressing objects:  50% (2/4)
remote: Compressing objects:  75% (3/4        )remote:
remote: Compressing objects: 100% (4/4)
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 2), reused 0 (delta 0)
 From git@boss:drivings
   0f35f06..5bc8866  master     -> origin/master


Then I realized that the message is git gc logs looks like, so I did:

$ git gc
Counting objects: 51, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (51/51), done.
Total 51 (delta 12), reused 51 (delta 12)

The message are pretty similar, so I sent the logs to dev/null but:

$ git gc >/dev/null
Counting objects: 51, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (51/51), done.
Total 51 (delta 12), reused 51 (delta 12)

I realized that the message are sent to standard error,
so the question is why is the reason to do that?

The quick solution to my problem of annoying mails is send the output 
error to /dev/null
but what happens when an error really occur, there will be no message to 
alert me.

thanks for your help

saludos.-

--
Richard Rossel
Software Engineer at Airsage Inc.
Valparaiso - Chile

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 14:45 git gc logs to standard error Richard Rossel
@ 2009-12-14 15:55 ` Johan Herland
  2009-12-14 16:04   ` Jacob Helwig
  2009-12-14 16:10   ` Richard Rossel
  0 siblings, 2 replies; 8+ messages in thread
From: Johan Herland @ 2009-12-14 15:55 UTC (permalink / raw)
  To: git; +Cc: Richard Rossel

On Monday 14 December 2009, Richard Rossel wrote:
> Hi,
> I have a question related to the output of git gc logs. Let me
> explain,
>
> [...]
>
> I realized that the message are sent to standard error,
> so the question is why is the reason to do that?
>
> The quick solution to my problem of annoying mails is send the output
> error to /dev/null
> but what happens when an error really occur, there will be no message
> to alert me.

Try the --quiet parameter to "git gc" (and other git commands).


...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 15:55 ` Johan Herland
@ 2009-12-14 16:04   ` Jacob Helwig
  2009-12-14 16:23     ` Richard Rossel
  2009-12-14 16:10   ` Richard Rossel
  1 sibling, 1 reply; 8+ messages in thread
From: Jacob Helwig @ 2009-12-14 16:04 UTC (permalink / raw)
  To: Johan Herland; +Cc: git, Richard Rossel

On Mon, Dec 14, 2009 at 07:55, Johan Herland <johan@herland.net> wrote:
> On Monday 14 December 2009, Richard Rossel wrote:
>> Hi,
>> I have a question related to the output of git gc logs. Let me
>> explain,
>>
>> [...]
>>
>> I realized that the message are sent to standard error,
>> so the question is why is the reason to do that?
>>
>> The quick solution to my problem of annoying mails is send the output
>> error to /dev/null
>> but what happens when an error really occur, there will be no message
>> to alert me.
>
> Try the --quiet parameter to "git gc" (and other git commands).
>
>
> ...Johan
>
> --
> Johan Herland, <johan@herland.net>
> www.herland.net

I think the real problem that Richard is experiencing is that git
fetch isn't respecting the --quiet option.  The output being similar
to git gc, and also being on STDERR seems to be a red-herring.

Richard,

What version of git are you using?

Also, what is the output from 'git fetch --q; echo $?' if you just run
that in your repo?  If the last line you see is '0', then that should
be the only output you see.

-Jacob

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 15:55 ` Johan Herland
  2009-12-14 16:04   ` Jacob Helwig
@ 2009-12-14 16:10   ` Richard Rossel
  1 sibling, 0 replies; 8+ messages in thread
From: Richard Rossel @ 2009-12-14 16:10 UTC (permalink / raw)
  To: git

>
> On Monday 14 December 2009, Richard Rossel wrote:
>    
>> Hi,
>> I have a question related to the output of git gc logs. Let me
>> explain,
>>
>> [...]
>>
>> I realized that the message are sent to standard error,
>> so the question is why is the reason to do that?
>>
>> The quick solution to my problem of annoying mails is send the output
>> error to /dev/null
>> but what happens when an error really occur, there will be no message
>> to alert me.
>>      
> Try the --quiet parameter to "git gc" (and other git commands).
>
>
> ...Johan
>
>    


Yes,  the quiet option works when I do 'git gc', but in the cron file 
there is no
git-gc command, only fetch and reset. I suppose that  those commands 
calls (internally)
to git-gc.
Also I try with -q option in fetch and reset but without results, the 
only thing that
works was with 2>/dev/null, but as I mention before, is not a good idea 
because
I will miss the real errors messages.

The real question here is why git-gc send those logs to the standard 
error instead of
standard output?

--
Richard Rossel
Airsage Inc.
Valparaiso - Chile

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 16:04   ` Jacob Helwig
@ 2009-12-14 16:23     ` Richard Rossel
  2009-12-14 16:28       ` Jacob Helwig
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Rossel @ 2009-12-14 16:23 UTC (permalink / raw)
  To: git

>
> On Mon, Dec 14, 2009 at 07:55, Johan Herland<johan@herland.net>  wrote:
>    
>> On Monday 14 December 2009, Richard Rossel wrote:
>>      
>>> Hi,
>>> I have a question related to the output of git gc logs. Let me
>>> explain,
>>>
>>> [...]
>>>
>>> I realized that the message are sent to standard error,
>>> so the question is why is the reason to do that?
>>>
>>> The quick solution to my problem of annoying mails is send the output
>>> error to /dev/null
>>> but what happens when an error really occur, there will be no message
>>> to alert me.
>>>        
>> Try the --quiet parameter to "git gc" (and other git commands).
>>
>>
>> ...Johan
>>
>> --
>> Johan Herland,<johan@herland.net>
>> www.herland.net
>>      
> I think the real problem that Richard is experiencing is that git
> fetch isn't respecting the --quiet option.  The output being similar
> to git gc, and also being on STDERR seems to be a red-herring.
>
> Richard,
>
> What version of git are you using?
>
> Also, what is the output from 'git fetch --q; echo $?' if you just run
> that in your repo?  If the last line you see is '0', then that should
> be the only output you see.
>
> -Jacob
>    

$ git --version
git version 1.5.4.3

And when there is no change in the repo

$ git fetch --q; echo $?
0

no messages and no error , but when there is a change to syncronize

$ git fetch --q; echo $?
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta remote: 2), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
 From git@boss:sandbox
    3e4df7f..b92d27c  master     -> origin/master
0

here come the messages but the return value is still 0

I will try to update git to v1.6.5.6 and see what happend

--
Richard Rossel
Airsage Inc.
Valparaiso - Chile

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 16:23     ` Richard Rossel
@ 2009-12-14 16:28       ` Jacob Helwig
  2009-12-14 16:37         ` Richard Rossel
  0 siblings, 1 reply; 8+ messages in thread
From: Jacob Helwig @ 2009-12-14 16:28 UTC (permalink / raw)
  To: Richard Rossel; +Cc: git

On Mon, Dec 14, 2009 at 08:23, Richard Rossel <rrossel@inf.utfsm.cl> wrote:
>
> $ git --version
> git version 1.5.4.3
>
> And when there is no change in the repo
>
> $ git fetch --q; echo $?
> 0
>
> no messages and no error , but when there is a change to syncronize
>
> $ git fetch --q; echo $?
> remote: Counting objects: 7, done.
> remote: Compressing objects: 100% (5/5), done.
> remote: Total 5 (delta remote: 2), reused 0 (delta 0)
> Unpacking objects: 100% (5/5), done.
> From git@boss:sandbox
>   3e4df7f..b92d27c  master     -> origin/master
> 0
>

Don't use a double dash, if you're using the short option.

git fetch -q
OR
git fetch --quiet

git fetch --q <--- This is not what you think it is.

-Jacob

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 16:28       ` Jacob Helwig
@ 2009-12-14 16:37         ` Richard Rossel
  2009-12-14 16:46           ` Jacob Helwig
  0 siblings, 1 reply; 8+ messages in thread
From: Richard Rossel @ 2009-12-14 16:37 UTC (permalink / raw)
  To: git

>
> On Mon, Dec 14, 2009 at 08:23, Richard Rossel<rrossel@inf.utfsm.cl>  wrote:
>    
>> $ git --version
>> git version 1.5.4.3
>>
>> And when there is no change in the repo
>>
>> $ git fetch --q; echo $?
>> 0
>>
>> no messages and no error , but when there is a change to syncronize
>>
>> $ git fetch --q; echo $?
>> remote: Counting objects: 7, done.
>> remote: Compressing objects: 100% (5/5), done.
>> remote: Total 5 (delta remote: 2), reused 0 (delta 0)
>> Unpacking objects: 100% (5/5), done.
>>  From git@boss:sandbox
>>    3e4df7f..b92d27c  master     ->  origin/master
>> 0
>>
>>      
> Don't use a double dash, if you're using the short option.
>
> git fetch -q
> OR
> git fetch --quiet
>
> git fetch --q<--- This is not what you think it is.
>
> -Jacob
>
>    
doh, sorry, my mistake

$ git fetch -q; echo $?
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
 From git@boss:sandbox
    b92d27c..17b8b5d  master     -> origin/master
0

These is the output when there is a change to be syncronized

BTW,  in crontab the commands are using -q option, the mistake was made 
just here :)


-- 
Richard Rossel
Softare Engineer at Airsage Inc.
Valparaiso - Chile

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: git gc logs to standard error
  2009-12-14 16:37         ` Richard Rossel
@ 2009-12-14 16:46           ` Jacob Helwig
  0 siblings, 0 replies; 8+ messages in thread
From: Jacob Helwig @ 2009-12-14 16:46 UTC (permalink / raw)
  To: Richard Rossel; +Cc: git

On Mon, Dec 14, 2009 at 08:37, Richard Rossel <rrossel@inf.utfsm.cl> wrote:
>>
>> On Mon, Dec 14, 2009 at 08:23, Richard Rossel<rrossel@inf.utfsm.cl>
>>  wrote:
>>
>>>
>>> $ git --version
>>> git version 1.5.4.3
>>>
>>> And when there is no change in the repo
>>>
>>> $ git fetch --q; echo $?
>>> 0
>>>
>>> no messages and no error , but when there is a change to syncronize
>>>
>>> $ git fetch --q; echo $?
>>> remote: Counting objects: 7, done.
>>> remote: Compressing objects: 100% (5/5), done.
>>> remote: Total 5 (delta remote: 2), reused 0 (delta 0)
>>> Unpacking objects: 100% (5/5), done.
>>>  From git@boss:sandbox
>>>   3e4df7f..b92d27c  master     ->  origin/master
>>> 0
>>>
>>>
>>
>> Don't use a double dash, if you're using the short option.
>>
>> git fetch -q
>> OR
>> git fetch --quiet
>>
>> git fetch --q<--- This is not what you think it is.
>>
>> -Jacob
>>
>>
>
> doh, sorry, my mistake
>
> $ git fetch -q; echo $?
> remote: Counting objects: 5, done.
> remote: Compressing objects: 100% (2/2), done.
> remote: Total 3 (delta 1), reused 0 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From git@boss:sandbox
>   b92d27c..17b8b5d  master     -> origin/master
> 0
>
> These is the output when there is a change to be syncronized
>
> BTW,  in crontab the commands are using -q option, the mistake was made just
> here :)
>

It looks like you want to upgrade to at least 1.6.0.3 (I know that
with 1.6.5.5 I get no output with 'git fetch -q', whether or not there
are pending updates).  There's a fix (fe8aa148) for the issue[1] it
looks like you're having.

[1] http://marc.info/?l=git&m=121529226023180&w=2

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-14 16:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14 14:45 git gc logs to standard error Richard Rossel
2009-12-14 15:55 ` Johan Herland
2009-12-14 16:04   ` Jacob Helwig
2009-12-14 16:23     ` Richard Rossel
2009-12-14 16:28       ` Jacob Helwig
2009-12-14 16:37         ` Richard Rossel
2009-12-14 16:46           ` Jacob Helwig
2009-12-14 16:10   ` Richard Rossel

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).