git gc logs to standard error
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
Quoted 6 lines · Richard Rossel
Hi,
I have a question related to the output of git gc logs. Let me explain,[...]
Quoted 7 lines
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
Signature · 2 lines
Johan Herland, <[email protected]> www.herland.net
Quoted 17 lines · Richard Rossel
Quoted 7 lines
Hi,
I have a question related to the output of git gc logs. Let me explain,[...]
Quoted 8 lines
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.
Quoted 6 lines
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
Quoted 15 lines · Johan Herland
Quoted 6 lines · Richard Rossel
Hi,
I have a question related to the output of git gc logs. Let me explain,[...]
Quoted 7 lines
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.
Quoted 8 lines
Try the --quiet parameter to "git gc" (and other git commands).
...Johan
--
Johan Herland, <[email protected]>
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
Quoted 34 lines · Johan Herland
Quoted 17 lines · Richard Rossel
Quoted 7 lines
Hi,
I have a question related to the output of git gc logs. Let me explain,[...]
Quoted 8 lines
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.Quoted 9 lines
Try the --quiet parameter to "git gc" (and other git commands).
...Johan
--
Johan Herland,<[email protected]>
www.herland.netI 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,
Quoted 8 lines
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
Quoted 11 lines · Richard Rossel
$ git --version git version 1.5.4.3And when there is no change in the repo
$ git fetch --q; echo $? 0no messages and no error , but when there is a change to syncronize
Quoted 9 lines
$ 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
Quoted 25 lines · Richard Rossel
Quoted 11 lines
$ git --version git version 1.5.4.3And when there is no change in the repo
$ git fetch --q; echo $? 0no messages and no error , but when there is a change to syncronize
Quoted 10 lines
$ 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 0Don't use a double dash, if you're using the short option.
Quoted 9 lines
git fetch -q
OR
git fetch --quietgit 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 :)
Signature · 3 lines
Richard Rossel Softare Engineer at Airsage Inc. Valparaiso - Chile
Quoted 49 lines · Richard Rossel
Quoted 28 lines
Quoted 11 lines · Richard Rossel
$ git --version git version 1.5.4.3And when there is no change in the repo
$ git fetch --q; echo $? 0no messages and no error , but when there is a change to syncronize
Quoted 10 lines
$ 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 0Don't use a double dash, if you're using the short option.
Quoted 9 lines
git fetch -q
OR
git fetch --quietgit 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
Quoted 5 lines
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.