From 182cf6d5e2d6560defadeca939f6058046ef5c38 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Sun, 16 Jun 2024 14:48:02 -0700 Subject: [PATCH] docs: explain what `..` etc are shorthand for `..` is shorthand for `root()..visible_head()`, for example. We don't seem to explain that anywhere. I hope mentioning that will help readers understand the relationship between the shorthands and the full `x..y`, and also to see the correspondence between `..` and `::` (in how their default left and right operands are the same). --- docs/revsets.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/revsets.md b/docs/revsets.md index f64f55c73..bb5b8a6d6 100644 --- a/docs/revsets.md +++ b/docs/revsets.md @@ -52,18 +52,22 @@ only symbols. * `x-`: Parents of `x`, can be empty. * `x+`: Children of `x`, can be empty. -* `x::`: Descendants of `x`, including the commits in `x` itself. -* `x..`: Revisions that are not ancestors of `x`. -* `::x`: Ancestors of `x`, including the commits in `x` itself. +* `x::`: Descendants of `x`, including the commits in `x` itself. Shorthand for + `x::visible_heads()`. +* `x..`: Revisions that are not ancestors of `x`. Shorthand for + `x..visible_heads()`. +* `::x`: Ancestors of `x`, including the commits in `x` itself. Shorthand for + `root()::x`. * `..x`: Ancestors of `x`, including the commits in `x` itself, but excluding - the root commit. Equivalent to `::x ~ root()`. + the root commit. Shorthand for `root()..x`. Equivalent to `::x ~ root()`. * `x::y`: Descendants of `x` that are also ancestors of `y`. Equivalent to `x:: & ::y`. This is what `git log` calls `--ancestry-path x..y`. * `x..y`: Ancestors of `y` that are not also ancestors of `x`. Equivalent to `::y ~ ::x`. This is what `git log` calls `x..y` (i.e. the same as we call it). -* `::`: All visible commits in the repo. Equivalent to `all()`. +* `::`: All visible commits in the repo. Shorthand for + `root()::visible_heads()`. Equivalent to `all()`. * `..`: All visible commits in the repo, but excluding the root commit. - Equivalent to `~root()`. + Shorthand for `root()..visible_heads()`. Equivalent to `~root()`. * `~x`: Revisions that are not in `x`. * `x & y`: Revisions that are in both `x` and `y`. * `x ~ y`: Revisions that are in `x` but not in `y`.