Commit graph

508 commits

Author SHA1 Message Date
Philip Metzger
0690922ca1 FAQ: Add some more variants on how to deal with temporary files
The people in #323 think that we should document all patterns there are to deal with ignored files.
2024-07-11 20:01:57 +02:00
Emily
93d76e5d8f str_util: support case‐insensitive string patterns
Partially resolve a 1.5‐year‐old TODO comment.

Add opt‐in syntax for case‐insensitive matching, suffixing the
pattern kind with `-i`. Not every context supports case‐insensitive
patterns (e.g. Git branch fetch settings). It may make sense to make
this the default in at least some contexts (e.g. the commit signature
and description revsets), but it would require some thought to avoid
more confusing context‐sensitivity.

Make `mine()` match case‐insensitively unconditionally, since email
addresses are conventionally case‐insensitive and it doesn’t take
a pattern anyway.

This currently only handles ASCII case folding, due to the complexities
of case‐insensitive Unicode comparison and the `glob` crate’s lack
of support for it. This is unlikely to matter for email addresses,
which very rarely contain non‐ASCII characters, but is unfortunate
for names and descriptions. However, the current matching behaviour is
already seriously deficient for non‐ASCII text due to the lack of any
normalization, so this hopefully shouldn’t be a blocker to adding the
interface. An expository comment has been left in the code for anyone
who wants to try and address this (perhaps a future version of myself).
2024-07-10 05:58:34 +01:00
Yuya Nishihara
44a39017f0 diff: highlight word-level changes in git diffs
The output looks somewhat similar to color-words diffs. Unified diffs are
verbose, but are easier to follow if adjacent lines are added/removed + modified
for example.

Word-level diffing is forcibly enabled. We can also add a config knob (or
!color condition) to turn it off to save CPU time.

I originally considered disabling highlights in block insertion/deletion, but
that wasn't always great. This can be addressed separately as it also applies
to color-words diffs. #3958
2024-07-05 16:07:12 +09:00
Benjamin Tan
0c0e001262 git init: add revset alias for trunk() when intializing with existing git repository 2024-07-04 23:04:19 +08:00
Benjamin Tan
d8899e1ae7 git clone: add revset alias for trunk() 2024-07-04 23:04:19 +08:00
Matt Kulukundis
aaa99e6dc7 diff: add a file-by-file variant for external diff tools 2024-07-03 20:09:17 -04:00
Yuya Nishihara
5a85254bde docs: add customization example of color-words diff style
The default style is compatible with various terminal emulators, but I suspect
that many people wouldn't like underlines. Let's add an example to override it.
2024-07-02 18:47:36 +09:00
Philip Metzger
3b2197c74a docs: Add a Design Doc blueprint.
This should be the template for all new Design Docs, minor deviations aside.
Hopefully this makes the process a bit easier.
2024-06-30 15:37:40 +02:00
Philip Metzger
c4777e4721 docs: Formalize our design docs process a bit.
This adds the basic outline of _when_ a Design Doc should be written. See the next
commit in the stack for the blueprint. 

By adding this we hopefully can prevent unnecessary churn from new and longtime contributors, 
when they want to add a major feature or rewrite a core part of Jujutsu. The text is written
as a guideline, not a rule.
2024-06-30 15:37:40 +02:00
Martin von Zweigbergk
8d67b1412e cleanup: leverage BoxStream/BoxFuture type aliases
Thanks to @fowles for bringing these to my attention.
2024-06-26 11:34:52 +09:00
Ilya Grigoriev
46b37aca2f docs: replace jj files -> jj file list
`jj files` is now deprecated
2024-06-24 21:01:55 -07:00
dploch
1a78ba5eaf copy-info: initial design doc 2024-06-24 13:26:12 -04:00
Martin von Zweigbergk
31b8f07fa0 docs: hyphenate "community-built" 2024-06-20 05:34:02 +09:00
Martin von Zweigbergk
2cdb767991 docs: explain that jj was started 3 years before Sapling announcement
Someone at work asked me why I started jj when Sapling already
existed. Let's clarify that I started it before.
2024-06-20 05:24:28 +09:00
Martin von Zweigbergk
9257d0946e docs: use bullet lists in revset examples to save vertical space 2024-06-20 05:21:03 +09:00
Martin von Zweigbergk
3ebad154ca docs: add examples for some revset functions too 2024-06-19 19:57:22 +09:00
Ilya Grigoriev
a6d470dbc3 docs revsets.md: fixup 4d08c2c
This makes the examples in
https://martinvonz.github.io/jj/prerelease/revsets/#operators render
properly at the cost of worse (but readable) rendering on GitHub.

Also fixes a typo.
2024-06-17 22:58:25 -07:00
Philip Metzger
30f54862dd docs: Add a page for community built tools.
Thank you all for building tools around it.
2024-06-17 19:47:13 +02:00
Matt Kulukundis
8aa71f58f3 feat: add an option to monitor the filesystem asynchronously
- make an internal set of watchman extensions until the client api gets
  updates with triggers
- add a config option to enable using triggers in watchman

Co-authored-by: Waleed Khan <me@waleedkhan.name>
2024-06-16 23:24:22 -04:00
Martin von Zweigbergk
4d08c2cce8 docs: include examples for operators
There's been a lot of questions about the subtle differences between
`..` and `::`. I hope these examples will help with that.

We should also add examples to the revset functions (e.g. `heads()` is
not obvious how it works), but that can come later.
2024-06-17 12:23:46 +09:00
Martin von Zweigbergk
182cf6d5e2 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).
2024-06-17 12:23:46 +09:00
Ilya Grigoriev
4a63506e9f docs CLI Reference: make the warning in the beginning less scary
I am currently not aware of any severe differences between the generated
markdown and `jj help`, though this could change if we look over the
text carefully or if we start using `clap` features we weren't using
before.
2024-06-15 20:30:40 -07:00
Yuya Nishihara
a7bff04af8 revset, templater: implement arity-based alias overloading
Still alias function shadows builtin function (of any arity) by name. This
allows to detect argument error as such, but might be a bit inconvenient if
user wants to overload heads() for example. If needed, maybe we can add some
config/revset syntax to import builtin function to alias namespace.

The functions table is keyed by name, not by (name, arity) pair. That's mainly
because std collections require keys to be Borrow, and a pair of borrowed
values is incompatible with owned pair. Another reason is it makes easy to look
up overloads by name.

Alias overloading could also be achieved by adding default parameters, but that
will complicate the implementation a bit more, and can't prevent shadowing of
0-ary immutable_heads().

Closes #2966
2024-06-14 23:11:29 +09:00
Kyle J Strand
03a0921e12 give descendants a range arg 2024-06-13 18:54:57 -06:00
Ilya Grigoriev
2d0b715ad0 docs: update windows docs to mention minus, update minus docs
Quick fix to #3850.
2024-06-10 11:47:34 -07:00
Ilya Grigoriev
b8d0cf31b8 docs install_and_setup: move Arch Linux after From Source
I am not sure how to order the other entries, but "From Source" seems to
me like the most important one.
2024-06-09 10:15:16 -07:00
Yuya Nishihara
d2efd89135 docs: clarify that revset parents and children can be empty
I just added "can be empty" since it seems obvious when it becomes empty if it
can be empty. AFAICT, the confusion in #3821 is whether or not "no parents"
falls back to root().
2024-06-07 11:27:37 +09:00
Yuya Nishihara
186f639dfb docs: sort list of operators in order of binding strengths
We can add a separate precedence/associativity table, but I think the ordered
list is good enough. Nullary :: and .. have no binding, but inserted after the
infix versions for brevity.
2024-06-07 11:27:37 +09:00
Yuya Nishihara
fcc0b86f0a docs: fix another missing shell quoting around root()
We've turned the "root" symbol into a function before. That's probably why.
2024-06-04 21:19:16 +09:00
Matthew Davidson
88cb56d3dd docs: Fix zsh-breaking logging example 2024-06-04 20:44:11 +09:00
Ilya Grigoriev
a30df323bd jj git push docs: document safety checks
As discussed in
https://discord.com/channels/968932220549103686/1226363798483636265/1226415448615288864
2024-06-01 11:19:48 -07:00
Glen Choo
8a4087d07b docs: document code.cmd editor on Windows
On Windows `code` works in the shell, but not when specified to jj, because the
executable is actually named `code.cmd`! This is a feature of Windows, where
certain file extensions (defined by the PATHEXT environment variable) are
automatically treated as executable and can have their extensions omitted.

Presumably, jj doesn't support this feature on Windows, though perhaps it
should. For now, avoid adding an explanation of PATHEXT so as to not clutter
things too much, and just suggest `code.cmd` on Windows. Most readers should be
able to put two and two together from there.
2024-05-30 10:21:20 +08:00
Ilya Grigoriev
92403d7d11 require poetry 1.8, recommend installing it via pipx
I feel like recommending people install Poetry via a package manager was
a mistake. Poetry only supports its latest version, and while newer
versions are sort-of backward-compatible, they print warnings in
different situations and have different bugs.  Installing `pipx` via a
package manager, OTOH, works fine, and its older versions work fine.

Using Poetry 1.8+ allows us to use Poetry's new "non-package" mode,
which would no longer print warnings if the user does `poetry install`
instead of `poetry install --no-root`. It's likely that in newer
versions of Poetry, it will become an error.
2024-05-27 10:53:35 -07:00
Yuya Nishihara
f54aca7e67 docs: s/socio-economics/socioeconomics/ per codespell suggestion 2024-05-24 11:34:03 +09:00
Yuya Nishihara
02eb164dae config: migrate "config get"/"set" to TOML-based name argument parsing 2024-05-23 12:22:12 +09:00
Matt Stark
fa6f5e3880 Add the revsets mutable and immutable.
I add them as aliases, since a user may instead choose to define `immutable_heads()`, for example, as `heads(immutable())`, and the define `immutable()` instead.
2024-05-22 09:19:46 +10:00
dploch
a49da4ad01 revset: implement a 'reachable(src, domain)' expression
This revset correctly implements "reachability" from a set of source commits following both parent and child edges as far as they can go within a domain set. This type of 'bfs' query is currently impossible to express with existing revset functions.
2024-05-21 10:52:31 -04:00
Remo Senekowitsch
c9375bf76f docs: fix converting a repo into a co-located one
`jj st` doesn't add the file `.git/refs/heads/main` so the git repo is left
in an invalid state. `jj new @-` puts the git repo in a valid state.
2024-05-20 21:39:27 +09:00
Waleed Khan
6eefad9b67 docs: Add Log header
There are six related settings that would be good to group in the table of contents.
2024-05-18 16:39:28 -07:00
Martin von Zweigbergk
8e0ac1d167 docs: conflicted branches have two "?" as suffix
Looks like we forgot to update this when we changed from one to two
question marks.
2024-05-17 07:00:15 -07:00
Ilya Grigoriev
0d0f8af05d docs CLI reference: explain that argument help is truncated
Perhaps this will help with issues like
https://github.com/martinvonz/jj/issues/3667
2024-05-15 09:45:40 -07:00
Ilya Grigoriev
c9b44f3828 docs: ask MkDocs to fail on links to non-existent sections
This also requires anchors to be lower-cased: https://github.com/mkdocs/mkdocs/issues/3703
2024-05-14 13:14:27 -07:00
tinger
d0a29a831d cli: add ui.color = "debug"
When using `ui.color = "debug"`, changes in the output style
additionally include delimiters << and >>, as well as all active labels
at this point separated by ::. The output is otherwise unformatted and
the delimiters and labels inherit the style of the content they apply
to.
2024-05-11 10:16:09 +02:00
Yuya Nishihara
8e4f75552d templater: add tracking methods to remote RefName
More tests will be added later as "branch list" templates.

In "log" template, we might want to see the number of "local" commits ahead
of any tracked remotes. It can be implemented later in a similar way (or as a
nested remote_refs list.)
2024-05-10 08:36:38 +09:00
Yuya Nishihara
9a5b001d58 templater: add SizeHint type to represent revset.count_estimate() value
We'll probably add binary comparison operators at some point, but this patch
also adds size_hint.zero() method. Otherwise, we'll have to write
"if(x.upper() && x.upper() == 0, ..)" to deal with None.

The resulting "branch list" template will look like:
```
separate(", ",
  if(!ref.tracking_ahead_count().zero(),
    if(ref.tracking_ahead_count().exact(),
      "ahead by " ++ ref.tracking_ahead_count().exact() ++ " commits",
      "ahead by at least " ++ ref.tracking_ahead_count().lower() ++ " commits")),
  if(!ref.tracking_behind_count().zero(),
    if(ref.tracking_behind_count().exact(),
      "behind by " ++ ref.tracking_behind_count().exact() ++ " commits",
      "behind by at least " ++ ref.tracking_behind_count().lower() ++ " commits")),
)
```
2024-05-09 08:51:34 +09:00
Ilya Grigoriev
9be159342c config.md: advertise diffedit3 as an alternative to meld-3 diff editor
This is instead of https://github.com/martinvonz/jj/pull/3292, which would make
`diffedit3` built into `jj`. I still have some hope of eventually making
`diffedit3` into the default diff editor that is available without any
configuration, which probably requires building it into `jj`, but this may not
happen, and it wouldn't hurt to test `diffedit3` first. Some examples of
concerns (see also the discussion in that PR):

- It is only a guess on my part that this would make a good default. The editor
might not be polished enough, and most users are not used to 3-pane diff
editing. I think most users would like it if they tried it, but this might be
plain wrong.

- There are concerns about adding a heavyweight dependency on `jj`. While I
tried to make it as lightweight as possible, it still unavoidably includes a web
server.

- There may be ways to bundle `diffedit3` with `jj` without combining them in a
single binary.
2024-05-08 11:38:41 -07:00
Ilya Grigoriev
638649b435 tutorial: edits to the diff editor explanation
Follows up on #3599. I also moved the discussion of other diff editors to a
footnote, as it didn't seem to fit well into the flow of the text.
2024-05-05 18:17:38 -07:00
Eidolon
3d898d0a06 Add default value of revsets.log to config docs
I wanted to have a reference point for the built-in revsets,
but `jj config get revsets.log` doesn't turn anything up since
it has special handling for the legacy config key
`ui.default-revset`. So I had to dig into the source code of jj
to get it.

I think it might help others to be able to reason about revsets
to have the log default shown in the settings documentation.
2024-05-05 07:17:32 -07:00
Yuya Nishihara
4db068e7f7 templater: expose RefTarget methods through RefName type
I considered adding RefTarget template type, but some of the methods naturally
fit to RefName. For example, a conflicted branch name is decorated as "??", so
it makes sense to add branch.conflict() instead of branch.target().conflict().

I'm not pretty sure how many RefName methods we'll need to add to port the
current branch listing, but there will be .tracked(), .tracking_local_present(),
.ahead_by(), and .behind_by().
2024-05-03 15:16:52 +09:00
Charles Crete
d9d60118a3 docs: update tutorial to include :builtin diff editor instructions 2024-05-02 23:04:40 -04:00