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

[StGit PATCH 1/5] Remove the 'fail_dump' argument to git.apply_patch()

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Sep 16, 2009, 21:40 UTC
Message-ID
<20090916214055.6622.96912.stgit@toshiba-laptop>
In-Reply-To
<20090916214049.6622.44662.stgit@toshiba-laptop>

Since we have a 'reject' argument, there is no need for the failed diff to be dumped.

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
 stgit/git.py |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index 012e282..97b1e96 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -818,7 +818,7 @@ def repack():
     GRun('repack', '-a', '-d', '-f').run()
 
 def apply_patch(filename = None, diff = None, base = None,
-                fail_dump = True, reject = False, strip = None):
+                reject = False, strip = None):
     """Apply a patch onto the current or given index. There must not
     be any local changes in the tree, otherwise the command fails
     """
@@ -847,14 +847,7 @@ def apply_patch(filename = None, diff = None, base = None,
     except GitRunException:
         if base:
             switch(orig_head)
-        if fail_dump:
-            # write the failed diff to a file
-            f = file('.stgit-failed.patch', 'w+')
-            f.write(diff)
-            f.close()
-            out.warn('Diff written to the .stgit-failed.patch file')
-
-        raise
+        raise GitException('Diff does not apply cleanly')
 
     if base:
         top = commit(message = 'temporary commit used for applying a patch',
Previous: Catalin MarinasNext: Catalin Marinas
Message 2 of 6 in “More UI clean-up”
  1. 0/5 More UI clean-upCatalin Marinas, Sep 16, 2009
  2. 1/5 Remove the 'fail_dump' argument to git.apply_patch()Catalin Marinas, Sep 16, 2009
  3. 2/5 Add the --reject option to foldCatalin Marinas, Sep 16, 2009
  4. 3/5 Do not create an empty patch if import failed without --rejectCatalin Marinas, Sep 16, 2009
  5. 4/5 Add the -p option to foldCatalin Marinas, Sep 16, 2009
  6. 5/5 Autosign imported patchesCatalin Marinas, Sep 16, 2009

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.