So I was trying to use apply a diff file to my git dev branch. The diff I wanted to apply was this one here: https://github.com/mbabker/joomla-cms/compare/JHtml_move.patch
You will have to check if you still see the error message bad git-diff - expected /dev/null on line 47
after Git 2.17 (Q2 2018).
Many places in "git apply
" knew that "/dev/null
" that signals "there is no such file on this side of the diff" can be followed by whitespace and garbage when parsing a patch, except for one, which made an otherwise valid patch (e.g. ones from subversion) rejected.
See commit e454ad4 (15 Feb 2018) by Tatyana Krasnukha (tkrasnukha).
See commit f16ef7b (15 Feb 2018) by Johannes Schindelin (dscho).
(Merged by Junio C Hamano -- gitster -- in commit 177bd65, 28 Feb 2018)
See also git-for-windows/git issue 1489
apply
: handle Subversion diffs with/dev/null
gracefullySubversion generates diffs that can contain lines like this one:
--- /dev/null (nonexistent)
Let's teach Git's apply machinery to handle such a line gracefully.