Commit Graph

1074 Commits

Author SHA1 Message Date
Yuya Nishihara
123088b8e4 revset: expand all() set to include all referenced commits
The semantics is similar to experimental.directaccess=true in Mercurial. Hidden
revisions and their ancestors become temporarily available. This means all() is
not exactly the same as ::visible_heads(). The latter never includes hidden
revisions.

We could instead transform all() to (all() | referenced_commits). However, this
wouldn't work if expressions like ::hidden are intersected/united with filters,
all(), etc.

Fixes #5871
2025-06-19 11:21:49 +00:00
Austin Seipp
3b0c6d440f docs: fix indentation levels of some items
Thanks to idealseal on GitHub for the pointer.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-06-18 19:23:12 +00:00
Yuya Nishihara
0a60e85525 templater: add json() function
This was discussed in #3219 and #3262, and apparently, people don't agree
whether we should implement machine-readable formatting by using templater.
However, there are recurring requests about JSON output, and "jj api" is still
vaporware. So I think it's good to add some support for JSON output.

I'm not going to add syntax to build custom JSON object/list for now. Instead,
property types such as Commit will implement fixed serialization output. The
user might have to write ad-hoc JSON constructs to concatenate the default JSON
output and their custom JSON fields.

We'll need a documentation about which types are serializable. I think this can
be added later when more types get serialization support.
2025-06-18 18:34:37 +00:00
Kaiyi Li
f4274dd845 docs: record 06393993 as a contributor whose employer pays for contributions 2025-06-16 18:05:58 +00:00
Lars Francke
1a8ada0611 docs: Remove now outdated reference to issue 469 2025-06-13 12:25:38 +00:00
Josh Steadmon
dda07150f5 paid_contributors: correct Ben Brittain's GitHub username 2025-06-10 19:40:33 +00:00
Scott Taylor
a8876cb1ec revset: parse x.. as ~ancestors(x)
Currently, this is parsed as `x..visible_heads()`, which prevents
optimizing `x.. & ::y` to `x..y`.

An alternative would be to remove `::visible_heads()` from
intersections, similar to `all()`, but it might be better to avoid
removing `visible_heads()` if it was explictly requested by a user.
2025-06-09 04:35:33 +00:00
Greg Morenz
4ff0594542 Don't blame libgit2 for lack of partial clone support
jj no longer uses libgit2, so this can't be blamed on it. We still don't support partial clones though [1] . 

There's no real tracking issue for this. This PR [2] is as close as it gets, but it doesn't feel appropriate to link in the docs.

[1] https://github.com/jj-vcs/jj/issues/6690#issuecomment-2946785320
[2] https://github.com/jj-vcs/jj/pull/6451/
2025-06-08 00:49:53 +00:00
Ilya Grigoriev
43b5feaff6 docs: put bare URLs in angle brackets
This makes MkDocs render them as links.
2025-06-07 20:20:47 +00:00
Vincent Ging Ho Yim
9925d52f89 docs: add missing word in paid_contributors.md 2025-06-07 17:51:23 +00:00
Ilya Grigoriev
b8c156bd54 docs releasing: suggest checking for misplaced changelog entries
See parent commit for an example
2025-06-07 02:15:31 +00:00
Austin Seipp
b16bed1350 docs: file ben/austin as paid contributors for ERSC
Signed-off-by: Austin Seipp <austin@ersc.io>
2025-06-05 21:21:03 +00:00
Yuya Nishihara
04ba49f083 docs: fix unbalanced parentheses in jq script 2025-06-04 14:01:13 +00:00
Yuya Nishihara
8739bdfa36 docs: mention expressions equivalent to heads() and roots()
In the context of #6659, I was wondering whether it would help if heads(x) were
decomposed to x & ~::x-.
2025-06-03 08:34:17 +00:00
Colin Nelson
66254d5d0f docs: add note about inotify and watchman 2025-06-02 20:29:47 +00:00
Vincent Ging Ho Yim
fce53da225 docs/releasing: update jq filter
- Use `jq -s` to read the entire input (could be several arrays due to GitHub API
  pagination) before running the filter just once.
- Deduplicate by `.author.login` in case a person with the same GitHub username has
  commits under different names within a release.
- Use string interpolation to format each line.
2025-05-28 05:41:54 +00:00
Martin von Zweigbergk
6012083ca8 docs: rewrite copy-tracking design with proposal for handling conflicts
This version describes a design that I think will work relatively well
for supporting copy tracing even when there are conflicts.

There are still some open questions, in particular around how to
populate the data in Git repos, and how to efficiently query the data
in very large repos like the one at Google. I think it's still clear
enough that we can start working on the implementation.
2025-05-24 17:44:17 +00:00
Vincent Ging Ho Yim
bc7294695f docs: move shell completion commands into tabs 2025-05-23 17:53:30 +00:00
Vincent Ging Ho Yim
beeda3140d docs: wrap environment variable and filepath in backticks 2025-05-23 17:53:30 +00:00
Vincent Ging Ho Yim
596bc0b59d docs/tutorial: fix op log output to show verbatim command
The op log should show the same command as on line 270.
2025-05-23 03:34:55 +00:00
Vincent Ging Ho Yim
88deb563e9 docs/tutorial: fix id of commit being squashed into
The commit id prefix here should be `f7fb5943`, from the working copy's parent before
the squash (on line 351). Also see line 413 where the full commit id is shown in the
`Undid operation` message.
2025-05-23 03:34:55 +00:00
Vincent Ging Ho Yim
f1765183d6 cli: use more precise wording in conflict resolution hint
We already use "conflicted commit" at the very end of the hint, so I've reused that term
here.
2025-05-22 03:49:34 +00:00
Vincent Ging Ho Yim
365f26fe58 cli util completion: remove deprecated arguments for each shell
The optional arguments for each shell were deprecated in #2945 and v0.19.0.

The `shell` argument is now required, and Bash completions are no longer generated by
default if `jj util completion` is run without any arguments.
2025-05-22 02:51:51 +00:00
Vincent Ging Ho Yim
4e4518d51e docs: fix minimum fish version with dynamic completions enabled by default
Dynamic completions were added to fish [4.0.2]. To date there is no 4.1 yet.

[4.0.2]: https://github.com/fish-shell/fish-shell/releases/tag/4.0.2
2025-05-21 16:19:58 +00:00
Felix Geisendörfer
7335ed90a3 docs: add jjui to the list of community tools
Disclaimer: I am not associated with jjui, but enjoy using it.
2025-05-19 13:45:45 +00:00
Vincent Ging Ho Yim
941f55d85f docs/operation-log: Fix section header casing 2025-05-19 02:19:49 +00:00
Yuya Nishihara
1e4c636a02 docs: add section about naming convention of template labels 2025-05-19 01:41:15 +00:00
Vincent Ging Ho Yim
ddd417469e docs/revsets: fix typo 2025-05-17 14:03:22 +00:00
Isaac Corbrey
85d54eb3d8 docs: Don't include unnecessary shebangs
It isn't necessary to include shebangs in scripts passed into
`util exec` since you're already explicitly calling out the shell you'd
like to use. This change removes shebangs from examples for `util exec`
and adds a note below calling this out.
2025-05-17 11:51:07 +00:00
T6
13c6257aac templater: add arithmetic operators 2025-05-16 12:45:09 +00:00
Yuya Nishihara
a9bae8bc91 templater: deprecate CommitId::normal_hex()
If CommitId and ChangeId were separate types in templates, we wouldn't add
CommitId::normal_hex().
2025-05-16 11:12:33 +00:00
Yuya Nishihara
851d25cd68 cli: unify diff format/tool config variables
This allows users to override the external tool set in ~/.jjconfig.toml. The
config variable is renamed to ui.diff-formatter to be consistent with the other
diff/merge editor settings.

--tool=:<format> support will be added separately.

Closes #3327
2025-05-16 00:33:49 +00:00
Yuya Nishihara
dd33f9ae08 cli: git clone: add config to not track default remote bookmark
Since jj operates in detached HEAD state, a tracking bookmark isn't technically
needed in order to check out a commit. I usually employ this and delete
unmanaged local bookmarks after cloning repository. This option will automate
the setup.
2025-05-15 09:08:07 +00:00
Philip Metzger
6cbb21f86f conflicts: document the "same-change rule"
I think its time to finally give our Conflict Algebra rule a term.
This is will make our documentation alot easier, and gives it a name for
new design docs.

All credit goes to @martinvonz for coming up with the term in #4988.
2025-05-14 15:08:29 +00:00
Yuya Nishihara
2d79c6431d templater: introduce newtype to format ref/remote name in revset syntax
This is the last part of the series 02722eae54 "view: port bookmark/tag name
types to RefName/RemoteName." Templater doesn't use these name types internally
because we wouldn't gain much type safety in template language.

The return type of .remote() is changed to Option<RefSymbol>. An empty symbol is
rendered with quotes, so it would be weird if local_bookmark.remote() returned
an empty RefSymbol.
2025-05-13 23:54:47 +00:00
kkoang
f02c02eabc docs: Add support for installing JJ using the winget command. 2025-05-13 05:42:03 +00:00
Yuya Nishihara
cb877a94c1 templater: allow comparison between optional and non-optional values
I'm going to add RefSymbol(String) type to format bookmark/remote name in revset
syntax. Since an empty symbol will be rendered differently from an empty string,
bookmark.remote() -> String will be changed to -> Option<RefSymbol>. Then, we'll
need to add support for comparison between optional and non-optional values.

In template language, method call on None produces an error. If we followed this
rule, comparison would have to be expressed as `opt && opt == lit`. I feel this
would be too verbose, and wouldn't help eliminate user error caused by
unintended comparison between Option<T> and T anyway. So this patch implements
comparison by lifting T to Option<T> implicitly.
2025-05-13 00:18:02 +00:00
kkoang
53272510bf docs: Update tutorial.md using the command in version 0.29.0 2025-05-12 20:41:22 +00:00
Mateus Auler
96a0c4f759 docs: document code to avoid duplicating gerrit change-id
Adapted from:
- https://gist.github.com/thoughtpolice/8f2fd36ae17cd11b8e7bd93a70e31ad6#file-jjconfig-toml-L247
- 28a0e40439/.jjconfig.toml (L150)
2025-05-11 17:00:32 +00:00
Vincent Ging Ho Yim
8c4840135f docs/templates: surround type names with backticks in section headings
In particular, this fixes the section heading for the `List<Trailer>` type. Before this
commit, that heading was rendered incorrectly as 'List type'.
2025-05-11 13:14:36 +00:00
Vincent Ging Ho Yim
d08f19dc3e docs/core_tenets: fix typo 2025-05-10 15:36:46 +00:00
Alper Cugun
0fe7b3a428 docs: Remove deprecated backout command from git table
Change default location for revert as suggested by @emilazy
2025-05-09 15:26:53 +00:00
Michael Pratt
88be1b4c56 docs: clarify commit_trailers deduplication
I spent quite a while confused by the presence of
`if(!trailers.contains_key("Change-Id")` in the `commit_trailers` example. My
thinking was: if `commit_trailers` already performs deduplication, then isn't
this logic useless?

Eventually I realized that the `commit_trailers` deduplication works on the
entire line, not just the key as I'd assumed. (And that makes sense for
trailers like Signed-off-by that can appear more than once.)

I've reworded the `commit_trailers` documentation to try to make this more
clear.
2025-05-08 09:17:56 +00:00
Emily
7bcc5cca8f git: remove git2 feature 2025-05-07 19:29:20 +00:00
Emily
f3de3858ef git: remove git.subprocess setting 2025-05-07 19:29:20 +00:00
Austin Seipp
5017c44deb docs: improve release process tidbits (again)
`heads(tags())` was rather confusing in my repository because I have
a bunch of tags pushed to my fork that are tracked locally. Assuming
that `trunk()` is something like `main@origin` or whatnot, then using
`heads(tags() & ::trunk())` works quite a bit better.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2025-05-07 17:07:16 +00:00
Nils Koch
deb4f1ba79 docs: update git compatibility docs for commit signing 2025-05-04 22:52:24 +00:00
Nicole Patricia Mazzuca
05fa4bc0a3 docs: add some more info on signing
I was asked about this in Discord, so I wanted to make sure to have the
information available in the docs and not just the code.
2025-05-03 11:27:36 +00:00
Nicole Patricia Mazzuca
6f6496ba83 config: default to XDG config files on macOS
Support existing users with the "legacy" config directory, as well.
This will be deprecated in a latter commit.
2025-05-02 20:05:24 +00:00
Gaëtan Lehmann
2c4a0328f9 templates: add self.trailers().contains_key(key)
as a simpler and more readable alternative to

    self.trailers().filter(|t| t.key() == "Change-Id")
2025-04-29 06:36:12 +00:00