From 0c31e0ba61aea5e16afaf137480d5fe9868fb00c Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Tue, 19 Sep 2023 19:20:30 -0700 Subject: [PATCH] trunk() docs fix: commits aren't tried in order; newest commit wins That's my understanding of how `latest()` revset works. --- docs/revsets.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/revsets.md b/docs/revsets.md index 1df7c0cda..a6673db9a 100644 --- a/docs/revsets.md +++ b/docs/revsets.md @@ -167,8 +167,9 @@ See [revsets.toml](https://github.com/martinvonz/jj/blob/main/cli/src/config/rev for a comprehensive list. * `trunk()`: Resolves to the head commit for the trunk branch of the `origin` - remote. The branches `main`, `master`, and `trunk` are tried in order. - If none of the branches exist, it evaluates to `root()`. + remote. The branches `main`, `master`, and `trunk` are tried. If more than one + potential trunk commit exists, the newest one is chosen. If none of the + branches exist, the revset evaluates to `root()`. You can [override](./config.md) this as appropriate. If you do, make sure it always resolves to exactly one commit. For example: