unicorn-fail / dreditor.org

Dreditor Browser Extension Site
https://dreditor.org
GNU General Public License v2.0
0 stars 1 forks source link

Interdiff web service #17

Open sun opened 9 years ago

sun commented 9 years ago

Lacking proper support/usage of branches/patch-serials, other Drupal core contributors/reviewers become more and more mad of asking everyone for interdiffs - even for the most silly patches.

Objective

→ Instead of manually creating interdiffs, generate them automatically.

Dreditor needs to expose links, but that's a different topic.

Requirements

Synopsis:

/interdiff?old=<uri>&new=<uri>[&timestamp=<unix_timestamp>]

Parameters:

Logic:

  1. Checkout HEAD@{"$timestamp"}
  2. curl $old > old.patch
  3. curl $new > new.patch
  4. interdiff old.patch new.patch && pass-through output (as-is)
  5. || fall back to diff -up0 old.patch new.patch (diff of diffs)

Creating this issue "ahead of time". Didn't study yet whether it would be feasible to re-implement interdiff in pure JS. (Theoretically not much harder than "formatting" a diff, but not verified.)

markhalliwell commented 9 years ago

Interesting idea. I wouldn't be opposed to this, just have a few questions:

  1. Is this really necessary? Shouldn't we instead direct people to create these themselves, in a tool such as https://www.drupal.org/project/drush_iq?
  2. How do you envision making this new "service" visible in Dreditor's UI?
  3. I'm a little hesitant on having to pull core's HEAD each time (it's massive). I am assuming that we should just pull once initially and then pull again to ensure we're on latest HEAD before each checkout?
  4. Semi-related to the above. In reading http://linux.die.net/man/1/interdiff, is a checkout of the repo actually necessary for interdiff to work? It sounds like it's just a diff between two existing files.

xref: https://www.drupal.org/node/1798362

star-szr commented 9 years ago

Why not incorporate this functionality into the d.o infrastructure? Then I could see these automagic interdiffs on my phone, too.

markhalliwell commented 9 years ago

Agreed, I think that would be the ultimate goal for sure. Until then though I can kind of see why @sun would want this though in the interim, even if just prototyping for d.o.

star-szr commented 9 years ago

For sure, it just had to be said :) carry on.