format-patch

NAME

git-format-patch - Prepare patches for e-mail submissiongit-format-patch - 電子メール送信用のパッチを準備する

SYNOPSIS概要

git format-patch [-k] [(-o|--output-directory) <dir> | --stdout]
		   [--no-thread | --thread[=<style>]]
		   [(--attach|--inline)[=<boundary>] | --no-attach]
		   [-s | --signoff]
		   [--signature=<signature> | --no-signature]
		   [--signature-file=<file>]
		   [-n | --numbered | -N | --no-numbered]
		   [--start-number <n>] [--numbered-files]
		   [--in-reply-to=Message-Id] [--suffix=.<sfx>]
		   [--ignore-if-in-upstream]
		   [--rfc] [--subject-prefix=Subject-Prefix]
		   [(--reroll-count|-v) <n>]
		   [--to=<email>] [--cc=<email>]
		   [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
		   [--interdiff=<previous>]
		   [--range-diff=<previous> [--creation-factor=<percent>]]
		   [--progress]
		   [<common diff options>]
		   [ <since> | <revision range> ]

DESCRIPTION説明

Prepare each commit with its patch in one file per commit, formatted to resemble UNIX mailbox format. The output of this command is convenient for e-mail submission or for use with git am.UNIXのメールボックスフォーマットに似たフォーマットの、コミットごとに1つのファイルでパッチごとに各コミットを準備します。このコマンドの出力は、Eメール送信やgit amでの使用に便利です

There are two ways to specify which commits to operate on.どのコミットを操作するかを指定する方法は2つあります。

  1. A single commit, <since>, specifies that the commits leading to the tip of the current branch that are not in the history that leads to the <since> to be output.単一のコミット<since>は、<since>が出力されることになる履歴にない現在のブランチの先端に至るコミットを指定します。

  2. Generic <revision range> expression (see "SPECIFYING REVISIONS" section in gitrevisions[7]) means the commits in the specified range.一般的な<revision range>式(gitrevisions [7]のリビジョンの指定を参照)は指定された範囲のコミットを意味します。

The first rule takes precedence in the case of a single <commit>. To apply the second rule, i.e., format everything since the beginning of history up until <commit>, use the --root option: git format-patch --root <commit>. If you want to format only <commit> itself, you can do this with git format-patch -1 <commit>.単一の<commit>の場合、最初の規則が優先されます。2番目の規則を適用する、すなわち、履歴の開始から<commit>までのすべてをフォーマットするには、--rootオプションを使用しますgit format-patch --root <commit>。<commit>自体のみをフォーマットしたい場合は、を使用してこれを実行できますgit format-patch -1 <commit>

By default, each output file is numbered sequentially from 1, and uses the first line of the commit message (massaged for pathname safety) as the filename. With the --numbered-files option, the output file names will only be numbers, without the first line of the commit appended. The names of the output files are printed to standard output, unless the --stdout option is specified.デフォルトでは、各出力ファイルは1から順番に番号が付けられ、コミットメッセージの最初の行(パス名の安全性のためにマッサージされたもの)をファイル名として使用します。この--numbered-filesオプションを指定すると、出力ファイル名は数字だけになり、コミットの最初の行は追加されません。--stdoutオプションが指定されていない限り、出力ファイルの名前は標準出力に出力されます。

If -o is specified, output files are created in <dir>. Otherwise they are created in the current working directory. The default path can be set with the format.outputDirectory configuration option. The -o option takes precedence over format.outputDirectory. To store patches in the current working directory even when format.outputDirectory points elsewhere, use -o ..-oを指定した場合、出力ファイルは<dir>に作成されます。それ以外の場合は、それらは現在の作業ディレクトリに作成されます。デフォルトパスはformat.outputDirectory設定オプションで設定できます。この-oオプションが優先されformat.outputDirectoryます。format.outputDirectory他の場所を指している場合でも現在の作業ディレクトリにパッチを保存するには、を使用します-o .

By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank line (see the DISCUSSION section of git-commit[1]).デフォルトでは、単一パッチの主題は "[PATCH]"で、その後にコミットメッセージから最初の空白行までの行の連結が続きます(git-commit [1]のDISCUSSIONセクションを参照)。

When multiple patches are output, the subject prefix will instead be "[PATCH n/m] ". To force 1/1 to be added for a single patch, use -n. To omit patch numbers from the subject, use -N.複数のパッチが出力されている場合、件名のプレフィックスは「[PATCH n / m]」になります。単一のパッチに1/1を強制的に追加するには、を使用します-n。件名からパッチ番号を省略するには、を使用します-N

If given --thread, git-format-patch will generate In-Reply-To and References headers to make the second and subsequent patch mails appear as replies to the first mail; this also generates a Message-Id header to reference.与えられた場合には--threadgit-format-patch生成されますIn-Reply-ToReferences目以降のパッチメールを作るために、ヘッダーは、最初のメールへの返信として表示されます。これはMessage-Id参照するヘッダも生成します。

OPTIONSオプション

-p
--no-stat

Generate plain patches without any diffstats.diffstatsなしでプレーンパッチを生成します。

-U<n> -U <n>
--unified=<n> --unified = <n>

Generate diffs with <n> lines of context instead of the usual three.通常の3行ではなく<n>行のコンテキストでdiffを生成します。

--indent-heuristic

Enable the heuristic that shifts diff hunk boundaries to make patches easier to read. This is the default.パッチを読みやすくするために差分ハンクの境界をシフトするヒューリスティックを有効にします。これがデフォルトです。

--no-indent-heuristic

Disable the indent heuristic.インデントヒューリスティックを無効にします。

--minimal - 最小

Spend extra time to make sure the smallest possible diff is produced.可能な限り最小の差分が生成されるように、余分な時間をかけてください。

--patience - おしゃべり

Generate a diff using the "patience diff" algorithm."patience diff"アルゴリズムを使って差分を生成します。

--histogram - ヒストグラム

Generate a diff using the "histogram diff" algorithm."histogram diff"アルゴリズムを使って差分を生成します。

--anchored=<text> --anchored = <テキスト>

Generate a diff using the "anchored diff" algorithm.「アンカー付き差分」アルゴリズムを使用して差分を生成します。

This option may be specified more than once.このオプションは複数回指定できます。

If a line exists in both the source and destination, exists only once, and starts with this text, this algorithm attempts to prevent it from appearing as a deletion or addition in the output. It uses the "patience diff" algorithm internally.行がソースとデスティネーションの両方に存在し、1回だけ存在し、このテキストで始まる場合、このアルゴリズムはその行が削除または追加として出力に表示されないようにします。内部的に "patience diff"アルゴリズムを使用しています。

--diff-algorithm={patience|minimal|histogram|myers} --diff-algorithm = {patience | minimal | histogram | myers}

Choose a diff algorithm. The variants are as follows:差分アルゴリズムを選択してください。バリアントは以下のとおりです。

default, myers defaultmyers

The basic greedy diff algorithm. Currently, this is the default.基本的な欲張りな差分アルゴリズム。現在、これがデフォルトです。

minimal

Spend extra time to make sure the smallest possible diff is produced.可能な限り最小の差分が生成されるように、余分な時間をかけてください。

patience

Use "patience diff" algorithm when generating patches.パッチを生成するときは "patience diff"アルゴリズムを使用してください。

histogram

This algorithm extends the patience algorithm to "support low-occurrence common elements".このアルゴリズムは、忍耐度アルゴリズムを「発生頻度の低い共通要素をサポートする」ように拡張したものです。

For instance, if you configured the diff.algorithm variable to a non-default value and want to use the default one, then you have to use --diff-algorithm=default option.たとえば、diff.algorithm変数をデフォルト以外の値に設定し、デフォルトの値を使用したい場合は、--diff-algorithm=defaultoption を使用する必要があります。

--stat[=<width>[,<name-width>[,<count>]]] --stat [= <幅> [、<名前 - 幅> [、<数>]]]

Generate a diffstat. By default, as much space as necessary will be used for the filename part, and the rest for the graph part. Maximum width defaults to terminal width, or 80 columns if not connected to a terminal, and can be overridden by <width>. The width of the filename part can be limited by giving another width <name-width> after a comma. The width of the graph part can be limited by using --stat-graph-width=<width> (affects all commands generating a stat graph) or by setting diff.statGraphWidth=<width> (does not affect git format-patch). By giving a third parameter <count>, you can limit the output to the first <count> lines, followed by ... if there are more.diffstatを生成します。デフォルトでは、必要なだけのスペースがファイル名部分に使用され、残りの部分はグラフ部分に使用されます。最大幅はデフォルトで端末幅に設定され<width>ます。端末に接続されていない場合は80桁になります。ファイル名部分の幅は、<name-width>コンマの後に別の幅を指定することで制限できます。グラフの部分の幅は、使用することによって制限することができる--stat-graph-width=<width>(STATグラフを生成するすべてのコマンドに影響を与える)、または設定してdiff.statGraphWidth=<width>(影響を与えませんgit format-patch)。3番目のパラメータを指定<count>することで、最初の<count>行に出力を制限し、その後にさらに出力がある...場合はそれに続けます。

These parameters can also be set individually with --stat-width=<width>, --stat-name-width=<name-width> and --stat-count=<count>.これらのパラメータは、またして個別に設定することができ--stat-width=<width>--stat-name-width=<name-width>そして--stat-count=<count>

--compact-summary

Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally "+l" if it’s a symlink) and mode changes ("+x" or "-x" for adding or removing executable bit respectively) in diffstat. The information is put between the filename part and the graph part. Implies --stat.ファイルの作成や削除( "new"または "gone"、オプションで "+ l"、シンボリックリンクの場合はオプションの "+ l"など)やモードの変更(追加または削除の場合は "+ x"や "-x")などの拡張ヘッダー情報の要約を出力します。 diffstatの実行可能ビット)情報はファイル名部分とグラフ部分の間に置かれます。ほのめかし--statます。

--numstat

Similar to --stat, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly. For binary files, outputs two - instead of saying 0 0.に似て--statいますが、追加された行と削除された行の数を10進表記とパス名で表示します。バイナリファイルの場合は、-言う代わりに2 を出力します0 0

--shortstat

Output only the last line of the --stat format containing total number of modified files, as well as number of added and deleted lines.--stat変更されたファイルの総数と、追加された行と削除された行の数を含むフォーマットの最後の行だけを出力します。

--dirstat[=<param1,param2,…​>] --dirstat [= <param1、param2、…>]

Output the distribution of relative amount of changes for each sub-directory. The behavior of --dirstat can be customized by passing it a comma separated list of parameters. The defaults are controlled by the diff.dirstat configuration variable (see git-config[1]). The following parameters are available:各サブディレクトリの相対的な変更量の分布を出力します。の振る舞いは--dirstat、パラメータのコンマ区切りのリストを渡すことでカスタマイズできます。デフォルトはdiff.dirstat設定変数によって制御されます(git-config [1]参照)。以下のパラメータが利用可能です。

changes

Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination. This ignores the amount of pure code movements within a file. In other words, rearranging lines in a file is not counted as much as other changes. This is the default behavior when no parameter is given.転送元から削除された行、または転送先に追加された行をカウントして、dirstat番号を計算します。これはファイル内の純粋なコードの移動量を無視します。つまり、ファイル内の行の並べ替えは、他の変更ほどにはカウントされません。これは、パラメータが指定されていない場合のデフォルトの動作です。

lines

Compute the dirstat numbers by doing the regular line-based diff analysis, and summing the removed/added line counts. (For binary files, count 64-byte chunks instead, since binary files have no natural concept of lines). This is a more expensive --dirstat behavior than the changes behavior, but it does count rearranged lines within a file as much as other changes. The resulting output is consistent with what you get from the other --*stat options.通常の行ベースの差分分析を行い、削除/追加された行数を合計することによって、dirstat数を計算します。(バイナリファイルの場合、バイナリファイルには行の自然な概念がないため、代わりに64バイトのチャンクを数えてください)。これは--dirstat動作よりも高価な動作ですが、changes他の変更と同じくらいファイル内の再配置された行をカウントします。結果の出力は、他の--*statオプションから得られるものと一致しています。

files

Compute the dirstat numbers by counting the number of files changed. Each changed file counts equally in the dirstat analysis. This is the computationally cheapest --dirstat behavior, since it does not have to look at the file contents at all.変更されたファイルの数を数えることによってdirstat番号を計算します。それぞれの変更されたファイルは、嫌悪感分析において等しく数えられます。--dirstatファイルの内容をまったく調べる必要がないため、これは計算上最も安価な動作です。

cumulative

Count changes in a child directory for the parent directory as well. Note that when using cumulative, the sum of the percentages reported may exceed 100%. The default (non-cumulative) behavior can be specified with the noncumulative parameter.親ディレクトリの子ディレクトリの変更もカウントします。使用時cumulativeに、報告されたパーセンテージの合計が100%を超える可能性があることに注意してください。デフォルトの(非累積的な)振る舞いはnoncumulativeパラメータで指定できます。

<limit>

An integer parameter specifies a cut-off percent (3% by default). Directories contributing less than this percentage of the changes are not shown in the output.整数パラメータは、カットオフパーセント(デフォルトでは3%)を指定します。この割合より少ない変更を提供しているディレクトリは、出力には表示されません。

Example: The following will count changed files, while ignoring directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories: --dirstat=files,10,cumulative.例:以下は、変更されたファイルの総数の10%未満のディレクトリを無視し、変更されたファイルを数え、親ディレクトリに子ディレクトリの数を累積します--dirstat=files,10,cumulative

--summary - 概要

Output a condensed summary of extended header information such as creations, renames and mode changes.作成、名前変更、モード変更などの拡張ヘッダー情報の要約を出力します。

--no-renames

Turn off rename detection, even when the configuration file gives the default to do so.設定ファイルがデフォルトを指定している場合でも、名前の変更の検出を無効にします。

--full-index

Instead of the first handful of characters, show the full pre- and post-image blob object names on the "index" line when generating patch format output.最初の一握りの文字の代わりに、パッチフォーマットの出力を生成するときに、 "index"行に完全なプリイメージとポストイメージのBLOBオブジェクト名を表示します。

--binary - バイナリ

In addition to --full-index, output a binary diff that can be applied with git-apply.に加えて--full-index、適用できるバイナリ差分を出力しgit-applyます。

--abbrev[=<n>] --abbrev [= <n>]

Instead of showing the full 40-byte hexadecimal object name in diff-raw format output and diff-tree header lines, show only a partial prefix. This is independent of the --full-index option above, which controls the diff-patch output format. Non default number of digits can be specified with --abbrev=<n>.diff-raw形式の出力とdiff-treeヘッダー行に完全な40バイトの16進数のオブジェクト名を表示する代わりに、部分的なプレフィックスのみを表示します。これは--full-index、diff-patchの出力フォーマットを制御する上記のオプションとは無関係です。デフォルト以外の桁数をで指定できます--abbrev=<n>

-B[<n>][/<m>] -B [<n>] [/ <m>]
--break-rewrites[=[<n>][/<m>]] --break-rewritees [= [<n>] [/ <m>]]

Break complete rewrite changes into pairs of delete and create. This serves two purposes:完全な書き換えの変更を削除と作成のペアに分割します。これには2つの目的があります。

It affects the way a change that amounts to a total rewrite of a file not as a series of deletion and insertion mixed together with a very few lines that happen to match textually as the context, but as a single deletion of everything old followed by a single insertion of everything new, and the number m controls this aspect of the -B option (defaults to 60%). -B/70% specifies that less than 30% of the original should remain in the result for Git to consider it a total rewrite (i.e. otherwise the resulting patch will be a series of deletion and insertion mixed together with context lines).それは、文脈としてテキスト的に一致することが起こる非常に少数の行と混合された一連の削除と挿入としてではなく、ファイルの完全な書き換えに相当する変更に影響する方法に影響します。新しいものすべてを1回挿入mすると、その数によって-Bオプションのこの側面が制御されます(デフォルトは60%)。-B/70%Gitが完全な書き換えと見なすには、元の30%未満を結果に残すように指定します(そうでなければ、結果として得られるパッチは、一連の削除と挿入がコンテキスト行と混在したものになります)。

When used with -M, a totally-rewritten file is also considered as the source of a rename (usually -M only considers a file that disappeared as the source of a rename), and the number n controls this aspect of the -B option (defaults to 50%). -B20% specifies that a change with addition and deletion compared to 20% or more of the file’s size are eligible for being picked up as a possible source of a rename to another file.-Mと一緒に使用すると、完全に書き換えられたファイルも名前変更のソースと見なされ(通常、-Mは、名前変更のソースとして表示されなくなったファイルのみを考慮します)、- nBオプションのこの側面を制御します。デフォルトは50%です。-B20%ファイルのサイズの20%以上と比較した追加および削除による変更が、別のファイルへの名前変更の可能性のあるソースとして選択されるのに適格であることを指定します。

-M[<n>] -M [<n>]
--find-renames[=<n>] --find-renames [= <n>]

Detect renames. If n is specified, it is a threshold on the similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn’t changed. Without a % sign, the number is to be read as a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as -M5%. To limit detection to exact renames, use -M100%. The default similarity index is 50%.名前変更を検出します。n指定されている場合、それは類似性インデックス(つまり、ファイルのサイズと比較した追加/削除の量)に関するしきい値です。たとえば-M90%、ファイルの90%以上が変更されていない場合、Gitは削除/追加のペアを名前の変更と見なす必要があります。%符号なしの場合、数値は小数点の前に小数部として読み取られます。すなわち、-M50.5 になるので、と同じ-M50%です。同様に、-M05と同じ-M5%です。検出を正確な名前変更に限定するには、を使用します-M100%。デフォルトの類似度は50%です。

-C[<n>] -C [<n>]
--find-copies[=<n>] --find-copies [= <n>]

Detect copies as well as renames. See also --find-copies-harder. If n is specified, it has the same meaning as for -M<n>.コピーと名前の変更を検出します。もご覧ください--find-copies-hardernを指定した場合は、と同じ意味になり-M<n>ます。

--find-copies-harder

For performance reasons, by default, -C option finds copies only if the original file of the copy was modified in the same changeset. This flag makes the command inspect unmodified files as candidates for the source of copy. This is a very expensive operation for large projects, so use it with caution. Giving more than one -C option has the same effect.パフォーマンス上の理由から、デフォルトで-Cは、コピーの元のファイルが同じチェンジセット内で変更されている場合にのみコピーが検索されます。このフラグは、コピー元の候補として未修正のファイルを検査します。これは大規模プロジェクトでは非常に高価な操作なので、慎重に使用してください。複数の-Cオプションを指定しても同じ効果があります。

-D
--irreversible-delete

Omit the preimage for deletes, i.e. print only the header but not the diff between the preimage and /dev/null. The resulting patch is not meant to be applied with patch or git apply; this is solely for people who want to just concentrate on reviewing the text after the change. In addition, the output obviously lacks enough information to apply such a patch in reverse, even manually, hence the name of the option.削除のためにpreimageを省略してください、すなわち、preimageとの間の差分ではなくヘッダーだけを印刷してください/dev/null。得られたパッチが適用されることを意図されていないpatch、またはgit apply、これは、変更後のテキストを見直すことに専念したい人のためだけのものです。さらに、そのようなパッチを手動でも逆に適用するのに十分な情報が出力に欠けているため、オプションの名前です。

When used together with -B, omit also the preimage in the deletion part of a delete/create pair.一緒に使用する場合-Bは、削除/作成ペアの削除部分のプレイメージも省略します。

-l<num> -l <番号>

The -M and -C options require O(n^2) processing time where n is the number of potential rename/copy targets. This option prevents rename/copy detection from running if the number of rename/copy targets exceeds the specified number.-Mそして-Cオプションは、nは電位リネーム/コピー標的の数はO(N ^ 2)の処理時間を必要とします。このオプションは、名前変更/コピーターゲットの数が指定された数を超えた場合に名前変更/コピー検出が実行されないようにします。

-O<orderfile> -O <orderfile>

Control the order in which files appear in the output. This overrides the diff.orderFile configuration variable (see git-config[1]). To cancel diff.orderFile, use -O/dev/null.出力に表示されるファイルの順序を制御します。これはdiff.orderFile設定変数を上書きします(git-config [1]を参照)。キャンセルするにdiff.orderFileはを使用してください-O/dev/null

The output order is determined by the order of glob patterns in <orderfile>. All files with pathnames that match the first pattern are output first, all files with pathnames that match the second pattern (but not the first) are output next, and so on. All files with pathnames that do not match any pattern are output last, as if there was an implicit match-all pattern at the end of the file. If multiple pathnames have the same rank (they match the same pattern but no earlier patterns), their output order relative to each other is the normal order.出力順序は、<orderfile>内のglobパターンの順序によって決まります。最初のパターンと一致するパス名を持つすべてのファイルが最初に出力され、2番目のパターンと一致するが最初のパターンと一致しないパス名を持つすべてのファイルが次に出力されます。どのパターンとも一致しないパス名を持つすべてのファイルは、あたかもファイルの終わりに暗黙の全部突き合わせパターンがあったかのように、最後に出力されます。複数のパス名が同じランクを持つ場合(それらは同じパターンに一致しますが、以前のパターンには一致しない場合)、互いに対する相対的な出力順序は通常の順序です。

<orderfile> is parsed as follows:<orderfile>は次のように解析されます。

  • Blank lines are ignored, so they can be used as separators for readability.空白行は無視されるため、読みやすくするために区切り文字として使用できます。

  • Lines starting with a hash ("#") are ignored, so they can be used for comments. Add a backslash ("\") to the beginning of the pattern if it starts with a hash.ハッシュ( " #")で始まる行は無視されるため、コメントに使用できます。\ハッシュで始まる場合は、パターンの先頭に円記号( " ")を追加します。

  • Each other line contains a single pattern.他の各行には単一のパターンが含まれています。

Patterns have the same syntax and semantics as patterns used for fnmatch(3) without the FNM_PATHNAME flag, except a pathname also matches a pattern if removing any number of the final pathname components matches the pattern. For example, the pattern "foo*bar" matches "fooasdfbar" and "foo/bar/baz/asdf" but not "foobarx".パターンは、FNM_PATHNAMEフラグなしでfnmatch(3)に使用されるパターンと同じ構文および意味論を持ちます。ただし、最終パス名の構成要素をいくつでも削除した場合、パス名もパターンと一致する点が異なります。たとえば、パターン " foo*bar"は " fooasdfbar"と " foo/bar/baz/asdf"には一致しますが " "には一致しませんfoobarx

-a
--text - テキスト

Treat all files as text.すべてのファイルをテキストとして扱います。

--ignore-cr-at-eol

Ignore carriage-return at the end of line when doing a comparison.比較をするとき、行末での復帰を無視します。

--ignore-space-at-eol

Ignore changes in whitespace at EOL.EOLで空白の変更を無視します。

-b
--ignore-space-change

Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.空白の量の変化を無視します。これは行末の空白を無視し、1つ以上の空白文字の他のすべてのシーケンスを等価と見なします。

-w
--ignore-all-space

Ignore whitespace when comparing lines. This ignores differences even if one line has whitespace where the other line has none.行を比較するときに空白を無視します。片方の行に空白があり、もう一方の行に空白がない場合でも、これは違いを無視します。

--ignore-blank-lines

Ignore changes whose lines are all blank.すべての行が空白になっている変更を無視します。

--inter-hunk-context=<lines> --inter-hunk-context = <lines>

Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other. Defaults to diff.interHunkContext or 0 if the config option is unset.指定した行数までの差分ハンク間のコンテキストを表示し、それによって互いに近いハンクを融合します。diff.interHunkContextconfigオプションが設定されていない場合、デフォルトは0または0です。

-W
--function-context - 機能コンテキスト

Show whole surrounding functions of changes.変更の周囲の機能全体を表示します。

--ext-diff

Allow an external diff helper to be executed. If you set an external diff driver with gitattributes[5], you need to use this option with git-log[1] and friends.外部のdiffヘルパーを実行できるようにします。gitattributes [5]で外部のdiffドライバを設定した場合は、git-log [1]とその仲間と共にこのオプションを使う必要があります。

--no-ext-diff

Disallow external diff drivers.外部のdiffドライバを許可しません。

--textconv
--no-textconv

Allow (or disallow) external text conversion filters to be run when comparing binary files. See gitattributes[5] for details. Because textconv filters are typically a one-way conversion, the resulting diff is suitable for human consumption, but cannot be applied. For this reason, textconv filters are enabled by default only for git-diff[1] and git-log[1], but not for git-format-patch[1] or diff plumbing commands.バイナリファイルを比較するときに外部テキスト変換フィルタを実行することを許可(または禁止)します。詳細はgitattributes [5]を見てください。textconvフィルタは通常一方向の変換であるため、結果の差分は人間の消費には適していますが、適用することはできません。このため、textconvフィルタは、git-diff [1]およびgit-log [1]に対してのみデフォルトで有効になりますが、git-format-patch [1]またはdiff plumbingコマンドには無効になります。

--ignore-submodules[=<when>] --ignore-submodules [= <when>]

Ignore changes to submodules in the diff generation. <when> can be either "none", "untracked", "dirty" or "all", which is the default. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the ignore option in git-config[1] or gitmodules[5]. When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content). Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior until 1.7.0). Using "all" hides all changes to submodules.差分生成でサブモジュールへの変更を無視します。<when>は、 "none"、 "untracked"、 "dirty"、または "all"のいずれかです。これがデフォルトです。noneを使用すると、追跡されていないファイルまたは変更されたファイルが含まれている場合、またはそのHEADがスーパープロジェクトに記録されたコミットと異なる場合に変更されたサブモジュールが考慮されます。git -config [1]またはgitmodules [ 1]ignoreオプションの設定を上書きするために使用できます。 5]。「追跡されていない」が使用されている場合、サブモジュールは追跡されていないコンテンツのみを含む場合はダーティとは見なされません(ただし、変更されたコンテンツについてはスキャンされます)。"dirty"を使用しても、サブモジュールの作業ツリーに対するすべての変更は無視されます。スーパープロジェクトに保存されているコミットへの変更のみが表示されます(これは1.7.0までの動作でした)。"all"を使用すると、サブモジュールに対するすべての変更が隠されます。

--src-prefix=<prefix> --src-prefix = <prefix>

Show the given source prefix instead of "a/"."a /"の代わりに与えられたソースプレフィックスを表示します。

--dst-prefix=<prefix> --dst-prefix = <prefix>

Show the given destination prefix instead of "b/"."b /"の代わりに与えられた宛先プレフィックスを表示します。

--no-prefix

Do not show any source or destination prefix.送信元または宛先のプレフィックスを表示しません。

--line-prefix=<prefix> --line-prefix = <prefix>

Prepend an additional prefix to every line of output.出力の各行に追加の接頭辞を付けます。

--ita-invisible-in-index

By default entries added by "git add -N" appear as an existing empty file in "git diff" and a new file in "git diff --cached". This option makes the entry appear as a new file in "git diff" and non-existent in "git diff --cached". This option could be reverted with --ita-visible-in-index. Both options are experimental and could be removed in future.デフォルトでは、 "git add -N"で追加されたエントリは、 "git diff"には既存の空のファイルとして、 "git diff --cached"には新しいファイルとして表示されます。このオプションはエントリを "git diff"では新しいファイルとして、 "git diff --cached"では存在しないように見せます。このオプションは元に戻すことができます--ita-visible-in-index。どちらのオプションも実験的であり、将来削除される可能性があります。

For more detailed explanation on these common options, see also gitdiffcore[7].これらの共通オプションに関するより詳細な説明については、gitdiffcore [7]も参照してください。

-<n> - <n>

Prepare patches from the topmost <n> commits.一番上の<n>コミットからパッチを準備します。

-o <dir> -o <ディレクトリ>
--output-directory <dir>

Use <dir> to store the resulting files, instead of the current working directory.現在の作業ディレクトリではなく、<dir>を使用して結果のファイルを保存します。

-n
--numbered - 番号付き

Name output in [PATCH n/m] format, even with a single patch.単一パッチでも[PATCH n / m]形式で名前が出力されます。

-N
--no-numbered - 番号なし

Name output in [PATCH] format.[PATCH]形式で名前が出力されます。

--start-number <n>

Start numbering the patches at <n> instead of 1.パッチの番号付けを1ではなく<n>から始めます。

--numbered-files - 番号付きファイル

Output file names will be a simple number sequence without the default first line of the commit appended.出力ファイル名は、コミットのデフォルトの最初の行が追加されていない単純な番号シーケンスになります。

-k
--keep-subject

Do not strip/add [PATCH] from the first line of the commit log message.コミットログメッセージの最初の行から[PATCH]を削除または追加しないでください。

-s
--signoff - サインオフ

Add Signed-off-by: line to the commit message, using the committer identity of yourself. See the signoff option in git-commit[1] for more information.Signed-off-by:自分のコミッターIDを使用して、コミットメッセージに行を追加します。詳細についてはgit-commit [1]のsignoffオプションを参照してください。

--stdout

Print all commits to the standard output in mbox format, instead of creating a file for each one.それぞれのファイルを作成する代わりに、すべてのコミットをmboxフォーマットで標準出力に出力します。

--attach[=<boundary>] --attach [= <境界>]

Create multipart/mixed attachment, the first part of which is the commit message and the patch itself in the second part, with Content-Disposition: attachment.マルチパート/ミックスアタッチメントを作成します。最初の部分はコミットメッセージで、2番目の部分はパッチそのものContent-Disposition: attachmentです。

--no-attach

Disable the creation of an attachment, overriding the configuration setting.構成設定を上書きして、添付ファイルの作成を無効にします。

--inline[=<boundary>] --inline [= <boundary>]

Create multipart/mixed attachment, the first part of which is the commit message and the patch itself in the second part, with Content-Disposition: inline.マルチパート/ミックスアタッチメントを作成します。最初の部分はコミットメッセージで、2番目の部分はパッチそのものContent-Disposition: inlineです。

--thread[=<style>] --thread [= <style>]
--no-thread

Controls addition of In-Reply-To and References headers to make the second and subsequent mails appear as replies to the first. Also controls generation of the Message-Id header to reference.2番目以降のメールが最初のメールに対する返信として表示されるように、ヘッダーの追加In-Reply-ToReferencesヘッダーを制御します。Message-Id参照するヘッダの生成も制御します。

The optional <style> argument can be either shallow or deep. shallow threading makes every mail a reply to the head of the series, where the head is chosen from the cover letter, the --in-reply-to, and the first patch mail, in this order. deep threading makes every mail a reply to the previous one.オプションの<style>引数は、shallowまたはのいずれかdeepです。浅いスレッドは、すべてのメールをシリーズの先頭への返信にします。先頭には、カバーレター、--in-reply-to先頭のパッチメール、および最初のパッチメールの順に選択されます。深いスレッド化により、すべてのメールが前のメールに返信されます。

The default is --no-thread, unless the format.thread configuration is set. If --thread is specified without a style, it defaults to the style specified by format.thread if any, or else shallow.構成が設定されてい--no-threadない限り、デフォルトはですformat.thread。場合--threadによって指定されたスタイルにスタイルなしで指定され、それがデフォルトでformat.threadあれば、あるいはそうでありませんshallow

Beware that the default for git send-email is to thread emails itself. If you want git format-patch to take care of threading, you will want to ensure that threading is disabled for git send-email.git send-emailのデフォルトは電子メールを自分自身に通すことです。あなたgit format-patchがスレッドの世話をしたい場合は、スレッドが無効になっていることを確認する必要がありますgit send-email

--in-reply-to=Message-Id --in-reply-to =メッセージID

Make the first mail (or all the mails with --no-thread) appear as a reply to the given Message-Id, which avoids breaking threads to provide a new patch series.最初のメール(またはすべてのメール--no-thread)を指定のMessage-Idへの返信として表示するようにします。これにより、新しいパッチシリーズを提供するためにスレッドが壊れることを回避できます。

--ignore-if-in-upstream

Do not include a patch that matches a commit in <until>..<since>. This will examine all patches reachable from <since> but not from <until> and compare them with the patches being generated, and any patch that matches is ignored.コミットに一致するパッチを<until> .. <since>に含めないでください。これは、<since>からは到達可能だが<until>からは到達できないすべてのパッチを調べ、それらを生成中のパッチと比較します。一致するパッチはすべて無視されます。

--subject-prefix=<Subject-Prefix> --subject-prefix = <Subject-Prefix>

Instead of the standard [PATCH] prefix in the subject line, instead use [<Subject-Prefix>]. This allows for useful naming of a patch series, and can be combined with the --numbered option.件名の標準の[PATCH]プレフィックスの代わりに、代わりに[<Subject-Prefix>]を使用します。これはパッチシリーズの便利な命名を可能にし、--numberedオプションと組み合わせることができます。

--rfc

Alias for --subject-prefix="RFC PATCH". RFC means "Request For Comments"; use this when sending an experimental patch for discussion rather than application.別名--subject-prefix="RFC PATCH"。RFCは「Request For Comments」を意味します。実験的なパッチを討議のためにアプリケーションではなく送るときに使用してください。

-v <n>
--reroll-count=<n> --reroll-count = <n>

Mark the series as the <n>-th iteration of the topic. The output filenames have v<n> prepended to them, and the subject prefix ("PATCH" by default, but configurable via the --subject-prefix option) has ` v<n>` appended to it. E.g. --reroll-count=4 may produce v4-0001-add-makefile.patch file that has "Subject: [PATCH v4 1/20] Add makefile" in it.トピックのn番目の反復としてシリーズをマークします。出力ファイル名がv<n>それらの前に追加され、件名の接頭辞(デフォルトでは "PATCH"ですが、--subject-prefixオプションで設定可能です)に `v <n>`が追加されています。例えば、 "Subject:[PATCH v4 1/20] Add makefile" --reroll-count=4を含むv4-0001-add-makefile.patchファイルを作成するかもしれません。

--to=<email> --to = <email>

Add a To: header to the email headers. This is in addition to any configured headers, and may be used multiple times. The negated form --no-to discards all To: headers added so far (from config or command line).To:メールヘッダーにヘッダーを追加します。これは設定済みのヘッダに追加されるもので、複数回使用することができます。否定形式--no-toは、To:(configまたはコマンドラインから)これまでに追加されたすべてのヘッダを破棄します。

--cc=<email> --cc = <email>

Add a Cc: header to the email headers. This is in addition to any configured headers, and may be used multiple times. The negated form --no-cc discards all Cc: headers added so far (from config or command line).Cc:メールヘッダーにヘッダーを追加します。これは設定済みのヘッダに追加されるもので、複数回使用することができます。否定形式--no-ccは、Cc:(configまたはコマンドラインから)これまでに追加されたすべてのヘッダを破棄します。

--from - から
--from=<ident> --from = <ident>

Use ident in the From: header of each commit email. If the author ident of the commit is not textually identical to the provided ident, place a From: header in the body of the message with the original author. If no ident is given, use the committer ident.各コミットEメールのヘッダーに使用identFrom:ます。コミットの作者のアイデンティティが提供されたものとテキスト的に同一ではない場合、元の作者と一緒にメッセージの本文にヘッダをident置きFrom:ます。no identが与えられた場合は、committer identを使用してください。

Note that this option is only useful if you are actually sending the emails and want to identify yourself as the sender, but retain the original author (and git am will correctly pick up the in-body header). Note also that git send-email already handles this transformation for you, and this option should not be used if you are feeding the result to git send-email.このオプションは、実際にメールを送信していて自分自身を送信者として識別したいが元の作者を保持したい(そしてgit am本文のヘッダーを正しくピックアップする)場合にのみ有用であることに注意してください。git send-emailこの変換はすでにあなたのために処理されているので注意してくださいgit send-email。もしあなたが結果を与えているのであれば、このオプションは使わないでください。

--add-header=<header> --add-header = <ヘッダ>

Add an arbitrary header to the email headers. This is in addition to any configured headers, and may be used multiple times. For example, --add-header="Organization: git-foo". The negated form --no-add-header discards all (To:, Cc:, and custom) headers added so far from config or command line.電子メールのヘッダーに任意のヘッダーを追加します。これは設定済みのヘッダに追加されるもので、複数回使用することができます。たとえば、--add-header="Organization: git-foo"。否定形は--no-add-header破棄全てTo:Cc:これまでに設定するか、コマンドラインから添加し、そしてカスタム)ヘッダー。

--[no-]cover-letter - [no-]カバーレター

In addition to the patches, generate a cover letter file containing the branch description, shortlog and the overall diffstat. You can fill in a description in the file before sending it out.パッチに加えて、ブランチの説明、shortlog、および全体のdiffstatを含むカバーレターファイルを生成します。送信する前に、ファイルに説明を記入することができます。

--interdiff=<previous> --interdiff = <前>

As a reviewer aid, insert an interdiff into the cover letter, or as commentary of the lone patch of a 1-patch series, showing the differences between the previous version of the patch series and the series currently being formatted. previous is a single revision naming the tip of the previous series which shares a common base with the series being formatted (for example git format-patch --cover-letter --interdiff=feature/v1 -3 feature/v2).査読者の援助として、カバーレターに相互拡散を挿入するか、1パッチシリーズの単独パッチの解説として、パッチシリーズの前のバージョンと現在フォーマットされているシリーズとの違いを示してください。previous(例えばgit format-patch --cover-letter --interdiff=feature/v1 -3 feature/v2)フォーマットされているシリーズと共通のベースを共有する前のシリーズの先端を命名する単一の改訂です。

--range-diff=<previous> --range-diff = <前>

As a reviewer aid, insert a range-diff (see git-range-diff[1]) into the cover letter, or as commentary of the lone patch of a 1-patch series, showing the differences between the previous version of the patch series and the series currently being formatted. previous can be a single revision naming the tip of the previous series if it shares a common base with the series being formatted (for example git format-patch --cover-letter --range-diff=feature/v1 -3 feature/v2), or a revision range if the two versions of the series are disjoint (for example git format-patch --cover-letter --range-diff=feature/v1~3..feature/v1 -3 feature/v2).査読者の助けとして、range-diff(git-range-diff [1]を参照)をカバーレターに挿入するか、1パッチシリーズの唯一のパッチの解説として、以前のバージョンのパッチとの違いを示してください。 seriesと現在フォーマット中のseries previousフォーマットされているシリーズと共通のベースを共有している場合は前のシリーズのチップを命名する単一のリビジョン、シリーズgit format-patch --cover-letter --range-diff=feature/v1 -3 feature/v2の2つのバージョンが互いに素である場合はリビジョン範囲になりgit format-patch --cover-letter --range-diff=feature/v1~3..feature/v1 -3 feature/v2ます。

Note that diff options passed to the command affect how the primary product of format-patch is generated, and they are not passed to the underlying range-diff machinery used to generate the cover-letter material (this may change in the future).このコマンドに渡されるdiffオプションは、一次積の生成方法に影響し、カバーレター素材の生成に使用されるformat-patch基礎となるrange-diff機構には渡されません(これは将来変更される可能性があります)。

--creation-factor=<percent> --creation-factor = <パーセント>

Used with --range-diff, tweak the heuristic which matches up commits between the previous and current series of patches by adjusting the creation/deletion cost fudge factor. See git-range-diff[1]) for details.とともに使用して--range-diff、作成/削除コストファッジファクターを調整することによって、前のパッチと現在の一連のパッチの間でコミットを一致させるヒューリスティックを微調整します。詳細はgit-range-diff [1]を参照してください。

--notes[=<ref>] --notes [= <ref>]

Append the notes (see git-notes[1]) for the commit after the three-dash line.3点鎖線の後にコミットのメモを追加します(git-notes [1]を参照)。

The expected use case of this is to write supporting explanation for the commit that does not belong to the commit log message proper, and include it with the patch submission. While one can simply write these explanations after format-patch has run but before sending, keeping them as Git notes allows them to be maintained between versions of the patch series (but see the discussion of the notes.rewrite configuration options in git-notes[1] to use this workflow).これが期待されるユースケースは、適切なコミットログメッセージに属さないコミットのための裏付けとなる説明を書き、それをパッチ提出に含めることです。これらの説明format-patchは実行後で送信前に簡単に書くことができますが、Git notesとして残しておくことでパッチシリーズのバージョン間でそれらを維持することができます(ただし、このワークフローを使用するにnotes.rewritegit-notes [1]の設定オプションの説明を参照)。)

--[no-]signature=<signature> - [no-] signature = <署名>

Add a signature to each message produced. Per RFC 3676 the signature is separated from the body by a line with '-- ' on it. If the signature option is omitted the signature defaults to the Git version number.生成された各メッセージに署名を追加します。RFC 3676によると、署名は ' - 'が付いた行で本文と分離されています。signatureオプションが省略された場合、署名はデフォルトでGitバージョン番号になります。

--signature-file=<file> --signature-file = <ファイル>

Works just like --signature except the signature is read from a file.署名がファイルから読み取られること以外は--signatureと同じように機能します。

--suffix=.<sfx> --suffix =。<sfx>

Instead of using .patch as the suffix for generated filenames, use specified suffix. A common alternative is --suffix=.txt. Leaving this empty will remove the .patch suffix..patch生成されたファイル名のサフィックスとして使用する代わりに、指定されたサフィックスを使用してください。一般的な方法は--suffix=.txtです。これを空のままにしておくと、.patch接尾辞が削除されます。

Note that the leading character does not have to be a dot; for example, you can use --suffix=-patch to get 0001-description-of-my-change-patch.先頭文字はドットである必要はありません。たとえば、あなたが--suffix=-patch取得するために使用することができます0001-description-of-my-change-patch

-q
--quiet - 静か

Do not print the names of the generated files to standard output.生成されたファイルの名前を標準出力に表示しません。

--no-binary

Do not output contents of changes in binary files, instead display a notice that those files changed. Patches generated using this option cannot be applied properly, but they are still useful for code review.バイナリファイルの変更内容を出力しないで、代わりにそれらのファイルが変更されたという通知を表示します。このオプションを使用して生成されたパッチは正しく適用できませんが、コードレビューにはまだ役立ちます。

--zero-commit

Output an all-zero hash in each patch’s From header instead of the hash of the commit.コミットのハッシュの代わりに各パッチのFromヘッダにオールゼロのハッシュを出力します。

--base=<commit> --base = <commit>

Record the base tree information to identify the state the patch series applies to. See the BASE TREE INFORMATION section below for details.ベースツリー情報を記録して、パッチシリーズが適用される状態を識別します。詳細については、下記の「基本ツリー情報」のセクションを参照してください。

--root - ルート

Treat the revision argument as a <revision range>, even if it is just a single commit (that would normally be treated as a <since>). Note that root commits included in the specified range are always formatted as creation patches, independently of this flag.ただ1つのコミットであっても、リビジョン引数を<リビジョン範囲>として扱います(通常<since>として扱われます)。指定された範囲に含まれるルートコミットは、このフラグとは関係なく、常に作成パッチとしてフォーマットされます。

--progress - 進捗

Show progress reports on stderr as patches are generated.パッチが生成されたときに標準エラー出力に関する進捗レポートを表示します。

CONFIGURATION設定

You can specify extra mail header lines to be added to each message, defaults for the subject prefix and file suffix, number patches when outputting more than one patch, add "To" or "Cc:" headers, configure attachments, and sign off patches with configuration variables.各メッセージに追加する追加のメールヘッダー行、件名のプレフィックスとファイルサフィックスのデフォルト、複数のパッチを出力するときのパッチの番号、 "To"または "Cc:"ヘッダーの追加、添付ファイルの設定、およびパッチのサインオフを指定できます。構成変数を使って。

[format]
	headers = "Organization: git-foo\n"
	subjectPrefix = CHANGE
	suffix = .txt
	numbered = auto
	to = <email>
	cc = <email>
	attach [ = mime-boundary-string ]
	signOff = true
	coverletter = auto

DISCUSSION討論

The patch produced by git format-patch is in UNIX mailbox format, with a fixed "magic" time stamp to indicate that the file is output from format-patch rather than a real mailbox, like so:git format-patchによって生成されたパッチはUNIXのメールボックスフォーマットで、ファイルが実際のメールボックスではなくformat-patchから出力されることを示すための固定された「マジック」タイムスタンプが付いています。

From 8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep 17 00:00:00 2001
From: Tony Luck <tony.luck@intel.com>
Date: Tue, 13 Jul 2010 11:42:54 -0700
Subject: [PATCH] =?UTF-8?q?[IA64]=20Put=20ia64=20config=20files=20on=20the=20?=
 =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20diet?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
arch/arm config files were slimmed down using a python script
(See commit c2330e286f68f1c408b4aa6515ba49d57f05beae comment)
Do the same for ia64 so we can have sleek & trim looking
...

Typically it will be placed in a MUA’s drafts folder, edited to add timely commentary that should not go in the changelog after the three dashes, and then sent as a message whose body, in our example, starts with "arch/arm config files were…​". On the receiving end, readers can save interesting patches in a UNIX mailbox and apply them with git-am[1].通常、それはMUAの下書きフォルダに置かれ、3つのダッシュの後にchangelogに入ってはいけないタイムリーなコメントを追加するように編集され、その後本文が "arch / arm config files"で始まるメッセージとして送られます。 ……」受信側では、読者は興味深いパッチをUNIXのメールボックスに保存してgit-am [1]で適用することができます。

When a patch is part of an ongoing discussion, the patch generated by git format-patch can be tweaked to take advantage of the git am --scissors feature. After your response to the discussion comes a line that consists solely of "-- >8 --" (scissors and perforation), followed by the patch with unnecessary header fields removed:パッチが進行中の議論の一部であるとき、git format-patchによって生成されたパッチはgit am --scissors機能を利用するために微調整することができます。議論に対するあなたの返答の後に " -- >8 --"(はさみとミシン目)だけで構成される行が続き、その後に不要なヘッダフィールドが削除されたパッチが続きます。

...
> So we should do such-and-such.
Makes sense to me.  How about this patch?
-- >8 --
Subject: [IA64] Put ia64 config files on the Uwe Kleine-K??nig diet
arch/arm config files were slimmed down using a python script
...

When sending a patch this way, most often you are sending your own patch, so in addition to the "From $SHA1 $magic_timestamp" marker you should omit From: and Date: lines from the patch file. The patch title is likely to be different from the subject of the discussion the patch is in response to, so it is likely that you would want to keep the Subject: line, like the example above.この方法でパッチを送るとき、たいていあなたはあなた自身のパッチを送っているので、 " From $SHA1 $magic_timestamp"マーカーに加えてパッチファイルからFrom:Date:行を省くべきです。パッチのタイトルは、パッチが対応しているディスカッションの主題とは異なる可能性があるため、上記の例のように、Subject:行をそのまま使用することをお勧めします。

Checking for patch corruptionパッチ破損の確認

Many mailers if not set up properly will corrupt whitespace. Here are two common types of corruption:正しく設定されていないと、多くのメーラーが空白を壊すでしょう。これが2つの一般的な種類の破損です。

  • Empty context lines that do not have any whitespace.持っていない空のコンテキスト行の任意の空白を。

  • Non-empty context lines that have one extra whitespace at the beginning.先頭に余分な空白が1つある空でないコンテキスト行

One way to test if your MUA is set up correctly is:MUAが正しく設定されているかどうかをテストする1つの方法は、次のとおりです。

  • Send the patch to yourself, exactly the way you would, except with To: and Cc: lines that do not contain the list and maintainer address.リストとメンテナのアドレスが含まれていないTo:とCc:の行を除いて、あなたがしたのと全く同じ方法でパッチを自分自身に送ってください。

  • Save that patch to a file in UNIX mailbox format. Call it a.patch, say.そのパッチをUNIXメールボックス形式のファイルに保存します。それをa.patchと呼びましょう。

  • Apply it:それを適用する:

    $ git fetch <project> master:test-apply
    $ git checkout test-apply
    $ git reset --hard
    $ git am a.patch

If it does not apply correctly, there can be various reasons.正しく適用されない場合は、さまざまな理由が考えられます。

  • The patch itself does not apply cleanly. That is bad but does not have much to do with your MUA. You might want to rebase the patch with git-rebase[1] before regenerating it in this case.パッチ自体はきれいには適用されません。それは悪いことですが、あなたのMUAとはあまり関係がありません。この場合、パッチを再生成する前に、git-rebase [1]でパッチをリベースすることをお勧めします。

  • The MUA corrupted your patch; "am" would complain that the patch does not apply. Look in the .git/rebase-apply/ subdirectory and see what patch file contains and check for the common corruption patterns mentioned above.MUAによってパッチが破損しました。"am"はパッチが適用されないと文句を言うでしょう。.git / rebase-apply /サブディレクトリを調べて、パッチファイルに含まれているものを確認し、上記の一般的な破損パターンを確認します。

  • While at it, check the info and final-commit files as well. If what is in final-commit is not exactly what you would want to see in the commit log message, it is very likely that the receiver would end up hand editing the log message when applying your patch. Things like "Hi, this is my first patch.\n" in the patch e-mail should come after the three-dash line that signals the end of the commit message.その間に、infoファイルとfinal-commitファイルもチェックしてください。あるものならば、最終的なコミットコミットログメッセージに表示したいものを正確にではない、受信機があなたのパッチを適用する際に、ログメッセージを編集し、手を終わるだろう可能性が非常に高いです。パッチメールの "こんにちは、これが私の最初のパッチです。\ n"のようなものは、コミットメッセージの終わりを知らせる3つのダッシュの後にくるべきです。

MUA-SPECIFIC HINTSMUA特有のヒント

Here are some hints on how to successfully submit patches inline using various mailers.さまざまなメーラーを使用してインラインでパッチを正常に送信する方法に関するヒントがいくつかあります。

GMail

GMail does not have any way to turn off line wrapping in the web interface, so it will mangle any emails that you send. You can however use "git send-email" and send your patches through the GMail SMTP server, or use any IMAP email client to connect to the google IMAP server and forward the emails through that.GMailにはWebインターフェースで行の折り返しをオフにする方法がないため、送信したEメールを混乱させることになります。ただし、 "git send-email"を使用してGMail SMTPサーバーを介してパッチを送信することも、IMAP電子メールクライアントを使用してGoogle IMAPサーバーに接続して電子メールを転送することもできます。

For hints on using git send-email to send your patches through the GMail SMTP server, see the EXAMPLE section of git-send-email[1].git send-emailを使ってあなたのパッチをGMail SMTPサーバを通して送るためのヒントについてはgit-send-email [1]の例のセクションを見てください。

For hints on submission using the IMAP interface, see the EXAMPLE section of git-imap-send[1].IMAPインターフェースを使用した送信に関するヒントについては、git-imap-send [1]のEXAMPLEセクションを参照してください。

Thunderbirdサンダーバード

By default, Thunderbird will both wrap emails as well as flag them as being format=flowed, both of which will make the resulting email unusable by Git.デフォルトでは、Thunderbirdは電子メールをラップし、format = flowedであることを示すフラグを立てます。その結果、Gitでは結果の電子メールを使用できなくなります。

There are three different approaches: use an add-on to turn off line wraps, configure Thunderbird to not mangle patches, or use an external editor to keep Thunderbird from mangling the patches.3つの異なるアプローチがあります:アドオンを使って行の折り返しを止める、Thunderbirdがパッチを壊さないように設定する、あるいは外部エディタを使ってThunderbirdがパッチを壊さないようにする。

Approach #1 (add-on)アプローチ1(アドオン)

Install the Toggle Word Wrap add-on that is available from https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/ It adds a menu entry "Enable Word Wrap" in the composer’s "Options" menu that you can tick off. Now you can compose the message as you otherwise do (cut + paste, git format-patch | git imap-send, etc), but you have to insert line breaks manually in any text that you type.https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/から入手可能なToggle Word Wrapアドオンをインストールします。作曲家の[オプション]メニューに[Enable Word Wrap]メニュー項目を追加します。あなたはカチカチ音をたてることができます。これで、他の方法(カット+貼り付け、git format-patch | git imap-sendなど)でメッセージを作成できますが、入力したテキストには改行を手動で挿入する必要があります。

Approach #2 (configuration)アプローチ2(構成)

Three steps:3つのステップ

  1. Configure your mail server composition as plain text: Edit…​Account Settings…​Composition & Addressing, uncheck "Compose Messages in HTML".メールサーバの作成をプレーンテキストとして設定します。編集...アカウント設定...作成とアドレス指定、[HTMLでメッセージを作成]のチェックを外します。

  2. Configure your general composition window to not wrap.折り返さないように一般的な構成ウィンドウを構成します。

    In Thunderbird 2: Edit..Preferences..Composition, wrap plain text messages at 0Thunderbird 2の場合:編集..設定..構成、プレーンテキストメッセージを0で折り返す

    In Thunderbird 3: Edit..Preferences..Advanced..Config Editor. Search for "mail.wrap_long_lines". Toggle it to make sure it is set to false. Also, search for "mailnews.wraplength" and set the value to 0.Thunderbird 3の場合:編集..環境設定...詳細設定エディタ。"mail.wrap_long_lines"を検索してください。それがに設定されていることを確認するために切り替えfalseます。また、 "mailnews.wraplength"を検索して値を0に設定します。

  3. Disable the use of format=flowed: Edit..Preferences..Advanced..Config Editor. Search for "mailnews.send_plaintext_flowed". Toggle it to make sure it is set to false.format = flowed:Edit..Preferences..Advanced..Config Editorの使用を無効にします。"mailnews.send_plaintext_flowed"を検索してください。それがに設定されていることを確認するために切り替えfalseます。

After that is done, you should be able to compose email as you otherwise would (cut + paste, git format-patch | git imap-send, etc), and the patches will not be mangled.それが済んだら、そうでなければ(カット+貼り付け、git format-patch | git imap-sendなど)Eメールを作成することができるはずです。そしてパッチは壊されません。

Approach #3 (external editor)アプローチ3(外部編集者)

The following Thunderbird extensions are needed: AboutConfig from http://aboutconfig.mozdev.org/ and External Editor from http://globs.org/articles.php?lng=en&pg=8次Thunderbirdの拡張が必要とされていますAboutConfigからhttp://aboutconfig.mozdev.org/および外部エディタからhttp://globs.org/articles.php?lng=en&pg=8

  1. Prepare the patch as a text file using your method of choice.選択した方法を使用して、パッチをテキストファイルとして準備します。

  2. Before opening a compose window, use Edit→Account Settings to uncheck the "Compose messages in HTML format" setting in the "Composition & Addressing" panel of the account to be used to send the patch.作成ウィンドウを開く前に、編集→アカウント設定を使用して、パッチの送信に使用するアカウントの「作成と宛先指定」パネルにある「HTML形式のメッセージを作成」設定のチェックを外します。

  3. In the main Thunderbird window, before you open the compose window for the patch, use Tools→about:config to set the following to the indicated values:Thunderbirdのメインウィンドウでパッチの作成ウィンドウを開く前に、[ツール]→[about:config]を使用して、以下を表示されている値に設定します。

    	mailnews.send_plaintext_flowed  => false
    	mailnews.wraplength             => 0
  4. Open a compose window and click the external editor icon.作成ウィンドウを開き、外部エディタのアイコンをクリックします。

  5. In the external editor window, read in the patch file and exit the editor normally.外部エディタウィンドウでパッチファイルを読み込み、通常どおりエディタを終了します。

Side note: it may be possible to do step 2 with about:config and the following settings but no one’s tried yet.サイドノート:about:configと次の設定を使ってステップ2を実行することは可能かもしれませんが、まだ試した人はいません。

	mail.html_compose                       => false
	mail.identity.default.compose_html      => false
	mail.identity.id?.compose_html          => false

There is a script in contrib/thunderbird-patch-inline which can help you include patches with Thunderbird in an easy way. To use it, do the steps above and then use the script as the external editor.contrib / thunderbird-patch-inlineには、Thunderbirdに簡単にパッチを含めるのに役立つスクリプトがあります。これを使用するには、上記の手順を実行してから、スクリプトを外部エディタとして使用します。

KMail

This should help you to submit patches inline using KMail.これは、KMailを使用してパッチをインラインで送信するのに役立ちます。

  1. Prepare the patch as a text file.パッチをテキストファイルとして準備します。

  2. Click on New Mail.新規メールをクリックします。

  3. Go under "Options" in the Composer window and be sure that "Word wrap" is not set.Composerウィンドウの[オプション]の下に移動し、[折り返し]が設定されていないことを確認します。

  4. Use Message → Insert file…​ and insert the patch.メッセージ→ファイルの挿入…を使用してパッチを挿入してください。

  5. Back in the compose window: add whatever other text you wish to the message, complete the addressing and subject fields, and press send.作成ウィンドウに戻ります。メッセージに他のテキストを追加し、アドレス指定フィールドと件名フィールドに入力して、送信を押します。

BASE TREE INFORMATIONベースツリー情報

The base tree information block is used for maintainers or third party testers to know the exact state the patch series applies to. It consists of the base commit, which is a well-known commit that is part of the stable part of the project history everybody else works off of, and zero or more prerequisite patches, which are well-known patches in flight that is not yet part of the base commit that need to be applied on top of base commit in topological order before the patches can be applied.ベースツリー情報ブロックは、パッチシリーズが適用される正確な状態を知るためにメンテナまたはサードパーティのテスタに使用されます。これは、他の人が作業をしているプロジェクト履歴の安定した部分の一部であるよく知られたコミットである基本コミットと、まだ実行されていない既知のパッチである0個以上の必須パッチで構成されます。一部のベースは、コミットの上に適用することの必要性ベースがコミットのパッチを適用する前に、トポロジカル順序で。

The base commit is shown as "base-commit: " followed by the 40-hex of the commit object name. A prerequisite patch is shown as "prerequisite-patch-id: " followed by the 40-hex patch id, which can be obtained by passing the patch through the git patch-id --stable command.塩基は、コミットコミットオブジェクト名の40進続く:「ベースコミット」として示されています。前提パッチは、 40進続く:「前提パッチ-ID」として示されているパッチIDを介してパッチを通過させることによって得ることができる、git patch-id --stableコマンド。

Imagine that on top of the public commit P, you applied well-known patches X, Y and Z from somebody else, and then built your three-patch series A, B, C, the history would be like:公のコミットPの上に、他の人からの有名なパッチX、Y、Zを適用し、それからあなたの3パッチのシリーズA、B、Cを作成したとすると、歴史はこんな感じになるでしょう。

---P---X---Y---Z---A---B---C

With git format-patch --base=P -3 C (or variants thereof, e.g. with --cover-letter or using Z..C instead of -3 C to specify the range), the base tree information block is shown at the end of the first message the command outputs (either the first patch, or the cover letter), like this:git format-patch --base=P -3 C(又はその変異体、例えばと共に--cover-letter又は使用Z..Cの代わりに-3 C範囲を指定する)、ベース・ツリー情報ブロックは、このような最初のメッセージコマンド出力(最初のパッチ、またはカバーレターのいずれか)の端部に示されています。

base-commit: P
prerequisite-patch-id: X
prerequisite-patch-id: Y
prerequisite-patch-id: Z

For non-linear topology, such as次のような非線形トポロジの場合

---P---X---A---M---C
    \         /
     Y---Z---B

You can also use git format-patch --base=P -3 C to generate patches for A, B and C, and the identifiers for P, X, Y, Z are appended at the end of the first message.またgit format-patch --base=P -3 C、A、B、Cのパッチを生成するためにも使用できます。また、P、X、Y、Zの識別子が最初のメッセージの最後に追加されます。

If set --base=auto in cmdline, it will track base commit automatically, the base commit will be the merge base of tip commit of the remote-tracking branch and revision-range specified in cmdline. For a local branch, you need to track a remote branch by git branch --set-upstream-to before using this option.--base=autocmdlineで設定された場合、それは自動的にベースコミットを追跡します、ベースコミットはcmdlineで指定されたリモートトラッキングブランチとリビジョン範囲のtipコミットのマージベースになります。ローカルブランチの場合は、git branch --set-upstream-toこのオプションを使用する前にリモートブランチを追跡する必要があります。

EXAMPLES

  • Extract commits between revisions R1 and R2, and apply them on top of the current branch using git am to cherry-pick them:リビジョンR1とR2の間のコミットを抽出し、それらをチェリーピックするためにgit amを使って現在のブランチの上にそれらを適用します。

    $ git format-patch -k --stdout R1..R2 | git am -3 -k
  • Extract all commits which are in the current branch but not in the origin branch:現在のブランチにはあるがオリジンブランチにはないすべてのコミットを抽出します。

    $ git format-patch origin

    For each commit a separate file is created in the current directory.コミットごとに、個別のファイルが現在のディレクトリに作成されます。

  • Extract all commits that lead to origin since the inception of the project:プロジェクトが開始されてから発生したコミットをすべて抽出します。

    $ git format-patch --root origin
  • The same as the previous one:前のものと同じです。

    $ git format-patch -M -B origin

    Additionally, it detects and handles renames and complete rewrites intelligently to produce a renaming patch. A renaming patch reduces the amount of text output, and generally makes it easier to review. Note that non-Git "patch" programs won’t understand renaming patches, so use it only when you know the recipient uses Git to apply your patch.さらに、名前の変更と完全な書き換えを検出して処理し、名前変更パッチを作成します。名前変更パッチはテキスト出力の量を減らし、一般的に見直しを容易にします。Git以外の「パッチ」プログラムはパッチの名前変更を理解できないので、受信者があなたのパッチを適用するためにGitを使っていることがわかっているときだけそれを使ってください。

  • Extract three topmost commits from the current branch and format them as e-mailable patches:現在のブランチから一番上の3つのコミットを抽出し、それらを電子メールパッチとしてフォーマットします。

    $ git format-patch -3

SEE ALSO関連項目

git-am[1], git-send-email[1]git-am [1]git-send-email [1]

GIT

Part of the git[1] suite一部のgit [1]スイート

関連記事

スポンサーリンク

mb_strlenやmb_strimwidthの注意点

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る