diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-22 00:18:55 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-22 00:18:55 +0300 |
commit | 15108de2fa0cd8f002a0551d14c84505a853071c (patch) | |
tree | ffdbcfd36b7f18eba44b8733c4df582303433000 /Documentation | |
parent | e25cabbf6b34e4a6e903d65102d87055cc994778 (diff) | |
parent | ab89575387c02ea024163256826ad1c6dd2e4247 (diff) |
Merge branch 'jk/format-patch-ignore-noprefix'
"git format-patch" honors the src/dst prefixes set to nonstandard
values with configuration variables like "diff.noprefix", causing
receiving end of the patch that expects the standard -p1 format to
break. Teach "format-patch" to ignore end-user configuration and
always use the standard prefixes.
This is a backward compatibility breaking change.
* jk/format-patch-ignore-noprefix:
rebase: prefer --default-prefix to --{src,dst}-prefix for format-patch
format-patch: add format.noprefix option
format-patch: do not respect diff.noprefix
diff: add --default-prefix option
t4013: add tests for diff prefix options
diff: factor out src/dst prefix setup
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config/format.txt | 7 | ||||
-rw-r--r-- | Documentation/diff-options.txt | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/config/format.txt b/Documentation/config/format.txt index 73678d88a1..8cf6f00d93 100644 --- a/Documentation/config/format.txt +++ b/Documentation/config/format.txt @@ -144,3 +144,10 @@ will only show notes from `refs/notes/bar`. format.mboxrd:: A boolean value which enables the robust "mboxrd" format when `--stdout` is in use to escape "^>+From " lines. + +format.noprefix:: + If set, do not show any source or destination prefix in patches. + This is equivalent to the `diff.noprefix` option used by `git + diff` (but which is not respected by `format-patch`). Note that + by setting this, the receiver of any patches you generate will + have to apply them using the `-p0` option. diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 7d73e976d9..08ab86189a 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -852,6 +852,11 @@ endif::git-format-patch[] --no-prefix:: Do not show any source or destination prefix. +--default-prefix:: + Use the default source and destination prefixes ("a/" and "b/"). + This is usually the default already, but may be used to override + config such as `diff.noprefix`. + --line-prefix=<prefix>:: Prepend an additional prefix to every line of output. |