jj-vcs/jj

FR: Better defaults for `trunk()`

Open

#7 990 ouverte le 10 nov. 2025

Voir sur GitHub
 (27 commentaires) (0 réactions) (1 assigné)Rust (1 052 forks)batch import
good first issue

Métriques du dépôt

Stars
 (28 830 stars)
Métriques de merge PR
 (Merge moyen 23j 5h) (46 PRs mergées en 30 j)

Description

As discussed in https://discord.com/channels/968932220549103686/1436372580000075978, the current default for trunk() seems to have some drawbacks.

  • root() as fallback is unlucky, if you have none of the previous options, root() is considered the trunk() which means that with the default log revset, root() is always shown. And it also means that if you do something like jj rebase -d trunk(), chances are high that you get an error about immutable commits not being rebased unless you have no immutable commits yet. I have a gut feeling that none() would be better than root(), so that if you try to do something with trunk() you get an imho better error that the revset is empty, and jj log will not by default always show the root() commit.

  • it might make sense to coalesce first the latest of the remote bookmarks considered now, then to the latest local bookmark with one of the three names, and only after that either fall back to root() or - as noted in the first point - to none().

  • When jj git init is used to create a new empty repository, trunk() alias should be set to the one branch that is now available in Git.

  • When jj git init is used to create a JJ repo on an existing purely-local Git repository, it should also set the trunk() alias like when doing it on a repo with remotes or when doing jj git clone.

Guide contributeur