git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[StGit PATCH] Discard stderr output from git apply

From
Karl Hasselström <kha@treskal.com>
Date
Jul 4, 2008, 06:35 UTC
Message-ID
<20080704063427.9515.68707.stgit@yoghurt>

It prints error messages when it fails, and we don't need to see them since we don't care exactly _why_ it failed.

Signed-off-by: Karl Hasselström <kha@treskal.com>
---

With the optimizations that make us start using apply a lot; I noticed git apply was spamming on stderr.

 stgit/lib/git.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/stgit/lib/git.py b/stgit/lib/git.py
index 6ccdfa7..9208965 100644
--- a/stgit/lib/git.py
+++ b/stgit/lib/git.py
@@ -556,7 +556,7 @@ class Index(RunWithEnv):
         """In-index patch application, no worktree involved."""
         try:
             self.run(['git', 'apply', '--cached']
-                     ).raw_input(patch_text).no_output()
+                     ).raw_input(patch_text).discard_stderr().no_output()
         except run.RunException:
             raise MergeException('Patch does not apply cleanly')
     def delete(self):
Next: Catalin Marinas
Message 1 of 3 in “Discard stderr output from git apply”
  1. Discard stderr output from git applyKarl Hasselström, Jul 4, 2008
  2. Catalin MarinasJul 7, 2008
  3. Karl HasselströmJul 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.