Commit graph

20 commits

Author SHA1 Message Date
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
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
Martin von Zweigbergk
a67fbb6714 cli: switch default graph style to be Sapling's curved style
We seem to quite unanimously prefer this style, so let's make the
default.
2023-02-12 07:23:29 -08:00
Martin von Zweigbergk
3ccdd1f98a tests: pass string instead of bytes to add_config()
I don't think need to write non-UTF8 bytes to our config files. If we
ever do (maybe to test that we give the user a reasonable error
message), we add a custom function for that.
2023-01-26 12:48:30 -08:00
Ilya Grigoriev
e32342a6c4 jj op log: Show durations with relative timestamps
Before, the humanized versions of start and end times often were identical.
2023-01-07 12:08:00 -08:00
Ilya Grigoriev
a48b4855be Have jj op log obey ui.relative-timestamps option 2023-01-07 12:08:00 -08:00
Yuya Nishihara
6f8fb09609 cli: append "\n" to commit description specified by -m/--message
Otherwise the description set by -m would differ from the one set by editor.
This fixes test_describe() which says "make no changes", but previously "\n"
would be added by the second "jj describe".

As you can see, almost all hashes change in CLI tests. This means in-flight
PRs will need to be rebased to update insta snapshots.

Description text could be normalized by CommitBuilder, but the caller would
have to normalize it beforehand to compare with the current description, so
we would need an explicit function anyway. Another idea is to add a newtype
that represents a normalized description, and make CommitBuilder require it.
Commit::description() will return &Description in place of &str to ensure
that commit.description() == raw_str wouldn't compile.

Git CLI provides --cleanup=<mode> option to switch normalization rules, but
I don't think we'll need such feature.
2022-12-22 14:59:03 +09:00
Yuya Nishihara
67be440f4a cli: resolve operation symbol first and apply '-' postfix repeatedly
Just like revsets.
2022-12-13 09:28:48 +09:00
Yuya Nishihara
c46c150542 cli: add one more operation to test_op_log()
Also made op id variables less dynamic as operation ids are now stable
in tests.
2022-12-13 09:28:48 +09:00
Martin von Zweigbergk
d8feed9be4 copyright: change from "Google LLC" to "The Jujutsu Authors"
Let's acknowledge everyone's contributions by replacing "Google LLC"
in the copyright header by "The Jujutsu Authors". If I understand
correctly, it won't have any legal effect, but maybe it still helps
reduce concerns from contributors (though I haven't heard any
concerns).

Google employees can read about Google's policy at
go/releasing/contributions#copyright.
2022-11-28 06:05:45 -10:00
Martin von Zweigbergk
37e30a4b68 tests: use snapshot testing for operation log
The operation IDs are now predictable in tests.
2022-11-24 16:00:20 -10:00
Martin von Zweigbergk
8d7a9e729b tests: set test hostname and username for operation log
This makes the tests more hermetic, even though I don't think the
default values (taken from `whoami`) can break any tests (then we
would have already seen them break). Now we just need to make the
operation log's timestamps predictable and then we can start using
operation IDs in snapshot tests.
2022-11-24 16:00:20 -10:00
Martin von Zweigbergk
9502d84872 operations: make hostname and username configurable
We currently get the hostname and username from the `whoami` crate. We
do that in lib crate, without giving the caller a way to override
them. That seems wrong since it might be used in a server and
performing operations on behalf of some other user. This commit makes
the hostname and username configurable, so the calling crate can pass
them in. If they have not been passed in, we still default to the
values from the `whoami` crate.
2022-11-14 10:02:04 -08:00
Benjamin Saunders
646fc338ab Include @ in the default revset
Yields a less confusing behavior of `jj log` after pushing a commit.
2022-10-19 13:30:16 -07:00
Martin von Zweigbergk
d0ecbaf1a4 graphlog: don't de-indent multi-line text at end of chain 2022-05-11 04:42:44 -07:00
Martin von Zweigbergk
8ef00a3498 tests: re-run with insta crate version b9d99e87065b 2022-04-28 16:55:10 -07:00
Martin von Zweigbergk
f71047c823 cli: add hard-coded support for specifying previous operation
It's useful for testing to be able to specify some operation that's
not the latest one.

I didn't update the changelog because this feature is mostly for
testing.
2022-04-26 10:42:29 -07:00
Martin von Zweigbergk
f8512226fc cli: return specialized message on non-hex operation ID 2022-04-26 10:42:29 -07:00
Martin von Zweigbergk
6619a18056 tests: add test for jj op log and --at-op
We can't easily test much of the output of `jj op log` because it's
unstable, but here are at least a few tests.
2022-04-26 10:42:29 -07:00