Replies: 1 comment
-
Define them as aliases? [aliases]
'relative' = ['--config', 'template-aliases."format_timestamp(timestamp)"="timestamp.ago()"']
'committer' = ['--config', 'template-aliases."commit_timestamp(commit)"="commit.committer().timestamp()"'] $ jj relative committer log
# output displays with relative timestamps and committers instead of authors This does require explicitly writing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I appreciate that the template language gives me fine-grained and almost arbitrary control over how things are displayed.
However, as I identify things that matter to me, to which alternative choices might apply, I'd like a more convenient way to choose between these alternatives.
For example, I can switch between showing committer or author timestamp by adding
--config "template-aliases.'commit_timestamp(commit)'='commit.XXX().timestamp()'"
to the command and tweaking the
XXX
buried therein. It works, but it's not very user-friendly.Now imagine I have a number of orthogonal alternatives, for example whether to show absolute or relative timestamps, and so on. Using the
--config
approach to switching was unwieldy and had a very low signal to noise ration for just a single option: with multiple switches it becomes a nightmare.Approaches like using command aliases for switching between options would lead to a combinatorial explosion of such aliases. In short, I'm looking for something like good old unix CLI options that affect config alternatives of my choosing.
How could I get orthogonal, composable, concise option switching for my JJ templates?
Beta Was this translation helpful? Give feedback.
All reactions