ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

208 commits

Author SHA1 Message Date
Martin von Zweigbergk
1d5edddef7 docs: clarify that file() revsets match recursively 2023-04-25 14:57:57 -07:00
Glen Choo
d165e931eb docs/design: propose submodule storage approach
This doc discusses the requirements of a submodule storage solution and
proposes a solution: storing submodules as full jj repos.
2023-04-24 14:29:47 -07:00
Glen Choo
562eebe213 WIP docs/design: describe submodule storage ideas and how to judge them
This doc describes what we need to consider in a submodule storage
solution, some possible solutions and what criteria we should use to
decide on a future direction.

This is still a WIP:

- The solutions are still underdescribed
- The actual evaluation of solutions is missing

Suggestions for the above are welcome :)
2023-04-24 14:29:47 -07:00
tp-woven
831c45539e Fix small typo 2023-04-18 18:03:05 +09:00
Martin von Zweigbergk
e65b8c3cad docs: add a glossary
The need for a glossary came up on Discord today.

This needs some more work, but I think this is a good start. I'm still
happy to update it if anyone has suggestions, of course. I haven't
started sprinkling pointers to the glossary from other places, so
users will only discover it by browsing the `docs/` directory.
2023-04-17 16:48:23 -07:00
Aaron Bull Schaefer
6c627fb30d cli: default to log when no subcommand is provided
This is a convenience optimization to improve the default user
experience, since `jj log` is a frequently run command. Accessing the
help information explicitly still follows normal CLI conventions, and
instructions are displayed appropriately if the user happens to make a
mistake. Discoverability should not be adversely harmed.

Note that this behavior mirrors what Sapling does [2], where `sl` will
display the smartlog by default.

[1] https://github.com/clap-rs/clap/issues/975
[2] https://sapling-scm.com/docs/overview/smartlog
2023-04-17 16:30:42 -07:00
Ilya Grigoriev
e448198530 contributing.md: docs on working with protos 2023-04-16 22:04:27 -07:00
Ilya Grigoriev
7d9faef95f contributing.md: Fix up the MSRV, explain it a bit more 2023-04-16 22:04:27 -07:00
Martin von Zweigbergk
df7079033e docs: mention Sapling as a similar tool 2023-04-13 10:10:14 -07:00
Aaron Bull Schaefer
ba9ecea269 docs: explicitly list the platform-specific config paths
The value table is borrowed from the upstream dirs library documenation:
- https://docs.rs/dirs/5.0.0/dirs/fn.config_dir.html
2023-04-12 15:04:23 -07:00
Aaron Bull Schaefer
239f879caf docs: fix minor typos in GitHub example commands 2023-04-11 14:41:00 -07:00
Ilya Grigoriev
21128ba703 docs: add a word to docs about divergent 2023-04-09 22:56:33 -07:00
Ilya Grigoriev
d50c0f5085 Templater: label hidden commits (aka abandoned commits)
Looks like "change_id normal" + color. Picture for `jj obslog`:

https://user-images.githubusercontent.com/4123047/230708271-4108cf5f-255d-419e-bd3e-fc97dc8b8660.png

This should also be occasionally be useful for e.g. `jj log commit_id`.

I also considered the wording `(Was change_id)` or `change_id (old)`, `change_id (obs)`.
2023-04-09 22:56:33 -07:00
Ilya Grigoriev
c735d92e8c formatter: allow using "default" terminal color
The "default" color resets the terminal color to default.
2023-04-09 22:56:33 -07:00
Martin von Zweigbergk
24a512683b revset: add a revset function for finding commits with conflicts
This adds `conflict()` revset that selects commits with conflicts. We
may want to extend it later to consider only conflicts at certain
paths.
2023-04-06 16:46:21 -07:00
David Barnett
22306af17a Add docs on how to use GitHub CLI in repos that aren't co-located 2023-04-05 21:22:49 -06:00
Martin von Zweigbergk
e1c57338a1 revset: split out no-args head() to visible_heads()
The `heads()` revset function with one argument is the counterpart to
`roots()`. Without arguments, it returns the visible heads in the
repo, i.e. `heads(all())`. The two use cases are quite different, and
I think it would be good to clarify that the no-arg form returns the
visible heads, so let's split that out to a new `visible_heads()`
function.
2023-04-03 23:46:34 -07:00
Glen Choo
707d82245f docs/technical: add aspirational Git submodules doc
This document is meant to be a record of how we think about Git
submodules (and not a _current_ implementation of submodules). We will
fill it out incrementally as we get a clearer idea of what we want
submodules to look like.

As an initial version, I started with (IMO) the least controversial
points:

- We want to support most workflows Git submodules users are accustomed
  to.

- A roadmap that allows us to incrementally roll out Git submodule
  functionality (instead of having to boil the ocean).
2023-04-03 12:58:17 -07:00
Ilya Grigoriev
0e2579ee6a Switch graph node to use for commit instead of
This follows up on 5c703aeb03.

The only reason for this change is that, subjectively, the result looks better to me. I'm not sure why, but I couldn't get used to the old symbol in spite of its seeming reasonableness. It felt really bold and heavy.

If people agree, we can wait until we need to update the screenshots for some other reason before merging this. Sorry I didn't figure this out while the discussion about the referenced commit was going on.

I'm not 100% certain how many fonts support each symbol. Please try it out and let me know if it doesn't work for you.

Compare after:

![image](https://user-images.githubusercontent.com/4123047/229251383-563b889d-7233-42e2-a3c5-bf9368a4d1fd.png)

and before:

![image](https://user-images.githubusercontent.com/4123047/229251695-7fd0ff2c-2832-4262-ade5-5120288cccdf.png)
2023-04-02 23:15:37 -07:00
Martin von Zweigbergk
0f23ad46f3 docs: add note that co-located mode helps when tools expect a Git repo 2023-03-29 11:25:47 -07:00
Martin von Zweigbergk
6ff7686b69 docs: finally describe what we mean by "co-located repos" 2023-03-29 11:25:47 -07:00
Yuya Nishihara
0532301e03 revset: add latest(candidates, count) predicate
This serves the role of limit() in Mercurial. Since revsets in JJ is
(conceptually) an unordered set, a "limit" predicate should define its
ordering criteria. That's why the added predicate is named as "latest".

Closes #1110
2023-03-25 23:48:50 +09:00
Yuya Nishihara
75d68fe24c templater: add "parents" keyword in place of "parent_commit_ids"
All commit keywords are mapped to nullary methods. No matter if we'll
introduce .field syntax and/or self. keyword, this implementation can be
reused.
2023-03-24 12:17:38 +09:00
Yuya Nishihara
a0be6a5a11 templater: add support for unformattable property
A property of Commit type won't have a default format.
2023-03-24 12:17:38 +09:00
Christophe Poucet
c5503cee84 Seems like it's referring to the wrong commit? 2023-03-21 21:44:15 -07:00
Martin von Zweigbergk
2495c8f27e cargo: update MSRV to 1.64
We need 1.64 to bump `clap` to `4.1`. We don't really need to upgrade
to that, but being on an older version causes minor confusions like
#1393. Rust 1.64 is very close to 6 months old at this point.
2023-03-17 22:44:29 -07:00
Yuya Nishihara
998727266c templater: add join method to mapped template 2023-03-18 12:04:00 +09:00
Yuya Nishihara
3124444d24 templater: add list.map(|x| ...) operation
This involves a little hack to insert a lambda parameter 'x' to be used at
keyword position. If the template language were dynamically typed (and were
interpreted), .map() implementation would be simpler. I considered that, but
interpreter version has its own warts (late error reporting, uneasy to cache
static object, etc.), and I don't think the current template engine is
complex enough to rewrite from scratch.

.map() returns template, which can't be join()-ed. This will be fixed later.
2023-03-18 12:04:00 +09:00
Martin von Zweigbergk
be46efdd0f tutorial: clarify that files need to be saved before closing editors
As suggested in #1386.
2023-03-17 06:50:33 -07:00
Yuya Nishihara
86318bf530 templater: add timestamp.format() method
A format string is parsed statically due to error handling restriction.
I think it covers almost all use cases.
2023-03-15 12:14:42 +09:00
Martin von Zweigbergk
5c703aeb03 cli: replace o as graph node by when using unicode graph
@joyously found `o` confusing because it's a valid change id prefix. I
don't have much preference, but `●` seems fine. The "ascii",
"ascii-large", and "legacy" graph styles still use "o".

I didn't change `@` since it seems useful to have that match the
symbol used on the CLI. I don't think we want to have users do
something like `jj co ◎-`.
2023-03-12 23:21:05 -07:00
Yuya Nishihara
904e9c5520 cli: add ui.log-word-wrap option
Unlike Mercurial, this isn't a template keyword/function, but a config knob.
Exposing graph_width to templater wouldn't be easy, and I don't think it's
better to handle terminal wrapping in template.

I'm not sure if patch content should be wrapped, so this option only applies
to the template output for now.

Closes #1043
2023-03-11 12:01:17 +09:00
Yuya Nishihara
c52efd9df3 templater: add fill(width, content) function
The parameter order follows indent()/label() functions, but this might be
a bad idea because fill() is more likely to have optional parameters. We can
instead add template.fill(width) method as well as .indent(prefix). If we take
this approach, we'll probably need to add string.fill()/indent() methods,
and/or implicit cast at method resolution. The good thing about the method
syntax is that we can add string.refill(), etc. for free, without inventing
generic labeled template functions.

For #1043, I think it's better to add a config like ui.log-word-wrap = true.
We could add term_width/graph_width keywords to the templater, but the
implementation would be more complicated, and is difficult to use for the
basic use case. Unlike Mercurial, our templater doesn't have a context map
to override the graph_width stub.
2023-03-10 16:07:55 +09:00
Yuya Nishihara
e8fd12aff6 templater: add list.join(separator) method
The implementation is a bit tricky since we have to combine a property
(of C -> Vec<Template<()>> type) and a separator of Template<C> type.
2023-03-10 12:58:32 +09:00
Yuya Nishihara
6c146de2e8 templater: add string.lines() method
This wouldn't be used much in practice, but is useful for writing tests of
list methods.
2023-03-10 12:58:32 +09:00
Yuya Nishihara
4984e611f4 templater: add "parent_commit_ids" keyword
A list type isn't so useful without a map operation, but List<CommitId>
is at least printable. Maybe we can experiment with it to craft a map
operation.

If a map operation is introduced, this keyword might be replaced with
"parents.map(|commit| commit.commit_id)", where parents is of List<Commit>
type, and the .map() method will probably return List<Template>.
2023-03-07 11:33:15 +09:00
tp-woven
39cbabf58e Clarify that files() is relative 2023-03-06 13:54:38 +09:00
Yuya Nishihara
8f8a9c91bc templater: add indent(prefix, content) function
The argument order is different from Mercurial's indent() function. I think
indent(prefix, content) is more readable for lengthy content. However,
indent(content, prefix, ...) might be better if we want to add an optional
firstline_prefix argument.
2023-03-04 12:10:53 +09:00
Yuya Nishihara
681944954e docs: document template syntax, keywords and methods
Not all keywords and methods have description, but I think the function
signature should help understand the behavior.
2023-03-02 15:31:19 +09:00
Martin von Zweigbergk
e3a96177f7 docs: Update section about support for .gitignores
Issues #65 and #87 were both fixed almost a year ago.
2023-03-01 18:03:31 -08:00
Yuya Nishihara
66458a097e templater: require infix ++ operator to concatenate expressions
This eliminates ambiguous parsing between "func()" and "expr ()".

I chose "++" as template concatenation operator in case we want to add
bit-wise negate operator. It's also easier to find/replace than "~".
2023-03-01 16:39:23 +09:00
Ilya Grigoriev
49fd177c47 templater: Allow separate styling for change and commit ids 2023-02-21 22:50:27 -08:00
Yuya Nishihara
b5f1728ffb templater: migrate op log to template language
The outermost "op-log" label isn't moved to the default template. I think
it belongs to the command's formatter rather than the template.

Old bikeshedding items:
- "current_head", "is_head", or "is_head_op"
  => renamed to "current_operation"
- "templates.op-log" vs "templates.op_log" (the whole template is labeled
  as "op-log")
  => renamed to "op_log"
- "template-aliases.'format_operation_duration(time_range)'"
  => renamed to 'format_time_range(time_range)'
2023-02-20 18:20:41 +09:00
Ilya Grigoriev
4059fe77fd operation-log.md: Give a brief description of @, +, - 2023-02-18 22:42:51 -08:00
Ilya Grigoriev
385429446b config.md: Additional changes to the section about TOML
Based on @martinvonz 's suggestion from https://github.com/martinvonz/jj/pull/1263.
2023-02-18 22:40:23 -08:00
Ilya Grigoriev
9df7919763 config.md: Fixup to complicated dotted example from 6cc7aa7
Added @martinvonz 's suggestion from https://github.com/martinvonz/jj/pull/1263.
2023-02-18 22:40:23 -08:00
Isabella Basso
3dfedf5814 docs/config.md: add example for using pipes
As discussed on issue #1273, pipe usage on the jj config differs from
git and hg.

Signed-off-by: Isabella Basso <isabbasso@riseup.net>
2023-02-17 08:35:35 -08:00
Ilya Grigoriev
e7bd7a635a config.md: Add a link to TOML syntax guide 2023-02-16 09:56:57 -08:00
Ilya Grigoriev
6cc7aa72e8 config.md: expand on equivalence of headers and dotted keys
Now that we use headers to define `[template-aliases]`, I thought we should explain how they are also equivalent to dotted keys.

Alternatively, we could rewrite them all in the dotted style, but it would look awkward.
2023-02-16 09:56:57 -08:00
Ilya Grigoriev
e4aa2cb2e5 Rename ui.relative-timestamps to ui.oplog-relative-timestamps 2023-02-15 21:26:14 -08:00