git-quiltimport
Apply a quilt patch series to Git
SYNOPSIS
git quiltimport [--dry-run] [--author=<author>] [--mbox] [--patches=<dir>] [--series=<file>] [--keep-tree] [--prefix=<patch-prefix>] [--suffix=<patch-suffix>]
PARAMETERS
--dry-run
Do not actually apply any patches; just show what would be done.
--author=<author>
Specify the author for all imported commits. If omitted, the author is extracted from the patch header's 'From:' line.
--mbox
Treat patches as mbox format. By default, patches are expected to be plain diffs.
--patches=<dir>
Look for patches and the 'series' file in the specified directory <dir> instead of the default "patches" directory.
--series=<file>
Use <file> as the series file instead of "series" within the patch directory.
--keep-tree
After importing, keep the Git working tree clean. This means the import happens in a temporary index and then committed.
--prefix=<patch-prefix>
Add <patch-prefix> to the name of each patch when looking it up in the patches directory, useful for filename mismatches.
--suffix=<patch-suffix>
Add <patch-suffix> to the name of each patch when looking it up in the patches directory, similar to --prefix.
DESCRIPTION
git-quiltimport imports a quilt patchset from a specified directory (defaulting to "patches") and applies each patch as a new Git commit. It constructs the commit message for each commit from the patch's header comments (e.g., 'Subject:', 'From:', 'Date:') followed by the patch's body.
The command requires a "series" file within the patch directory, which dictates the order of patches. This utility bridges Git and Quilt workflows, enabling users to efficiently migrate Quilt-managed patches into Git's commit history, or to integrate patches initially managed by Quilt directly into a Git repository. It is particularly useful for projects transitioning from Quilt-based patch management to Git, ensuring that the historical record of individual patch applications is accurately preserved.
CAVEATS
The command strictly expects a quilt-like directory structure, including a 'series' file listing patches. Patches are primarily expected to be plain diffs unless the --mbox option is used. The successful extraction of commit metadata relies heavily on well-formed patch headers.
PATCH FORMAT INTERPRETATION
By default, git-quiltimport expects patches to be standard diffs. The --mbox option alters this behavior, enabling the command to parse patches as individual emails, extracting sender, date, and subject from email headers.
COMMIT MESSAGE SOURCE
The commit message for each imported commit is automatically generated from the patch's header comments (lines like 'Subject:', 'From:', 'Date:', etc.) followed by the main body of the patch (content after the '---' separator).
HISTORY
git-quiltimport serves as a critical bridge for interoperability between Git and older patch management tools like Quilt. Its development likely arose from the practical need for projects to smoothly transition from Quilt-based workflows to Git while preserving their extensive patch history, or for developers accustomed to Quilt to seamlessly integrate their changes into a Git repository. It reflects Git's broader design philosophy of being highly adaptable and accommodating diverse development practices.
SEE ALSO
git-format-patch(1), git-am(1), quilt(1)