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

10 commits

Author SHA1 Message Date
Martin von Zweigbergk
5ecc95a245 cli: make diff stat determine path length in chars, not bytes 2023-08-31 16:26:43 -07:00
Martin von Zweigbergk
0493e2b50e cli: use non-ascii chars in diff stat test
This shows that there's too much padding because we pad based on
number of bytes.

I had to reduce the path names for the file names not to get too long
for my file system.
2023-08-31 16:26:43 -07:00
Martin von Zweigbergk
4377c08f83 cli: don't crash diffstat on very narrow terminals
We can still crash on terminals that are less than 4 characters wide
(maybe it doesn't matter if we do because the user can't tell the
crash report from a diffstat in such a terminal?). This patch fixes
the crash.
2023-08-31 16:26:43 -07:00
Martin von Zweigbergk
5ce4ed45de cli: allow diff stat bar to be one character longer
I think the `+ 1` here came from an old iteration of this feature
where there was a single space before each line.
2023-08-31 16:26:43 -07:00
Martin von Zweigbergk
939528122d cli: fix crash on diff stat with long path name
We would run into a panic due to "attempt to subtract with overflow"
if the path was long. This patch fixes that and adds tests showing the
current behavior when there are long paths and/or large diffs.
2023-08-31 16:26:43 -07:00
Oscar Bonilla
5bd726f77d Add jj diffs --stat option 2023-08-19 23:49:16 -07:00
Anton Bulakh
dc6e1d7dee cli: hide irrelevant information about root commit in default log templates
I've extracted the `builtin_log_root` template for users to customize the
default templates without fully overriding them, for example I would remove
the change_id/commit_id for myself - and we discussed in Discord that leaving
those makes sense for the user to be reminded/teached that the root commit has
a change id made from z's.
2023-08-15 18:54:59 +03:00
Martin von Zweigbergk
00d2d2d4fc cli: indicate empty files in default diff format
Empty files can be confusing in diff output. For example:


```
Added regular file file1:
Added regular file file2:
        1: foo
```

This commit adds an "(empty)" placeholder instead. Since it's not
colored, and doesn't have line numbers, it will hopefully not be
mistaken for a file with the contents "(empty)".
2023-08-13 01:51:43 +00:00
Yuya Nishihara
4c9c923258 cli: show warning if external diff generator exited with non-zero status 2023-08-11 13:47:13 +09:00
Martin von Zweigbergk
0075174308 tests: move tests/ under cli/ so they're run again
Thanks to @ilyagr for noticing that they should be moved.
2023-08-05 06:18:59 +00:00
Renamed from tests/test_diff_command.rs (Browse further)