2023-08-26 04:56:32 +00:00
<!doctype html>
< html lang = "en" class = "no-js" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
2023-08-26 05:06:49 +00:00
< link rel = "canonical" href = "https://martinvonz.github.io/jj/prerelease/revsets/" >
2023-08-26 04:56:32 +00:00
< link rel = "prev" href = "../config/" >
< link rel = "next" href = "../templates/" >
< link rel = "icon" href = "../assets/images/favicon.png" >
< meta name = "generator" content = "mkdocs-1.5.2, mkdocs-material-9.2.3" >
< title > Revset language - Jujutsu docs< / title >
< link rel = "stylesheet" href = "../assets/stylesheets/main.0e669242.min.css" >
< link rel = "preconnect" href = "https://fonts.gstatic.com" crossorigin >
< link rel = "stylesheet" href = "https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback" >
< style > : root { --md-text-font : "Roboto" ; --md-code-font : "Roboto Mono" } < / style >
< script > _ _md _scope = new URL ( ".." , location ) , _ _md _hash = e => [ ... e ] . reduce ( ( e , _ ) => ( e << 5 ) - e + _ . charCodeAt ( 0 ) , 0 ) , _ _md _get = ( e , _ = localStorage , t = _ _md _scope ) => JSON . parse ( _ . getItem ( t . pathname + "." + e ) ) , _ _md _set = ( e , _ , t = localStorage , a = _ _md _scope ) => { try { t . setItem ( a . pathname + "." + e , JSON . stringify ( _ ) ) } catch ( e ) { } } < / script >
< / head >
< body dir = "ltr" >
< script > var palette = _ _md _get ( "__palette" ) ; if ( palette && "object" == typeof palette . color ) for ( var key of Object . keys ( palette . color ) ) document . body . setAttribute ( "data-md-color-" + key , palette . color [ key ] ) < / script >
< input class = "md-toggle" data-md-toggle = "drawer" type = "checkbox" id = "__drawer" autocomplete = "off" >
< input class = "md-toggle" data-md-toggle = "search" type = "checkbox" id = "__search" autocomplete = "off" >
< label class = "md-overlay" for = "__drawer" > < / label >
< div data-md-component = "skip" >
< a href = "#revsets" class = "md-skip" >
Skip to content
< / a >
< / div >
< div data-md-component = "announce" >
< / div >
< div data-md-color-scheme = "default" data-md-component = "outdated" hidden >
< / div >
< header class = "md-header md-header--shadow" data-md-component = "header" >
< nav class = "md-header__inner md-grid" aria-label = "Header" >
< a href = ".." title = "Jujutsu docs" class = "md-header__button md-logo" aria-label = "Jujutsu docs" data-md-component = "logo" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z" / > < / svg >
< / a >
< label class = "md-header__button md-icon" for = "__drawer" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z" / > < / svg >
< / label >
< div class = "md-header__title" data-md-component = "header-title" >
< div class = "md-header__ellipsis" >
< div class = "md-header__topic" >
< span class = "md-ellipsis" >
Jujutsu docs
< / span >
< / div >
< div class = "md-header__topic" data-md-component = "header-topic" >
< span class = "md-ellipsis" >
Revset language
< / span >
< / div >
< / div >
< / div >
< / nav >
< / header >
< div class = "md-container" data-md-component = "container" >
< main class = "md-main" data-md-component = "main" >
< div class = "md-main__inner md-grid" >
< div class = "md-sidebar md-sidebar--primary" data-md-component = "sidebar" data-md-type = "navigation" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
< nav class = "md-nav md-nav--primary" aria-label = "Navigation" data-md-level = "0" >
< label class = "md-nav__title" for = "__drawer" >
< a href = ".." title = "Jujutsu docs" class = "md-nav__button md-logo" aria-label = "Jujutsu docs" data-md-component = "logo" >
< svg xmlns = "http://www.w3.org/2000/svg" viewBox = "0 0 24 24" > < path d = "M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z" / > < / svg >
< / a >
Jujutsu docs
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_1" >
< label class = "md-nav__link" for = "__nav_1" id = "__nav_1_label" tabindex = "0" >
< span class = "md-ellipsis" >
Getting started
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_1_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_1" >
< span class = "md-nav__icon md-icon" > < / span >
Getting started
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../install-and-setup/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Installation and Setup
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../tutorial/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Tutorial and Birds-Eye View
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../github/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Working with Github
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "../FAQ/" class = "md-nav__link" >
< span class = "md-ellipsis" >
FAQ
< / span >
< / a >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_3" >
< label class = "md-nav__link" for = "__nav_3" id = "__nav_3_label" tabindex = "0" >
< span class = "md-ellipsis" >
Concepts
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_3_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_3" >
< span class = "md-nav__icon md-icon" > < / span >
Concepts
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../working-copy/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Working Copy
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../branches/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Branches
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../conflicts/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Conflicts
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../operation-log/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Operation Log
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../glossary/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Glossary
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--active md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_4" checked >
< label class = "md-nav__link" for = "__nav_4" id = "__nav_4_label" tabindex = "0" >
< span class = "md-ellipsis" >
Configuration
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_4_label" aria-expanded = "true" >
< label class = "md-nav__title" for = "__nav_4" >
< span class = "md-nav__icon md-icon" > < / span >
Configuration
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../config/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Settings
< / span >
< / a >
< / li >
< li class = "md-nav__item md-nav__item--active" >
< input class = "md-nav__toggle md-toggle" type = "checkbox" id = "__toc" >
< label class = "md-nav__link md-nav__link--active" for = "__toc" >
< span class = "md-ellipsis" >
Revset language
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< a href = "./" class = "md-nav__link md-nav__link--active" >
< span class = "md-ellipsis" >
Revset language
< / span >
< / a >
< nav class = "md-nav md-nav--secondary" aria-label = "Table of contents" >
< label class = "md-nav__title" for = "__toc" >
< span class = "md-nav__icon md-icon" > < / span >
Table of contents
< / label >
< ul class = "md-nav__list" data-md-component = "toc" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "#symbols" class = "md-nav__link" >
Symbols
< / a >
< nav class = "md-nav" aria-label = "Symbols" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#priority" class = "md-nav__link" >
Priority
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "#operators" class = "md-nav__link" >
Operators
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#functions" class = "md-nav__link" >
Functions
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#string-patterns" class = "md-nav__link" >
String patterns
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#aliases" class = "md-nav__link" >
Aliases
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#examples" class = "md-nav__link" >
Examples
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "../templates/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Templating language
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_5" >
< label class = "md-nav__link" for = "__nav_5" id = "__nav_5_label" tabindex = "0" >
< span class = "md-ellipsis" >
Comparisons
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_5_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_5" >
< span class = "md-nav__icon md-icon" > < / span >
Comparisons
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../git-comparison/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Git comparison
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../git-compatibility/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Git compatibility
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../sapling-comparison/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Sapling
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../related-work/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Other related work
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_6" >
< label class = "md-nav__link" for = "__nav_6" id = "__nav_6_label" tabindex = "0" >
< span class = "md-ellipsis" >
Technical details
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_6_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_6" >
< span class = "md-nav__icon md-icon" > < / span >
Technical details
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../technical/architecture/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Architecture
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../technical/concurrency/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Concurrency
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../technical/conflicts/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Conflicts
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_7" >
< label class = "md-nav__link" for = "__nav_7" id = "__nav_7_label" tabindex = "0" >
< span class = "md-ellipsis" >
Contributing
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_7_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_7" >
< span class = "md-nav__icon md-icon" > < / span >
Contributing
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../contributing/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Guidelines and Setup
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../code-of-conduct/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Code of conduct
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item md-nav__item--nested" >
< input class = "md-nav__toggle md-toggle " type = "checkbox" id = "__nav_8" >
< label class = "md-nav__link" for = "__nav_8" id = "__nav_8_label" tabindex = "0" >
< span class = "md-ellipsis" >
Design docs
< / span >
< span class = "md-nav__icon md-icon" > < / span >
< / label >
< nav class = "md-nav" data-md-level = "1" aria-labelledby = "__nav_8_label" aria-expanded = "false" >
< label class = "md-nav__title" for = "__nav_8" >
< span class = "md-nav__icon md-icon" > < / span >
Design docs
< / label >
< ul class = "md-nav__list" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "../design/git-submodules/" class = "md-nav__link" >
< span class = "md-ellipsis" >
git-submodules
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../design/git-submodule-storage/" class = "md-nav__link" >
< span class = "md-ellipsis" >
git-submodule-storage
< / span >
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "../design/tracking-branches/" class = "md-nav__link" >
< span class = "md-ellipsis" >
Tracking branches
< / span >
< / a >
< / li >
< / ul >
< / nav >
< / li >
< / ul >
< / nav >
< / div >
< / div >
< / div >
< div class = "md-sidebar md-sidebar--secondary" data-md-component = "sidebar" data-md-type = "toc" >
< div class = "md-sidebar__scrollwrap" >
< div class = "md-sidebar__inner" >
< nav class = "md-nav md-nav--secondary" aria-label = "Table of contents" >
< label class = "md-nav__title" for = "__toc" >
< span class = "md-nav__icon md-icon" > < / span >
Table of contents
< / label >
< ul class = "md-nav__list" data-md-component = "toc" data-md-scrollfix >
< li class = "md-nav__item" >
< a href = "#symbols" class = "md-nav__link" >
Symbols
< / a >
< nav class = "md-nav" aria-label = "Symbols" >
< ul class = "md-nav__list" >
< li class = "md-nav__item" >
< a href = "#priority" class = "md-nav__link" >
Priority
< / a >
< / li >
< / ul >
< / nav >
< / li >
< li class = "md-nav__item" >
< a href = "#operators" class = "md-nav__link" >
Operators
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#functions" class = "md-nav__link" >
Functions
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#string-patterns" class = "md-nav__link" >
String patterns
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#aliases" class = "md-nav__link" >
Aliases
< / a >
< / li >
< li class = "md-nav__item" >
< a href = "#examples" class = "md-nav__link" >
Examples
< / a >
< / li >
< / ul >
< / nav >
< / div >
< / div >
< / div >
< div class = "md-content" data-md-component = "content" >
< article class = "md-content__inner md-typeset" >
< h1 id = "revsets" > Revsets< / h1 >
< p > Jujutsu supports a functional language for selecting a set of revisions.
Expressions in this language are called "revsets" (the idea comes from
< a href = "https://www.mercurial-scm.org/repo/hg/help/revsets" > Mercurial< / a > ). The language
consists of symbols, operators, and functions.< / p >
< p > Most < code > jj< / code > commands accept a revset (or multiple). Many commands, such as
< code > jj diff -r < revset> < / code > expect the revset to resolve to a single commit; it is
an error to pass a revset that resolves to more than one commit (or zero
commits) to such commands.< / p >
< p > The words "revisions" and "commits" are used interchangeably in this document.< / p >
< p > The commits listed by < code > jj log< / code > without arguments are called "visible commits".
Other commits are only included if you explicitly mention them (e.g. by commit
ID or a Git ref pointing to them).< / p >
< h2 id = "symbols" > Symbols< / h2 >
< p > The symbol < code > root< / code > refers to the virtual commit that is the oldest ancestor of
all other commits.< / p >
< p > The symbol < code > @< / code > refers to the working copy commit in the current workspace. Use
< code > < workspace name> @< / code > to refer to the working-copy commit in another workspace.< / p >
< p > A full commit ID refers to a single commit. A unique prefix of the full commit
ID can also be used. It is an error to use a non-unique prefix.< / p >
< p > A full change ID refers to all visible commits with that change ID (there is
typically only one visible commit with a given change ID). A unique prefix of
the full change ID can also be used. It is an error to use a non-unique prefix.< / p >
< p > Use double quotes to prevent a symbol from being interpreted as an expression.
For example, < code > "x-"< / code > is the symbol < code > x-< / code > , not the parents of symbol < code > x< / code > .
Taking shell quoting into account, you may need to use something like
< code > jj log -r '"x-"'< / code > .< / p >
< h3 id = "priority" > Priority< / h3 >
< p > Jujutsu attempts to resolve a symbol in the following order:< / p >
< ol >
< li > < code > @< / code > < / li >
< li > < code > root< / code > < / li >
< li > Tag name< / li >
< li > Branch name< / li >
< li > Git ref< / li >
< li > Commit ID or change ID< / li >
< / ol >
< h2 id = "operators" > Operators< / h2 >
< p > The following operators are supported. < code > x< / code > and < code > y< / code > below can be any revset, not
only symbols.< / p >
< ul >
< li > < code > x & y< / code > : Revisions that are in both < code > x< / code > and < code > y< / code > .< / li >
< li > < code > x | y< / code > : Revisions that are in either < code > x< / code > or < code > y< / code > (or both).< / li >
< li > < code > x ~ y< / code > : Revisions that are in < code > x< / code > but not in < code > y< / code > .< / li >
< li > < code > ~x< / code > : Revisions that are not in < code > x< / code > .< / li >
< li > < code > x-< / code > : Parents of < code > x< / code > .< / li >
< li > < code > x+< / code > : Children of < code > x< / code > .< / li >
< li > < code > :x< / code > : Ancestors of < code > x< / code > , including the commits in < code > x< / code > itself.< / li >
< li > < code > x:< / code > : Descendants of < code > x< / code > , including the commits in < code > x< / code > itself.< / li >
< li > < code > x:y< / code > : Descendants of < code > x< / code > that are also ancestors of < code > y< / code > . Equivalent
to < code > x: & :y< / code > . This is what < code > git log< / code > calls < code > --ancestry-path x..y< / code > .< / li >
< li > < code > ::x< / code > , < code > x::< / code > , and < code > x::y< / code > : New versions of for < code > :x< / code > , < code > x:< / code > , and < code > x:y< / code > to be
released in jj 0.9.0. We plan to delete the latter in jj 0.15+.< / li >
< li > < code > x..y< / code > : Ancestors of < code > y< / code > that are not also ancestors of < code > x< / code > . Equivalent to
< code > :y ~ :x< / code > . This is what < code > git log< / code > calls < code > x..y< / code > (i.e. the same as we call it).< / li >
< li > < code > ..x< / code > : Ancestors of < code > x< / code > , including the commits in < code > x< / code > itself. Equivalent to
< code > :x< / code > and provided for consistency.< / li >
< li > < code > x..< / code > : Revisions that are not ancestors of < code > x< / code > .< / li >
< / ul >
< p > You can use parentheses to control evaluation order, such as < code > (x & y) | z< / code > or
< code > x & (y | z)< / code > .< / p >
< h2 id = "functions" > Functions< / h2 >
< p > You can also specify revisions by using functions. Some functions take other
revsets (expressions) as arguments.< / p >
< ul >
< li > < code > parents(x)< / code > : Same as < code > x-< / code > .< / li >
< li > < code > children(x)< / code > : Same as < code > x+< / code > .< / li >
< li > < code > ancestors(x)< / code > : Same as < code > :x< / code > .< / li >
< li > < code > descendants(x)< / code > : Same as < code > x:< / code > .< / li >
< li > < code > connected(x)< / code > : Same as < code > x:x< / code > . Useful when < code > x< / code > includes several commits.< / li >
< li > < code > all()< / code > : All visible commits in the repo.< / li >
< li > < code > none()< / code > : No commits. This function is rarely useful; it is provided for
completeness.< / li >
< li > < code > branches([pattern])< / code > : All local branch targets. If < code > pattern< / code > is specified,
branches whose name contains the given string are selected. For example,
< code > branches(push)< / code > would match the branches < code > push-123< / code > and < code > repushed< / code > but not
the branch < code > main< / code > . If a branch is in a conflicted state, all its possible
targets are included.< / li >
< li > < code > remote_branches([branch_pattern[, [remote=]remote_pattern]])< / code > : All remote
branch targets across all remotes. If just the < code > branch_pattern< / code > is specified,
branches whose name contains the given string across all remotes are
selected. If both < code > branch_pattern< / code > and < code > remote_pattern< / code > are specified, the
selection is further restricted to just the remotes whose name contains
< code > remote_pattern< / code > . For example, < code > remote_branches(push, ri)< / code > would match the
branches < code > push-123@origin< / code > and < code > repushed@private< / code > but not < code > push-123@upstream< / code >
or < code > main@origin< / code > or < code > main@upstream< / code > . If a branch is in a conflicted state,
all its possible targets are included.< / li >
< li > < code > tags()< / code > : All tag targets. If a tag is in a conflicted state, all its
possible targets are included.< / li >
< li > < code > git_refs()< / code > : All Git ref targets as of the last import. If a Git ref
is in a conflicted state, all its possible targets are included.< / li >
< li > < code > git_head()< / code > : The Git < code > HEAD< / code > target as of the last import. Equivalent to
< code > present(HEAD@git)< / code > .< / li >
< li > < code > visible_heads()< / code > : All visible heads (same as < code > heads(all())< / code > ).< / li >
< li > < code > heads(x)< / code > : Commits in < code > x< / code > that are not ancestors of other commits in < code > x< / code > .
Note that this is different from
< a href = "https://repo.mercurial-scm.org/hg/help/revsets" > Mercurial's< / a > < code > heads(x)< / code >
function, which is equivalent to < code > x ~ x-< / code > .< / li >
< li > < code > roots(x)< / code > : Commits in < code > x< / code > that are not descendants of other commits in < code > x< / code > .
Note that this is different from
< a href = "https://repo.mercurial-scm.org/hg/help/revsets" > Mercurial's< / a > < code > roots(x)< / code >
function, which is equivalent to < code > x ~ x+< / code > .< / li >
< li > < code > latest(x[, count])< / code > : Latest < code > count< / code > commits in < code > x< / code > , based on committer
timestamp. The default < code > count< / code > is 1.< / li >
< li > < code > merges()< / code > : Merge commits.< / li >
< li > < code > description(pattern)< / code > : Commits with the given string in their
description.< / li >
< li > < code > author(pattern)< / code > : Commits with the given string in the author's name or
email.< / li >
< li > < code > mine()< / code > : Commits where the author's email matches the email of the current
user.< / li >
< li > < code > committer(pattern)< / code > : Commits with the given string in the committer's
name or email.< / li >
< li > < code > empty()< / code > : Commits modifying no files. This also includes < code > merges()< / code > without
user modifications and < code > root< / code > .< / li >
< li > < code > file(pattern..)< / code > : Commits modifying the paths specified by the < code > pattern..< / code > .
Paths are relative to the directory < code > jj< / code > was invoked from. A directory name
will match all files in that directory and its subdirectories. For example,
< code > file(foo)< / code > will match files < code > foo< / code > , < code > foo/bar< / code > , < code > foo/bar/baz< / code > , but not file
< code > foobar< / code > .< / li >
< li > < code > conflict()< / code > : Commits with conflicts.< / li >
< li > < code > present(x)< / code > : Same as < code > x< / code > , but evaluated to < code > none()< / code > if any of the commits
in < code > x< / code > doesn't exist (e.g. is an unknown branch name.)< / li >
< / ul >
< h2 id = "string-patterns" > String patterns< / h2 >
< p > Functions that perform string matching support the following pattern syntax.< / p >
< ul >
< li > < code > "string"< / code > , < code > substring:"string"< / code > : Matches strings that contain < code > string< / code > .< / li >
< li > < code > exact:"string"< / code > : Matches strings exactly equal to < code > string< / code > .< / li >
< / ul >
< h2 id = "aliases" > Aliases< / h2 >
< p > New symbols and functions can be defined in the config file, by using any
combination of the predefined symbols/functions and other aliases.< / p >
< p > For example:< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > < span class = "k" > [revset-aliases]< / span >
< span class = "s" > ' mine' < / span > < span class = "w" > < / span > < span class = "o" > =< / span > < span class = "w" > < / span > < span class = "s" > ' author(martinvonz)' < / span >
< span class = "s" > ' user(x)' < / span > < span class = "w" > < / span > < span class = "o" > =< / span > < span class = "w" > < / span > < span class = "s" > ' author(x) | committer(x)' < / span >
< / code > < / pre > < / div >
< h2 id = "examples" > Examples< / h2 >
< p > Show the parent(s) of the working-copy commit (like < code > git log -1 HEAD< / code > ):< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r @-
< / code > < / pre > < / div >
< p > Show commits not on any remote branch:< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r ' remote_branches()..'
< / code > < / pre > < / div >
< p > Show commits not on < code > origin< / code > (if you have other remotes like < code > fork< / code > ):< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r ' remote_branches(remote=origin)..'
< / code > < / pre > < / div >
< p > Show all ancestors of the working copy (almost like plain < code > git log< / code > )< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r :@
< / code > < / pre > < / div >
< p > Show the initial commits in the repo (the ones Git calls "root commits"):< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r root+
< / code > < / pre > < / div >
< p > Show some important commits (like < code > git --simplify-by-decoration< / code > ):< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r ' tags() | branches()'
< / code > < / pre > < / div >
< p > Show local commits leading up to the working copy, as well as descendants of
those commits:< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r ' (remote_branches()..@):'
< / code > < / pre > < / div >
< p > Show commits authored by "martinvonz" and containing the word "reset" in the
description:< / p >
< div class = "codehilite" > < pre > < span > < / span > < code > jj log -r ' author(martinvonz) & description(reset)'
< / code > < / pre > < / div >
< / article >
< / div >
< / div >
< / main >
< footer class = "md-footer" >
< div class = "md-footer-meta md-typeset" >
< div class = "md-footer-meta__inner md-grid" >
< div class = "md-copyright" >
Made with
< a href = "https://squidfunk.github.io/mkdocs-material/" target = "_blank" rel = "noopener" >
Material for MkDocs
< / a >
< / div >
< / div >
< / div >
< / footer >
< / div >
< div class = "md-dialog" data-md-component = "dialog" >
< div class = "md-dialog__inner md-typeset" > < / div >
< / div >
< script id = "__config" type = "application/json" > { "base" : ".." , "features" : [ ] , "search" : "../assets/javascripts/workers/search.dfff1995.min.js" , "translations" : { "clipboard.copied" : "Copied to clipboard" , "clipboard.copy" : "Copy to clipboard" , "search.result.more.one" : "1 more on this page" , "search.result.more.other" : "# more on this page" , "search.result.none" : "No matching documents" , "search.result.one" : "1 matching document" , "search.result.other" : "# matching documents" , "search.result.placeholder" : "Type to start searching" , "search.result.term.missing" : "Missing" , "select.version" : "Select version" } , "version" : { "provider" : "mike" } } < / script >
< script src = "../assets/javascripts/bundle.78eede0e.min.js" > < / script >
< / body >
< / html >