Page MenuHomePhabricator

Non-standard patches lead to exceptions being generated
Closed, DuplicatePublic

Description

When handling patches which aren't generated by a VCS (such as dpkg-source for instance) it looks like Phabricator gets tripped up, leading to us getting the following error message:

Unhandled Exception ("AphrontQueryException")
#1048: Column 'filename' cannot be null

These sorts of patches often come from Linux distributions which usually base their patches off tarballs rather than actual VCS checkouts. The use case for being able to handle these patches is the contributors/packagers in question are trying to upstream fixes which they've had to come up with to support their particular environment.

Given these patches are a little non-standard though, gracefully not accepting them would also be fine (not sure what your goals are upstream regarding patch handling)

Below is a patch which is known to trigger this condition

Event Timeline

I'll merge this into T12664, but realistically it's exceptionally unlikely that we'll add the ability to parse these diffs given one example and no idea how to generate them in the general case, and apparently only one install encounters these diffs, and they aren't generated with a legitimate VCS tool.

The example also claims to be a Git diff (the text says diff --git) but I believe git can never generate a diff in this form. If git can generate a diff in this form, please show us an example git diff ... command which generates a diff like this. If git can not generate a diff in this form, I'd say this is a bug with the the underlying tool, and it should either generate an authentic git diff instead, or generate a unified diff or some other diff, rather than claim it is generating a git diff while generating a diff in a form that git does not generate.

Tangential, but T8768 is a case where we generated an unfaithful synthetic diff (a diff --git that the git binary could not generate since 2006) and took the blame for it.