-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: use shiny, colored graph nodes by default #3381
Conversation
There was some liking for having a upside down T box drawing character for the root, but maybe that's bad as a default because reversed is a thing. What about users of the ascii mode? If the code hasn't changed since I introduced this, this will override the symbols used in the ascii mode as well. And (possibly worse) I don't think toml allows you to unset this value to get the ascii defaults. |
ca58af7
to
c38c930
Compare
@@ -1167,16 +1167,16 @@ fn test_graph_styles() { | |||
@ merge | |||
|\ | |||
| \ | |||
| o side branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is the ascii breakage I mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default node template is defined in settings.rs
for this reason.
Yup I loved that. Perhaps "log_inverted: bool" of some sorts could be added to templater globals?. Maybe in a separate PR |
cli/src/config/templates.toml
Outdated
if(!self, label("elided", "⇋"), | ||
if(current_working_copy, label("wcc", "@"), | ||
if(immutable, label("immutable", "◆"), | ||
if(description.starts_with("wip: "), label("wip", "!"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like !
very much because it kind of looks like a continuation of the line going into it.
I haven't found anything better though
Yuya added `coalesce()` as a built-in function with variable arity in a2a9b7d, and we want to use it with more-than-two arguments in the default `log_node` configuration in order to provide better graph node symbols for users. However, `test_templater` already defined this name as an alias, but with only two parameters; this alias now conflicts with the built-in definition and overrides it, causing the test to fail catastrophically because now the default configuration is considered invalid. Simply renaming it fixes this without invalidating the actual test case. Signed-off-by: Austin Seipp <[email protected]> Change-Id: I18593f64b9168fc334001c2ff5d49ad8d81c006d
c38c930
to
ffa4891
Compare
op_log_node = 'if(current_operation, "@", "◉")' | ||
|
||
log_node = ''' | ||
label("node", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: perhaps, "node" should be moved to the caller (as we do for "op_log"), but that can be addressed later.
@@ -1167,16 +1167,16 @@ fn test_graph_styles() { | |||
@ merge | |||
|\ | |||
| \ | |||
| o side branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default node template is defined in settings.rs
for this reason.
@@ -39,6 +39,20 @@ log = 'builtin_log_compact' | |||
op_log = 'builtin_op_log_compact' | |||
show = 'builtin_log_detailed' | |||
|
|||
op_log_node = 'if(current_operation, "@", "◉")' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to make the "normal" symbol consistent with log_node
? Do we want to make labels/colors consistent?
Signed-off-by: Austin Seipp <[email protected]> Change-Id: I4e7e5f6cd3c1afa0b42ee88725bc89d3bfafdc0a
ffa4891
to
0710bf2
Compare
I'm tempted to play around with things a bit more. I have some ideas, let's see how easy it would be to actually make them happen... Edit: shared some of this in the discord |
This should hopefully unblock jj-vcs#3381.
This should hopefully unblock jj-vcs#3381.
This should hopefully unblock jj-vcs#3381.
I would still prefer something like Actually, I quite like the idea of using |
I don't want us to get stuck debating the symbols for too long. I would prefer to see this merged with more conservative choices to start with instead. I would say that the current |
That sounds fine. I don't mean that comment to be blocking, especially as it sounds like this PR is more or less ready to be merged. |
Another non-blocking thought: the diamond is annoyingly not centered vertically with my font. I wonder if something like (also, another ad for |
And re colors: I really like making |
If/when #3460 gets merged you could also have a different symbol for snapshot operations in the oplog 🙃 |
I think |
Let's stick with the unicode block of box drawing characters for the graph and anything that is supposed to meld with the graph. Those we can depend on actually lining up with each other. |
I don't mind that actually, it has similar semantics as the ~ at the bottom of a tree, and the color/label makes clear what it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been using this for a bit, and I'm quite used to it now. In particular, I'm now relying on the green tint of @
and the immutable commit marker.
So, I think I'll approve this. If somebody feels this is not ready, please speak up.
I have made two changes to this that I really like. I'd recommend including them in this PR, but I can also make them my own PR; I don't want to slow this down on deciding how controversial my suggestions are.
diff --git a/cli/src/config/templates.toml b/cli/src/config/templates.toml
index 4e9ad79ef8...ad7cfd793d 100644
--- a/cli/src/config/templates.toml
+++ b/cli/src/config/templates.toml
@@ -44,13 +44,13 @@
log_node = '''
label("node",
coalesce(
- if(!self, label("elided", "⇋")),
+ if(!self, label("elided", "~")),
if(current_working_copy, label("working_copy", "@")),
- if(immutable, label("immutable", "◆")),
+ if(immutable, label("immutable", "⏹")),
label("normal", "○")
)
)
'''
* "Elided nodes" are specified with the "harpoon" symbol `⇋` to show that | ||
there are commits between the two nodes that are "cut" out, and not shown. | ||
* Commits whose description begins with `wip:` are represented with a yellow | ||
`!` symbol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still true about !
? I think it was removed from the PR (and I'd prefer to keep this PR simpler). Or is that already merged?
We also need to remember to update this if we change any of the notes.
First change is fine to me, and kinda helps with keeping ascii and regular similar. Second one is not aligned in my setup. :P There is some precedence for using the diamond (was it from git branchless?). Worst case you can override it on your own. The bigger blocker for this change atm is moving the defaults from the config files to being hard coded in the rust code. |
What do you mean?
I'm not violently opposed to a diamond, I just think a rectangle looks more solid and better.
Ah, I see, this would override the ascii mode too. This does need a solution. My first instinct would be the opposite: move the ASCII config to templates. I'll un-approve this because of the ASCII issue, thanks for keeping me honest. |
I see, thanks. |
btw, I think it's okay to add ascii/unicode default "aliases" which the user can freely choose. People like me might want to use the ascii version in unicode graph. |
Checklist
If applicable:
CHANGELOG.md