{"thread":{"id":"14283","subject":"[StGit PATCH] Discard stderr output from git apply","startedAt":"2008-07-04T06:35:18Z","lastAt":"2008-07-08T04:39:02Z","messageCount":3,"participants":["Karl Hasselström","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"82200","messageId":"20080704063427.9515.68707.stgit@yoghurt","threadId":"14283","inReplyTo":null,"subject":"[StGit PATCH] Discard stderr output from git apply","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-07-04T06:35:18Z","receivedAt":"2008-07-04T06:35:18Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"It prints error messages when it fails, and we don't need to see them\nsince we don't care exactly _why_ it failed.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\nWith the optimizations that make us start using apply a lot; I noticed\ngit apply was spamming on stderr.\n\n stgit/lib/git.py |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\n\ndiff --git a/stgit/lib/git.py b/stgit/lib/git.py\nindex 6ccdfa7..9208965 100644\n--- a/stgit/lib/git.py\n+++ b/stgit/lib/git.py\n@@ -556,7 +556,7 @@ class Index(RunWithEnv):\n         \"\"\"In-index patch application, no worktree involved.\"\"\"\n         try:\n             self.run(['git', 'apply', '--cached']\n-                     ).raw_input(patch_text).no_output()\n+                     ).raw_input(patch_text).discard_stderr().no_output()\n         except run.RunException:\n             raise MergeException('Patch does not apply cleanly')\n     def delete(self):\n"},{"id":"82491","messageId":"b0943d9e0807071349u7c35d2fcr5025b2b282f290f6@mail.gmail.com","threadId":"14283","inReplyTo":"20080704063427.9515.68707.stgit@yoghurt","subject":"Re: [StGit PATCH] Discard stderr output from git apply","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-07-07T20:49:31Z","receivedAt":"2008-07-07T20:49:31Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"2008/7/4 Karl Hasselström <kha@treskal.com>:\n> It prints error messages when it fails, and we don't need to see them\n> since we don't care exactly _why_ it failed.\n\nAre you sure we don't need this? I found it useful when running\n\"import\" to see why a patch failed.\n\n-- \nCatalin\n"},{"id":"82546","messageId":"20080708043902.GD2247@diana.vm.bytemark.co.uk","threadId":"14283","inReplyTo":"b0943d9e0807071349u7c35d2fcr5025b2b282f290f6@mail.gmail.com","subject":"Re: [StGit PATCH] Discard stderr output from git apply","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-07-08T04:39:02Z","receivedAt":"2008-07-08T04:39:02Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-07-07 21:49:31 +0100, Catalin Marinas wrote:\n\n> 2008/7/4 Karl Hasselström <kha@treskal.com>:\n>\n> > It prints error messages when it fails, and we don't need to see\n> > them since we don't care exactly _why_ it failed.\n>\n> Are you sure we don't need this? I found it useful when running\n> \"import\" to see why a patch failed.\n\nAww, you're right. Apply isn't just called from the simple merge fast\npath, it's also used to apply patches. Who would've guessed? ;-)\n\nI'll add a parameter to shut it up or not depending on the caller's\npreferences.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}