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
dependabot[bot]
78cdf71d9a
cargo: bump insta from 1.26.0 to 1.28.0
...
Bumps [insta](https://github.com/mitsuhiko/insta ) from 1.26.0 to 1.28.0.
- [Release notes](https://github.com/mitsuhiko/insta/releases )
- [Changelog](https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md )
- [Commits](https://github.com/mitsuhiko/insta/compare/1.26.0...1.28.0 )
---
updated-dependencies:
- dependency-name: insta
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 16:53:47 +00:00
dependabot[bot]
034dd3528d
github: bump dtolnay/rust-toolchain
...
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain ) from 0a1713a447f74360b294fd86bc56dc23af3a9d3e to 52e69531e6f69a396bc9d1226284493a5db969ff.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases )
- [Commits](0a1713a447...52e69531e6
)
---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 08:39:18 -08:00
Ilya Grigoriev
e4aa2cb2e5
Rename ui.relative-timestamps
to ui.oplog-relative-timestamps
2023-02-15 21:26:14 -08:00
Ilya Grigoriev
859b0f680c
Make ui.relative-timestamps
default to true
...
This seems like a better default for `jj op log`, which is now the only thing
this option affects.
2023-02-15 21:26:14 -08:00
Ilya Grigoriev
bb6bad18ad
Update docs/config.toml with new way to show relative timestamps
2023-02-15 21:26:14 -08:00
Martin von Zweigbergk
d8997999f2
repo: replace RepoRef by Repo trait
2023-02-15 19:15:17 -08:00
Martin von Zweigbergk
f6a4cb57da
repo: extract a Repo
trait for Arc<ReadonlyRepo>
and MutableRepo
...
This will soon replace the `RepoRef` enum, just like how the `Index`
trait replaced the `IndexRef` enum.
2023-02-15 19:15:17 -08:00
Martin von Zweigbergk
b7dad291df
repo: make all base_repo() functions return &Arc<ReadonlyRepo>
...
This is to prepare for a `Repo` trait implemented for
`Arc<ReadonlyRepo>` (not for `ReadonlyRepo` itself).
2023-02-15 19:15:17 -08:00
Martin von Zweigbergk
8a067282c8
repo: make ReadonlyRepo::index()
return a &dyn Index
...
This is just a little preparation for extracting a `Repo` trait that's
implemented by both `ReadonlyRepo` and `MutableRepo`. The `index()`
function in that trait will of course have to return the same type in
both implementations, and that type will be `&dyn Index`.
2023-02-15 19:15:17 -08:00
Yuya Nishihara
3c61e9239c
config: remove ui.log-author-format in favor of template alias
2023-02-16 11:43:17 +09:00
Yuya Nishihara
6316ec7442
config: migrate log/show timestamp format away from config knob
...
Since oplog still relies on ui.relative-timestamps, this config key
isn't removed.
2023-02-16 11:43:17 +09:00
Yuya Nishihara
a00767bc0f
config: remove ui.unique-prefixes/log-id-preferred-length in favor of alias
2023-02-16 11:43:17 +09:00
Yuya Nishihara
7913f90869
templater: remove "brackets" short id style in favor of template alias
...
Though .prefix() + .rest() has to call .shortest() twice, I don't think
the added cost would be significant.
2023-02-16 11:43:17 +09:00
Yuya Nishihara
ffa690abec
docs: document default template aliases instead of config knobs
...
I'm going to remove the corresponding config knobs.
As an example of "brackets" short id, I put a simplified version. It's
unlikely that the "rest()" gets empty for hashes of 12-char long.
2023-02-16 11:43:17 +09:00
Yuya Nishihara
ed4a696dea
templater: add shortest().prefix()/rest() accessors
...
This ensures that the "brackets" style can be emulated by a template
expression.
2023-02-16 11:43:17 +09:00
Martin von Zweigbergk
29792dab9b
cli: avoid a closure in op log
code for printing timestamp
...
I find it easier to read the code without the closure and the extra
indentation. Instead, leverage `formatter.labeled()`.
2023-02-15 09:46:38 -08:00
dependabot[bot]
2217a78df3
github: bump dtolnay/rust-toolchain
...
Bumps [dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain ) from 25dc93b901a87e864900a8aec6c12e9aa794c0c3 to 0a1713a447f74360b294fd86bc56dc23af3a9d3e.
- [Release notes](https://github.com/dtolnay/rust-toolchain/releases )
- [Commits](25dc93b901...0a1713a447
)
---
updated-dependencies:
- dependency-name: dtolnay/rust-toolchain
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 08:49:33 -08:00
Martin von Zweigbergk
e76492b5e9
demos: minor changes to operation log demo
2023-02-15 00:25:56 -08:00
Yuya Nishihara
1bdee80a0d
cli: remove attempt to detect EPIPE caused by bad pager configuration
...
It turned out bad idea because EPIPE (or SIGPIPE) is kind of a successful
termination. We could show some warning based on pager exit code, but let's
avoid messing up again.
io::Error occurred in handle_command_result() is still mapped to a BrokenPipe.
panic()-ing there should be wrong.
2023-02-15 15:36:23 +09:00
Martin von Zweigbergk
91775fc4f6
demos: update with recent changes
...
I had to modify the operation log a bit to fit on my scren with #1221
fixed.
Closes #1221 .
2023-02-14 22:12:23 -08:00
Martin von Zweigbergk
73ce048256
demos: add blank line at the end
...
This makes it slightly easier to take a screenshot without getting the
cursor character from the shell input line just below.
2023-02-14 22:12:23 -08:00
Martin von Zweigbergk
d87f49ce5f
demos: remove unnecessary sleep
s
2023-02-14 22:12:23 -08:00
Martin von Zweigbergk
54156335e4
cli: don't print error about broken pipe
...
`jj log | head` consistently prints "Error: Broken pipe" for me. I
don't know how the output gets printed after the pipe has been closed,
but neither `git` nor `hg` prints an error, so I think we shouldn't
either.
2023-02-14 21:29:02 -08:00
Yuya Nishihara
0abf9ce8cd
cli: move default "show" template to alias
...
I'm not pretty sure if this is structurally good, but 'jj log -T show'
is useful.
2023-02-15 01:44:33 +09:00
dependabot[bot]
65ff1afb0d
cargo: bump once_cell from 1.17.0 to 1.17.1
...
Bumps [once_cell](https://github.com/matklad/once_cell ) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/matklad/once_cell/releases )
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md )
- [Commits](https://github.com/matklad/once_cell/compare/v1.17.0...v1.17.1 )
---
updated-dependencies:
- dependency-name: once_cell
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2023-02-14 16:23:42 +00:00
Yuya Nishihara
605eb72883
config: rename [template] section to [templates], drop .graph suffix
...
This should be more consistent with the other tables.
2023-02-15 00:23:48 +09:00
Yuya Nishihara
9c6fa67b86
config: apply configured id style to commit_summary template
...
Thanks to 81af5f820b
"repo: calculate shortest unique prefix separately for
commit/change", commit_id.shortest() now works even if the repo is MutableRepo.
2023-02-15 00:23:48 +09:00
Yuya Nishihara
bc7ca03da4
config: extract commit_summary template to config/templates.toml
2023-02-15 00:23:48 +09:00
Yuya Nishihara
e996f6859b
cli: add dummy load of summary template to WorkspaceCommandHelper::new()
...
Alternatively, we can make all callers propagate TemplateParseError, but I
don't think format_commit_summary() should have such signature.
2023-02-15 00:23:48 +09:00
Yuya Nishihara
32f4a81329
config: extract "show" template to config/templates.toml
...
Aside from [template] vs [templates], we might want a "show" template alias
so "jj log -Tshow" serves the role of "hg log -v".
2023-02-15 00:23:48 +09:00
Yuya Nishihara
a5a49c8c12
config: extract default log template to config/templates.toml
2023-02-15 00:23:48 +09:00
Yuya Nishihara
a2bc826cf4
cli: migrate log formatting options to leverage template aliases
...
No more format!() template expressions.
We might want a separate namespace for configurable "default" aliases, but
let's start with a simple approach. Even if we had [default-templates]
section, it would be practically the same as [template-aliases] so long as
'default-templates.f()' appears as 'f()' in template.
2023-02-15 00:23:48 +09:00
Yuya Nishihara
7e271347d0
cli: remove stale comment about conditional template labeling
...
We can add boolean.then() for convenience, but it isn't strictly needed.
label(if()) works fine.
2023-02-15 00:23:48 +09:00
Martin von Zweigbergk
2d8aa2d90e
index: delete IndexRef, use Index trait
...
I don't know why I didn't create a trait to begin with. Maybe I had
trouble with lifetimes or object-safety.
2023-02-14 06:51:49 -08:00
Martin von Zweigbergk
b955e3de03
index: extract a trait for the index
...
Even though we don't know the details yet, we know that we want to
make the index pluggable like the commit and opstore
backends. Defining a trait for it should be a good step. We can refine
the trait later.
2023-02-14 06:51:49 -08:00
Martin von Zweigbergk
7a985ed122
index: remove lifetime parameter to IndexRef::heads()/topo_order()
...
I want to replace `IndexRef` by a trait, and I want that trait to be
object-safe.
2023-02-14 06:51:49 -08:00
Martin von Zweigbergk
a474c688a8
index: simplify a test helper by specializing it
...
We apparently always have an `&Arc<ReadonlyIndex>` where we call the
`generation_number()` function.
2023-02-14 06:51:49 -08:00
Martin von Zweigbergk
78d77661bc
tutorial: update with recent changes, plus some other editing
...
We have made some changes to CLI output that had not made it into the
tutorial. It's time to update it, especially with the new change id
rendering. Since I'm updating it now, and since it's a bit of work to
do so, I decided to use GitHub's Hello-World repo instead of jj's own
repo as our example.
2023-02-14 06:06:58 -08:00
Martin von Zweigbergk
81af5f820b
repo: calculate shortest unique prefix separately for commit/change
...
We now resolve the two kinds of ids in separate spaces, so the
shortest prefixes should also be calculated in separate spaces.
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
222709196a
repo: remove code for conflict between root commit/change id
...
The two ids no longer share a prefix, so we don't need to worry about
one being a prefix of the other.
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
d6909002f0
repo: elide lifetime on resolve_change_id_prefix()
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
04a0c60b16
revset: remove code for conflict between commit/change id
...
Commit ids and change ids now use non-overlapping symbols for their
digits, so they can't share a prefix.
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
9261bfe5fc
revset: resolve change ids only using the new hex digits
...
Now that we use the new hex digits when we display change ids, we no
longer need to be able to resolve the old (conventional) digits.
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
331ebf4cef
cli: use reverse-alphabet hex for branch name in jj git push --change
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
9887d2c3d6
templater: use reverse-alphabet hex for change ids
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
562042312d
templater: inline trivial CommitOrChangeId::as_bytes()
2023-02-13 22:49:21 -08:00
Martin von Zweigbergk
39640cc288
revset: allow resolving change id using hex digits from reverse alphabet
...
By separating the value spaces change ids and commit ids, we can
simplify lookup of a prefix. For example, if we know that a prefix is
for a change id, we don't have to try to find matching commit ids. I
think it might also help new users more quickly understand that change
ids are not commit ids.
This commit is a step towards that separation. It allows resolving
change ids by using hex digits from the back of the alphabet instead
of 0-f, so 'z'='0', 'y'='1', etc, and 'k'='f'. Thanks to @ilyagr for
the idea. The regular hex digits are still allowed.
2023-02-13 22:49:21 -08:00
Yuya Nishihara
b44148871a
templater: save alias chain to report type/name error in original context
...
Since type/name checking is made after alias substitution, we need to preserve
the original context to generate a readable error message.
We could instead attach a stack of (alias_id, span) to ExpressionNode, but
the extra AliasExpanded node helps to capture downstream error by a single
.map_err() call.
2023-02-14 10:06:28 +09:00