Git Product home page Git Product logo

Comments (2)

martinvonz avatar martinvonz commented on September 13, 2024

I've added initial support for revsets over the last week or two.

There's now support for looking up a single commit by git ref, such as jj diff -r origin/main (yes, there was no support for that until last week).

There is also support for looking up multiple commits. jj log gained a -r flag that can be passed a revset. Some valid revset functions are all_heads() (including those normally hidden), non_obsolete_heads() (the heads of the graph that jj log show you by default), public_heads(). The supported operators are :foo for parents, foo: for children, *:foo for ancestors and foo:* for descendants.

from jj.

martinvonz avatar martinvonz commented on September 13, 2024

There are some basic revset functions and operators and I think we can consider this done. There are of course tons of other revsets we'll want to add, but we can do that as we find a need for them. What we have now is at least enough for me to define the aliases I need for jj log etc.

The operators that exist now are:
parents: :foo
children: foo:
ancestors: ,,foo
descendants: foo,,
DAG range: foo,,bar (like hg's foo::bar)
range: foo,,,bar (like git's foo..bar)
union: foo | bar
intersection: foo & bar
difference foo - bar

Functions:
parents(<set>)
ancestors(<set>)
children(<set>)
descendants(<set>)
all_heads()
non_obsolete_heads()
public_heads()
git_refs()
merges()
description(<needle>)

I have not added any revsets for precursors or successors. I also haven't made any optimizations (e.g. rewriting ,,bar - ,,foo as foo,,,bar).

from jj.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.