~sircmpwn/sr.ht-discuss

4 3

Dependencies between patches

Details
Message ID
<87pmlsmf7t.fsf@vincent-lee.net>
DKIM signature
pass
Download raw message
Hey all, just wanted to float an idea I mentioned on IRC a few weeks
back. Currently, patchsets sent to lists are assumed to apply directly to
trunk, and builds will attempt to do so.

This doesn't really work when you have patchsets that depend on other
patchsets, e.g. if you're working on a large, complex feature that
requires multiple patchsets each containing multiple commits.

GitHub fails miserably at this, forcing contributors to make multiple
pull-requests out of the same branch (which makes review difficult as
commits of the earlier PR's show up in the later PR's as well), or give
up and make one massive monster PR.

Phabricator handles this well by allowing each Revision (patchset) to
specify which ones it depends upon.

It would be great to have a way to mark a patchset as depending on
another one, and builds would apply all of the prerequisite patchsets
before applying the current one for testing.

Fortunately, @emersion pointed out on IRC that Git already has a
built-in feature called the "Base Tree Information" [1] whereby you send
along with a given patch the public ancestor commit hash, plus the
"patch id's" of all the dependencies. Patch-ID's are simply a hashed
form of the patch contents.

It would be cool if lists and builds could make use of this to implement
dependencies between patches. Should I make a ticket for this?

Thanks,
Vincent

[1]: https://git-scm.com/docs/git-format-patch#_base_tree_information
Details
Message ID
<CJ4RR6O0NHGF.2GWTZS7ONU8W9@taiga>
In-Reply-To
<87pmlsmf7t.fsf@vincent-lee.net> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
I would like to see lists.sr.ht/builds.sr.ht deal with this. The best
way to start on this IMO would be to ingest base commit ID into the
database during lists.sr.ht-process, then update the GraphQL API to
support fetching patches by their base commit. Then we can update
hub.sr.ht to account for this in the build submission.
Details
Message ID
<QsHVPOmTTC6JCYkzWPFIU0L1yDPEOAOmEFAb0Q0oKWVDuUM3Y3p8VM_aXKAxCtJnJJACkCI6ci0WbtM2eIPDn2id_rqzVVzCf7mElWBAAhA=@emersion.fr>
In-Reply-To
<CJ4RR6O0NHGF.2GWTZS7ONU8W9@taiga> (view parent)
DKIM signature
pass
Download raw message
On Friday, April 8th, 2022 at 11:59, Drew DeVault <sir@cmpwn.com> wrote:

> I would like to see lists.sr.ht/builds.sr.ht deal with this. The best
> way to start on this IMO would be to ingest base commit ID into the
> database during lists.sr.ht-process, then update the GraphQL API to
> support fetching patches by their base commit. Then we can update
> hub.sr.ht to account for this in the build submission.

I assume you mean s/base commit ID/patch ID/?

These are different things:

- The patch ID is basically a hash of the patch file.
- The base commit ID is the commit sha1 the patch series is based on.
  Usually it's whatever HEAD points to when the patch is written by the
  author. It's used by git-am to handle conflicts better when applying
  the patch. (No more "sha1 information is lacking or useless" errors.)
Details
Message ID
<CJ4RZRRB5BFV.2JFKNWBK21LKQ@taiga>
In-Reply-To
<QsHVPOmTTC6JCYkzWPFIU0L1yDPEOAOmEFAb0Q0oKWVDuUM3Y3p8VM_aXKAxCtJnJJACkCI6ci0WbtM2eIPDn2id_rqzVVzCf7mElWBAAhA=@emersion.fr> (view parent)
DKIM signature
pass
Download raw message
On Fri Apr 8, 2022 at 12:06 PM CEST, Simon Ser wrote:
> I assume you mean s/base commit ID/patch ID/?

We should probably store both. My answer is whichever answer is the
correct one; I lack the context to judge. Whoever writes the patch
should do the research.
Details
Message ID
<87ilrinajr.fsf@vincent-lee.net>
In-Reply-To
<CJ4RZRRB5BFV.2JFKNWBK21LKQ@taiga> (view parent)
DKIM signature
pass
Download raw message
"Drew DeVault" <sir@cmpwn.com> writes:

> On Fri Apr 8, 2022 at 12:06 PM CEST, Simon Ser wrote:
>> I assume you mean s/base commit ID/patch ID/?
>
> We should probably store both. My answer is whichever answer is the
> correct one; I lack the context to judge. Whoever writes the patch
> should do the research.

Great, I filed hub ticket #85 to track this https://todo.sr.ht/~sircmpwn/hub.sr.ht/85
Reply to thread Export thread (mbox)