Commit graph

5 commits

Author SHA1 Message Date
Austin Seipp
48fa821e60 cli: move src/ directory to new cli/ directory
Summary: In preparation for unifying all workspace dependencies across all
crates, let's go ahead and move the jj-cli crate into its own new directory.
This will also be a nicer and more uniform layout as we add new `jj-*` crates.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Change-Id: Icf94e7ae5f290dc8e181215727b38ada
2023-08-04 19:00:42 -05:00
Martin von Zweigbergk
aac5b7aa25 cargo: rename crates from jujutsu/jujutsu-lib to jj-cli/jj-lib
Almost everyone calls the project "jj", and there seeems to be
consensus that we should rename the crates. I originally wanted the
crates to be called `jj` and `jj-lib`, but `jj` was already
taken. `jj-cli` is probably at least as good for it anyway.

Once we've published a 0.8.0 under the new names, we'll release 0.7.1
versions under the old names with pointers to the new crates names.
2023-07-09 06:40:43 +02:00
Yuya Nishihara
b6a5d63b09 time_util: add functions to parse format spec and apply it later
In templater, it's easier to handle invalid format string at parsing stage, so
I want to build formatting items upfront. Since the formatting items borrow
the input string by reference, we need to manually convert them to the owned
variants.
2023-03-15 12:14:42 +09:00
Yuya Nishihara
731a94e4f2 time_util: cache parsed result of default time format
While measuring overhead of interpreter version of the template engine, I
noticed the templater spend some time in chrono. I don't think this would
matter in practice, but it's easy to cache the formatting items.

    % jj log -r'all()' -T'".\n"' --no-graph | wc -l
    2996

    % hyperfine --warmup 3 --runs 20 "jj log --ignore-working-copy -r 'all()' -Tshow --no-graph"
    (original)
      Time (mean ± σ):     120.0 ms ±  18.7 ms    [User: 97.5 ms, System: 22.5 ms]
      Range (min … max):    96.7 ms … 144.1 ms    20 runs
    (new)
      Time (mean ± σ):     106.2 ms ±  12.3 ms    [User: 86.1 ms, System: 20.1 ms]
      Range (min … max):    96.3 ms … 130.4 ms    20 runs

Regarding the template engine rewrites, I'm yet sure that the interpreter
version is strictly better. It's simpler, but could make some caching story
difficult. So I'm not gonna replace the engine anytime soon.
2023-03-15 12:14:42 +09:00
Samuel Tardieu
efceccb17d refactor: separate timestamp related utilities in time_util module 2023-01-14 16:07:09 +01:00