{"thread":{"id":"24740","subject":"Silent maintenance","startedAt":"2010-08-14T13:11:57Z","lastAt":"2010-08-15T13:12:00Z","messageCount":9,"participants":["Enrico Weigelt","Ævar Arnfjörð Bjarmason","Valeo de Vries","Jonathan Nieder","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"148086","messageId":"20100814131156.GA24769@nibiru.local","threadId":"24740","inReplyTo":null,"subject":"Silent maintenance","fromName":"Enrico Weigelt","fromEmail":"weigelt@metux.de","sentAt":"2010-08-14T13:11:57Z","receivedAt":"2010-08-14T13:11:57Z","isPatch":false,"sender":{"key":"weigelt@metux.de","avatar":null},"body":"Hi,\n\nare there some flags to make the maintenance commands like\ngit-repack and git-gc silent, so they only output errors ?\n\n\nthx\n-- \n----------------------------------------------------------------------\n Enrico Weigelt, metux IT service -- http://www.metux.de/\n\n phone:  +49 36207 519931  email: weigelt@metux.de\n mobile: +49 151 27565287  icq:   210169427         skype: nekrad666\n----------------------------------------------------------------------\n Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme\n----------------------------------------------------------------------\n"},{"id":"148087","messageId":"AANLkTing1Lgt7JEeg9SY4J2Q3i_cDuK5uJhmd=6DbzuZ@mail.gmail.com","threadId":"24740","inReplyTo":"20100814131156.GA24769@nibiru.local","subject":"Re: Silent maintenance","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-14T13:26:05Z","receivedAt":"2010-08-14T13:26:05Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Aug 14, 2010 at 13:11, Enrico Weigelt <weigelt@metux.de> wrote:\n> are there some flags to make the maintenance commands like\n> git-repack and git-gc silent, so they only output errors ?\n\nWith Git you should check the exit code of commands, not if they're\nsilent or not.\n\nAre you running something via cron?\n"},{"id":"148093","messageId":"AANLkTimZ4df7wVXSGdNm+vWgAuPVDcUupxEvn9FByx=P@mail.gmail.com","threadId":"24740","inReplyTo":"20100814131156.GA24769@nibiru.local","subject":"Re: Silent maintenance","fromName":"Valeo de Vries","fromEmail":"valeo@valeo.co.cc","sentAt":"2010-08-14T16:33:44Z","receivedAt":"2010-08-14T16:33:44Z","isPatch":false,"sender":{"key":"valeo@valeo.co.cc","avatar":null},"body":"On 14 August 2010 14:11, Enrico Weigelt <weigelt@metux.de> wrote:\n> Hi,\n>\n> are there some flags to make the maintenance commands like\n> git-repack and git-gc silent, so they only output errors ?\n\nJust redirect stdout to /dev/null and check git's return status, as Ævar said.\n\nValeo\n"},{"id":"148094","messageId":"AANLkTi=+veDhBEt-tK_qaXhvMVmRCZtW7+O6ig3ujASz@mail.gmail.com","threadId":"24740","inReplyTo":"AANLkTimZ4df7wVXSGdNm+vWgAuPVDcUupxEvn9FByx=P@mail.gmail.com","subject":"Re: Silent maintenance","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-14T16:41:11Z","receivedAt":"2010-08-14T16:41:11Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Aug 14, 2010 at 16:33, Valeo de Vries <valeo@valeo.co.cc> wrote:\n> On 14 August 2010 14:11, Enrico Weigelt <weigelt@metux.de> wrote:\n>> Hi,\n>>\n>> are there some flags to make the maintenance commands like\n>> git-repack and git-gc silent, so they only output errors ?\n>\n> Just redirect stdout to /dev/null and check git's return status, as Ęvar said.\n\nIt's better to not redirect anything, set a trap that checks if\nanything exited with non-zero, and then look at all the output if\nanything fails.\n"},{"id":"148107","messageId":"20100814210556.GB2372@burratino","threadId":"24740","inReplyTo":"20100814131156.GA24769@nibiru.local","subject":"Re: Silent maintenance","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-08-14T21:05:56Z","receivedAt":"2010-08-14T21:05:56Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Enrico Weigelt wrote:\n\n> are there some flags to make the maintenance commands like\n> git-repack and git-gc silent, so they only output errors ?\n\nDoes --quiet work?  If not, patches would be welcome.\n"},{"id":"148112","messageId":"AANLkTimLHand0g965TJmk=Y4Q+0uTFovZZRZXf9Fx4UB@mail.gmail.com","threadId":"24740","inReplyTo":"20100814210556.GB2372@burratino","subject":"Re: Silent maintenance","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-14T21:41:44Z","receivedAt":"2010-08-14T21:41:44Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Aug 14, 2010 at 21:05, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Enrico Weigelt wrote:\n>\n>> are there some flags to make the maintenance commands like\n>> git-repack and git-gc silent, so they only output errors ?\n>\n> Does --quiet work?  If not, patches would be welcome.\n\nI intentionally neglected to mention that. That inevitably leads to\ncases where something fails, but you didn't record the output.\n\nInstead (copy/paste from a recent post of mine to an unrelated mailing\nlist, funny how these things come up at the same time), do:\n\nJust install this: http://search.cpan.org/dist/App-Cronjob/\n\nThen put something like this in your crontab:\n\n   @daily cronjob -E -j josm-build -E /path/to/build.sh\n\ncronjob(1) will consume all the output, and either print it all or\nnothing, depending on the exit code of the program it's running.\n\nIf you're running a POSIX shell script you can add this to the top of\nthe script:\n\n   # Exit on errors\n   trap 'fail' ERR\n   fail () {\n       code=$?\n       echo \"Failed with exit code $code\"\n       exit 1\n   }\n\nThen you don't have to check the exit code of everything individually.\n\nI use this for all my cronjobs, see\ne.g. http://github.com/avar/openstreetmap-mirror for an example, it's\nwhat I use to get E-Mails when the JOSM GitHub mirror fails, but\n*only* when it fails.\n"},{"id":"148113","messageId":"20100814220410.GA16592@coredump.intra.peff.net","threadId":"24740","inReplyTo":"AANLkTimLHand0g965TJmk=Y4Q+0uTFovZZRZXf9Fx4UB@mail.gmail.com","subject":"Re: Silent maintenance","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-08-14T22:04:10Z","receivedAt":"2010-08-14T22:04:10Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 14, 2010 at 09:41:44PM +0000, Ævar Arnfjörð Bjarmason wrote:\n\n> On Sat, Aug 14, 2010 at 21:05, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> > Enrico Weigelt wrote:\n> >\n> >> are there some flags to make the maintenance commands like\n> >> git-repack and git-gc silent, so they only output errors ?\n> >\n> > Does --quiet work?  If not, patches would be welcome.\n> \n> I intentionally neglected to mention that. That inevitably leads to\n> cases where something fails, but you didn't record the output.\n\nI'm confused. Isn't the point of quiet to silence all of the cruft, and\nleave only actual errors?\n\n  $ git gc\n  Counting objects: 128, done.\n  Compressing objects: 100% (49/49), done.\n  Writing objects: 100% (128/128), done.\n  Total 128 (delta 71), reused 121 (delta 68)\n\n  $ git gc --quiet\n\n  $ chmod -w .git/objects/pack\n  $ git gc --quiet\n  fatal: Unable to create temporary file: Permission denied\n  error: failed to run repack\n\nIsn't that what the OP wanted?\n\n> cronjob(1) will consume all the output, and either print it all or\n> nothing, depending on the exit code of the program it's running.\n\nThat is a good solution for broken programs that have no \"print only\nerrors\" mode, but I don't think git is one of those (and if it is, we\nshould fix it).\n\n-Peff\n"},{"id":"148115","messageId":"AANLkTim1HL_WH_ShxNYXmsSnbMNq7=C7oj46qav2OQe1@mail.gmail.com","threadId":"24740","inReplyTo":"20100814220410.GA16592@coredump.intra.peff.net","subject":"Re: Silent maintenance","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-08-15T00:21:18Z","receivedAt":"2010-08-15T00:21:18Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Aug 14, 2010 at 22:04, Jeff King <peff@peff.net> wrote:\n> On Sat, Aug 14, 2010 at 09:41:44PM +0000, Ævar Arnfjörð Bjarmason wrote:\n>\n>> On Sat, Aug 14, 2010 at 21:05, Jonathan Nieder <jrnieder@gmail.com> wrote:\n>> > Enrico Weigelt wrote:\n>> >\n>> >> are there some flags to make the maintenance commands like\n>> >> git-repack and git-gc silent, so they only output errors ?\n>> >\n>> > Does --quiet work?  If not, patches would be welcome.\n>>\n>> I intentionally neglected to mention that. That inevitably leads to\n>> cases where something fails, but you didn't record the output.\n>\n> I'm confused. Isn't the point of quiet to silence all of the cruft, and\n> leave only actual errors?\n>\n>  $ git gc\n>  Counting objects: 128, done.\n>  Compressing objects: 100% (49/49), done.\n>  Writing objects: 100% (128/128), done.\n>  Total 128 (delta 71), reused 121 (delta 68)\n>\n>  $ git gc --quiet\n>\n>  $ chmod -w .git/objects/pack\n>  $ git gc --quiet\n>  fatal: Unable to create temporary file: Permission denied\n>  error: failed to run repack\n>\n> Isn't that what the OP wanted?\n\nMaybe, personally I prefer to get all or nothing. If you specify\n--quiet you'll only get errors, so it doesn't give you much\ncontext. But if you use cronjob(1) you can see at a glance the normal\noutput of all the successfully executed commands that led up to your\nfailure.\n\nE.g. the output of a successful \"cherry-pick\" right before a failing\nmerge can be really helpful to see the state of the failing program.\n"},{"id":"148127","messageId":"20100815131200.GA27637@nibiru.local","threadId":"24740","inReplyTo":"AANLkTim1HL_WH_ShxNYXmsSnbMNq7=C7oj46qav2OQe1@mail.gmail.com","subject":"Re: Silent maintenance","fromName":"Enrico Weigelt","fromEmail":"weigelt@metux.de","sentAt":"2010-08-15T13:12:00Z","receivedAt":"2010-08-15T13:12:00Z","isPatch":false,"sender":{"key":"weigelt@metux.de","avatar":null},"body":"* Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n\nHi folks,\n\n> Maybe, personally I prefer to get all or nothing. If you specify\n> --quiet you'll only get errors, so it doesn't give you much\n> context. But if you use cronjob(1) you can see at a glance the normal\n> output of all the successfully executed commands that led up to your\n> failure.\n\nfor my purpose, this should be sufficient, as I'll have to step\nin manually in case of errors anyways.\n\nthx to all.\n\n\ncu\n-- \n----------------------------------------------------------------------\n Enrico Weigelt, metux IT service -- http://www.metux.de/\n\n phone:  +49 36207 519931  email: weigelt@metux.de\n mobile: +49 151 27565287  icq:   210169427         skype: nekrad666\n----------------------------------------------------------------------\n Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme\n----------------------------------------------------------------------\n"}]}