Making an interdiff each time you post a patch to an issue is repetitive, tedious (IMO), and error-prone (in my experience).

It seems to me that this is a task we should automate.

On way to do this would be to calculate the interdiffs on the fly, between patch N and patch N-1. But then we'd probably want to cache that, and the diff between two uploaded files isn't ever going to change, so the interdiff between two files might as well be... just a file.

So I reckon the simplest way to do this would be to create an interdiff with the most recent patch when a user uploads a new patch to an issue.

For the more complex case where the interdiff should be done to a patch that's older, we could provide a UI, or for that matter, provide a UI to prevent the interdiff being made (e.g., the new patch is a completely different approach so an interdiff makes no sense).

CommentFileSizeAuthor
#3 d.org interdiff UI.png130.7 KBjoachim
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm’s picture

Something that will go into https://www.drupal.org/roadmap/issue-workflow is automatically committing uploaded patches to the appropriate Git namespace & branch. Then interdiffs become unnecessary.

webchick’s picture

I was going to bump this to major but unfortunately it already is. :) This is a huge drag at sprints with new contirbutors.

We should make sure with issue workflows that there's a button in the issue queue somewhere called "interdiff" for people who need it.

joachim’s picture

Issue summary: View changes
FileSize
130.7 KB

This is the sort of UI I had in mind:

Below the file upload form elements, a set of radios as follows:

- [default] create an interdiff from the most recent patch
- create an interdiff from a specified patch [if this is selected, a dropdown appears listing all the files on the issue, with their comment number & author, the user picks one]
- don't create an interdiff

very bad mockup

For implementation, this can either be a custom File widget that Project Issue provides, or use hook_field_widget_form_alter() to add the extra stuff at the end of the normal file widget.