Skip to content

Prevent "pq export" (etc.) from creating unparsable diffs when diff.noprefix=true is set.

Using diff.noprefix=true globally makes Git nicer to use as a human, as it makes it possible to copy file paths when running git diff (etc.) on the command line.

Otherwise, you typically see filenames which technically don't exist. For instance, these files aren't under a directory called "a" or "b" at all; they are placeholders:

--- a/tochange.py +++ b/tochange.py

However, when this global option is set, "pq export" will serialise the patch branch into debian/patches with the filenames missing the prefix, which dpkg-source then can't actually parse and it errors out. In other words, they look like this:

--- tochange.py +++ tochange.py

A patch is attached that overrides diff.noprefix when calling out to "git diff", meaning that it will use "a/" and "b/" as expected. This seems somewhat analogous to overriding the user's core.abbrev setting.

Closes: #1088032

Merge request reports

Loading