Skip to content
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

FR: Support passing template to jj show command #2969

Closed
zummenix opened this issue Feb 6, 2024 · 4 comments · Fixed by #3010
Closed

FR: Support passing template to jj show command #2969

zummenix opened this issue Feb 6, 2024 · 4 comments · Fixed by #3010
Labels
enhancement New feature or request

Comments

@zummenix
Copy link
Contributor

zummenix commented Feb 6, 2024

Is your feature request related to a problem? Please describe.

I'd like to setup my shell prompt to print current state of a change – basic info like change id, empty or not, maybe description and a branch

Describe the solution you'd like

I'd like to pass a custom template from my jj config to jj show, for example ex: jj show -T prompt_show_oneline

Describe alternatives you've considered

One alternative is to use jj log -T prompt_show_oneline | head -n1 but it prints leading symbols of a graph (dots and @) that I don't need in this case.

Additional context

@martinvonz
Copy link
Member

but it prints leading symbols of a graph

There's --no-graph :) (But that doesn't mean that we shouldn't support templating in jj show.)

@zummenix
Copy link
Contributor Author

zummenix commented Feb 6, 2024

There's --no-graph

Thank you! I haven't thought about it :)

I managed it to work using jj log --no-graph --limit 1 -r ..@ -T prompt_show_oneline

@necauqua
Copy link
Contributor

necauqua commented Feb 6, 2024

Just in case keep in mind that that means every prompt invocation also snapshots the repo, which sometimes could be bad, potentially - say you have a gigabyte of logs temporarily or something, although that one would be caught by the heuristic - and a bunch of operations for all the snapshots too

For truly lightweight prompt (that will show that repo is stale until you run some jj command), a non-snapshotting status/diff are needed (there's a FR I made for that, hard to look up on mobile while typing this)

@zummenix
Copy link
Contributor Author

zummenix commented Feb 6, 2024

For truly lightweight prompt (that will show that repo is stale until you run some jj command), a non-snapshotting status/diff are needed (there's a FR I made for that, hard to look up on mobile while typing this)

@necauqua Most likely this one: #2562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants