templates: make op_summary in e.g. jj undo output more readable and colorful#4602
Merged
templates: make op_summary in e.g. jj undo output more readable and colorful#4602
op_summary in e.g. jj undo output more readable and colorful#4602Conversation
op_summary more readable and colorfulop_summary in e.g. jj undo output more readable and colorful
yuja
reviewed
Oct 8, 2024
2cc8459 to
4469c82
Compare
ilyagr
added a commit
that referenced
this pull request
Oct 13, 2024
Added colons to make it seem less like an English sentence, see #4602 (comment) I believe printing both the start and end times is excessive for a summary. For now, I have it print just the start time for consistency. I intend to change it to print the ending time later. I was a bit torn on whether to use `format_timestamp(self.time().start())` or `self.time().start().ago()`. The latter looks better, but is less configurable and worse for dates long ago. In the future, we could add a `format_op_summary_timestamp` function and/or a template function that uses `.ago()` for recent dates and absolute dates for old dates. Add colon
ilyagr
added a commit
that referenced
this pull request
Oct 13, 2024
Added colons to make it seem less like an English sentence, see #4602 (comment) I believe printing both the start and end times is excessive for a summary. For now, I have it print just the start time for consistency. I intend to change it to print the ending time later. I was a bit torn on whether to use `format_timestamp(self.time().start())` or `self.time().start().ago()`. The latter looks better, but is less configurable and worse for dates long ago. In the future, we could add a `format_op_summary_timestamp` function and/or a template function that uses `.ago()` for recent dates and absolute dates for old dates. Add colon
ilyagr
added a commit
that referenced
this pull request
Oct 13, 2024
Added colons to make it seem less like an English sentence, see #4602 (comment) I believe printing both the start and end times is excessive for a summary. For now, I have it print just the start time for consistency. I intend to change it to print the ending time later. I was a bit torn on whether to use `format_timestamp(self.time().start())` or `self.time().start().ago()`. The latter looks better, but is less configurable and worse for dates long ago. In the future, we could add a `format_op_summary_timestamp` function and/or a template function that uses `.ago()` for recent dates and absolute dates for old dates. Add colon
Contributor
Author
|
I'll keep this unmerged for a few hours in case somebody has a comment or wants me to wait. |
ilyagr
added a commit
that referenced
this pull request
Oct 13, 2024
Added colons to make it seem less like an English sentence, see #4602 (comment) I believe printing both the start and end times is excessive for a summary. For now, I have it print just the start time for consistency. I intend to change it to print the ending time later. I was a bit torn on whether to use `format_timestamp(self.time().start())` or `self.time().start().ago()`. The latter looks better, but is less configurable and worse for dates long ago. In the future, we could add a `format_op_summary_timestamp` function and/or a template function that uses `.ago()` for recent dates and absolute dates for old dates. Add colon
4 tasks
ilyagr
added a commit
that referenced
this pull request
Oct 14, 2024
Added colons to make it seem less like an English sentence, see #4602 (comment) I believe printing both the start and end times is excessive for a summary. For now, I have it print just the start time for consistency. I intend to change it to print the ending time later. I was a bit torn on whether to use `format_timestamp(self.time().start())` or `self.time().start().ago()`. The latter looks better, but is less configurable and worse for dates long ago. In the future, we could add a `format_op_summary_timestamp` function and/or a template function that uses `.ago()` for recent dates and absolute dates for old dates.
Added colons to make it seem less like an English sentence, see #4602 (comment) I believe printing both the start and end times is excessive for a summary. For now, I have it print just the start time for consistency. I intend to change it to print the ending time later. I was a bit torn on whether to use `format_timestamp(self.time().start())` or `self.time().start().ago()`. The latter looks better, but is less configurable and worse for dates long ago. In the future, we could add a `format_op_summary_timestamp` function and/or a template function that uses `.ago()` for recent dates and absolute dates for old dates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is meant to be a quick fix before I update the demos in the README. The primary reason to update them is the branch -> bookmark transition, but I noticed that
jj undo's output is currently not very pretty.I believe printing both the start and end times is excessive for a summary. For a long-running operation like
jj describewith the editor open for a long time, the ending time seems more meaningful.I was a bit torn on whether to use
format_timestamp(self.time().end())orself.time().end().ago(). The latter looks better (finished 2 seconds agoinstead offinished 2024-10-07 15:46:03), but is less configurable and worse for dates long ago. In the future, we could add aformat_op_summary_timestampfunction and/or a template function that uses.ago()for recent dates and absolute dates for old dates.Previous look:

Or in the demo:

New look:
Previous version
Checklist
If applicable:
CHANGELOG.md