Page MenuHomePhorge

Discussion: stacked diffs / dependent revisions
Open, Needs TriagePublic

Description

A feature which is missing from Differential that would be welcomed by advanced users is the ability to stack multiple related revisions, possibly from different repositories, with a defined dependency graph so that they can be landed together and in the right order.

This is a fairly difficult feature to implement and hasn't been done well in any existing tools that I'm aware of.

The sort of defacto-standard way to do this is to add a Depends-on: footer to each commit. That footer is used to uniquely identify the commits that must be applied before the commit in question.

Prior art:

  • git-depend - looks promising
  • zuul - solves this problem but it's a big complicated system.
  • git-submodule - difficult to use, not a good solution IMO

Event Timeline

There is some support for this today, I have worked with dependent revisions in the past. There are some gaps but it’s possible today. I’ll look through my notes but I think this requires a fair amount of additional state tracking as commits change on local machines. I haven’t fully thought through it all but I think an ideal solution would be something like mercurial’s “evolve”, but that is likely a ton of work.

https://www.mercurial-scm.org/doc/evolution/

I think that D25359 is a nice example of a complete use case, where one Diff from one repo depends from another Diff from another repo.

When they are from the same repos, it works great in my opinion. But in that case, the arc patch probably needs an improvement in order to do not try to auto-apply the dependent non-relevant patch in your same repository. Probably it should just say something like "Please manually apply these dependent patches in their relevant repositories: ..."

So maybe this is just a matter of parsing that commit part "Depends-on:" since everything else seem already implemented to me. Partially related quiz in T15738