Git Patch - Scissors Line Above the Real Commit Message
A patch sent as a reply: the mail subject starts with `Re:`, quoted text sits above a `-- >8 --` scissors line, and the real commit subject and body sit below it. `git am --scissors` discards everything above the cut; a parser that trusts the mail Subject header records 'Re: [PATCH] ...' as the commit title.
From c3ceaab9675de1b27d18b5f54f5f3eb2a8675e3a Mon Sep 17 00:00:00 2001
From: Priya Raman <priya.raman@example.invalid>
Date: Wed, 11 Mar 2026 15:47:02 +0000
Subject: Re: [PATCH] fix(format): reject amounts with no digits
On Wed, 11 Mar 2026, Miguel Otero wrote:
> Could you resend with the NaN guard folded in?
Sure — updated version below.
-- >8 --
fix(format): reject amounts with no digits
parseMinor returned NaN for input with no digits at all, and the
caller stored it as zero.
---
web/src/format.ts | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/web/src/format.ts b/web/src/format.ts
index fd6b21b..5d40a9f 100644
--- a/web/src/format.ts
+++ b/web/src/format.ts
@@ -1,9 +1,11 @@
export interface Money {
amount: number;
currency: string;
+ locale?: string;
}
const GROUPING = 3;
+const DEFAULT_LOCALE = "en-GB";
export function formatMinor(minor: number, currency: string): string {
const sign = minor < 0 ? "-" : "";
@@ -33,5 +35,9 @@
export function parseMinor(text: string): number {
const cleaned = text.replace(/[^0-9-]/g, "");
- return Number.parseInt(cleaned, 10);
+ const parsed = Number.parseInt(cleaned, 10);
+ if (Number.isNaN(parsed)) {
+ throw new RangeError("parseMinor: no digits in " + JSON.stringify(text));
+ }
+ return parsed;
}
--
2.43.0
Specifications
- Seed
- 20260807
- Scissors
- -- >8 --
- Reply Quoting
- true
- Files
- 1
- Subject Is Reply Header
- true
- Line Endings
- LF
- Encoding
- UTF-8
Testing contract
Expected to pass- Scenario
- Extract the commit message from a mailed patch that carries a scissors line.
- Expected result
- The commit subject is 'fix(format): reject amounts with no digits' taken from below the scissors, not the 'Re: [PATCH] ...' mail header, and the quoted reply text is discarded.
What is a .patch file?
A .patch file is a unified diff packaged for transmission, most often as produced by `git format-patch`. Beyond the diff itself it carries an email-style header with the author, date, and commit subject, a commit message body, per-file `diff --git` headers recording renames and mode changes, and hunk headers of the form `@@ -old,count +new,count @@`. Applying it reconstructs a specific change against a specific before-state.
How to use this file
Use an example .patch file to test patch application, code-review renderers, and diff parsers: exercising renames, mode changes, binary hunks, added and deleted files, and the `\ No newline at end of file` marker that naive parsers silently drop.
How to use this file for testing
“Git Patch - Scissors Line Above the Real Commit Message” is a deterministic Testaroo fixture for Email parsing, Visual diff / regression, Code parsing. Standards-compliant RFC 822 messages (plain, multipart text+HTML, and with an attachment) plus an MBOX mailbox, for testing header parsing, MIME decoding, attachment extraction, and mailbox splitting.
Documented properties for this file: seed 20260807 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such, expect parsers to fail loudly rather than silently accept them.
Diff and patch fixtures name their target paths and the exact edge case they exercise, rename, mode change, binary hunk, CRLF↔LF, or missing trailing newline. Apply or render them against the documented before-state; every author, path, and hash is fictional.
Generated by generation/version_control.py. Free for any use, no attribution required, license.
Related files
- mboxGit Format-Patch Series - All Four Messages as One MboxThe same four messages concatenated into a single mbox, which is exactly what `git format-patch --stdout` produces and what `git am` consumes. The From_ separator lines use git's fixed sentinel date, so a splitter cannot rely on the timestamp being real.

- patchGit Format-Patch Series - 0000 Cover LetterThe `--cover-letter` message git writes ahead of a series: a `[PATCH 0/3]` subject, a shortlog of the authors and their subjects, and the combined diffstat, but no diff of its own. Series tooling has to recognise it as metadata and not try to apply it.

- patchGit Format-Patch Series - 0001 of 3Patch 1 of a three-message series, threaded under the cover letter with In-Reply-To and References headers. Applying the three out of order breaks: the series is only self-consistent in numeric order.

- patchGit Format-Patch Series - 0002 of 3Patch 2 of a three-message series, threaded under the cover letter with In-Reply-To and References headers. Applying the three out of order breaks: the series is only self-consistent in numeric order.

- patchGit Format-Patch Series - 0003 of 3Patch 3 of a three-message series, threaded under the cover letter with In-Reply-To and References headers. Applying the three out of order breaks: the series is only self-consistent in numeric order.

- patchGit Patch - Abbreviated index HashesThe `index` line abbreviates both blob ids to seven characters, which is what plain format-patch emits and what most patches in the wild carry. Three-way application can still fall back to path matching, but the blobs cannot be looked up unambiguously in a large repository.
