{"thread":{"id":"66568","subject":"Git crashed on `git apply --check`","startedAt":"2026-10-17T15:17:02Z","lastAt":"2026-10-25T22:56:14Z","messageCount":3,"participants":["Gingrspacecadet","Tanga Joris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"555328","messageId":"CALdwsC1cMKZgRPZA+pBaJe4PPs9q9W0K9CQLmM2bgUCyysTB-w@mail.gmail.com","threadId":"66568","inReplyTo":null,"subject":"Git crashed on `git apply --check`","fromName":"Gingrspacecadet","fromEmail":"jackrawlings2011@gmail.com","sentAt":"2026-10-17T15:17:02Z","receivedAt":"2026-10-17T15:17:02Z","isPatch":false,"sender":{"key":"jackrawlings2011@gmail.com","avatar":null},"body":"Thank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\nChecking the following patch:\ndiff --git a/tests/constraint_type_signature_lifting.test\nb/tests/constraint_type_signature_lifting.test\n\nnew file mode 100644\nindex 0000000..0000000\n--- /dev/null\n+++ b/tests/constraint_type_signature_lifting.test\n@@ -0,0 +1,40 @@\n+name: constraint types in signatures are lifted to generic parameters\n+expect: pass\n+stop: run\n+errors: 0\n+\n+[source]\n+constraint Readable = {\n+    fn uint64 Readable.read(Readable *self);\n+}\n+\n+type File = struct {\n+    uint64 size;\n+};\n+\n+fn uint64 File.read(File *self) {\n+    return self.size;\n+}\n+\n+fn Readable identity(Readable value) {\n+    return value;\n+}\n+\n+fn uint64 read_size(Readable file) {\n+    return file.read();\n+}\n+\n+fn int64 main() {\n+    File file = {42};\n+    File copy = identity(file);\n+    if (copy.size != 42) return 1;\n+    if (read_size(file) != 42) return 2;\n+    return 0;\n+}\n+\n+[stdout]\n+\n+[stderr]\n+\n+[exit]\n+0\n\nWhat did you expect to happen?\nThe patch check to pass\n\nWhat happened instead?\n\"git: apply.c:3856: check_preimage: Assertion `patch->is_new <= 0' failed.i\"\n\n[System Info]\ngit version:\ngit version 2.54.0\ncpu: x86_64\nbuilt from commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nrust: enabled\ngettext: enabled\nlibcurl: 8.19.0\nOpenSSL: OpenSSL 3.6.2 7 Apr 2026\nzlib-ng: 2.3.3\nSHA-1: SHA1_DC\nSHA-256: SHA256_BLK\ndefault-ref-format: files\ndefault-hash: sha1\nuname: Linux 7.0.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 23 May 2026\n14:21:20 +0000 x86_64\ncompiler info: gnuc: 15.2\nlibc info: glibc: 2.43\n$SHELL (typically, interactive shell): /usr/bin/bash\n\n\n[Enabled Hooks]\n\n"},{"id":"556141","messageId":"20261024061017.100191-1-tangajoris@gmail.com","threadId":"66568","inReplyTo":"CALdwsC1cMKZgRPZA+pBaJe4PPs9q9W0K9CQLmM2bgUCyysTB-w@mail.gmail.com","subject":"Re: Git crashed on `git apply --check`","fromName":"Tanga Joris","fromEmail":"tangajoris@gmail.com","sentAt":"2026-10-24T06:10:17Z","receivedAt":"2026-10-24T06:10:17Z","isPatch":false,"sender":{"key":"tangajoris@gmail.com","avatar":null},"body":"Hi,\n\nThanks for the report. I was unable to reproduce it with the patch as\nquoted (the \"diff --git\" line is wrapped in your mail), but I can\ntrigger the same assertion on current master, and on 2.43, when the\n\"--- /dev/null\" line comes before \"new file mode\" in the header:\n\n    diff --git a/n.txt b/n.txt\n    --- /dev/null\n    +++ b/n.txt\n    new file mode 100644\n    @@ -0,0 +1 @@\n    +hello\n\nWas your patch handwritten or generated by a tool, and could you\nplease check whether its header lines are in that order? If you can,\nplease attach the exact file so that we can confirm it is the same\nproblem.\n\nThanks,\nTanga\n\n"},{"id":"556237","messageId":"CAKrRMNr=e2b0aYC_MPCUdY4Ln+Dtrb75V_o1UeHJRbRT29NLzQ@mail.gmail.com","threadId":"66568","inReplyTo":"CALdwsC11JHUBBTt3e_RFixLYSF0VU1C+mG7bQsO0vV=a68XHNw@mail.gmail.com","subject":"Re: Git crashed on `git apply --check`","fromName":"Tanga Joris","fromEmail":"tangajoris@gmail.com","sentAt":"2026-10-25T22:56:14Z","receivedAt":"2026-10-25T22:56:14Z","isPatch":false,"sender":{"key":"tangajoris@gmail.com","avatar":null},"body":"Adding the list back\n\nOn Sat, 24 Oct 2026 at 20:08, Gingrspacecadet\n<jackrawlings2011@gmail.com> wrote:\n>\n> hi,\n>\n> I've attached the patch that faulted.\n>\n> It was generated by an LLM.\n\nHello,\n\nThank you for sending the original patch file. The crash was caused\nby a blank line after the diff --git line in the new-file section,\nand it is reproducible on master. I am currently working on a fix.\n\nBest,\nTanga\n\n"}]}