Skip to content
Novus Examples
patch308 B

Git Patch - Empty Commit With No Diff

format-patch output for a commit created with `--allow-empty`: full mail headers, a commit message, the `---` separator, and then straight to the signature with no diffstat and no diff. Pipelines that treat 'no diff found' as a parse error reject a message that git itself considers valid.

Preview — first 11 linespatch
From efcd4c3e50631c3788989a1e24ae01f20b84a149 Mon Sep 17 00:00:00 2001
From: Miguel Otero <miguel.otero@example.invalid>
Date: Tue, 10 Mar 2026 09:00:00 +0000
Subject: [PATCH] chore: retag 4.3.0 after the CI outage

Created with git commit --allow-empty so the tag has something to point at.
---
-- 
2.43.0

Specifications

Seed
20260807
Files
0
Hunks
0
Has Diff
false
Allow Empty
true
Line Endings
LF
Encoding
UTF-8

Testing contract

Expected to pass
Scenario
Feed a format-patch message that contains no diff at all to a patch pipeline.
Expected result
The message parses successfully with zero file sections and a non-empty commit subject; it is not reported as malformed.

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 - Empty Commit With No Diff” is a deterministic Novus Examples fixture for Error handling, Visual diff / regression, Code parsing. Deliberately corrupt and invalid files, clearly labelled, for testing how your tool fails.

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.