Skip to content

FR: Revset selecting multiple fork points #6130

@DavidDTA

Description

@DavidDTA

Is your feature request related to a problem? Please describe.
In my jj log, I would like to show the set of commits I'm interested in x, along with the fork point between each commit in x and trunk().

Describe the solution you'd like
One option would be a fork_points(revset, reference) function, which would select exactly the set of commits I've described.

Describe alternatives you've considered
There could be a function like for_each(revset, lambda) which would create a revset containing the union of the revsets obtained by running the lambda on each revision in revset. This would allow the above function to be defined as fork_points(revset, reference) = for_each(revset, |revision| fork_point(revision, reference)). This would add quite a bit of complexity to the language, and would also invite another variant that takes the intersection instead of the union of the resulting revsets. Alternatively, an even more generic solution would be to introduce fold.

Additional context
I don't believe this is currently possible, but please let me know if it is! I am currently using ancestors(trunk()..x, 2) & ::trunk(), but this selects some undesirable revisions in some cases where trunk()..x contains a merge commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions